Files
PC-Light-Forum/js/textbus.min.js
DESKTOP-RQ919RC\Pc 620d21dd5d feat: 新增发布主题页面及编辑器功能
refactor(css): 优化详情页样式并移除冗余代码
feat(js): 实现发布主题的编辑器功能及图片/视频上传
docs: 添加编辑器样式文件及发布页面HTML结构
2025-12-11 19:11:43 +08:00

2 lines
677 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! For license information please see textbus.min.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("textbus",[],t):"object"==typeof exports?exports.textbus=t():e.textbus=t()}(self,(function(){return function(){var e={608:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var s=typeof n;if("string"===s||"number"===s)e.push(n);else if(Array.isArray(n)){if(n.length){var i=o.apply(null,n);i&&e.push(i)}}else if("object"===s){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var a in n)r.call(n,a)&&n[a]&&e.push(a)}}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},271:function(e,t,n){"use strict";n.r(t);var r=n(618),o=n.n(r),s=n(921),i=n.n(s)()(o());i.push([e.id,'.tb-jumbotron-setting{display:none;border-radius:4px;font-size:14px;position:absolute;right:10px;top:10px;background:#fff;box-shadow:1px 2px 3px rgba(0,0,0,.1);color:#333;border:0;outline:none;cursor:pointer}.tb-jumbotron-setting:hover{color:#1296db}tb-jumbotron:hover .tb-jumbotron-setting{display:block}.tb-step-item-add{position:absolute;right:0;top:0;display:none;cursor:pointer}.tb-step-item-add:hover{-webkit-transform:scale(1.2);transform:scale(1.2)}.tb-step-item-add:after{content:"+"}.tb-step-item:hover .tb-step-item-add{display:block}.tb-step-item-icon{cursor:pointer}.td-table-multiple-select *::selection{background-color:rgba(0,0,0,0) !important}.tb-timeline-icon:hover{-webkit-transform:scale(1.2);transform:scale(1.2);cursor:pointer}.tb-timeline-add{display:none;position:absolute;right:0;top:0;font-size:20px;line-height:1;cursor:pointer}.tb-timeline-add:before{content:"+"}.tb-timeline-add:hover{-webkit-transform:scale(1.2);transform:scale(1.2)}.tb-timeline-item:hover .tb-timeline-add{display:block}.tb-timeline-content{overflow:hidden}tb-word-explain{position:relative}tb-word-explain:hover .tb-word-explain-close{display:block}.tb-word-explain-close{display:none;position:absolute;right:10px;top:0;font-size:20px;line-height:1;cursor:pointer}.tb-word-explain-close:hover{-webkit-transform:scale(1.2);transform:scale(1.2)}.tb-word-explain-close:before{content:"u00d7"}',""]),t.default=i},140:function(e,t,n){"use strict";n.r(t);var r=n(618),o=n.n(r),s=n(921),i=n.n(s)()(o());i.push([e.id,'.tb-alert{display:block;padding:10px 15px;border-radius:6px;border:1px solid #e9eaec;background-color:#f8f8f9;margin-top:1em;margin-bottom:1em}.tb-alert.tb-alert-primary{border-color:rgba(18,150,219,.3);background-color:rgba(18,150,219,.15)}.tb-alert.tb-alert-primary.tb-alert-fill{color:#fff;background-color:#1296db}.tb-alert.tb-alert-success{border-color:rgba(21,189,154,.3);background-color:rgba(21,189,154,.15)}.tb-alert.tb-alert-success.tb-alert-fill{color:#fff;background-color:#15bd9a}.tb-alert.tb-alert-info{border-color:rgba(106,209,236,.3);background-color:rgba(106,209,236,.15)}.tb-alert.tb-alert-info.tb-alert-fill{color:#fff;background-color:#6ad1ec}.tb-alert.tb-alert-warning{border-color:rgba(255,153,0,.3);background-color:rgba(255,153,0,.15)}.tb-alert.tb-alert-warning.tb-alert-fill{color:#fff;background-color:#f90}.tb-alert.tb-alert-danger{border-color:rgba(231,79,94,.3);background-color:rgba(231,79,94,.15)}.tb-alert.tb-alert-danger.tb-alert-fill{color:#fff;background-color:#e74f5e}.tb-alert.tb-alert-dark{border-color:rgba(73,80,96,.3);background-color:rgba(73,80,96,.15)}.tb-alert.tb-alert-dark.tb-alert-fill{color:#fff;background-color:#495060}.tb-alert.tb-alert-gray{border-color:rgba(187,190,196,.3);background-color:rgba(187,190,196,.15)}.tb-alert.tb-alert-gray.tb-alert-fill{color:#fff;background-color:#bbbec4}.tb-alert-fill code{background-color:rgba(255,255,255,.2);border:none}.tb-blockquote{padding:10px 15px;border-left:10px solid #dddee1;background-color:#f8f8f9;margin:1em 0;border-radius:4px}.tb-blockquote>*:first-child{margin-top:0}blockquote>*:last-child{margin-bottom:0}tb-image-card{display:block;margin-top:10px;margin-bottom:20px;box-shadow:1px 2px 3px rgba(0,0,0,.1);border-radius:3px;overflow:hidden}tb-image-card>div>img{width:100%;display:block;min-height:40px}tb-image-card>p{margin:0;text-align:center;font-size:15px;color:#aaa;height:24px;line-height:24px;padding:6px 20px;box-sizing:content-box}.tb-img{max-width:100%}tb-jumbotron{display:block;min-height:200px;margin-bottom:1em;background-color:#eee;padding:20px;position:relative;border-radius:4px;overflow:hidden}tb-katex,.katex-display,.katex,.katex-html{display:inline-block}tb-katex{margin-left:.5em;margin-right:.5em}.tb-list-item{margin-top:.5em;margin-bottom:.5em}code,.tb-pre{background-color:#fefefe}.tb-pre code{padding:0;border:none;background:none;border-radius:0;vertical-align:inherit}code{padding:1px 5px;border-radius:3px;vertical-align:middle;border:1px solid rgba(0,0,0,.08)}.tb-pre{position:relative}.tb-pre-content{border-radius:5px;border:1px solid #efefef;line-height:1.418em;display:flex;position:relative;word-break:break-all;word-wrap:break-word;white-space:pre-wrap;overflow:hidden}code,kbd,pre,samp{font-family:Microsoft YaHei Mono,Menlo,Monaco,Consolas,Courier New,monospace}.tb-code-line-number-bg{background-color:#f9f9f9;border-right:1px solid #eee;width:3em}.tb-code-content{flex:1;padding:15px 0 15px 0;counter-reset:codeNum}.tb-color-content-highlight{background-color:#eee}.tb-color-content-highlight .tb-code-line{opacity:.56}.tb-code-line{position:relative;display:block;padding:0 15px 0 .5em}.tb-code-line::before{counter-increment:codeNum;content:counter(codeNum);position:absolute;left:-5.3em;top:0;width:4em;text-align:right;padding:0 .8em 0 .5em;overflow:hidden;white-space:nowrap;color:#aeaeae}.tb-color-content-highlight .tb-code-line-emphasize{opacity:1;background-color:#fefefe}.tb-pre-lang{position:absolute;right:0;top:0;opacity:.5;pointer-events:none;font-size:13px;padding:4px 10px}.tb-hl-keyword{font-weight:bold}.tb-hl-string{color:#d14}.tb-hl-function{color:#0086b3}.tb-hl-number{color:#388138}.tb-hl-tag{color:navy}.tb-hl-comment{color:#998;font-style:italic}.tb-hl-boolean{color:#388138;font-weight:bold}.tb-hl-builtin{color:#0086b3}.tb-hl-regex{color:#f60}.tb-hl-attr-name{color:#0086b3}.tb-hl-attr-value{color:#d14}.tb-hl-class-name{color:#0086b3;font-weight:bold}.tb-hl-selector{color:#0086b3;font-weight:bold}.tb-pre[theme=dark] .tb-pre-content{color:#a9aeb2;background-color:#1c2838;border-color:#353535}.tb-pre[theme=dark] .tb-color-content-highlight{background-color:#263140}.tb-pre[theme=dark] .tb-color-content-highlight .tb-code-line-emphasize{opacity:1;background-color:#1c2838}.tb-pre[theme=dark] .tb-hl-keyword{color:#0086b3}.tb-pre[theme=dark] .tb-hl-tag{color:#0086b3}.tb-pre[theme=dark] .tb-hl-comment{color:#4c5156}.tb-pre[theme=dark] .tb-hl-string{color:#ce5a70}.tb-pre[theme=dark] .tb-hl-attr-value{color:#ce5a70}.tb-pre[theme=dark] .tb-hl-regex{color:#af741d}.tb-pre[theme=dark] .tb-hl-selector{color:#ce5a70;font-weight:normal}.tb-pre[theme=dark] .tb-code-line::before{color:#536171}.tb-pre[theme=dark] .tb-code-line-number-bg{background-color:#2d3a48;border-right-color:#292929}tb-step{display:flex}.tb-step-item{position:relative;flex:1}.tb-step-item:last-child .tb-step-item-line{display:none}.tb-step-item.tb-complete .tb-step-item-line{border-top-color:#15bd9a}.tb-step-item.tb-complete .tb-step-item-icon{background-color:#15bd9a}.tb-step-item.tb-current .tb-step-item-line{border-top-style:dashed}.tb-step-item.tb-current .tb-step-item-icon{background-color:#1296db}.tb-step-item.tb-waiting .tb-step-item-line{border-top-style:dashed}.tb-step-item.tb-waiting .tb-step-item-icon{background-color:#bbbec4}.tb-step-item.tb-waiting .tb-step-item-content{opacity:.8}.tb-step-item-header{position:relative;margin-bottom:1em}.tb-step-item-icon{width:1.6em;height:1.6em;border-radius:50%;position:relative;text-align:center;line-height:1.6em;color:#fff;font-weight:500}.tb-step-item-line{position:absolute;top:50%;left:0;right:0;border-top:1px solid #dddee1}.tb-step-item-content{padding-right:15px}.tb-step-title{font-weight:500;margin:0;font-size:1.2em}.tb-step-title>small{font-weight:normal;opacity:.8}.tb-step-content{font-weight:normal;margin:0}.tb-table td,.tb-table th{border-width:1px;border-style:solid;padding:3px 8px}.tb-table{border-spacing:0;border-collapse:collapse;width:100%}.tb-table-textbus td,th{border-color:#aaa}tb-timeline{display:block;padding-top:1em;padding-left:5px}.tb-timeline-item{display:block;position:relative;padding-left:1.5em;padding-bottom:.5em;opacity:.76}.tb-timeline-item:first-of-type>.tb-timeline-line{top:1em}.tb-timeline-item:last-of-type>.tb-timeline-line{bottom:calc(100% - 1em)}.tb-timeline-line{position:absolute;left:0;top:0;bottom:0;width:0;border-left:1px solid #dddee1}.tb-timeline-icon{box-sizing:border-box;position:absolute;width:9px;height:9px;border-radius:50%;left:-4px;top:.5em;background-color:#fff;border:1px solid #bbbec4}.tb-timeline-item-primary{opacity:1}.tb-timeline-item-primary>.tb-timeline-icon{border-color:#1296db;background-color:#1296db}.tb-timeline-item-primary>.tb-timeline-line{border-color:#1296db}.tb-timeline-item-info{opacity:1}.tb-timeline-item-info>.tb-timeline-icon{border-color:#6ad1ec;background-color:#6ad1ec}.tb-timeline-item-info>.tb-timeline-line{border-color:#6ad1ec}.tb-timeline-item-success{opacity:1}.tb-timeline-item-success>.tb-timeline-icon{border-color:#15bd9a;background-color:#15bd9a}.tb-timeline-item-success>.tb-timeline-line{border-color:#15bd9a}.tb-timeline-item-warning{opacity:1}.tb-timeline-item-warning>.tb-timeline-icon{border-color:#f90;background-color:#f90}.tb-timeline-item-warning>.tb-timeline-line{border-color:#f90}.tb-timeline-item-danger{opacity:1}.tb-timeline-item-danger>.tb-timeline-icon{border-color:#e74f5e;background-color:#e74f5e}.tb-timeline-item-danger>.tb-timeline-line{border-color:#e74f5e}.tb-timeline-item-dark{opacity:1}.tb-timeline-item-dark>.tb-timeline-icon{border-color:#495060;background-color:#495060}.tb-timeline-item-dark>.tb-timeline-line{border-color:#495060}.tb-timeline-item-gray{opacity:1}.tb-timeline-item-gray>.tb-timeline-icon{border-color:#bbbec4;background-color:#bbbec4}.tb-timeline-item-gray>.tb-timeline-line{border-color:#bbbec4}tb-todolist{display:block;margin-top:1em;margin-bottom:1em}.tb-todolist-item{padding-top:.2em;padding-bottom:.2em;display:flex}.tb-todolist-btn{margin-right:.6em}.tb-todolist-state{display:inline-block;margin-top:3px;width:12px;height:12px;border:2px solid #1296db;background:#fff;border-radius:3px;cursor:pointer;position:relative;box-sizing:content-box}.tb-todolist-state:after{content:"";position:absolute;border-right:2px solid #fff;border-bottom:2px solid #fff;box-sizing:content-box;left:3px;top:1px;width:4px;height:6px;-webkit-transform:rotateZ(45deg);transform:rotateZ(45deg)}.tb-todolist-state-active:after{border-color:#1296db}.tb-todolist-state-disabled{opacity:.5}.tb-todolist-content{flex:1}tb-word-explain{display:flex;margin-top:1em;margin-bottom:1em;padding:10px 20px;background-color:#f8f8f9;border-radius:10px}.tb-word-explain-title-group{width:140px;padding-right:20px}.tb-word-explain-title{margin:0;font-size:inherit}.tb-word-explain-subtitle{margin:0;font-weight:300;font-size:.9em}.tb-word-explain-detail{flex:1;padding-left:20px;border-left:1px solid #ddd}@media screen and (max-width: 767px){tb-word-explain{display:block}.tb-word-explain-title-group{width:auto !important}.tb-word-explain-title-group{padding-right:0;display:flex;align-items:baseline;padding-bottom:.5em;margin-bottom:.5em}.tb-word-explain-subtitle{margin-left:.5em;font-weight:300;font-size:.9em}.tb-word-explain-detail{padding-left:0;border-left:none}}',""]),t.default=i},921:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,o,s){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(i[l]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&i[u[0]]||(void 0!==s&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},618:function(e){"use strict";e.exports=function(e){return e[1]}},494:function(){Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean},158:function(){!function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism)},219:function(){!function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,(function(e,n){return"(?:"+t[+n]+")"}))}function n(e,n,r){return RegExp(t(e,n),r||"")}function r(e,t){for(var n=0;n<t;n++)e=e.replace(/<<self>>/g,(function(){return"(?:"+e+")"}));return e.replace(/<<self>>/g,"[^\\s\\S]")}var o="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",s="class enum interface record struct",i="add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",a="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function l(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var c=l(s),u=RegExp(l(o+" "+s+" "+i+" "+a)),h=l(s+" "+i+" "+a),d=l(o+" "+s+" "+a),p=r(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),m=r(/\((?:[^()]|<<self>>)*\)/.source,2),f=/@?\b[A-Za-z_]\w*\b/.source,g=t(/<<0>>(?:\s*<<1>>)?/.source,[f,p]),b=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[h,g]),v=/\[\s*(?:,\s*)*\]/.source,y=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[b,v]),x=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[p,m,v]),w=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[x]),k=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[w,b,v]),C={keyword:u,punctuation:/[<>()?,.:[\]]/},S=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,T=/"(?:\\.|[^\\"\r\n])*"/.source,A=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;e.languages.csharp=e.languages.extend("clike",{string:[{pattern:n(/(^|[^$\\])<<0>>/.source,[A]),lookbehind:!0,greedy:!0},{pattern:n(/(^|[^@$\\])<<0>>/.source,[T]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:n(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[b]),lookbehind:!0,inside:C},{pattern:n(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[f,k]),lookbehind:!0,inside:C},{pattern:n(/(\busing\s+)<<0>>(?=\s*=)/.source,[f]),lookbehind:!0},{pattern:n(/(\b<<0>>\s+)<<1>>/.source,[c,g]),lookbehind:!0,inside:C},{pattern:n(/(\bcatch\s*\(\s*)<<0>>/.source,[b]),lookbehind:!0,inside:C},{pattern:n(/(\bwhere\s+)<<0>>/.source,[f]),lookbehind:!0},{pattern:n(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[y]),lookbehind:!0,inside:C},{pattern:n(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[k,d,f]),inside:C}],keyword:u,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),e.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:n(/([(,]\s*)<<0>>(?=\s*:)/.source,[f]),lookbehind:!0,alias:"punctuation"}}),e.languages.insertBefore("csharp","class-name",{namespace:{pattern:n(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[f]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:n(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[m]),lookbehind:!0,alias:"class-name",inside:C},"return-type":{pattern:n(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[k,b]),inside:C,alias:"class-name"},"constructor-invocation":{pattern:n(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[k]),lookbehind:!0,inside:C,alias:"class-name"},"generic-method":{pattern:n(/<<0>>\s*<<1>>(?=\s*\()/.source,[f,p]),inside:{function:n(/^<<0>>/.source,[f]),generic:{pattern:RegExp(p),alias:"class-name",inside:C}}},"type-list":{pattern:n(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[c,g,f,k,u.source,m,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:n(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[g,m]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:u,"class-name":{pattern:RegExp(k),greedy:!0,inside:C},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var E=T+"|"+S,M=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[E]),B=r(t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[M]),2),R=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,O=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[b,B]);e.languages.insertBefore("csharp","class-name",{attribute:{pattern:n(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[R,O]),lookbehind:!0,greedy:!0,inside:{target:{pattern:n(/^<<0>>(?=\s*:)/.source,[R]),alias:"keyword"},"attribute-arguments":{pattern:n(/\(<<0>>*\)/.source,[B]),inside:e.languages.csharp},"class-name":{pattern:RegExp(b),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var N=/:[^}\r\n]+/.source,I=r(t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[M]),2),P=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[I,N]),L=r(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[E]),2),F=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[L,N]);function z(t,r){return{interpolation:{pattern:n(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[t]),lookbehind:!0,inside:{"format-string":{pattern:n(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[r,N]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:n(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[P]),lookbehind:!0,greedy:!0,inside:z(P,I)},{pattern:n(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[F]),lookbehind:!0,greedy:!0,inside:z(F,L)}],char:{pattern:RegExp(S),greedy:!0}}),e.languages.dotnet=e.languages.cs=e.languages.csharp}(Prism)},751:function(){!function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism)},784:function(){Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Prism.languages.go["class-name"]},425:function(){!function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism)},719:function(){Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json},107:function(){!function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,o=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function s(e,t){return e=e.replace(/<S>/g,(function(){return n})).replace(/<BRACES>/g,(function(){return r})).replace(/<SPREAD>/g,(function(){return o})),RegExp(e,t)}o=s(o).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=s(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:s(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:s(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);var i=function(e){return e?"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(i).join(""):""},a=function(t){for(var n=[],r=0;r<t.length;r++){var o=t[r],s=!1;if("string"!=typeof o&&("tag"===o.type&&o.content[0]&&"tag"===o.content[0].type?"</"===o.content[0].content[0].content?n.length>0&&n[n.length-1].tagName===i(o.content[0].content[1])&&n.pop():"/>"===o.content[o.content.length-1].content||n.push({tagName:i(o.content[0].content[1]),openedBraces:0}):n.length>0&&"punctuation"===o.type&&"{"===o.content?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&"punctuation"===o.type&&"}"===o.content?n[n.length-1].openedBraces--:s=!0),(s||"string"==typeof o)&&n.length>0&&0===n[n.length-1].openedBraces){var l=i(o);r<t.length-1&&("string"==typeof t[r+1]||"plain-text"===t[r+1].type)&&(l+=i(t[r+1]),t.splice(r+1,1)),r>0&&("string"==typeof t[r-1]||"plain-text"===t[r-1].type)&&(l=i(t[r-1])+l,t.splice(r-1,1),r--),t[r]=new e.Token("plain-text",l,null,l)}o.content&&"string"!=typeof o.content&&a(o.content)}};e.hooks.add("after-tokenize",(function(e){"jsx"!==e.language&&"tsx"!==e.language||a(e.tokens)}))}(Prism)},664:function(){Prism.languages.less=Prism.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),Prism.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})},925:function(){!function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}}(Prism)},779:function(){Prism.languages.scss=Prism.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),Prism.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),Prism.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),Prism.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),Prism.languages.scss.atrule.inside.rest=Prism.languages.scss},531:function(){!function(e){var t={pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0},r={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},url:{pattern:/\burl\((["']?).*?\1\)/i,greedy:!0},string:{pattern:/("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/,greedy:!0},interpolation:null,func:null,important:/\B!(?:important|optional)\b/i,keyword:{pattern:/(^|\s+)(?:(?:else|for|if|return|unless)(?=\s|$)|@[\w-]+)/,lookbehind:!0},hexcode:/#[\da-f]{3,6}/i,color:[/\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i,{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,boolean:/\b(?:false|true)\b/,operator:[/~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.{2,3}|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/],number:n,punctuation:/[{}()\[\];:,]/};r.interpolation={pattern:/\{[^\r\n}:]+\}/,alias:"variable",inside:{delimiter:{pattern:/^\{|\}$/,alias:"punctuation"},rest:r}},r.func={pattern:/[\w-]+\([^)]*\).*/,inside:{function:/^[^(]+/,rest:r}},e.languages.stylus={"atrule-declaration":{pattern:/(^[ \t]*)@.+/m,lookbehind:!0,inside:{atrule:/^@[\w-]+/,rest:r}},"variable-declaration":{pattern:/(^[ \t]*)[\w$-]+\s*.?=[ \t]*(?:\{[^{}]*\}|\S.*|$)/m,lookbehind:!0,inside:{variable:/^\S+/,rest:r}},statement:{pattern:/(^[ \t]*)(?:else|for|if|return|unless)[ \t].+/m,lookbehind:!0,inside:{keyword:/^\S+/,rest:r}},"property-declaration":{pattern:/((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)(?!\s)[^{\r\n]*(?:;|[^{\r\n,]$(?!(?:\r?\n|\r)(?:\{|\2[ \t])))/m,lookbehind:!0,inside:{property:{pattern:/^[^\s:]+/,inside:{interpolation:r.interpolation}},rest:r}},selector:{pattern:/(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)))*(?:,$|\{|(?=(?:\r?\n|\r)(?:\{|\1[ \t])))/m,lookbehind:!0,inside:{interpolation:r.interpolation,comment:r.comment,punctuation:/[{},]/}},func:r.func,string:r.string,comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0,greedy:!0},interpolation:r.interpolation,punctuation:/[{}()\[\];:.]/}}(Prism)},586:function(){Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach((function(e){e.inside.interpolation.inside=Prism.languages.swift}))},633:function(){!function(e){var t=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"];var n=e.languages.tsx.tag;n.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+n.pattern.source+")",n.pattern.flags),n.lookbehind=!0}(Prism)},301:function(){!function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(Prism)},652:function(e,t,n){var r=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},o={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof s?new s(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){var r,s;switch(n=n||{},o.util.type(t)){case"Object":if(s=o.util.objId(t),n[s])return n[s];for(var i in r={},n[s]=r,t)t.hasOwnProperty(i)&&(r[i]=e(t[i],n));return r;case"Array":return s=o.util.objId(t),n[s]?n[s]:(r=[],n[s]=r,t.forEach((function(t,o){r[o]=e(t,n)})),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,"gi"),""),e.classList.add("language-"+n)},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName("script");for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r="no-"+t;e;){var o=e.classList;if(o.contains(t))return!0;if(o.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=o.util.clone(o.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var s=(r=r||o.languages)[e],i={};for(var a in s)if(s.hasOwnProperty(a)){if(a==t)for(var l in n)n.hasOwnProperty(l)&&(i[l]=n[l]);n.hasOwnProperty(a)||(i[a]=s[a])}var c=r[e];return r[e]=i,o.languages.DFS(o.languages,(function(t,n){n===c&&t!=e&&(this[t]=i)})),i},DFS:function e(t,n,r,s){s=s||{};var i=o.util.objId;for(var a in t)if(t.hasOwnProperty(a)){n.call(t,a,t[a],r||a);var l=t[a],c=o.util.type(l);"Object"!==c||s[i(l)]?"Array"!==c||s[i(l)]||(s[i(l)]=!0,e(l,n,a,s)):(s[i(l)]=!0,e(l,n,null,s))}}},plugins:{},highlightAll:function(e,t){o.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};o.hooks.run("before-highlightall",r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),o.hooks.run("before-all-elements-highlight",r);for(var s,i=0;s=r.elements[i++];)o.highlightElement(s,!0===t,r.callback)},highlightElement:function(t,n,r){var s=o.util.getLanguage(t),i=o.languages[s];o.util.setLanguage(t,s);var a=t.parentElement;a&&"pre"===a.nodeName.toLowerCase()&&o.util.setLanguage(a,s);var l={element:t,language:s,grammar:i,code:t.textContent};function c(e){l.highlightedCode=e,o.hooks.run("before-insert",l),l.element.innerHTML=l.highlightedCode,o.hooks.run("after-highlight",l),o.hooks.run("complete",l),r&&r.call(l.element)}if(o.hooks.run("before-sanity-check",l),(a=l.element.parentElement)&&"pre"===a.nodeName.toLowerCase()&&!a.hasAttribute("tabindex")&&a.setAttribute("tabindex","0"),!l.code)return o.hooks.run("complete",l),void(r&&r.call(l.element));if(o.hooks.run("before-highlight",l),l.grammar)if(n&&e.Worker){var u=new Worker(o.filename);u.onmessage=function(e){c(e.data)},u.postMessage(JSON.stringify({language:l.language,code:l.code,immediateClose:!0}))}else c(o.highlight(l.code,l.grammar,l.language));else c(o.util.encode(l.code))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(o.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=o.tokenize(r.code,r.grammar),o.hooks.run("after-tokenize",r),s.stringify(o.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var o=new l;return c(o,o.head,e),a(e,o,t,o.head,0),function(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}(o)},hooks:{all:{},add:function(e,t){var n=o.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=o.hooks.all[e];if(n&&n.length)for(var r,s=0;r=n[s++];)r(t)}},Token:s};function s(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function i(e,t,n,r){e.lastIndex=t;var o=e.exec(n);if(o&&r&&o[1]){var s=o[1].length;o.index+=s,o[0]=o[0].slice(s)}return o}function a(e,t,n,r,l,h){for(var d in n)if(n.hasOwnProperty(d)&&n[d]){var p=n[d];p=Array.isArray(p)?p:[p];for(var m=0;m<p.length;++m){if(h&&h.cause==d+","+m)return;var f=p[m],g=f.inside,b=!!f.lookbehind,v=!!f.greedy,y=f.alias;if(v&&!f.pattern.global){var x=f.pattern.toString().match(/[imsuy]*$/)[0];f.pattern=RegExp(f.pattern.source,x+"g")}for(var w=f.pattern||f,k=r.next,C=l;k!==t.tail&&!(h&&C>=h.reach);C+=k.value.length,k=k.next){var S=k.value;if(t.length>e.length)return;if(!(S instanceof s)){var T,A=1;if(v){if(!(T=i(w,C,e,b))||T.index>=e.length)break;var E=T.index,M=T.index+T[0].length,B=C;for(B+=k.value.length;E>=B;)B+=(k=k.next).value.length;if(C=B-=k.value.length,k.value instanceof s)continue;for(var R=k;R!==t.tail&&(B<M||"string"==typeof R.value);R=R.next)A++,B+=R.value.length;A--,S=e.slice(C,B),T.index-=C}else if(!(T=i(w,0,S,b)))continue;E=T.index;var O=T[0],N=S.slice(0,E),I=S.slice(E+O.length),P=C+S.length;h&&P>h.reach&&(h.reach=P);var L=k.prev;if(N&&(L=c(t,L,N),C+=N.length),u(t,L,A),k=c(t,L,new s(d,g?o.tokenize(O,g):O,y,O)),I&&c(t,k,I),A>1){var F={cause:d+","+m,reach:P};a(e,t,n,k.prev,C,F),h&&F.reach>h.reach&&(h.reach=F.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,n){var r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function u(e,t,n){for(var r=t.next,o=0;o<n&&r!==e.tail;o++)r=r.next;t.next=r,r.prev=t,e.length-=o}if(e.Prism=o,s.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var r="";return t.forEach((function(t){r+=e(t,n)})),r}var s={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},i=t.alias;i&&(Array.isArray(i)?Array.prototype.push.apply(s.classes,i):s.classes.push(i)),o.hooks.run("wrap",s);var a="";for(var l in s.attributes)a+=" "+l+'="'+(s.attributes[l]||"").replace(/"/g,"&quot;")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'"'+a+">"+s.content+"</"+s.tag+">"},!e.document)return e.addEventListener?(o.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,s=n.code,i=n.immediateClose;e.postMessage(o.highlight(s,o.languages[r],r)),i&&e.close()}),!1),o):o;var h=o.util.currentScript();function d(){o.manual||o.highlightAll()}if(h&&(o.filename=h.src,h.hasAttribute("data-manual")&&(o.manual=!0)),!o.manual){var p=document.readyState;"loading"===p||"interactive"===p&&h&&h.defer?document.addEventListener("DOMContentLoaded",d):window.requestAnimationFrame?window.requestAnimationFrame(d):window.setTimeout(d,16)}return o}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=r),void 0!==n.g&&(n.g.Prism=r),r.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},r.languages.markup.tag.inside["attr-value"].inside.entity=r.languages.markup.entity,r.languages.markup.doctype.inside["internal-subset"].inside=r.languages.markup,r.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))})),Object.defineProperty(r.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:r.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};o["language-"+t]={pattern:/[\s\S]+/,inside:r.languages[t]};var s={};s[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:o},r.languages.insertBefore("markup","cdata",s)}}),Object.defineProperty(r.languages.markup.tag,"addAttribute",{value:function(e,t){r.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:r.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),r.languages.html=r.languages.markup,r.languages.mathml=r.languages.markup,r.languages.svg=r.languages.markup,r.languages.xml=r.languages.extend("markup",{}),r.languages.ssml=r.languages.xml,r.languages.atom=r.languages.xml,r.languages.rss=r.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(r),r.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},r.languages.javascript=r.languages.extend("clike",{"class-name":[r.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),r.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,r.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:r.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:r.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:r.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:r.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:r.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),r.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:r.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),r.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),r.languages.markup&&(r.languages.markup.tag.addInlined("script","javascript"),r.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),r.languages.js=r.languages.javascript,function(){if(void 0!==r&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},t="data-src-status",n="loaded",o='pre[data-src]:not([data-src-status="loaded"]):not([data-src-status="loading"])';r.hooks.add("before-highlightall",(function(e){e.selector+=", "+o})),r.hooks.add("before-sanity-check",(function(s){var i=s.element;if(i.matches(o)){s.code="",i.setAttribute(t,"loading");var a=i.appendChild(document.createElement("CODE"));a.textContent="Loading…";var l=i.getAttribute("data-src"),c=s.language;if("none"===c){var u=(/\.(\w+)$/.exec(l)||[,"none"])[1];c=e[u]||u}r.util.setLanguage(a,c),r.util.setLanguage(i,c);var h=r.plugins.autoloader;h&&h.loadLanguages(c),function(e,o,s){var l=new XMLHttpRequest;l.open("GET",e,!0),l.onreadystatechange=function(){4==l.readyState&&(l.status<400&&l.responseText?function(e){i.setAttribute(t,n);var o=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var n=Number(t[1]),r=t[2],o=t[3];return r?o?[n,Number(o)]:[n,void 0]:[n,n]}}(i.getAttribute("data-range"));if(o){var s=e.split(/\r\n?|\n/g),l=o[0],c=null==o[1]?s.length:o[1];l<0&&(l+=s.length),l=Math.max(0,Math.min(l-1,s.length)),c<0&&(c+=s.length),c=Math.max(0,Math.min(c,s.length)),e=s.slice(l,c).join("\n"),i.hasAttribute("data-start")||i.setAttribute("data-start",String(l+1))}a.textContent=e,r.highlightElement(a)}(l.responseText):l.status>=400?s("✖ Error "+l.status+" while fetching file: "+l.statusText):s("✖ Error: File does not exist or is empty"))},l.send(null)}(l,0,(function(e){i.setAttribute(t,"failed"),a.textContent=e}))}})),r.plugins.fileHighlight={highlight:function(e){for(var t,n=(e||document).querySelectorAll(o),s=0;t=n[s++];)r.highlightElement(t)}};var s=!1;r.fileHighlight=function(){s||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),s=!0),r.plugins.fileHighlight.highlight.apply(this,arguments)}}}()},171:function(e,t,n){var r;!function(e){!function(t){var r="object"==typeof n.g?n.g:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),o=s(e);function s(e,t){return function(n,r){"function"!=typeof e[n]&&Object.defineProperty(e,n,{configurable:!0,writable:!0,value:r}),t&&t(n,r)}}void 0===r.Reflect?r.Reflect=e:o=s(r.Reflect,o),function(e){var t=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,r=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",o=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",s="function"==typeof Object.create,i={__proto__:[]}instanceof Array,a=!s&&!i,l={create:s?function(){return L(Object.create(null))}:i?function(){return L({__proto__:null})}:function(){return L({})},has:a?function(e,n){return t.call(e,n)}:function(e,t){return t in e},get:a?function(e,n){return t.call(e,n)?e[n]:void 0}:function(e,t){return e[t]}},c=Object.getPrototypeOf(Function),u="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,h=u||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[o]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var n=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,o=n+1;o<r;o++)this._keys[o-1]=this._keys[o],this._values[o-1]=this._values[o];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,s)},t.prototype.entries=function(){return new n(this._keys,this._values,i)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[o]=function(){return this.entries()},t.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function s(e,t){return t}function i(e,t){return[e,t]}}():Map,d=u||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function e(){this._map=new h}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[o]=function(){return this.keys()},e}():Set,p=new(u||"function"!=typeof WeakMap?function(){var e=l.create(),n=r();return function(){function e(){this._key=r()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&l.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?l.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=r()},e}();function r(){var t;do{t="@@WeakMap@@"+i()}while(l.has(e,t));return e[t]=!0,t}function o(e,r){if(!t.call(e,n)){if(!r)return;Object.defineProperty(e,n,{value:l.create()})}return e[n]}function s(e,t){for(var n=0;n<t;++n)e[n]=255*Math.random()|0;return e}function i(){var e,t=(e=16,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):s(new Uint8Array(e),e):s(new Array(e),e));t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var n="",r=0;r<16;++r){var o=t[r];4!==r&&6!==r&&8!==r||(n+="-"),o<16&&(n+="0"),n+=o.toString(16).toLowerCase()}return n}}():WeakMap);function m(e,t,n){var r=p.get(e);if(C(r)){if(!n)return;r=new h,p.set(e,r)}var o=r.get(t);if(C(o)){if(!n)return;o=new h,r.set(t,o)}return o}function f(e,t,n){if(g(e,t,n))return!0;var r=P(t);return!S(r)&&f(e,r,n)}function g(e,t,n){var r=m(t,n,!1);return!C(r)&&!!r.has(e)}function b(e,t,n){if(g(e,t,n))return v(e,t,n);var r=P(t);return S(r)?void 0:b(e,r,n)}function v(e,t,n){var r=m(t,n,!1);if(!C(r))return r.get(e)}function y(e,t,n,r){m(n,r,!0).set(e,t)}function x(e,t){var n=w(e,t),r=P(e);if(null===r)return n;var o=x(r,t);if(o.length<=0)return n;if(n.length<=0)return o;for(var s=new d,i=[],a=0,l=n;a<l.length;a++){var c=l[a];s.has(c)||(s.add(c),i.push(c))}for(var u=0,h=o;u<h.length;u++)c=h[u],s.has(c)||(s.add(c),i.push(c));return i}function w(e,t){var n=[],r=m(e,t,!1);if(C(r))return n;for(var s=function(e){var t=O(e,o);if(!B(t))throw new TypeError;var n=t.call(e);if(!T(n))throw new TypeError;return n}(r.keys()),i=0;;){var a=N(s);if(!a)return n.length=i,n;var l=a.value;try{n[i]=l}catch(e){try{I(s)}finally{throw e}}i++}}function k(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function C(e){return void 0===e}function S(e){return null===e}function T(e){return"object"==typeof e?null!==e:"function"==typeof e}function A(e,t){switch(k(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var n=3===t?"string":5===t?"number":"default",o=O(e,r);if(void 0!==o){var s=o.call(e,n);if(T(s))throw new TypeError;return s}return function(e,t){if("string"===t){var n=e.toString;if(B(n)&&!T(o=n.call(e)))return o;if(B(r=e.valueOf)&&!T(o=r.call(e)))return o}else{var r;if(B(r=e.valueOf)&&!T(o=r.call(e)))return o;var o,s=e.toString;if(B(s)&&!T(o=s.call(e)))return o}throw new TypeError}(e,"default"===n?"number":n)}function E(e){var t=A(e,3);return"symbol"==typeof t?t:function(e){return""+e}(t)}function M(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function B(e){return"function"==typeof e}function R(e){return"function"==typeof e}function O(e,t){var n=e[t];if(null!=n){if(!B(n))throw new TypeError;return n}}function N(e){var t=e.next();return!t.done&&t}function I(e){var t=e.return;t&&t.call(e)}function P(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===c)return t;if(t!==c)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return t;var o=r.constructor;return"function"!=typeof o||o===e?t:o}function L(e){return e.__=void 0,delete e.__,e}e("decorate",(function(e,t,n,r){if(C(n)){if(!M(e))throw new TypeError;if(!R(t))throw new TypeError;return function(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!C(r)&&!S(r)){if(!R(r))throw new TypeError;t=r}}return t}(e,t)}if(!M(e))throw new TypeError;if(!T(t))throw new TypeError;if(!T(r)&&!C(r)&&!S(r))throw new TypeError;return S(r)&&(r=void 0),function(e,t,n,r){for(var o=e.length-1;o>=0;--o){var s=(0,e[o])(t,n,r);if(!C(s)&&!S(s)){if(!T(s))throw new TypeError;r=s}}return r}(e,t,n=E(n),r)})),e("metadata",(function(e,t){return function(n,r){if(!T(n))throw new TypeError;if(!C(r)&&!function(e){switch(k(e)){case 3:case 4:return!0;default:return!1}}(r))throw new TypeError;y(e,t,n,r)}})),e("defineMetadata",(function(e,t,n,r){if(!T(n))throw new TypeError;return C(r)||(r=E(r)),y(e,t,n,r)})),e("hasMetadata",(function(e,t,n){if(!T(t))throw new TypeError;return C(n)||(n=E(n)),f(e,t,n)})),e("hasOwnMetadata",(function(e,t,n){if(!T(t))throw new TypeError;return C(n)||(n=E(n)),g(e,t,n)})),e("getMetadata",(function(e,t,n){if(!T(t))throw new TypeError;return C(n)||(n=E(n)),b(e,t,n)})),e("getOwnMetadata",(function(e,t,n){if(!T(t))throw new TypeError;return C(n)||(n=E(n)),v(e,t,n)})),e("getMetadataKeys",(function(e,t){if(!T(e))throw new TypeError;return C(t)||(t=E(t)),x(e,t)})),e("getOwnMetadataKeys",(function(e,t){if(!T(e))throw new TypeError;return C(t)||(t=E(t)),w(e,t)})),e("deleteMetadata",(function(e,t,n){if(!T(t))throw new TypeError;C(n)||(n=E(n));var r=m(t,n,!1);if(C(r))return!1;if(!r.delete(e))return!1;if(r.size>0)return!0;var o=p.get(t);return o.delete(n),o.size>0||p.delete(t),!0}))}(o)}()}(r||(r={}))},742:function(e,t,n){var r=n(271);r&&r.__esModule&&(r=r.default),e.exports="string"==typeof r?r:r.toString()},737:function(e,t,n){var r=n(140);r&&r.__esModule&&(r=r.default),e.exports="string"==typeof r?r:r.toString()}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={id:r,exports:{}};return e[r](s,s.exports,n),s.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return function(){"use strict";n.r(r),n.d(r,{browser:function(){return t},core:function(){return e},editor:function(){return o}});var e={};n.r(e),n.d(e,{ATTRIBUTE_LIST:function(){return xt},Annotations:function(){return l},Attribute:function(){return Ln},BehaviorSubject:function(){return G},COMPONENT_LIST:function(){return vt},ChangeMarker:function(){return Et},ChangeOrigin:function(){return ir},Commander:function(){return Zn},Content:function(){return Mt},ContentType:function(){return Fn},ContextMenuEvent:function(){return $t},Controller:function(){return qn},DeltaLite:function(){return Dn},Event:function(){return Vt},FORMATTER_LIST:function(){return yt},Format:function(){return In},Formatter:function(){return Pn},ForwardRef:function(){return m},Fragment:function(){return An},GetRangesEvent:function(){return Ut},HISTORY_STACK_SIZE:function(){return kt},History:function(){return lr},Inject:function(){return S},InjectFlags:function(){return y},Injectable:function(){return b},InjectionToken:function(){return v},Injector:function(){return x},Keyboard:function(){return hr},LocalHistory:function(){return ur},NativeRenderer:function(){return gt},NativeSelectionBridge:function(){return Hn},NullInjector:function(){return C},Observable:function(){return q},Optional:function(){return E},OutputRenderer:function(){return dr},Prop:function(){return M},Query:function(){return mr},QueryStateType:function(){return pr},READONLY:function(){return Ct},Ref:function(){return Ot},ReflectiveInjector:function(){return L},Registry:function(){return $n},RenderMode:function(){return zn},Renderer:function(){return or},RootComponentRef:function(){return bt},Scheduler:function(){return ar},Scope:function(){return g},Selection:function(){return Vn},Self:function(){return T},SkipSelf:function(){return A},Slot:function(){return _n},Slots:function(){return Bt},Starter:function(){return gr},Subject:function(){return j},Subscriber:function(){return z},Subscription:function(){return _},THROW_IF_NOT_FOUND:function(){return w},Type:function(){return F},VElement:function(){return On},VFragment:function(){return Bn},VTextNode:function(){return Tn},ZEN_CODING_DETECT:function(){return wt},auditTime:function(){return re},concat:function(){return oe},debounceTime:function(){return se},defineComponent:function(){return Ft},delay:function(){return ie},delayWhen:function(){return ae},distinctUntilChanged:function(){return V},empty:function(){return W},every:function(){return le},filter:function(){return ce},forwardRef:function(){return f},fromEvent:function(){return K},fromPromise:function(){return Y},getAnnotations:function(){return p},interval:function(){return X},invokeListener:function(){return Gt},jsx:function(){return En},jsxs:function(){return Mn},makeClassDecorator:function(){return d},makeError:function(){return ft},makeInjectError:function(){return i},makeMethodDecorator:function(){return h},makeParamDecorator:function(){return c},makePropertyDecorator:function(){return u},makeProvideScopeError:function(){return a},map:function(){return H},merge:function(){return J},microTask:function(){return U},noop:function(){return D},normalizeProvider:function(){return B},of:function(){return Z},onBlur:function(){return en},onBreak:function(){return dn},onCompositionEnd:function(){return xn},onCompositionStart:function(){return vn},onCompositionUpdate:function(){return yn},onContentDelete:function(){return un},onContentDeleted:function(){return hn},onContentInsert:function(){return pn},onContentInserted:function(){return mn},onContextMenu:function(){return on},onDestroy:function(){return fn},onDirtyViewClean:function(){return bn},onFocus:function(){return Qt},onFocusIn:function(){return tn},onFocusOut:function(){return nn},onGetRanges:function(){return gn},onPaste:function(){return rn},onSelected:function(){return Xt},onSelectionFromEnd:function(){return Zt},onSelectionFromFront:function(){return Jt},onSlotRemove:function(){return ln},onSlotRemoved:function(){return cn},onUnselect:function(){return Yt},onViewChecked:function(){return sn},onViewInit:function(){return an},race:function(){return Q},retry:function(){return ue},sampleTime:function(){return he},share:function(){return $},skip:function(){return de},stringify:function(){return s},switchMap:function(){return pe},take:function(){return me},tap:function(){return fe},throttleTime:function(){return ge},throwError:function(){return ee},timeout:function(){return te},triggerContextMenu:function(){return Kt},useContext:function(){return zt},useDynamicShortcut:function(){return Ht},useRef:function(){return jt},useSelf:function(){return Dt},useSlots:function(){return _t},useState:function(){return qt},zip:function(){return ne}});var t={};n.r(t),n.d(t,{CollaborateCursor:function(){return Lr},CollaborateSelectionAwarenessDelegate:function(){return Pr},DomRenderer:function(){return zr},EDITOR_OPTIONS:function(){return Mr},Input:function(){return Nr},MagicInput:function(){return jr},NativeInput:function(){return Vr},OutputTranslator:function(){return Ur},Parser:function(){return _r},SelectionBridge:function(){return Ir},VIEW_CONTAINER:function(){return Br},VIEW_DOCUMENT:function(){return Rr},VIEW_MASK:function(){return Or},Viewer:function(){return Wr},createElement:function(){return br},createTextNode:function(){return vr},getLayoutRectByRange:function(){return yr},isFirefox:function(){return Cr},isMac:function(){return wr},isMobileBrowser:function(){return Sr},isSafari:function(){return kr},isWindows:function(){return xr}});var o={};function s(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(s).join(", ")+"]";if(null==e)return""+e;if(e.name)return`${e.name}`;if(e.token)return`${e.token}`;const t=e.toString();if(null==t)return""+t;const n=t.indexOf("\n");return-1===n?t:t.substring(0,n)}function i(e){return function(t){const n=new Error(`No provide for \`${s(t)}\`!`);return n.name=e,n}}function a(e){return function(t){const n=new Error(`Can not found provide scope \`${s(t)}\`!`);return n.name=e,n}}n.r(o),n.d(o,{BlockAttrFormatter:function(){return vu},BlockAttrLoader:function(){return bu},BlockStyleFormatLoader:function(){return wu},BlockStyleFormatter:function(){return ku},ButtonTool:function(){return _h},CodeStyleFormatter:function(){return su},ContextMenu:function(){return Nh},Dialog:function(){return Uo},DialogTool:function(){return qh},DropdownTool:function(){return jh},Editor:function(){return Vp},FileUploader:function(){return $o},Form:function(){return Po},FormButton:function(){return Lo},FormHidden:function(){return Fo},FormNumber:function(){return zo},FormRadio:function(){return Do},FormSelect:function(){return _o},FormStatic:function(){return qo},FormSwitch:function(){return jo},FormTextField:function(){return Ho},FormTextarea:function(){return Vo},GroupTool:function(){return Vh},I18n:function(){return Co},InlineElementFormatter:function(){return Ru},InlineStyleFormatLoader:function(){return Uu},InlineStyleFormatter:function(){return Gu},InlineTagFormatLoader:function(){return Bu},InlineTagLeafStyleFormatter:function(){return ah},InlineTagStyleFormatLoader:function(){return sh},InlineTagStyleFormatter:function(){return ih},Layout:function(){return Rh},LinkFormatLoader:function(){return ro},LinkFormatter:function(){return oo},LinkJumpTipPlugin:function(){return Ih},Matcher:function(){return no},Message:function(){return Oh},OuterStyleFormatLoader:function(){return Qu},OuterStyleFormatter:function(){return eh},SegmentDropdownTool:function(){return $h},SelectTool:function(){return Uh},TableComponentSelectionAwarenessDelegate:function(){return fh},ToolType:function(){return Hh},Toolbar:function(){return _p},alertComponent:function(){return So},alertComponentLoader:function(){return To},audioComponent:function(){return Ao},audioComponentLoader:function(){return Eo},audioTool:function(){return Wh},audioToolConfigFactory:function(){return Gh},autoComplete:function(){return go},blockBackgroundColorFormatLoader:function(){return Mu},blockBackgroundColorFormatter:function(){return Tu},blockComponent:function(){return Mo},blockComponentLoader:function(){return Bo},blockTags:function(){return fu},blockquoteComponent:function(){return Ro},blockquoteComponentLoader:function(){return Oo},blockquoteTool:function(){return Yh},blockquoteToolConfigFactory:function(){return Kh},boldFormatLoader:function(){return Du},boldFormatter:function(){return Ou},boldTool:function(){return Jh},boldToolConfigFactory:function(){return Xh},cleanTool:function(){return Qh},cleanToolConfigFactory:function(){return Zh},codeFormatLoader:function(){return $u},codeFormatter:function(){return zu},codeStyleFormatter:function(){return iu},codeStyles:function(){return ru},codeTool:function(){return td},codeToolConfigFactory:function(){return ed},colorFormatLoader:function(){return nh},colorFormatter:function(){return th},colorTool:function(){return kd},colorToolConfigFactory:function(){return wd},componentsTool:function(){return Sd},componentsToolConfigFactory:function(){return Cd},createCell:function(){return po},createCodeSlot:function(){return du},createEditor:function(){return nm},createJumbotronSlot:function(){return Qo},createStepSlot:function(){return dh},createTimelineItem:function(){return yh},defaultAttributeLoaders:function(){return Xp},defaultAttributes:function(){return Qp},defaultComponentLoaders:function(){return Kp},defaultComponents:function(){return Jp},defaultFormatLoaders:function(){return Yp},defaultFormatters:function(){return Zp},defaultGroupTool:function(){return Ud},defaultGroupToolFactory:function(){return $d},defaultOptions:function(){return em},defaultTools:function(){return tm},dirFormatLoader:function(){return xu},dirFormatter:function(){return yu},emojiTool:function(){return zd},emojiToolConfigFactory:function(){return Fd},findFocusCell:function(){return yo},fontFamilyFormatLoader:function(){return Ju},fontFamilyFormatter:function(){return Ku},fontFamilyTool:function(){return Kd},fontFamilyToolConfigFactory:function(){return Wd},fontSizeFormatLoader:function(){return oh},fontSizeFormatter:function(){return rh},fontSizeTool:function(){return Xd},fontSizeToolConfigFactory:function(){return Yd},formatPainterTool:function(){return Zd},formatPainterToolConfigFactory:function(){return Jd},headingComponent:function(){return No},headingComponentLoader:function(){return Io},headingTool:function(){return ep},headingToolConfigFactory:function(){return Qd},historyBackTool:function(){return np},historyBackToolConfigFactory:function(){return tp},historyForwardTool:function(){return op},historyForwardToolConfigFactory:function(){return rp},i18n_en_US:function(){return Mh},i18n_zh_CN:function(){return Bh},imageCardComponent:function(){return Jo},imageCardComponentLoader:function(){return Zo},imageComponent:function(){return Ko},imageComponentLoader:function(){return Yo},imageTool:function(){return ip},imageToolConfigFactory:function(){return sp},inlineTags:function(){return gu},insertParagraphAfterTool:function(){return lp},insertParagraphAfterToolConfigFactory:function(){return ap},insertParagraphBeforeTool:function(){return up},insertParagraphBeforeToolConfigFactory:function(){return cp},isSupportFont:function(){return Gd},italicFormatLoader:function(){return _u},italicFormatter:function(){return Nu},italicTool:function(){return dp},italicToolConfigFactory:function(){return hp},jumbotronComponent:function(){return es},jumbotronComponentLoader:function(){return ts},katexComponent:function(){return Kc},katexComponentLoader:function(){return Yc},languageList:function(){return ou},leftToRightTool:function(){return _d},leftToRightToolConfigFactory:function(){return Dd},letterSpacingFormatLoader:function(){return Xu},letterSpacingFormatter:function(){return Wu},letterSpacingTool:function(){return Pd},letterSpacingToolConfigFactory:function(){return Id},lineHeightFormatLoader:function(){return Zu},lineHeightFormatter:function(){return Yu},lineHeightTool:function(){return Nd},lineHeightToolConfigFactory:function(){return Od},linkFormatLoader:function(){return io},linkFormatter:function(){return so},linkTool:function(){return mp},linkToolConfigFactory:function(){return pp},listComponent:function(){return Xc},listComponentLoader:function(){return Jc},olTool:function(){return bp},olToolConfigFactory:function(){return gp},paragraphComponent:function(){return eo},paragraphComponentLoader:function(){return to},preComponent:function(){return pu},preComponentLoader:function(){return mu},preTool:function(){return Rd},preToolConfigFactory:function(){return Bd},rightToLeftTool:function(){return jd},rightToLeftToolConfigFactory:function(){return qd},rootComponent:function(){return qp},rootComponentLoader:function(){return jp},selectCells:function(){return xo},serialize:function(){return vo},slotsToTable:function(){return bo},stepComponent:function(){return ph},stepComponentLoader:function(){return mh},strikeThroughFormatLoader:function(){return qu},strikeThroughFormatter:function(){return Iu},strikeThroughTool:function(){return yp},strikeThroughToolConfigFactory:function(){return vp},subscriptFormatLoader:function(){return Hu},subscriptFormatter:function(){return Lu},subscriptTool:function(){return Md},subscriptToolConfigFactory:function(){return Ed},superscriptFormatLoader:function(){return Vu},superscriptFormatter:function(){return Fu},superscriptTool:function(){return Ad},superscriptToolConfigFactory:function(){return Td},tableAddTool:function(){return wp},tableAddToolConfigFactory:function(){return xp},tableComponent:function(){return gh},tableComponentLoader:function(){return bh},tableRemoveTool:function(){return Cp},tableRemoveToolConfigFactory:function(){return kp},textAlignFormatLoader:function(){return Eu},textAlignFormatter:function(){return Su},textAlignTool:function(){return Tp},textAlignToolConfigFactory:function(){return Sp},textBackgroundColorFormatLoader:function(){return hh},textBackgroundColorFormatter:function(){return ch},textBackgroundTool:function(){return Ep},textBackgroundToolConfigFactory:function(){return Ap},textIndentFormatLoader:function(){return Au},textIndentFormatter:function(){return Cu},textIndentTool:function(){return Bp},textIndentToolConfigFactory:function(){return Mp},timelineComponent:function(){return xh},timelineComponentLoader:function(){return wh},todolistComponent:function(){return kh},todolistComponentLoader:function(){return Ch},ulTool:function(){return Op},ulToolConfigFactory:function(){return Rp},underlineFormatLoader:function(){return ju},underlineFormatter:function(){return Pu},underlineTool:function(){return Ip},underlineToolConfigFactory:function(){return Np},unlinkTool:function(){return Lp},unlinkToolConfigFactory:function(){return Pp},useDragResize:function(){return Zr},useEnterBreaking:function(){return ao},useTableMultipleRange:function(){return wo},verticalAlignFormatLoader:function(){return uh},verticalAlignFormatter:function(){return lh},verticalAlignTool:function(){return zp},verticalAlignToolConfigFactory:function(){return Fp},videoComponent:function(){return Sh},videoComponentLoader:function(){return Th},videoTool:function(){return Vd},videoToolConfigFactory:function(){return Hd},wordExplainComponent:function(){return Ah},wordExplainComponentLoader:function(){return Eh}}),n(171);class l{constructor(){this.classes=new Map,this.props=new Map,this.methods=new Map,this.params=new Map}setClassMetadata(e,t){this.classes.set(e,t)}getClassMetadata(e){return this.classes.get(e)}getClassMetadataKeys(){return Array.from(this.classes.keys())}pushParamMetadata(e,t){this.params.has(e)?this.params.get(e).push(t):this.params.set(e,[t])}getParamMetadata(e){return this.params.get(e)}getParamMetadataKeys(){return Array.from(this.params.keys())}getPropMetadataKeys(){return Array.from(this.props.keys())}pushPropMetadata(e,t){this.props.has(e)?this.props.get(e).push(t):this.props.set(e,[t])}getPropMetadata(e){return this.props.get(e)}pushMethodMetadata(e,t){this.methods.has(e)?this.methods.get(e).push(t):this.methods.set(e,[t])}getMethodMetadata(e){return this.methods.get(e)}}function c(e,t){return function(n,r,o){p(n).pushParamMetadata(e,{propertyKey:r,parameterIndex:o,metadata:t})}}function u(e,t,n){return function(r,o){p(r.constructor).pushPropMetadata(e,{injectToken:t||Reflect.getMetadata("design:type",r,o),propertyKey:o,contextCallback:n})}}function h(e,...t){return function(n,r){p(n.constructor).pushMethodMetadata(e,{methodName:r,params:t})}}function d(e,t){return function(n){p(n).setClassMetadata(e,{paramTypes:Reflect.getMetadata("design:paramtypes",n),metadata:t})}}function p(e){const t="__annotations__";if(!e[t]){const n=new l;Reflect.defineProperty(e,t,{get(){return n}})}return e[t]}class m{constructor(e){this.forwardRefFn=e}getRef(){return this.forwardRefFn()}}function f(e){return new m(e)}class g{constructor(e){this.name=e}toString(){return this.name||"[anonymous provide scope]"}}const b=function e(t){if(!(this instanceof e))return d(b,new b(t));this.provideIn=(null==t?void 0:t.provideIn)||null};class v{constructor(e){this.description=e}toString(){return this.description||"[anonymous injection token]"}}var y;!function(e){e.Default="Default",e.Self="Self",e.SkipSelf="SkipSelf",e.Optional="Optional"}(y||(y={}));class x{}const w={__debug_value__:"THROW_IF_NOT_FOUND"},k=i("NullInjectorError");class C extends x{constructor(){super(...arguments),this.parentInjector=null}get(e,t=w){if(t===w)throw k(e);return t}}const S=function(e){if(!(this instanceof S))return c(S,new S(e));this.token=e},T=function(){if(!(this instanceof T))return c(T,new T)},A=function(){if(!(this instanceof A))return c(A,new A)},E=function(){if(!(this instanceof E))return c(E,new E)},M=function(e,t=w,n){if(!(this instanceof M))return u(M,e,(function(e,r,o,s){e[r]=s.get(o instanceof m?o.getRef():o,t,n)}))};function B(e){return e.useValue?R(e):e.useClass?O(e):e.useExisting?function(e){return{provide:e.provide,scope:null,generateFactory(t){return function(){return t.get(e.useExisting)}},deps:[]}}(e):e.useFactory?function(e){return{provide:e.provide,scope:null,generateFactory(){return function(...t){return e.useFactory(...t)}},deps:N(e.provide,e.deps||[])}}(e):e.provide?e.provide instanceof v?R(e):function(e){return O(Object.assign(Object.assign({},e),{useClass:e.provide}))}(e):function(e){return O({provide:e,useClass:e})}(e)}function R(e){return{provide:e.provide,scope:null,generateFactory(){return function(){return e.useValue}},deps:[]}}function O(e){let t,n;if(e.deps)t=N(e.provide,e.deps);else{const r=function(e){const t=p(e),n=t.getClassMetadata(b);if(void 0===n)throw new Error(`Class \`${s(e)}\` is not injectable!`);const r=(n.paramTypes||[]).map((e=>[e]));return[S,T,A,E].forEach((e=>{(t.getParamMetadata(e)||[]).forEach((e=>{r[e.parameterIndex].push(e.metadata)}))})),{scope:n.metadata.provideIn,deps:r}}(e.useClass);n=r.scope,t=N(e.provide,r.deps)}return{provide:e.provide,scope:n,deps:t,generateFactory(t,n){return function(...r){const o=new e.useClass(...r);return n(e.provide,o),p(e.useClass).getPropMetadataKeys().forEach((n=>{(p(e.useClass).getPropMetadata(n)||[]).forEach((e=>{e.contextCallback(o,e.propertyKey,e.injectToken,t)}))})),o}}}}function N(e,t){return t.map(((t,n)=>{const r={injectKey:null,optional:!1,visibility:null};if(Array.isArray(t))for(let e=0;e<t.length;e++){const n=t[e];n instanceof S?r.injectKey=n.token:n instanceof T||n instanceof A?r.visibility=n:n instanceof E?r.optional=!0:r.injectKey=n}else r.injectKey=t;if(void 0===r.injectKey)throw new Error(`The ${n} th dependent parameter type of \`${s(e)}\` was not obtained,\nif the dependency is declared later, you can refer to it using \`constructor(@Inject(forwardRef(() => [Type|InjectionToken])) paramName: [Type]) {}\``);return r}))}const I=i("ReflectiveInjectorError"),P=a("ReflectiveInjectorError");class L extends x{constructor(e,t,n){super(),this.parentInjector=e,this.staticProviders=t,this.scope=n,this.recordValues=new Map,this.normalizedProviders=t.map((e=>B(e)))}get(e,t=w,n){var r;if((n=n||y.Default)===y.SkipSelf){if(this.parentInjector)return this.parentInjector.get(e,t);if(t!==w)return t;throw I(e)}if(this.recordValues.has(e))return this.recordValues.get(e);for(let t=0;t<this.normalizedProviders.length;t++){const n=this.normalizedProviders[t];if(n.provide===e)return this.getValue(e,w,n)}if(!(e instanceof v)){const n=null===(r=p(e).getClassMetadata(b))||void 0===r?void 0:r.metadata.provideIn;if(n){const r=B(e);if(this.scope===n)return this.normalizedProviders.push(r),this.getValue(e,w,r);const o=this.parentInjector;if(!o||o instanceof C){if("root"===r.scope)return this.normalizedProviders.push(r),this.getValue(e,w,r);if(t!==w)return t;throw P(r.scope)}}}if(n===y.Self){if(t===w)throw I(e);return t}if(this.parentInjector)return this.parentInjector.get(e,t,n===y.Optional?y.Optional:y.Default);if(t===w)throw I(e);return t}getValue(e,t=w,n){const{generateFactory:r,deps:o}=n,s=this.resolveDeps(o||[],t);let i=this.recordValues.get(e);if(i)return i;const a=r(this,((e,t)=>{this.recordValues.set(e,t)}));return i=a(...s),this.recordValues.set(e,i),i}resolveDeps(e,t){return e.map((e=>{let n;const r={},o=e.injectKey instanceof m?e.injectKey.getRef():e.injectKey;if(e.visibility instanceof T)n=this.get(o,r,y.Self);else if(e.visibility instanceof A){if(!this.parentInjector){if(e.optional&&t===w)return null;throw I(o)}n=this.parentInjector.get(o,r)}else n=this.get(o,r);if(n===r){if(e.optional)return t===w?null:t;throw I(o)}return n}))}}const F=Function;class z{constructor(e){this.closed=!1,this.syncErrorThrowable=!0,this.destinationOrNext="function"==typeof e?{next:e}:e}next(e){this.closed||this.destinationOrNext.next&&(this.syncErrorThrowable=!1,this.destinationOrNext.next(e),this.syncErrorThrowable=!0)}error(e){if(!this.closed){if(this.closed=!0,this.destinationOrNext.error)return this.syncErrorThrowable=!1,this.destinationOrNext.error(e),this.syncErrorThrowable=!0,void(this.destinationOrNext=null);throw this.syncErrorThrowable=!1,this.destinationOrNext=null,e}}complete(){this.closed||(this.closed=!0,this.destinationOrNext.complete&&(this.syncErrorThrowable=!1,this.destinationOrNext.complete(),this.syncErrorThrowable=!0),this.destinationOrNext=null)}}function D(){}class _{constructor(e){this.unsubscribeCallback=e,this.subs=[],this.isStopped=!1}add(...e){return this.isStopped||this.subs.push(...e),this}unsubscribe(){this.isStopped=!0,this.unsubscribeCallback&&(this.unsubscribeCallback(),this.unsubscribeCallback=D),this.subs.forEach((e=>e.unsubscribe())),this.subs=[]}}class q{constructor(e=(e=>{e.complete()})){this.source=e}pipe(...e){return 0===e.length?this:e.reduce(((e,t)=>t(new q((t=>e.subscribe(t))))),this)}subscribe(e=D){const t=this.toSubscriber(e);return this.trySubscribe(t)}toPromise(){return new Promise(((e,t)=>{this.subscribe({next(t){e(t)},error(e){t(e)}})}))}toSubscriber(e){return new z("function"==typeof e?{next:e}:e)}trySubscribe(e){let t;try{t=this.source(e)}catch(t){if(!e.syncErrorThrowable)throw t;e.error(t)}return new _("function"==typeof t?function(){e.closed=!0,t()}:t instanceof _?function(){e.closed=!0,t.unsubscribe()}:function(){e.closed=!0})}}class j extends q{constructor(){super((e=>{this.subscribers.push(e)})),this.subscribers=[]}asObservable(){return new q((e=>{this.subscribe(e)}))}next(e){[...this.subscribers].forEach((t=>{try{t.next(e)}catch(e){if(!t.syncErrorThrowable)throw e;t.error(e)}}))}error(e){[...this.subscribers].forEach((t=>{t.error(e)}))}complete(){[...this.subscribers].forEach((e=>{e.complete()}))}}function H(e){return function(t){return new q((n=>t.subscribe({next(t){n.next(e(t))},error(e){n.error(e)},complete(){n.complete()}})))}}function V(e){return function(t){return new q((n=>{let r={},o=!0;return t.subscribe({next(t){if(o)return o=!1,r=t,void n.next(t);if(e){const o=e(r,t);r=t,o&&n.next(t)}else t!==r&&(r=t,n.next(t))},error(e){n.error(e)},complete(){n.complete()}})}))}}function $(){return function(e){const t=new j;return e.subscribe({next(e){t.next(e)},error(e){t.error(e)},complete(){t.complete()}}),t}}function U(){return function(e){return new q((t=>{let n=[],r=null,o=!1;return e.subscribe({next(e){n.push(e),r||(r=Promise.resolve().then((()=>{const e=n;n=[],r=null,t.next(e),o&&t.complete()})))},error(e){t.error(e)},complete(){null===r?t.complete():o=!0}})}))}}class G extends j{constructor(e){super(),this.currentValue=e}next(e){this.currentValue=e,super.next(e)}subscribe(e=function(){}){const t=this.toSubscriber(e),n=this.trySubscribe(t);return t.next(this.currentValue),n}}function W(){return new q((e=>{e.complete()}))}function K(e,t,n=!1){return new q((r=>{function o(e){return r.next(e)}return e.addEventListener(t,o,n),function(){e.removeEventListener(t,o)}}))}function Y(e){return new q((t=>{e.then((e=>{t.next(e),t.complete()})).catch((e=>{t.error(e)}))}))}function X(e=1e3){return new q((t=>{let n,r=0;return function o(){n=setTimeout((function(){t.next(r),o(),r++}),e)}(),function(){clearTimeout(n)}}))}function J(...e){return new q((t=>{0===e.length&&t.complete();const n=e.map((e=>({source:e,isComplete:!1}))),r=n.map((e=>e.source.subscribe({next(e){t.next(e)},error(e){t.error(e)},complete(){e.isComplete=!0,n.every((e=>e.isComplete))&&t.complete()}})));return function(){r.forEach((e=>e.unsubscribe()))}}))}function Z(...e){return new q((t=>{e.forEach((e=>t.next(e))),t.complete()}))}function Q(...e){return new q((t=>{if(0===e.length)return void t.complete();let n=!0;const r=[];for(const o of e){if(!n)break;r.push(o.subscribe({next(e){n&&(n=!1,t.next(e),t.complete())},error(e){n&&t.error(e)},complete(){r.forEach((e=>e.unsubscribe())),t.complete()}}))}return function(){r.forEach((e=>e.unsubscribe()))}}))}function ee(e){return new q((t=>{t.error(e||new Error)}))}function te(e=1e3,t=0){return new q((n=>{const r=setTimeout((function(){n.next(t),n.complete()}),e);return function(){clearTimeout(r)}}))}function ne(...e){return new q((t=>{if(0===e.length)return void t.complete();const n=e.map((e=>({source:e,values:[],isComplete:!1}))),r=new _;function o(){for(const e of n)if(e.isComplete&&0===e.values.length){t.complete(),r.unsubscribe();break}}return n.forEach((e=>{r.add(e.source.subscribe({next(r){e.values.push(r),n.every((e=>e.values.length))&&(t.next(n.map((e=>e.values.shift()))),o())},error(e){t.error(e)},complete(){e.isComplete=!0,o()}}))})),r}))}function re(e){return function(t){return new q((n=>{let r,o=!0,s=null,i=!1,a=!1;const l=t.subscribe({next(t){o&&(r=t,o=!1,s=setTimeout((()=>{s=null,o=!0,n.next(r),i&&n.complete()}),e))},error(e){a=!0,l&&l.unsubscribe(),n.error(e)},complete(){null===s?n.complete():i=!0}});return a&&l.unsubscribe(),function(){clearTimeout(s),l.unsubscribe()}}))}}function oe(...e){return function(t){return new q((n=>{const r=[t,...e];let o,s=!1;return function e(){const t=r.shift();o=t.subscribe({next(e){n.next(e)},error(e){n.error(e)},complete(){s||(0!==r.length?e():n.complete())}})}(),function(){s=!0,o.unsubscribe()}}))}}function se(e){return function(t){return new q((n=>{let r=null,o=!1;const s=t.subscribe({next(t){clearTimeout(r),r=setTimeout((function(){r=null,n.next(t),o&&n.complete()}),e)},error(e){n.error(e)},complete(){null===r?n.complete():o=!0}});return function(){r=null,clearTimeout(r),s.unsubscribe()}}))}}function ie(e=0){return function(t){return new q((n=>{const r=[];let o=!1;const s=t.subscribe({next(t){r.push(setTimeout((function(){r.shift(),n.next(t),o&&0===r.length&&n.complete()}),e))},error(e){n.error(e)},complete(){o=!0}});return function(){r.forEach((e=>clearTimeout(e))),s.unsubscribe()}}))}}function ae(e){return function(t){return new q((n=>{const r=new _,o=t.subscribe({next(t){r.add(e(t).subscribe({complete(){n.next(t)}}))},error(e){n.error(e)},complete(){r.unsubscribe(),n.complete()}});return function(){r.unsubscribe(),o.unsubscribe()}}))}}function le(e){return function(t){return new q((n=>{const r=t.subscribe({next(t){e(t)||(n.next(!1),n.complete(),r.unsubscribe())},error(e){n.error(e)},complete(){n.next(!0),n.complete()}});return r}))}}function ce(e){return function(t){return new q((n=>t.subscribe({next(t){e(t)&&n.next(t)},error(e){n.error(e)},complete(){n.complete()}})))}}function ue(e){return function(t){return new q((n=>{let r=0,o=!1,s=function i(){return t.subscribe({next(e){n.next(e)},error(t){r<e?(r++,s=i()):(o=!0,n.error(t))},complete(){n.complete()}})}();return o&&s.unsubscribe(),function(){s.unsubscribe()}}))}}function he(e){return function(t){return new q((n=>{let r,o=!0,s=null,i=!1,a=!1;const l=t.subscribe({next(t){r=t,o&&(o=!1,s=setTimeout((()=>{o=!0,s=null,n.next(r),i&&n.complete()}),e))},error(e){a=!0,l&&l.unsubscribe(),n.error(e)},complete(){null===s?n.complete():i=!0}});return a&&l.unsubscribe(),function(){clearTimeout(s),l.unsubscribe()}}))}}function de(e){return function(t){return new q((n=>{let r=0;const o={next(t){r<e?r++:n.next(t)},error(e){n.error(e)},complete(){n.complete()}};return t.subscribe(o)}))}}function pe(e){return function(t){return new q((n=>{const r=new _;let o=!1;const s={next(t){r.add(e(t).subscribe({next(e){n.next(e),o&&n.complete()},error(e){n.error(e)},complete(){n.complete()}}))},error(e){n.error(e)},complete(){o=!0}};return t.subscribe(s),r}))}}function me(e){return function(t){return new q((n=>{let r=0;const o=new _;let s=!1;const i={next(t){if(r<e)return n.next(t),r++,void(r===e&&(s=!0,o.unsubscribe(),n.complete()));s=!0,n.complete()},error(e){n.error(e)},complete(){n.complete()}};return o.add(t.subscribe(i)),s&&o.unsubscribe(),o}))}}function fe(e){return function(t){return new q((n=>t.subscribe({next(t){e(t),n.next(t)},error(e){n.error(e)},complete(){n.complete()}})))}}function ge(e){return function(t){return new q((n=>{let r,o=!0;const s=t.subscribe({next(t){o&&(o=!1,n.next(t),r=setTimeout((()=>{o=!0}),e))},error(e){n.error(e)},complete(){n.complete()}});return function(){clearTimeout(r),s.unsubscribe()}}))}}function be(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function ve(e){return!!e&&!!e[ot]}function ye(e){var t;return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===st}(e)||Array.isArray(e)||!!e[rt]||!!(null===(t=e.constructor)||void 0===t?void 0:t[rt])||Te(e)||Ae(e))}function xe(e,t,n){void 0===n&&(n=!1),0===we(e)?(n?Object.keys:it)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function we(e){var t=e[ot];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Te(e)?2:Ae(e)?3:0}function ke(e,t){return 2===we(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Ce(e,t){return 2===we(e)?e.get(t):e[t]}function Se(e,t,n){var r=we(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function Te(e){return Qe&&e instanceof Map}function Ae(e){return et&&e instanceof Set}function Ee(e){return e.o||e.t}function Me(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=at(e);delete t[ot];for(var n=it(t),r=0;r<n.length;r++){var o=n[r],s=t[o];!1===s.writable&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(t[o]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function Be(e,t){return void 0===t&&(t=!1),Oe(e)||ve(e)||!ye(e)||(we(e)>1&&(e.set=e.add=e.clear=e.delete=Re),Object.freeze(e),t&&xe(e,(function(e,t){return Be(t,!0)}),!0)),e}function Re(){be(2)}function Oe(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function Ne(e){var t=lt[e];return t||be(18,e),t}function Ie(){return Je}function Pe(e,t){t&&(Ne("Patches"),e.u=[],e.s=[],e.v=t)}function Le(e){Fe(e),e.p.forEach(De),e.p=null}function Fe(e){e===Je&&(Je=e.l)}function ze(e){return Je={p:[],l:Je,h:e,m:!0,_:0}}function De(e){var t=e[ot];0===t.i||1===t.i?t.j():t.O=!0}function _e(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.g||Ne("ES5").S(t,e,r),r?(n[ot].P&&(Le(t),be(4)),ye(e)&&(e=qe(t,e),t.l||He(t,e)),t.u&&Ne("Patches").M(n[ot].t,e,t.u,t.s)):e=qe(t,n,[]),Le(t),t.u&&t.v(t.u,t.s),e!==nt?e:void 0}function qe(e,t,n){if(Oe(t))return t;var r=t[ot];if(!r)return xe(t,(function(o,s){return je(e,r,t,o,s,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return He(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=Me(r.k):r.o;xe(3===r.i?new Set(o):o,(function(t,s){return je(e,r,o,t,s,n)})),He(e,o,!1),n&&e.u&&Ne("Patches").R(r,n,e.u,e.s)}return r.o}function je(e,t,n,r,o,s){if(ve(o)){var i=qe(e,o,s&&t&&3!==t.i&&!ke(t.D,r)?s.concat(r):void 0);if(Se(n,r,i),!ve(i))return;e.m=!1}if(ye(o)&&!Oe(o)){if(!e.h.F&&e._<1)return;qe(e,o),t&&t.A.l||He(e,o)}}function He(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&Be(t,n)}function Ve(e,t){var n=e[ot];return(n?Ee(n):e)[t]}function $e(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function Ue(e){e.P||(e.P=!0,e.l&&Ue(e.l))}function Ge(e){e.o||(e.o=Me(e.t))}function We(e,t,n){var r=Te(t)?Ne("MapSet").N(t,n):Ae(t)?Ne("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:Ie(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,s=ct;n&&(o=[r],s=ut);var i=Proxy.revocable(o,s),a=i.revoke,l=i.proxy;return r.k=l,r.j=a,l}(t,n):Ne("ES5").J(t,n);return(n?n.A:Ie()).p.push(r),r}function Ke(e){return ve(e)||be(22,e),function e(t){if(!ye(t))return t;var n,r=t[ot],o=we(t);if(r){if(!r.P&&(r.i<4||!Ne("ES5").K(r)))return r.t;r.I=!0,n=Ye(t,o),r.I=!1}else n=Ye(t,o);return xe(n,(function(t,o){r&&Ce(r.t,t)===o||Se(n,t,e(o))})),3===o?new Set(n):n}(e)}function Ye(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Me(e)}var Xe,Je,Ze="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Qe="undefined"!=typeof Map,et="undefined"!=typeof Set,tt="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,nt=Ze?Symbol.for("immer-nothing"):((Xe={})["immer-nothing"]=!0,Xe),rt=Ze?Symbol.for("immer-draftable"):"__$immer_draftable",ot=Ze?Symbol.for("immer-state"):"__$immer_state",st=("undefined"!=typeof Symbol&&Symbol.iterator,""+Object.prototype.constructor),it="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,at=Object.getOwnPropertyDescriptors||function(e){var t={};return it(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},lt={},ct={get:function(e,t){if(t===ot)return e;var n=Ee(e);if(!ke(n,t))return function(e,t,n){var r,o=$e(t,n);return o?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.I||!ye(r)?r:r===Ve(e.t,t)?(Ge(e),e.o[t]=We(e.A.h,r,e)):r},has:function(e,t){return t in Ee(e)},ownKeys:function(e){return Reflect.ownKeys(Ee(e))},set:function(e,t,n){var r=$e(Ee(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=Ve(Ee(e),t),s=null==o?void 0:o[ot];if(s&&s.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(n,o)&&(void 0!==n||ke(e.t,t)))return!0;Ge(e),Ue(e)}return e.o[t]===n&&"number"!=typeof n&&(void 0!==n||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==Ve(e.t,t)||t in e.t?(e.D[t]=!1,Ge(e),Ue(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=Ee(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){be(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){be(12)}},ut={};xe(ct,(function(e,t){ut[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),ut.deleteProperty=function(e,t){return ut.set.call(this,e,t,void 0)},ut.set=function(e,t,n){return ct.set.call(this,e[0],t,n,e[0])};var ht=function(){function e(e){var t=this;this.g=tt,this.F=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var o=n;n=e;var s=t;return function(e){var t=this;void 0===e&&(e=o);for(var r=arguments.length,i=Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];return s.produce(e,(function(e){var r;return(r=n).call.apply(r,[t,e].concat(i))}))}}var i;if("function"!=typeof n&&be(6),void 0!==r&&"function"!=typeof r&&be(7),ye(e)){var a=ze(t),l=We(t,e,void 0),c=!0;try{i=n(l),c=!1}finally{c?Le(a):Fe(a)}return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(e){return Pe(a,r),_e(e,a)}),(function(e){throw Le(a),e})):(Pe(a,r),_e(i,a))}if(!e||"object"!=typeof e){if(void 0===(i=n(e))&&(i=e),i===nt&&(i=void 0),t.F&&Be(i,!0),r){var u=[],h=[];Ne("Patches").M(e,i,u,h),r(u,h)}return i}be(21,e)},this.produceWithPatches=function(e,n){if("function"==typeof e)return function(n){for(var r=arguments.length,o=Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(o))}))};var r,o,s=t.produce(e,n,(function(e,t){r=e,o=t}));return"undefined"!=typeof Promise&&s instanceof Promise?s.then((function(e){return[e,r,o]})):[s,r,o]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){ye(e)||be(8),ve(e)&&(e=Ke(e));var t=ze(this),n=We(this,e,void 0);return n[ot].C=!0,Fe(t),n},t.finishDraft=function(e,t){var n=(e&&e[ot]).A;return Pe(n,t),_e(void 0,n)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!tt&&be(20),this.g=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var o=Ne("Patches").$;return ve(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))},e}(),dt=new ht,pt=dt.produce,mt=(dt.produceWithPatches.bind(dt),dt.setAutoFreeze.bind(dt),dt.setUseProxies.bind(dt),dt.applyPatches.bind(dt));function ft(e){return function(t){const n=new Error(t);return n.name=`[TextbusError: ${e}]`,n.stack=n.stack.replace(/\n.*?(?=\n)/,""),n}}dt.createDraft.bind(dt),dt.finishDraft.bind(dt);class gt{}class bt{}const vt=new v("COMPONENT_LIST"),yt=new v("FORMATTER_LIST"),xt=new v("ATTRIBUTE_LIST"),wt=new v("ZEN_CODING_DETECT"),kt=new v("HISTORY_STACK_SIZE"),Ct=new v("READONLY");function St(e,t,n,r){var o,s=arguments.length,i=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,n,i):o(t,n))||i);return s>3&&i&&Object.defineProperty(t,n,i),i}function Tt(e,t){return function(n,r){t(n,r,e)}}function At(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}class Et{get dirty(){return this._dirty}get changed(){return this._changed}get outputDirty(){return this._outputDirty}get outputChanged(){return this._outputChanged}constructor(){this._dirty=!0,this._changed=!0,this._outputDirty=!0,this._outputChanged=!0,this.changeEvent=new j,this.childComponentRemovedEvent=new j,this.forceChangeEvent=new j,this.onChange=this.changeEvent.asObservable(),this.onChildComponentRemoved=this.childComponentRemovedEvent.asObservable(),this.onForceChange=this.forceChangeEvent.asObservable()}forceMarkDirtied(){this._dirty||(this._dirty=!0,this.forceMarkChanged())}forceMarkChanged(){this._changed||(this._changed=!0,this.forceChangeEvent.next())}markAsDirtied(e){this._dirty=!0,this._outputDirty=!0,this.markAsChanged(e)}markAsChanged(e){this._changed=!0,this._outputChanged=!0,this.changeEvent.next(e)}rendered(){this._dirty=this._changed=!1}outputRendered(){this._outputDirty=this._outputChanged=!1}reset(){this._changed=this._dirty=this._outputChanged=this._outputDirty=!0}recordComponentRemoved(e){this.childComponentRemovedEvent.next(e)}}class Mt{constructor(){this.segmenter=new Intl.Segmenter,this.data=[]}get length(){return this.data.reduce(((e,t)=>e+t.length),0)}correctIndex(e,t){if(0===e||e===this.length)return e;let n=0;for(const r of this.data){const o=r.length;if("string"==typeof r&&e>n&&e<n+o){const o=e-n,s=Math.max(0,o-15),i=Math.min(s+30,r.length),a=r.slice(s,i),l=this.segmenter.segment(a);let c=s;for(const r of l){const o=r.segment.length;if(e>n+c&&e<n+c+o)return t?n+c+o:n+c;if(c+=o,n+c>=e)break}return e}if(n+=o,n>=e)break}return e}insert(e,t){if(e>=this.length)this.append(t);else{let n=0,r=0;for(const o of this.data){if(e>=n)if("string"==typeof o){if(e>=n&&e<n+o.length){const s=[o.slice(0,e-n),t,o.slice(e-n)].filter((e=>e));"string"==typeof t?this.data.splice(r,1,s.join("")):this.data.splice(r,1,...s);break}}else if(e===n){const e=this.data[r-1];"string"==typeof e&&"string"==typeof t?this.data[r-1]=e+t:0===n?this.data.unshift(t):this.data.splice(r,0,t);break}r++,n+=o.length}}}append(e){const t=this.data.length-1,n=this.data[t];"string"==typeof n&&"string"==typeof e?this.data[t]=n+e:this.data.push(e)}cut(e=0,t=this.length){if(t<=e)return[];const n=this.slice(e,t),r=this.slice(0,e).concat(this.slice(t,this.length));return this.data=[],r.forEach((e=>this.append(e))),n}slice(e=0,t=this.length){if(e>=t)return[];e=this.correctIndex(e,!1),t=this.correctIndex(t,!0);let n=0;const r=[];for(const o of this.data){const s=n,i=o.length,a=n+i;if(n+=i,e<a&&t>s)if("string"==typeof o){const n=Math.max(0,e-s),i=Math.min(a,t)-s;r.push(o.slice(n,i))}else r.push(o)}return r}toJSON(){return this.data.map((e=>"string"==typeof e?e:e.toJSON()))}indexOf(e){let t=0;for(const n of this.data){if(n===e)return t;t+=n.length}return-1}getContentAtIndex(e){return this.slice(e,e+1)[0]}toGrid(){const e=[0];let t=0;return this.data.forEach((n=>{t+=n.length,e.push(t)})),[...e]}toString(){return this.data.map((e=>"string"==typeof e?e:e.toString())).join("")}}class Bt{get length(){return this.slots.length}get last(){return this.slots[this.length-1]||null}get first(){return this.slots[0]||null}get index(){return this._index}constructor(e,t=[]){this.host=e,this.slots=[],this._index=0,this.changeEvent=new j,this.childSlotChangeEvent=new j,this.childSlotRemoveEvent=new j,this.changeListeners=new WeakMap,this.onChange=this.changeEvent.asObservable(),this.onChildSlotChange=this.childSlotChangeEvent.asObservable(),this.onChildSlotRemove=this.childSlotRemoveEvent.asObservable(),this.insert(...Array.from(new Set(t)))}indexOf(e){return this.slots.indexOf(e)}remove(e){const t=this.slots.indexOf(e);return t>-1&&(this.retain(t),this.delete(1),!0)}insertAfter(e,t){const n=this.slots.indexOf(t);n>-1&&this.insertByIndex(e,n+1)}insertBefore(e,t){const n=this.slots.indexOf(t);n>-1&&this.insertByIndex(e,n)}insertByIndex(e,t){t<0&&(t=0),t>this.slots.length&&(t=this.slots.length),this.retain(t);const n=Array.isArray(e)?e:[e];this.insert(...n)}push(...e){this.retain(this.length),this.insert(...e)}pop(){if(this.length>0){const e=this.last;return this.retain(this.length-1),this.delete(1),e}return null}shift(){if(this.length>0){const e=this.first;return this.retain(0),this.delete(1),e}return null}unshift(...e){this.retain(0),this.insert(...e)}get(e){return this.slots[e]||null}replace(e,t){const n=this.indexOf(e);n>0&&(this.retain(n),this.delete(1),this.insert(t))}toJSON(){return this.slots.map((e=>e.toJSON()))}toArray(){return[...this.slots]}clean(){this.retain(0),this.delete(this.length)}insert(...e){if(0===e.length)return;const t=this._index;this.slots.splice(t,0,...e),e.forEach((e=>{e.parent&&e.parent.slots.remove(e),e.changeMarker.reset(),e.parent=this.host;const t=e.changeMarker.onChange.subscribe((t=>{t.path.unshift(this.indexOf(e)),e.changeMarker.dirty?this.host.changeMarker.markAsDirtied(t):this.host.changeMarker.markAsChanged(t),this.childSlotChangeEvent.next(e)}));t.add(e.changeMarker.onChildComponentRemoved.subscribe((e=>{this.host.changeMarker.recordComponentRemoved(e)}))),t.add(e.changeMarker.onForceChange.subscribe((()=>{e.changeMarker.dirty?this.host.changeMarker.forceMarkDirtied():this.host.changeMarker.forceMarkChanged()}))),this.changeListeners.set(e,t)})),this._index+=e.length,this.changeEvent.next({path:[],apply:[{type:"retain",offset:t},...e.map((e=>({type:"insertSlot",slot:e.toJSON(),ref:e})))],unApply:[{type:"retain",offset:t},{type:"delete",count:e.length}]})}retain(e){e<0?this._index=0:e>this.length?this._index=this.length:this._index=e}delete(e){const t=this._index,n=this.slots.splice(t,e);n.forEach((e=>{var t;null===(t=this.changeListeners.get(e))||void 0===t||t.unsubscribe(),this.changeListeners.delete(e)})),this.changeEvent.next({path:[],apply:[{type:"retain",offset:t},{type:"delete",count:e}],unApply:n.map(((e,n)=>(e.parent=null,[{type:"retain",offset:t+n},{type:"insertSlot",slot:e.toJSON(),ref:e}]))).flat()}),this.childSlotRemoveEvent.next(n)}cut(e=0,t=this.length){if(e>=t)return[];const n=this.slots.slice(e,t);return this.retain(e),this.delete(t-e),n}slice(e,t){return this.slots.slice(e,t)}has(e){return this.indexOf(e)>-1}toString(){return this.slots.map((e=>e.toString())).join("")}}!function(){function e(t){if(!ye(t))return t;if(Array.isArray(t))return t.map(e);if(Te(t))return new Map(Array.from(t.entries()).map((function(t){return[t[0],e(t[1])]})));if(Ae(t))return new Set(Array.from(t).map(e));var n=Object.create(Object.getPrototypeOf(t));for(var r in t)n[r]=e(t[r]);return ke(t,rt)&&(n[rt]=t[rt]),n}function t(t){return ve(t)?e(t):t}var n="add";!function(e,t){lt[e]||(lt[e]=t)}("Patches",{$:function(t,r){return r.forEach((function(r){for(var o=r.path,s=r.op,i=t,a=0;a<o.length-1;a++){var l=we(i),c=""+o[a];0!==l&&1!==l||"__proto__"!==c&&"constructor"!==c||be(24),"function"==typeof i&&"prototype"===c&&be(24),"object"!=typeof(i=Ce(i,c))&&be(15,o.join("/"))}var u=we(i),h=e(r.value),d=o[o.length-1];switch(s){case"replace":switch(u){case 2:return i.set(d,h);case 3:be(16);default:return i[d]=h}case n:switch(u){case 1:return"-"===d?i.push(h):i.splice(d,0,h);case 2:return i.set(d,h);case 3:return i.add(h);default:return i[d]=h}case"remove":switch(u){case 1:return i.splice(d,1);case 2:return i.delete(d);case 3:return i.delete(r.value);default:return delete i[d]}default:be(17,s)}})),t},R:function(e,r,o,s){switch(e.i){case 0:case 4:case 2:return function(e,r,o,s){var i=e.t,a=e.o;xe(e.D,(function(e,l){var c=Ce(i,e),u=Ce(a,e),h=l?ke(i,e)?"replace":n:"remove";if(c!==u||"replace"!==h){var d=r.concat(e);o.push("remove"===h?{op:h,path:d}:{op:h,path:d,value:u}),s.push(h===n?{op:"remove",path:d}:"remove"===h?{op:n,path:d,value:t(c)}:{op:"replace",path:d,value:t(c)})}}))}(e,r,o,s);case 5:case 1:return function(e,r,o,s){var i=e.t,a=e.D,l=e.o;if(l.length<i.length){var c=[l,i];i=c[0],l=c[1];var u=[s,o];o=u[0],s=u[1]}for(var h=0;h<i.length;h++)if(a[h]&&l[h]!==i[h]){var d=r.concat([h]);o.push({op:"replace",path:d,value:t(l[h])}),s.push({op:"replace",path:d,value:t(i[h])})}for(var p=i.length;p<l.length;p++){var m=r.concat([p]);o.push({op:n,path:m,value:t(l[p])})}i.length<l.length&&s.push({op:"replace",path:r.concat(["length"]),value:i.length})}(e,r,o,s);case 3:return function(e,t,r,o){var s=e.t,i=e.o,a=0;s.forEach((function(e){if(!i.has(e)){var s=t.concat([a]);r.push({op:"remove",path:s,value:e}),o.unshift({op:n,path:s,value:e})}a++})),a=0,i.forEach((function(e){if(!s.has(e)){var i=t.concat([a]);r.push({op:n,path:i,value:e}),o.unshift({op:"remove",path:i,value:e})}a++}))}(e,r,o,s)}},M:function(e,t,n,r){n.push({op:"replace",path:[],value:t===nt?void 0:t}),r.push({op:"replace",path:[],value:e})}})}();const Rt=ft("DefineComponent");class Ot{constructor(e=null){this.current=e}}class Nt{constructor(){this.listeners=new Map}add(e,t){let n=this.listeners.get(e);n||(n=[],this.listeners.set(e,n)),n.push(t)}get(e){return this.listeners.get(e)||[]}clean(e){this.listeners.delete(e)}}const It=new WeakMap,Pt=[];function Lt(){const e=Pt[Pt.length-1];if(!e)throw Rt("cannot be called outside the component!");return e}function Ft(e){const t={name:e.name,separable:!!e.separable,instanceType:e.type,zenCoding:e.zenCoding,createInstance(n,r){const o=new Et,s=new j,i=s.asObservable(),a={update(e,t=!0){return l.updateState(e,t)},onChange:i.pipe(H((e=>e.newState)))},l={name:t.name,type:t.instanceType,separable:t.separable,changeMarker:o,parent:null,get parentComponent(){var e;return(null===(e=l.parent)||void 0===e?void 0:e.parent)||null},get state(){return u},length:1,onStateChange:i,slots:null,extends:null,shortcutList:null,updateState(e,t=!0){let n,r;const i=u,a=pt(i,e,((e,t)=>{n=e,r=t}));return 0===n.length&&0===r.length?i:(u=a,o.markAsDirtied({path:[],apply:[{type:"apply",patches:n,value:a,record:t}],unApply:[{type:"apply",patches:r,value:i,record:t}]}),s.next({oldState:i,newState:a,record:t}),a)},toJSON(){return{name:t.name,state:null!=u?u:null,slots:l.slots.toJSON()}},toString(){return l.slots.toString()}},c={contextInjector:n,changeController:a,componentInstance:l,dynamicShortcut:[],eventCache:new Nt};Pt.push(c),l.extends=e.setup(r),fn((()=>{It.delete(l),h.forEach((e=>e.unsubscribe()))})),It.set(l,c.eventCache),Pt.pop(),l.slots=c.slots||new Bt(l),l.shortcutList=c.dynamicShortcut;let u=Reflect.has(c,"initState")?c.initState:null==r?void 0:r.state;const h=[l.slots.onChange.subscribe((e=>{o.markAsDirtied(e)}))];return l}};return t}function zt(e=x,t,n){return Lt().contextInjector.get(e,t,n)}function Dt(){return Lt().componentInstance}function _t(e){const t=Lt();if(Reflect.has(t,"slots"))throw Rt("only one unique slots is allowed for a component!");const n=new Bt(t.componentInstance,e);return t.slots=n,n}function qt(e){const t=Lt();if(Reflect.has(t,"initState"))throw Rt("only one unique state is allowed for a component!");return t.initState=e,t.changeController}function jt(e=null){return new Ot(e)}function Ht(e){Lt().dynamicShortcut.push(e)}class Vt{get isPrevented(){return this._isPrevented}constructor(e,t){this.target=e,this.data=t,this._isPrevented=!1}preventDefault(){this._isPrevented=!0}}class $t extends Vt{constructor(e,t){super(e,null),this.getMenus=t,this.isStopped=!1}get stopped(){return this.isStopped}stopPropagation(){this.isStopped=!0}useMenus(e){this.getMenus(e)}}class Ut extends Vt{constructor(e,t){super(e,null),this.getRanges=t}useRanges(e){this.getRanges(e)}}function Gt(e,t,n){if("object"!=typeof e||null===e)return;const r=It.get(e);if(r){if(r.get(t).forEach((e=>e(n))),"onViewChecked"===t){const e=r.get("onViewInit");r.clean("onViewInit"),e.forEach((e=>{e(n)}))}"onDestroy"===t&&It.delete(e)}}function Wt(e){return function(t){const n=Lt();n&&n.eventCache.add(e,t)}}function Kt(e){var t;let n=e;const r=[];for(;n;){const e=new $t(n,(e=>{r.push(e)}));if(Gt(n,"onContextMenu",e),e.stopped)break;n=(null===(t=n.parent)||void 0===t?void 0:t.parent)||null}return r}const Yt=Wt("onUnselect"),Xt=Wt("onSelected"),Jt=Wt("onSelectionFromFront"),Zt=Wt("onSelectionFromEnd"),Qt=Wt("onFocus"),en=Wt("onBlur"),tn=Wt("onFocusIn"),nn=Wt("onFocusOut"),rn=Wt("onPaste"),on=Wt("onContextMenu"),sn=Wt("onViewChecked"),an=Wt("onViewInit"),ln=Wt("onSlotRemove"),cn=Wt("onSlotRemoved"),un=Wt("onContentDelete"),hn=Wt("onContentDeleted"),dn=Wt("onBreak"),pn=Wt("onContentInsert"),mn=Wt("onContentInserted"),fn=Wt("onDestroy"),gn=Wt("onGetRanges"),bn=Wt("onDirtyViewClean"),vn=Wt("onCompositionStart"),yn=Wt("onCompositionUpdate"),xn=Wt("onCompositionEnd");var wn,kn;const Cn=ft("VElement"),Sn=Symbol("parentNode");class Tn{get parentNode(){return this[Sn]}constructor(e=""){this.textContent=e,this[wn]=null}}function An(e){return new Bn(e.children)}function En(e,t={}){const n=t.children;return Reflect.deleteProperty(t,"children"),n?On.createElement(e,t,n):On.createElement(e,t)}function Mn(e,t={}){return En(e,t)}wn=Sn;class Bn{constructor(e){this.children=e}}function Rn(e,t){if(t instanceof On)e.push(t);else if(t instanceof Tn)t.textContent&&e.push(t);else if("string"==typeof t&&t.length>0)e.push(new Tn(t));else if(t instanceof Bn)for(const n of t.children.flat())Rn(e,n);else!1!==t&&!0!==t&&null!=t&&e.push(new Tn(String(t)))}class On{static createElement(e,t=null,...n){const r=[];return n.flat(2).forEach((e=>{Rn(r,e)})),"function"==typeof e?e(Object.assign(Object.assign({},t),{children:r})):new On(e,t,r)}get parentNode(){return this[Sn]}get children(){return[...this._children]}constructor(e,t=null,n=[]){this.tagName=e,this[kn]=null,this.attrs=new Map,this.styles=new Map,this._children=[];const r=((t=t||{}).class||"").trim();this.classes=new Set(r?r.split(/\s+/g):[]),Reflect.deleteProperty(t,"class");const o=t.style||"",s=new Map;"string"==typeof o?o.split(";").map((e=>e.split(":"))).forEach((e=>{e[0]&&e[1]&&s.set(e[0].trim(),e[1].trim())})):"object"==typeof o&&Object.keys(o).forEach((e=>{s.set(e,o[e])})),this.styles=s,Reflect.deleteProperty(t,"style"),Reflect.deleteProperty(t,"slot"),this.listeners={},Object.keys(t).forEach((e=>{if(/^on[A-Z]/.test(e)){const n=t[e];"function"==typeof n&&(this.listeners[e.replace(/^on/,"").toLowerCase()]=n)}else this.attrs.set(e,t[e])})),this.appendChild(...n)}appendChild(...e){e.forEach((e=>{var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e),e[Sn]=this,this._children.push(e)}))}removeChild(e){const t=this._children.indexOf(e);if(t>-1)return this._children.splice(t,1),void(e[Sn]=null);throw Cn("node to be deleted is not a child of the current node.")}replaceChild(e,t){var n;const r=this._children.indexOf(t);if(r>-1)return null===(n=e.parentNode)||void 0===n||n.removeChild(e),this._children.splice(r,1,e),t[Sn]=null,void(e[Sn]=this);throw Cn("node to be replaced is not a child of the current node.")}}function Nn(e){return null==e}kn=Sn;class In{constructor(e){this.slot=e,this.map=new Map}merge(e,t,n=!1){let r=this.map.get(e);if(!r)return Nn(t.value)||(r=[t],this.map.set(e,r)),this;const o=this.normalizeFormatRange(n,r,t);return o.length?this.map.set(e,o):this.map.delete(e),this}stretch(e,t){return this.map.forEach((n=>{n.forEach((n=>{n.endIndex<e||(n.endIndex+=t,n.startIndex>=e&&(n.startIndex+=t))}))})),this}split(e,t){const n=Array.from({length:t});return Array.from(this.map).forEach((([t,r])=>{const o=this.tileRanges(r);o.splice(e,0,...n);const s=In.toRanges(o);this.map.set(t,s)})),this}shrink(e,t){return this.map.forEach((n=>{n.forEach((n=>{n.endIndex<=e||(n.endIndex=Math.max(e,n.endIndex-t),n.startIndex>e&&(n.startIndex=Math.max(e,n.startIndex-t)))}))})),Array.from(this.map.keys()).forEach((e=>{const t=this.map.get(e),n=this.normalizeFormatRange(!1,t);n.length?this.map.set(e,n):this.map.delete(e)})),this}extract(e,t){const n=new In(this.slot);return this.map.forEach(((r,o)=>{const s=this.extractFormatRangesByFormatter(e,t,o);s.length&&n.map.set(o,s)})),n}createFormatByRange(e,t,n){const r=new In(e);return this.map.forEach(((e,o)=>{const s=this.extractFormatRangesByFormatter(t,n,o);s.length&&r.map.set(o,s.map((e=>(e.startIndex-=t,e.endIndex-=t,e))))})),r}extractFormatRangesByFormatter(e,t,n){const r=[];return(this.map.get(n)||[]).forEach((n=>{if(n.startIndex>t||n.endIndex<e)return;const o=Math.max(n.startIndex,e),s=Math.min(n.endIndex,t);o<s&&r.push({startIndex:o,endIndex:s,value:n.value})})),r}discard(e,t,n){const r=this.map.get(e);return r&&this.normalizeFormatRange(!1,r,{startIndex:t,endIndex:n,value:null}),this}extractFormatsByIndex(e){const t=[];return 0===e?this.map.forEach(((e,n)=>{e.forEach((e=>{0===e.startIndex&&t.push([n,e.value])}))})):this.map.forEach(((n,r)=>{n.forEach((n=>{n.startIndex<e&&n.endIndex>=e&&t.push([r,n.value])}))})),t}toGrid(){const e=new Set;return e.add(0),e.add(this.slot.length),this.map.forEach((t=>{t.forEach((t=>{e.add(t.startIndex),e.add(t.endIndex)}))})),[...e].sort(((e,t)=>e-t))}toJSON(){const e={};return this.map.forEach(((t,n)=>{e[n.name]=t.map((e=>Object.assign({},e)))})),e}toTree(e,t){const n=this.extract(e,t),r={startIndex:e,endIndex:t};let o=t,s=e;const i=[],a=[];if(Array.from(n.map.keys()).forEach((r=>{n.map.get(r).forEach((l=>{l.startIndex===e&&l.endIndex===t?r.columned?a.push(Object.assign({formatter:r},l)):(i.push(Object.assign({formatter:r},l)),n.map.delete(r)):l.startIndex<o?(o=l.startIndex,s=l.endIndex):l.startIndex===o&&(s=Math.max(s,l.endIndex))}))})),n.map.size>a.length){if(r.children=[],e<o)if(a.length){const t=n.extract(e,o).toTree(e,o);r.children.push(t)}else r.children.push({startIndex:e,endIndex:o});const i=function(e,t){t.formats?e.children.push(t):t.children?e.children.push(...t.children):e.children.push(t)};i(r,n.toTree(o,s)),s<t&&i(r,n.extract(s,t).toTree(s,t))}else i.push(...a);return i.length&&(r.formats=i),r}toArray(){const e=[];return Array.from(this.map).forEach((t=>{const n=t[0];t[1].forEach((t=>{e.push(Object.assign(Object.assign({},t),{formatter:n}))}))})),e}normalizeFormatRange(e,t,n){n&&(t=e?[n,...t]:[...t,n]);const r=this.tileRanges(t);return In.toRanges(r)}tileRanges(e){const t=[];return e.forEach((e=>{t.length=Math.max(t.length,e.endIndex),t.fill(e.value,e.startIndex,e.endIndex)})),t.length=Math.min(t.length,this.slot.length),t}static toRanges(e){const t=[];let n=null;for(let r=0;r<e.length;r++){const o=e[r];Nn(o)?n=null:In.equal(null==n?void 0:n.value,o)?n.endIndex=r+1:(n={startIndex:r,endIndex:r+1,value:o},t.push(n))}return t}static equal(e,t){if(e===t)return!0;if("object"==typeof e&&"object"==typeof t){const n=Object.keys(e),r=Object.keys(t);if(n.length===r.length)return n.every((n=>r.includes(n)&&t[n]===e[n]))}return!1}}class Pn{constructor(e,t){this.name=e,this.columned=t}}class Ln{constructor(e){this.name=e}}var Fn,zn;!function(e){e[e.Text=1]="Text",e[e.InlineComponent=2]="InlineComponent",e[e.BlockComponent=3]="BlockComponent"}(Fn||(Fn={}));class Dn extends Array{constructor(){super(...arguments),this.attributes=new Map}}class _n{static get emptyPlaceholder(){return"\n"}get parentSlot(){var e;return(null===(e=this.parent)||void 0===e?void 0:e.parent)||null}get length(){return this.content.length}get isEmpty(){return 1===this.length&&this.getContentAtIndex(0)===_n.emptyPlaceholder}get index(){return this.isEmpty?0:this._index}constructor(e,t){this.state=t,this.parent=null,this.changeMarker=new Et,this.componentChangeListeners=new WeakMap,this.childComponentRemoveEvent=new j,this.id=Math.random(),this._index=0,this.content=new Mt,this.format=new In(this),this.attributes=new Map,this.contentChangeEvent=new j,this.stateChangeEvent=new j,this.applyFormatCoverChild=!1,this.schema=e.sort(),this.onContentChange=this.contentChangeEvent.asObservable(),this.onStateChange=this.stateChangeEvent.asObservable(),this.onChildComponentRemove=this.childComponentRemoveEvent.asObservable(),this.content.append(_n.emptyPlaceholder),this._index=0}setAttribute(e,t){const n=this.attributes.has(e),r=this.attributes.get(e);this.attributes.set(e,t);const o=[{type:"attrSet",name:e.name,value:t}];this.sliceContent().forEach((n=>{"string"!=typeof n&&n.slots.toArray().forEach((n=>{n.setAttribute(e,t)}))})),this.changeMarker.markAsDirtied({path:[],apply:o,unApply:[n?{type:"attrSet",name:e.name,value:r}:{type:"attrRemove",name:e.name}]}),this.contentChangeEvent.next(o)}getAttribute(e){var t;return null!==(t=this.attributes.get(e))&&void 0!==t?t:null}getAttributes(){return Array.from(this.attributes.entries())}removeAttribute(e){if(this.sliceContent().forEach((t=>{"string"!=typeof t&&t.slots.toArray().forEach((t=>{t.removeAttribute(e)}))})),!this.attributes.has(e))return;const t=this.attributes.get(e);this.attributes.delete(e);const n=[{type:"attrRemove",name:e.name}];this.changeMarker.markAsDirtied({path:[],apply:n,unApply:[{type:"attrSet",name:e.name,value:t}]}),this.contentChangeEvent.next(n)}hasAttribute(e){return this.attributes.has(e)}updateState(e,t=!0){let n,r;const o=this.state,s=pt(o,e,((e,t)=>{n=e,r=t}));if(0===n.length&&0===r.length)return o;this.state=s;const i={type:"apply",patches:n,value:s,record:t};return this.changeMarker.markAsDirtied({path:[],apply:[i],unApply:[{type:"apply",patches:r,value:o,record:t}]}),this.stateChangeEvent.next({newState:s,oldState:o,record:t}),s}write(e,t,n){const r=this.index,o=(this.isEmpty||0===r?this.format.extract(0,1):this.format.extract(r-1,r)).toArray().map((e=>[e.formatter,e.value]));return t&&(Array.isArray(t)?o.push(...t):o.push([t,n])),this.insert(e,o)}insert(e,t,n){const r="string"==typeof e?Fn.Text:e.type;if(!this.schema.includes(r))return!1;this.getContentAtIndex(this.index-1)===_n.placeholder&&(this.retain(this.index-1),this.delete(1));const o=this.isEmpty;let s,i;const a=this.index;if("string"==typeof e){if(0===e.length)return!0;s=e,i=e.length}else{i=1,s=e.toJSON(),e.parent&&e.parent.removeComponent(e),e.parent=this;const t=e.changeMarker.onChange.subscribe((t=>{t.path.unshift(this.indexOf(e)),this.changeMarker.markAsChanged(t)}));t.add(e.changeMarker.onChildComponentRemoved.subscribe((e=>{this.changeMarker.recordComponentRemoved(e)}))),t.add(e.changeMarker.onForceChange.subscribe((()=>{this.changeMarker.forceMarkChanged()}))),this.componentChangeListeners.set(e,t)}let l=[];if(t&&(Array.isArray(t)?l=t:l.push([t,n])),this.format.split(a,i),this.content.insert(a,e),this.applyFormats(l,a,i,!1),o&&0===this._index){const e=this.length-1;this.content.cut(e),this.format.shrink(e,1)}this._index=a+i;const c=[{type:"retain",offset:a},l.length?{type:"insert",content:s,ref:e,formats:l.reduce(((e,t)=>(e[t[0].name]=t[1],e)),{})}:{type:"insert",content:s,ref:e}];return this.changeMarker.markAsDirtied({path:[],apply:c,unApply:[{type:"retain",offset:a},{type:"delete",count:i}]}),this.contentChangeEvent.next(c),!0}retain(e,t,n){let r=[];if(t)if(Array.isArray(t)){if(0===t.length)return!0;r=t}else r.push([t,n]);const o=this.length;if(0===r.length)return e<0&&(e=0),e>o&&(e=o),this._index=this.content.correctIndex(e,!1),!0;const s=this._index;let i=this.content.correctIndex(s+e,!0);i>o&&(i=o);let a=s;const l=[],c=[],u=r.reduce(((e,t)=>(e[t[0].name]=t[1],e)),{}),h=r.reduce(((e,t)=>(e[t[0].name]=null,e)),{});if(i-s==1){const e=this.getContentAtIndex(s);"string"!=typeof e&&e.type===Fn.InlineComponent&&e.changeMarker.forceMarkDirtied()}return this.content.slice(s,i).forEach((e=>{const t=e.length;if("string"==typeof e||e.type!==Fn.BlockComponent){const e=this.format.extract(a,a+t);this.applyFormats(r,a,t,this.applyFormatCoverChild),l.push({type:"retain",offset:a},{type:"retain",offset:t,formats:Object.assign({},u)}),c.push({type:"retain",offset:a},{type:"retain",offset:t,formats:h},..._n.createActionByFormat(e))}else e.slots.toArray().forEach((e=>{this.applyFormatCoverChild?e.background((()=>{e.retain(0),e.retain(e.length,r)})):(e.retain(0),e.retain(e.length,r))}));a+=t})),(l.length||c.length)&&(this.changeMarker.markAsDirtied({path:[],apply:l,unApply:c}),l.length&&this.contentChangeEvent.next(l)),!0}delete(e){if(e<=0)return!1;const t=this._index;let n=this.content.correctIndex(this._index+e,!0);e=n-t,n>this.length&&(n=this.length);const r=this.content.cut(t,n),o=this.format.extract(t,n);this.format.shrink(t,e),0===this.length&&(this.content.append(_n.emptyPlaceholder),this.format=o.extract(0,1));const s=[{type:"retain",offset:t},{type:"delete",count:e}],i=[];return this.changeMarker.markAsDirtied({path:[],apply:s,unApply:[{type:"retain",offset:t},...r.map((e=>{var t;return"string"==typeof e?{type:"insert",content:e,ref:e}:(i.push(e),this.changeMarker.recordComponentRemoved(e),null===(t=this.componentChangeListeners.get(e))||void 0===t||t.unsubscribe(),this.componentChangeListeners.delete(e),e.parent=null,{type:"insert",content:e.toJSON(),ref:e})})),..._n.createActionByFormat(o)]}),this.contentChangeEvent.next(s),i.length&&this.childComponentRemoveEvent.next(i),!0}applyFormat(e,t){this.retain(t.startIndex),this.retain(t.endIndex-t.startIndex,e,t.value)}removeComponent(e){const t=this.indexOf(e);return t>-1&&(this.retain(t),this.delete(1))}cut(e=0,t=this.length){const n=this.cutTo(new _n(this.schema,this.state),e,t);return this.attributes.forEach(((e,t)=>{n.setAttribute(t,e)})),n}cutTo(e,t=0,n=this.length){t<0&&(t=0);const r=this.length;if(n>r&&(n=r),t>n)return e;if(0===e.getAttributes().length&&this.attributes.forEach(((t,n)=>{e.setAttribute(n,t)})),t=this.content.correctIndex(t,!1),n=this.content.correctIndex(n,!0),this.isEmpty)return e.format=this.format.createFormatByRange(e,0,1),this.retain(t),this.delete(n-t),e;if(t===r||t===r-1&&"\n"===this.content.getContentAtIndex(r-1))return e.format=this.format.createFormatByRange(e,t-1,t),this.retain(t),this.delete(n-t),e;this.retain(t);const o=this.content.slice(this.index,n),s=this.format.createFormatByRange(e,this.index,n);this.delete(n-this.index);const i=new _n([...e.schema]);return o.forEach((e=>{i.insert(e)})),i.format=s.createFormatByRange(i,0,i.length),i.toDelta().forEach((t=>{e.insert(t.insert,t.formats)})),this.isEmpty&&this.cleanAttributes(),e}indexOf(e){return this.content.indexOf(e)}getContentAtIndex(e){return this.content.getContentAtIndex(e)}sliceContent(e=0,t=this.length){return this.content.slice(e,t)}createFormatTree(){return this.format.toTree(0,this.length)}getFormatRangesByFormatter(e,t,n){return this.format.extractFormatRangesByFormatter(t,n,e)}getFormats(){return this.format.toArray()}extractFormatsByIndex(e){return this.format.extractFormatsByIndex(e)}toJSON(){var e;const t={};return this.attributes.forEach(((e,n)=>{t[n.name]=e})),{schema:this.schema,content:this.content.toJSON(),attributes:t,formats:this.format.toJSON(),state:null!==(e=this.state)&&void 0!==e?e:null}}toString(){return this.content.toString()}toDelta(){const e=new Dn;if(0===this.length)return e;const t=this.format.toGrid(),n=this.content.toGrid(),r=[...new Set([...t,...n])].sort(((e,t)=>e-t));this.attributes.forEach(((t,n)=>{e.attributes.set(n,t)}));let o=r.shift();for(;r.length;){const t=r.shift();e.push({insert:this.content.slice(o,t)[0],formats:this.format.extract(o,t).toArray().map((e=>[e.formatter,e.value]))}),o=t}return e}insertDelta(e){for(e.attributes.forEach(((e,t)=>{this.setAttribute(t,e)}));e.length;){const t=e[0];if(!this.insert(t.insert,t.formats))break;e.shift()}return e}cleanFormats(e=[],t=0,n=this.length){const r=this.getFormats();r.length?r.forEach((r=>{("function"==typeof e?e(r.formatter):e.includes(r.formatter))||(this.retain(t),this.retain(n-t,r.formatter,null))})):this.sliceContent(t,n).forEach((t=>{"string"!=typeof t&&t.slots.toArray().forEach((t=>{t.cleanFormats(e)}))}))}background(e){this.applyFormatCoverChild=!0,e(),this.applyFormatCoverChild=!1}cleanAttributes(e=[]){Array.from(this.attributes.keys()).forEach((t=>{("function"==typeof e?e(t):e.includes(t))||this.removeAttribute(t)})),this.sliceContent().forEach((t=>{"string"!=typeof t&&t.slots.toArray().forEach((t=>{t.cleanAttributes(e)}))}))}applyFormats(e,t,n,r){e.forEach((e=>{const o=e[0],s=e[1];this.format.merge(o,{startIndex:t,endIndex:t+n,value:s},r)}))}static createActionByFormat(e){return e.toArray().map((e=>[{type:"retain",offset:e.startIndex},{type:"retain",offset:e.endIndex-e.startIndex,formats:{[e.formatter.name]:e.value}}])).flat()}}_n.placeholder="",function(e){e.Output="Output",e.Readonly="Readonly",e.Editing="Editing"}(zn||(zn={}));let qn=class{get readonly(){return this._readonly}set readonly(e){this._readonly=e,this.readonlyStateChangeEvent.next(e)}constructor(e){this._readonly=!1,this.readonlyStateChangeEvent=new j,this.onReadonlyStateChange=this.readonlyStateChangeEvent.asObservable().pipe(V()),this._readonly=e}};var jn;qn=St([b(),Tt(0,S(Ct)),At("design:paramtypes",[Boolean])],qn);class Hn{}let Vn=jn=class{get isSelected(){return![this.startSlot,this.startOffset,this.endSlot,this.endOffset].includes(null)}get isCollapsed(){return this.isSelected&&this.startSlot===this.endSlot&&this.startOffset===this.endOffset}get startSlot(){return this._startSlot}get startOffset(){return this._startOffset}get endSlot(){return this._endSlot}get endOffset(){return this._endOffset}get anchorSlot(){return this._anchorSlot}get anchorOffset(){return this._anchorOffset}get focusSlot(){return this._focusSlot}get focusOffset(){return this._focusOffset}get commonAncestorSlot(){return this._commonAncestorSlot}get commonAncestorComponent(){return this._commonAncestorComponent}get nativeSelectionDelegate(){return this._nativeSelectionDelegate}set nativeSelectionDelegate(e){e!==this._nativeSelectionDelegate&&(this._nativeSelectionDelegate=e,this.controller.readonly||(e?this.bridge.connect(this.connector):this.bridge.disConnect()))}constructor(e,t){let n;this.root=e,this.controller=t,this.connector={setSelection:e=>{if(null===e){if(null===this.startSlot&&null===this.endSlot&&null===this.startOffset&&null===this.endOffset)return;return void this.unSelect()}const{focusOffset:t,focusSlot:n,anchorOffset:r,anchorSlot:o}=e;n===this.focusSlot&&o===this.anchorSlot&&t===this.focusOffset&&r===this.anchorOffset||this.setBaseAndExtent(o,r,n,t)}},this._commonAncestorSlot=null,this._commonAncestorComponent=null,this._startSlot=null,this._endSlot=null,this._startOffset=null,this._endOffset=null,this._anchorSlot=null,this._anchorOffset=null,this._focusSlot=null,this._focusOffset=null,this.changeEvent=new j,this._nativeSelectionDelegate=!1,this.subscriptions=[],this.customRanges=null,this.onChange=this.changeEvent.asObservable().pipe(V(((e,t)=>e&&t?!(e.focusOffset===t.focusOffset&&e.anchorOffset===t.anchorOffset&&e.focusSlot===t.focusSlot&&e.anchorSlot===t.anchorSlot):e!==t)),$());let r=null;const o=[];this.subscriptions.push(t.onReadonlyStateChange.subscribe((e=>{e?this.bridge.disConnect():this.bridge.connect(this.connector)})),this.onChange.pipe(H((()=>this.commonAncestorComponent)),V()).subscribe((t=>{for(;o.length;){const t=o.shift();let n=t;for(;n;)n===e.component&&Gt(t,"onFocusOut"),n=n.parentComponent}for(;t;)o.push(t),Gt(t,"onFocusIn"),t=t.parentComponent})),this.onChange.pipe(H((()=>this.commonAncestorComponent))).subscribe((e=>{let t=null;e&&Gt(e,"onGetRanges",new Ut(e,(e=>{t=e}))),this.customRanges=t})),this.onChange.pipe(H((()=>{var e,t,n;return(null===(e=this.startSlot)||void 0===e?void 0:e.parent)===(null===(t=this.endSlot)||void 0===t?void 0:t.parent)&&(null===(n=this.startSlot)||void 0===n?void 0:n.parent)||null})),V()).subscribe((t=>{if(n){let t=n;for(;t;)t===e.component&&Gt(n,"onBlur"),t=t.parentComponent}t&&Gt(t,"onFocus"),n=t})),this.onChange.pipe(H((()=>{if(r){let t=r.parentComponent;for(;t;)t===e.component&&Gt(r,"onUnselect"),t=t.parentComponent;r=null}if(!this.isSelected)return null;if(this.startSlot===this.endSlot&&this.endOffset-this.startOffset==1){const e=this.startSlot.getContentAtIndex(this.startOffset);if("string"!=typeof e)return e}return null})),V()).subscribe((e=>{e&&(Gt(e,"onSelected"),r=e)}))),Promise.resolve().then((()=>this.nativeSelectionDelegate=!0))}createSnapshot(){const{anchorSlot:e,anchorOffset:t,focusSlot:n,focusOffset:r}=this;return{restore:o=>{this._anchorSlot=e,this._anchorOffset=t,this._focusSlot=n,this._focusOffset=r,this.resetStartAndEndPosition(),o&&this.restore(!0)}}}destroy(){this.subscriptions.forEach((e=>e.unsubscribe())),this.subscriptions=[]}setBaseAndExtent(e,t,n,r){this.controller.readonly||(this._anchorSlot=e,e.retain(t),this._anchorOffset=e.index,this._focusSlot=n,n.retain(r),this._focusOffset=n.index,this.resetStartAndEndPosition())}getRanges(){return this.customRanges?this.customRanges.map((e=>({startOffset:e.startIndex,endOffset:e.endIndex,startSlot:e.slot,endSlot:e.slot}))):this.isSelected?[{startSlot:this.startSlot,endSlot:this.endSlot,startOffset:this.startOffset,endOffset:this.endOffset}]:[]}setAnchor(e,t){this.controller.readonly||(this._anchorSlot=e,e.retain(t),this._anchorOffset=e.index,this.resetStartAndEndPosition())}setFocus(e,t){this.controller.readonly||(this._focusSlot=e,e.retain(t),this._focusOffset=e.index,this.resetStartAndEndPosition())}setPosition(e,t){this.controller.readonly||(this._focusSlot=this._anchorSlot=e,e.retain(t),this._focusOffset=this._anchorOffset=e.index,this.resetStartAndEndPosition())}selectSlot(e){this.setBaseAndExtent(e,0,e,e.length)}selectFirstPosition(e,t=!1){const n=e.slots;if(n.length){const e=n.first,{slot:t,offset:r}=this.findFirstPosition(e,!1);this.setBaseAndExtent(t,r,t,r)}else this.selectComponentFront(e);t&&this.restore()}selectLastPosition(e,t=!1){const n=e.slots;if(n.length){const e=n.last,{slot:t,offset:r}=this.findLastPosition(e,!1);this.setBaseAndExtent(t,r,t,r)}else this.selectComponentEnd(e);t&&this.restore()}selectComponentFront(e,t=!1){const n=e.parent;if(n){const t=n.indexOf(e);this.setBaseAndExtent(n,t,n,t)}else this.unSelect();t&&this.restore()}selectComponentEnd(e,t=!1){const n=e.parent;if(n){const t=n.indexOf(e);this.setBaseAndExtent(n,t+1,n,t+1)}else this.unSelect();t&&this.restore()}selectChildSlots(e,t=!1){const n=e.slots;if(n.length){const e=this.findFirstPosition(n.first,!1),t=this.findLastPosition(n.last,!1);this.setBaseAndExtent(e.slot,e.offset,t.slot,t.offset)}else this.selectComponent(e,!1);t&&this.restore()}selectComponent(e,t=!1){const n=e.parent;if(n){const r=n.indexOf(e);this.setBaseAndExtent(n,r,n,r+1),t&&this.restore()}}getSelectedScopes(e=!1){if(!this.isSelected)return[];if(this.isCollapsed)return[{slot:this.startSlot,startIndex:this.startOffset,endIndex:this.startOffset}];const t=this.getScopes(this.startSlot,this.startOffset,this.endSlot,this.endOffset,!0);if(e){const e=[];return t.forEach((t=>{e.push(...this.decomposeSlotRange(t.slot,t.startIndex,t.endIndex))})),e}return t}toPrevious(){var e,t;if(!this.isCollapsed)return this.collapse(!0),void this.restore();const{startSlot:n,startOffset:r}=this,o=this.getPreviousPosition();if(o){this.setPosition(o.slot,o.offset);let s=null;if(n===this.startSlot)if(r===this.startOffset){const e=this.root.component.slots.first;this.setPosition(e,0)}else r-this.startOffset==1&&(s=n.getContentAtIndex(this.startOffset));else(null==n?void 0:n.parent)!==(null===(e=this.startSlot)||void 0===e?void 0:e.parent)&&(s=(null===(t=this.endSlot)||void 0===t?void 0:t.parent)||null);if(s&&"string"!=typeof s){const e=new Vt(s,null);Gt(s,"onSelectionFromEnd",e),e.isPrevented?this.setPosition(n,r):0===s.slots.length&&this.selectComponent(s)}this.restore()}}toNext(){var e,t;if(!this.isCollapsed)return this.collapse(),void this.restore();const{endSlot:n,endOffset:r}=this,o=this.getNextPosition();if(o){let s=o.offset;const i=o.slot;for(;s<=i.length&&(this.setPosition(i,s),i.index<s);)s++;let a=null;if(n===this.endSlot)if(r===this.endOffset){const e=this.root.component.slots.last;this.setPosition(e,e.length)}else this.endOffset-r==1&&(a=n.getContentAtIndex(r));else(null==n?void 0:n.parent)!==(null===(e=this.endSlot)||void 0===e?void 0:e.parent)&&(a=(null===(t=this.endSlot)||void 0===t?void 0:t.parent)||null);if(a&&"string"!=typeof a){const e=new Vt(a,null);Gt(a,"onSelectionFromFront",e),e.isPrevented?this.setPosition(n,r):0===a.slots.length&&this.selectComponent(a)}this.restore()}}toPreviousLine(){const e=this.bridge.getPreviousLinePositionByCurrent({slot:this.focusSlot,offset:this.focusOffset});e&&(this.setPosition(e.slot,e.offset),this.restore())}toNextLine(){const e=this.bridge.getNextLinePositionByCurrent({slot:this.focusSlot,offset:this.focusOffset});e&&(this.setPosition(e.slot,e.offset),this.restore())}wrapToAfter(){this.wrapTo(!1)}wrapToBefore(){this.wrapTo(!0)}wrapToPreviousLine(){const e=this.bridge.getPreviousLinePositionByCurrent({slot:this.focusSlot,offset:this.focusOffset});e&&(this.setFocus(e.slot,e.offset),this.restore())}wrapToNextLine(){const e=this.bridge.getNextLinePositionByCurrent({slot:this.focusSlot,offset:this.focusOffset});e&&(this.setFocus(e.slot,e.offset),this.restore())}collapse(e=!1){e?this.setPosition(this.startSlot,this.startOffset):this.setPosition(this.endSlot,this.endOffset)}restore(e=!0){if(this.nativeSelectionDelegate){const t=this.focusSlot,n=this.focusOffset,r=this.anchorSlot,o=this.anchorOffset;t&&r?(t.retain(n),r.retain(o),this.bridge.restore({focusOffset:n,focusSlot:t,anchorOffset:o,anchorSlot:r},e)):this.bridge.restore(null,e)}}getPaths(){if(!this.isSelected)return{anchor:[],focus:[]};const e=this.getPathsBySlot(this.anchorSlot)||[];e.push(this.anchorOffset);const t=this.getPathsBySlot(this.focusSlot)||[];return t.push(this.focusOffset),{anchor:e,focus:t}}usePaths(e){const t=this.findPositionByPath(e.anchor),n=this.findPositionByPath(e.focus);t&&n&&this.setBaseAndExtent(t.slot,t.offset,n.slot,n.offset)}unSelect(){this._anchorSlot=this._focusSlot=this._anchorOffset=this._focusOffset=null,this.resetStartAndEndPosition(),this.restore()}selectAll(){const e=this.root.component.slots.get(0);this.setBaseAndExtent(e,0,e,e.length),this.restore()}getNextPosition(){return this.isSelected?this.getNextPositionByPosition(this.focusSlot,this.focusOffset):null}getPreviousPosition(){return this.isSelected?this.getPreviousPositionByPosition(this.focusSlot,this.focusOffset):null}findSlotByPaths(e){const t=jn.findTreeNode(e,this.root.component);return t instanceof _n?t:null}findComponentByPaths(e){if(0===e.length)return this.root.component;const t=jn.findTreeNode(e,this.root.component);return t instanceof _n?null:t}getBlocks(){const e=[];return this.isSelected?(this.getGreedyRanges().forEach((t=>{e.push(...this.decomposeSlotRange(t.slot,t.startIndex,t.endIndex))})),e):e}getSlotRangeInCommonAncestorComponent(){const e=this.commonAncestorComponent;if(!e)return null;let t,n,r=this.startSlot,o=this.endSlot;for(;;){const n=r.parent;if(n===e){t=n.slots.indexOf(r);break}if(!(null==n?void 0:n.parent))return null;r=n.parent}for(;;){const t=o.parent;if(t===e){n=t.slots.indexOf(o)+1;break}if(!(null==t?void 0:t.parent))return null;o=t.parent}return t>=0&&n>=1?{startOffset:t,endOffset:n,component:e}:null}getGreedyRanges(){return this.isSelected?this.getScopes(this.startSlot,jn.getInlineContentStartIndex(this.startSlot,this.startOffset),this.endSlot,jn.getInlineContentEndIndex(this.endSlot,this.endOffset)):[]}findFirstPosition(e,t=!0){const n=e.getContentAtIndex(0);if(t&&n&&"string"!=typeof n){const e=n.slots.first;if(e)return this.findFirstPosition(e)}return{offset:0,slot:e}}findLastPosition(e,t=!0){const n=e.getContentAtIndex(e.length-1);if(t&&n&&"string"!=typeof n){const e=n.slots.last;if(e)return this.findLastPosition(e)}return{offset:"\n"===n?e.length-1:e.length,slot:e}}getCommonAncestorSlotScope(){if(!this.isSelected)return null;let e=this.startSlot,t=this.endSlot,n=this.startSlot,r=this.endSlot,o=this.startOffset,s=this.endOffset;const i=this.commonAncestorSlot,a=this.commonAncestorComponent;let l=null,c=null;for(;e!==i;)l=e.parent,l===a&&(n=e),e=l.parent,o=e.indexOf(l);for(;t!==i;)c=t.parent,c===a&&(r=t),t=c.parent,s=t.indexOf(c);return{startOffset:o,startSlot:e,startChildComponent:l,endOffset:s+1,endSlot:t,endChildComponent:c,startChildSlot:n,endChildSlot:r}}getPathsBySlot(e){const t=[];for(;;){const n=e.parent;if(!n)return null;const r=n.slots.indexOf(e);t.push(r);const o=n.parent;if(!o){if(n!==this.root.component)return null;break}const s=o.indexOf(n);t.push(s),e=o}return t.length?t.reverse():null}getNextPositionByPosition(e,t){if(t===e.length-1&&"\n"===e.getContentAtIndex(t)&&t++,t<e.length){const n=e.getContentAtIndex(t);if("string"!=typeof n){const e=n.slots.get(0);if(e)return this.findFirstPosition(e)}return{slot:e,offset:t+n.length}}const n=e;for(;e;){const t=e.parent,r=t.slots.indexOf(e);if(r<t.slots.length-1)return this.findFirstPosition(t.slots.get(r+1));const o=t.parent;if(!o){const e=n.length,t=n.getContentAtIndex(e-1);return{slot:n,offset:"\n"===t?e-1:e}}const s=o.indexOf(t);if(s<o.length-1){const e=o.getContentAtIndex(s+1);if("string"!=typeof e){const t=e.slots.first;if(t)return this.findFirstPosition(t)}return{slot:o,offset:s+1}}e=o}return{slot:n,offset:this.endOffset}}getPreviousPositionByPosition(e,t){if(t>0){const n=e.getContentAtIndex(t-1);if(n&&"string"!=typeof n){const e=n.slots.last;if(e)return this.findLastPosition(e)}return{slot:e,offset:t-n.length}}let n=e;for(;e;){const t=e.parent,r=t.slots,o=r.indexOf(e);if(o>0)return this.findLastPosition(r.get(o-1));const s=t.parent;if(!s)return{slot:n,offset:0};const i=s.indexOf(t);if(i>0){const e=s.getContentAtIndex(i-1);if(e&&"string"!=typeof e){const t=e.slots.last;if(t)return this.findLastPosition(t)}return{slot:s,offset:"\n"===e?i-1:i}}n=e=s}return{slot:n,offset:0}}getScopes(e,t,n,r,o=!1){const s=jn.getCommonAncestorSlot(e,n),i=jn.getCommonAncestorComponent(e,n);return this.getScopesByRange(e,t,n,r,s,i,o)}static getCommonAncestorComponent(e,t){let n=null==e?void 0:e.parent,r=null==t?void 0:t.parent;if(n===r)return n||null;const o=[],s=[];for(;n;){o.push(n);const e=n.parent;if(!e)break;n=e.parent}for(;r;){s.push(r);const e=r.parent;if(!e)break;r=e.parent}let i=null;for(;o.length&&s.length;){const e=o.pop();if(e!==s.pop())break;i=e}return i}static getCommonAncestorSlot(e,t){if(e===t)return e;const n=[],r=[];for(;e;){n.push(e);const t=e.parent;if(!t)break;e=t.parent}for(;t;){r.push(t);const e=t.parent;if(!e)break;t=e.parent}let o=null;for(;n.length&&r.length;){const e=n.pop();if(e!==r.pop())break;o=e}return o}static compareSelectionPaths(e,t,n=!0){let r=!0,o=0;for(;;){if(o<t.length){if(o<e.length){const s=e[o],i=t[o];if(s===i){if(o===t.length-1&&o===e.length-1)return n;o++;continue}r=s<i;break}r=!0;break}r=!1;break}return r}static getInlineContentStartIndex(e,t){const n=e.sliceContent(0,t);for(let e=n.length-1;e>=0;e--){const r=n[e];if("string"!=typeof r&&r.type===Fn.BlockComponent)break;t-=r.length}return t}static getInlineContentEndIndex(e,t){const n=e.sliceContent(t);for(let e=0;e<n.length;e++){const r=n[e];if("string"!=typeof r&&r.type===Fn.BlockComponent)break;t+=r.length}return t}decomposeSlotRange(e,t,n){const r=[];if(t>=n)return r;let o=null,s=0;return e.sliceContent(t,n).forEach((n=>{"string"!=typeof n&&n.type===Fn.BlockComponent&&0!==n.slots.length?(o=null,n.slots.toArray().forEach((e=>{r.push(...this.decomposeSlotRange(e,0,e.length))}))):o?o.endIndex=t+s+n.length:(o={startIndex:t+s,endIndex:t+s+n.length,slot:e},r.push(o)),s+=n.length})),r}resetStartAndEndPosition(){let e=[],t=[];if(this.focusSlot){const t=this.getPathsBySlot(this.focusSlot);t?(e=t,e.push(this.focusOffset)):this._focusSlot=this._focusOffset=null}if(this.anchorSlot){const e=this.getPathsBySlot(this.anchorSlot);e?(t=e,t.push(this.anchorOffset)):this._anchorSlot=this._anchorOffset=null}jn.compareSelectionPaths(t,e)?(this._startSlot=this.anchorSlot,this._startOffset=this.anchorOffset,this._endSlot=this.focusSlot,this._endOffset=this.focusOffset):(this._endSlot=this.anchorSlot,this._endOffset=this.anchorOffset,this._startSlot=this.focusSlot,this._startOffset=this.focusOffset),this._commonAncestorSlot=jn.getCommonAncestorSlot(this.startSlot,this.endSlot),this._commonAncestorComponent=jn.getCommonAncestorComponent(this.startSlot,this.endSlot),this.broadcastChanged()}wrapTo(e){if(!this.isSelected)return;const t=e?this.getPreviousPositionByPosition(this.focusSlot,this.focusOffset):this.getNextPositionByPosition(this.focusSlot,this.focusOffset);this.setBaseAndExtent(this.anchorSlot,this.anchorOffset,t.slot,t.offset),this.restore()}findPositionByPath(e){const t=[...e],n=t.pop(),r=this.findSlotByPaths(t);return r?{slot:r,offset:n}:null}broadcastChanged(){this.changeEvent.next(this.isSelected?{focusSlot:this.focusSlot,anchorSlot:this.anchorSlot,focusOffset:this.focusOffset,anchorOffset:this.anchorOffset}:null)}getScopesByRange(e,t,n,r,o,s,i=!1){const a=[],l=[];let c=null,u=null,h=null,d=null;if(this.customRanges)return this.customRanges;for(;e!==o;){a.push({startIndex:t,endIndex:e.length,slot:e}),c=e.parent;const r=c.slots,o=r.indexOf(n);if(h=r.indexOf(e),c!==s&&-1===o&&a.push(...r.slice(h+1,r.length).map((e=>({startIndex:0,endIndex:e.length,slot:e})))),!c.parent)break;t=(e=c.parent).indexOf(c)+1}for(;n!==o&&(l.push({startIndex:0,endIndex:r,slot:n}),u=n.parent,u);){const t=u.slots,o=t.indexOf(e);if(d=t.indexOf(n),u!==s&&-1===o&&l.push(...t.slice(0,d).map((e=>({startIndex:0,endIndex:e.length,slot:e}))).reverse()),!u.parent)break;r=(n=u.parent).indexOf(u)}const p=[...a];if(c&&c===u){const e=c.slots.slice(h+1,d);p.push(...e.map((e=>({startIndex:0,endIndex:e.length,slot:e}))))}else p.push({startIndex:t,endIndex:r,slot:o});return p.push(...l.reverse()),i?p.filter((e=>e.slot&&e.startIndex<e.endIndex)):p}static findTreeNode(e,t){if("object"!=typeof t)return null;const n=e.shift(),r=t.slots.get(n);if(0===e.length||!r)return r||null;const o=e.shift();return t=r.getContentAtIndex(o),0!==e.length&&t?jn.findTreeNode(e,t):t||null}};St([M(),At("design:type",Hn)],Vn.prototype,"bridge",void 0),Vn=jn=St([b(),At("design:paramtypes",[bt,qn])],Vn);let $n=class{constructor(e,t,n,r){this.contextInjector=e,this.components=t,this.attributes=n,this.formatters=r,this.componentMap=new Map,this.formatMap=new Map,this.attributeMap=new Map,t.reverse().forEach((e=>{this.componentMap.set(e.name,e)})),n.reverse().forEach((e=>{this.attributeMap.set(e.name,e)})),r.reverse().forEach((e=>{this.formatMap.set(e.name,e)}))}getComponent(e){return this.componentMap.get(e)||null}getFormatter(e){return this.formatMap.get(e)||null}getAttribute(e){return this.attributeMap.get(e)||null}createComponentByData(e,t){const n=this.getComponent(e);return n?n.createInstance(this.contextInjector,t):null}createSlot(e,t){const n=new _n(e.schema,e.state);return this.loadSlot(n,e,t)}createComponent(e,t){const n=this.getComponent(e.name);return n?this.createComponentByFactory(e,n,t):null}createComponentByFactory(e,t,n){const r=e.slots.map(n||(e=>this.createSlot(e)));return t.createInstance(this.contextInjector,{state:e.state,slots:r})}fillSlot(e,t){return this.loadSlot(t,e)}loadSlot(e,t,n){return t.content.forEach(((t,r)=>{if("string"==typeof t)e.insert(t);else{const o=n?n(t,r):this.createComponent(t);o&&e.insert(o)}})),Object.keys(t.formats).forEach((n=>{const r=this.getFormatter(n);r&&t.formats[n].forEach((t=>{e.retain(t.startIndex),e.retain(t.endIndex-t.startIndex,r,t.value)}))})),null!==t.attributes&&"object"==typeof t.attributes&&Object.keys(t.attributes).forEach((n=>{const r=this.attributeMap.get(n);r&&e.setAttribute(r,t.attributes[n])})),e}};function Un(e,t,n,r=[]){return Gn(n,e)?{slot:e,offset:t}:(r.push(e),Wn(e,n,r))}function Gn(e,t){const n="string"==typeof e?Fn.Text:e.type;return t.schema.includes(n)}function Wn(e,t,n){const r=e.parent,o=r.slots.indexOf(e);if(e!==r.slots.last)return Un(r.slots.get(o+1),0,t,n);const s=r.parent;if(!s)return null;if(n.includes(s))return Wn(s,t,n);const i=s.indexOf(r),a=Un(s,i+1,t,n);if(a)return a;n.push(s);const l=s.sliceContent(i+1).filter((e=>"string"!=typeof e)).shift();return l&&l.slots.length?Un(l.slots.get(0),0,t,n):Wn(s,t,n)}function Kn(e,t,n,r,o){const s=t.parent;if(!s)return{slot:t,offset:n};const i=s.parent;if(!i)return{slot:t,offset:n};const a=i.indexOf(s);if(1===s.slots.length){if(s===r)return{slot:t,offset:n};const l=new Vt(i,{index:a,count:1,toEnd:!o});return Gt(i.parent,"onContentDelete",l),l.isPrevented?{slot:t,offset:n}:(i.retain(a),i.delete(1),Gt(i.parent,"onContentDeleted",new Vt(i,null)),i.isEmpty?Kn(e,i,a,r,o):{slot:i,offset:i.index})}const l=s.slots.indexOf(t),c=0===l?{slot:i,offset:a}:e.findLastPosition(s.slots.get(l-1),!0),u=new Vt(s,{index:l,count:1,toEnd:!o});return Gt(s,"onSlotRemove",u),u.isPrevented?{slot:t,offset:n}:(s.slots.remove(t)&&Gt(s,"onSlotRemoved",new Vt(s,null)),c)}function Yn(e,t,n,r,o,s){const i=t.parent,a={slotState:t.state,parentComponentName:i.name,parentComponentState:i.state};let l=r.slotFactory(a);n.attributes.forEach(((e,t)=>{l.setAttribute(t,e)}));const c=[l];let u=0;for(;n.length;){const{insert:i,formats:h}=n.shift(),d=Gn(i,l),p=u;if(u+=i.length,d)l.insert(i,h),t===o.anchorSlot&&o.anchorOffset-s>=p&&o.anchorOffset-s<=u&&(o.anchorSlot=l,o.anchorOffset-=s),t===o.focusSlot&&o.focusOffset-s>=p&&o.focusOffset-s<=u&&(o.focusSlot=l,o.focusOffset-=s);else{if(o.anchorOffset>u&&(o.anchorOffset-=u),o.focusOffset>u&&(o.focusOffset-=u),"string"!=typeof i){const n=i.slots.toArray().map((n=>Yn(e,t,n.toDelta(),r,o,s))).flat();c.push(...n)}l=r.slotFactory(a),n.attributes.forEach(((e,t)=>{l.setAttribute(t,e)}))}}return c}function Xn(e,t,n){var r;const o=[];return t.length?(n.multipleSlot?o.push(n.target.createInstance(e,{state:null===(r=n.stateFactory)||void 0===r?void 0:r.call(n),slots:t})):t.forEach((t=>{var r;o.push(n.target.createInstance(e,{state:null===(r=n.stateFactory)||void 0===r?void 0:r.call(n),slots:[t]}))})),o):o}function Jn(e,t,n){let r=n;const o=t.sliceContent(0,n);for(;o.length;){const e=o.pop();if("string"!=typeof e&&e.type===Fn.BlockComponent)break;r-=e.length}return{slot:t,startIndex:r,endIndex:n}}$n=St([b(),Tt(1,S(vt)),Tt(2,S(xt)),Tt(3,S(yt)),At("design:paramtypes",[x,Array,Array,Array])],$n);let Zn=class{constructor(e,t,n,r){this.selection=e,this.injector=t,this.registry=n,this.rootComponentRef=r}transform(e){const t=this.selection;if(!t.isSelected)return!1;const n={anchorSlot:t.anchorSlot,anchorOffset:t.anchorOffset,focusSlot:t.focusSlot,focusOffset:t.focusOffset},r=t.getRanges();for(let t=0;t<r.length;t++){const o=r[t];if(!this.transformByRange(e,n,o))break}return t.setBaseAndExtent(n.anchorSlot,n.anchorOffset,n.focusSlot,n.focusOffset),!0}write(e,t,n){const r=this.selection;if(!r.isCollapsed&&!this.delete())return!1;const o=Un(r.startSlot,r.startOffset,e);if(!o)return!1;let s=o.slot.extractFormatsByIndex(o.offset);return t&&(Array.isArray(t)?s=[...s,...t]:s.push([t,n])),this.insert(e,s)}insert(e,t,n){const r=this.selection;if(!r.isCollapsed&&!this.delete())return!1;let o=[];t&&(Array.isArray(t)?o=t:o.push([t,n]));const s=Un(r.startSlot,r.startOffset,e);if(!s)return!1;const{slot:i,offset:a}=s,l=new Vt(i,{index:a,content:e,formats:o});if(Gt(i.parent,"onContentInsert",l),!l.isPrevented){i.retain(a),i.insert(e,o);const t=new Vt(i,{index:a,content:e,formats:o});Gt(i.parent,"onContentInserted",l),t.isPrevented||r.setBaseAndExtent(i,i.index,i,i.index)}return!l.isPrevented}delete(e,t=!0){"boolean"==typeof e?(t=e,e=function(){}):"function"!=typeof e&&(e=function(){});const n=this.selection;if(!n.isSelected)return!1;let r=n.endSlot,o=n.endOffset,s=n.startSlot,i=n.startOffset;if(n.isCollapsed)if(t){const e=n.getPreviousPosition();s=e.slot,i=e.offset}else{const e=n.getNextPosition();r=e.slot,o=e.offset}if(s===r&&i===o){if(s.isEmpty){e(s.cut());const r=Kn(n,s,i,this.rootComponentRef.component,t);return n.setBaseAndExtent(r.slot,r.offset,r.slot,r.offset),r.slot!==s||r.offset!==i}return!1}const a=n.getScopes(s,i,r,o,!0);let l=o;for(;a.length;){const o=a.pop(),{slot:i,startIndex:c}=o,u=o.endIndex,h=n.focusSlot===i&&n.focusOffset===u,d=new Vt(i,{index:c,count:u-c,toEnd:!t});if(Gt(i.parent,"onContentDelete",d),d.isPrevented)return!1;e(i.cut(c,u));const p=new Vt(i,null);if(Gt(i.parent,"onContentDeleted",p),p.isPrevented)return h?n.setFocus(i,u):n.setAnchor(i,u),!1;if(i===r&&(l=c),i!==s&&i!==r&&i.isEmpty){const e=Kn(n,i,c,this.rootComponentRef.component,t);e.slot===r&&(l=e.offset)}}if(s!==r){const o=new Vt(r,{index:l,count:r.length,toEnd:!t});if(Gt(r.parent,"onContentDelete",o),o.isPrevented)return!1;const a=r.cut(l);e(a);const c=new Vt(r,null);if(Gt(r.parent,"onContentDeleted",c),c.isPrevented||r.isEmpty&&Kn(n,r,0,this.rootComponentRef.component,t),!a.isEmpty){const e=a.toDelta();n.setPosition(s,i),e.forEach((e=>{this.insert(e.insert,e.formats)}))}if(c.isPrevented)return!1}return n.setBaseAndExtent(s,i,s,i),!0}break(){const e=this.selection;if(!e.isSelected)return!1;if(!e.isCollapsed&&!this.delete(!1))return!1;const t=this.selection.startSlot,n=new Vt(t,{index:this.selection.startOffset});if(Gt(t.parent,"onBreak",n),!n.isPrevented){const e=this.selection.startOffset,n=e===t.length||t.isEmpty,r=n?"\n\n":"\n";this.write(r)&&n&&this.selection.setPosition(t,e+1)}return!n.isPrevented}insertBefore(e,t){const n=null==t?void 0:t.parent;if(n){const r=n.indexOf(t);return this.selection.setBaseAndExtent(n,r,n,r),this.insert(e)}return!1}insertAfter(e,t){const n=null==t?void 0:t.parent;if(n){const r=n.indexOf(t)+1;return this.selection.setBaseAndExtent(n,r,n,r),this.insert(e)}return!1}replaceComponent(e,t){return!!this.removeComponent(e)&&this.insert(t)}copy(){this.injector.get(gt).copy()}cut(){return this.copy(),!this.selection.isCollapsed&&this.delete()}paste(e,t){if(e.isEmpty)return!1;const n=this.selection;if(!n.isSelected)return!1;n.isCollapsed||this.delete();const r=n.commonAncestorComponent,o=n.commonAncestorSlot,s=new Vt(o,{index:n.startOffset,data:e,text:t});if(Gt(r,"onPaste",s),!s.isPrevented){const t=e.toDelta(),r=new Dn;for(;t.length;){const{insert:e,formats:o}=t.shift(),s=n.commonAncestorSlot;if(Gn(e,s)){this.insert(e,o);continue}r.push(...s.cut(n.startOffset).toDelta());const i=s.parent;if(s!==i.slots.last)if(i.separable){const t=i.slots.indexOf(s),n=i.slots.cut(t+1),a=this.registry.createComponentByData(i.name,{state:"object"==typeof i.state&&null!==i.state?JSON.parse(JSON.stringify(i.state)):i.state,slots:n});r.push({insert:a,formats:[]}),this.insert(e,o)}else if("string"!=typeof e)for(const n of e.slots.toArray())t.unshift(...n.toDelta());else this.insert(e,o);else this.insert(e,o)}const o=this.selection.createSnapshot();for(;r.length;){const{insert:e,formats:t}=r.shift();this.insert(e,t)}o.restore();const s=n.startSlot.getContentAtIndex(n.startOffset);s&&"string"!=typeof s&&s.type===Fn.BlockComponent&&s.slots.length>0&&n.toNext()}return!s.isPrevented}cleanFormats(e=[]){this.selection.getSelectedScopes().forEach((t=>{const n=t.slot;0===t.startIndex&&t.endIndex===n.length-1&&"\n"===n.getContentAtIndex(n.length-1)&&t.endIndex++,n.cleanFormats(e,t.startIndex,t.endIndex)}))}applyFormat(e,t){if(this.selection.isCollapsed){const n=this.selection.commonAncestorSlot;if(n.isEmpty)n.retain(0),n.retain(n.length,e,t);else{this.write(_n.placeholder);const r=this.selection.startOffset;n.retain(r-1),n.retain(1,e,t)}}else this.selection.getSelectedScopes().forEach((n=>{n.slot.retain(n.startIndex),n.slot.retain(n.endIndex-n.startIndex,e,t)}))}unApplyFormat(e){if(this.selection.isCollapsed){const t=this.selection.commonAncestorSlot;if(t.isEmpty)t.retain(0),t.retain(t.length,e,null);else{const n=this.selection.startOffset;t.getContentAtIndex(n-1)===_n.placeholder?(t.retain(n-1),t.retain(1,e,null)):(this.write(_n.placeholder),t.retain(n),t.retain(1,e,null))}}else this.selection.getSelectedScopes().forEach((t=>{t.slot.retain(t.startIndex),t.slot.retain(t.endIndex-t.startIndex,e,null)}))}applyAttribute(e,t){this.selection.isCollapsed?this.selection.commonAncestorSlot.setAttribute(e,t):this.selection.getSelectedScopes().forEach((n=>{const r=n.slot.sliceContent(n.startIndex,n.endIndex),o=[];let s=!1;r.forEach((e=>{"string"==typeof e||e.type===Fn.InlineComponent?s=!0:o.push(e)})),s?n.slot.setAttribute(e,t):o.forEach((n=>{n.slots.toArray().forEach((n=>{n.setAttribute(e,t)}))}))}))}unApplyAttribute(e){this.selection.isCollapsed?this.selection.commonAncestorSlot.removeAttribute(e):this.selection.getSelectedScopes().forEach((t=>{const n=t.slot.sliceContent(t.startIndex,t.endIndex),r=[];let o=!1;n.forEach((e=>{"string"!=typeof e?r.push(e):o=!0})),o?t.slot.removeAttribute(e):r.forEach((t=>{t.slots.toArray().forEach((t=>{t.removeAttribute(e)}))}))}))}cleanAttributes(e=[]){this.selection.getSelectedScopes().forEach((t=>{const n=t.slot.sliceContent(t.startIndex,t.endIndex),r=[];let o=!1;n.forEach((e=>{"string"!=typeof e?r.push(e):o=!0})),o?t.slot.cleanAttributes(e):r.forEach((t=>{t.slots.toArray().forEach((t=>{t.cleanAttributes(e)}))}))}))}removeComponent(e){const t=null==e?void 0:e.parent;if(t){const n=t.indexOf(e);return this.selection.setBaseAndExtent(t,n,t,n+1),this.delete()}return!1}transformByRange(e,t,n){const{startSlot:r,startOffset:o,endSlot:s,endOffset:i}=n,a=this.selection,l=Vn.getCommonAncestorSlot(r,s),c=Vn.getCommonAncestorComponent(r,s);if(!l||!c)return!1;let u;u=l.parent!==c||t.anchorSlot===l&&t.focusSlot===l?c.parentComponent:c;const h={slot:r,offset:Vn.getInlineContentStartIndex(r,o)};let d={slot:s,offset:Vn.getInlineContentEndIndex(s,i)};const p=d.slot.parent;if(p.separable&&d.slot!==p.slots.last){const t=p.slots.indexOf(d.slot),n=p.slots.length-t,r=new Vt(p,{index:t+1,count:n-1,toEnd:!1});if(Gt(p,"onSlotRemove",r),!r.isPrevented){const r=p.slots.cut(t+1,t+n),o="object"==typeof p.state?JSON.parse(JSON.stringify(p.state)):p.state;let s=null;"function"==typeof e.existingComponentTransformer&&(s=e.existingComponentTransformer(p.name,r,o)||null),s||(s=this.registry.createComponentByData(p.name,{state:o,slots:r})),this.insertAfter(s,p)}}let m=[],f=null;for(;;){const n=a.getPathsBySlot(d.slot);if(!n)break;n.push(d.offset);const r=a.getPathsBySlot(h.slot);if(!r)break;if(r.push(h.offset),!Vn.compareSelectionPaths(r,n))break;const o=d.slot.isEmpty?{slot:d.slot,startIndex:0,endIndex:0}:Jn(0,d.slot,d.offset),{slot:s,startIndex:i,endIndex:l}=o,c=s.parent;if(!c.separable&&c.slots.length>1&&!s.schema.includes(e.target.instanceType))Xn(this.injector,m,e).forEach((e=>{this.insert(e)})),m=[],d=a.getPreviousPositionByPosition(s,0),f=null;else{if(a.setBaseAndExtent(s,i,s,l),s.isEmpty){if(d=a.getPreviousPositionByPosition(s,0),d.slot===s&&d.offset===i){f&&a.setPosition(f.slot,f.offset);break}if(c.separable||1===c.slots.length){const n=s.toDelta();m.unshift(...Yn(a,s,n,e,t,0)),f=Kn(a,s,0,u,!1)}else{const t=Xn(this.injector,m,e);m=[],a.selectComponentEnd(c),t.forEach((e=>{this.insert(e)})),f=null}}else{if(d=a.getPreviousPositionByPosition(s,i),d.slot===s&&d.offset===i){f&&a.setPosition(f.slot,f.offset);break}if(i===l){const t=Xn(this.injector,m,e);m=[],t.forEach((e=>{this.insert(e)}));continue}this.delete((n=>{if(c.separable||1===c.slots.length){const r=n.toDelta();return m.unshift(...Yn(a,s,r,e,t,i)),i>0?(d=a.getPreviousPositionByPosition(s,i),void(f={slot:s,offset:i})):void(f=Kn(a,s,0,u,!1))}f=null;let r=Xn(this.injector,m,e);m=[],a.selectComponentEnd(c),r.forEach((e=>{this.insert(e)}));const o=n.toDelta(),l=Yn(a,s,o,e,t,i);r=Xn(this.injector,l,e),r.forEach(((e,t)=>{a.setPosition(s,t+i),this.insert(e)})),i>0&&(d=a.getPreviousPositionByPosition(s,i),f={slot:s,offset:i})}))}if(f&&a.setPosition(f.slot,f.offset),o.slot===h.slot&&o.endIndex===h.offset)break}}return Xn(this.injector,m,e).forEach((e=>{this.insert(e)})),!0}};Zn=St([b(),At("design:paramtypes",[Vn,x,$n,bt])],Zn);const Qn=ft("Renderer");function er(e,t){e.attrs.set(t?"textbus-slot-root":"textbus-component-root","")}function tr(e,t){const n={remove:[],set:[]};return e.forEach(((e,r)=>{e!==t.get(r)&&n.set.push([r,e])})),t.forEach(((t,r)=>{e.has(r)||n.remove.push(r)})),n}function nr(e,t){const n=tr(e.styles,t.styles),r=tr(e.attrs,t.attrs),o=function(e,t){const n={add:[],remove:[]};return e.forEach((e=>{t.has(e)||n.add.push(e)})),t.forEach((t=>{e.has(t)||n.remove.push(t)})),n}(e.classes,t.classes),s=function(e,t){const n={remove:[],add:[]};return Object.keys(e).forEach((r=>{const o=e[r];if(!Reflect.has(t,r))return void n.add.push([r,o]);const s=t[r];o!==s&&(n.add.push([r,o]),n.remove.push([r,s]))})),Object.keys(t).forEach((r=>{Reflect.has(e,r)||n.remove.push([r,t[r]])})),n}(e.listeners,t.listeners);return{styleChanges:n,attrChanges:r,classesChanges:o,listenerChanges:s,isChanged:[r.set.length,r.remove.length,n.set.length,n.remove.length,o.add.length,o.remove.length,s.add.length,s.remove.length].join("")!=="0".repeat(8)}}class rr{constructor(){this.nativeVDomMapping=new WeakMap,this.vDomNativeMapping=new WeakMap}set(e,t){this.get(e)&&this.delete(e),this.get(t)&&this.delete(t),e instanceof On||e instanceof Tn?(this.vDomNativeMapping.set(e,t),this.nativeVDomMapping.set(t,e)):(this.vDomNativeMapping.set(t,e),this.nativeVDomMapping.set(e,t))}get(e){return e instanceof Tn||e instanceof On?this.vDomNativeMapping.get(e):this.nativeVDomMapping.get(e)}delete(e){if(e instanceof Tn||e instanceof On){const t=this.vDomNativeMapping.get(e);this.vDomNativeMapping.delete(e),this.nativeVDomMapping.delete(t)}else{const t=this.nativeVDomMapping.get(e);this.nativeVDomMapping.delete(e),this.vDomNativeMapping.delete(t)}}}let or=class{constructor(e,t){this.controller=e,this.rootComponentRef=t,this.componentVNode=new WeakMap,this.slotRootVNodeCaches=new WeakMap,this.vNodeLocation=new WeakMap,this.renderedVNode=new WeakMap,this.slotVNodesCaches=new WeakMap,this.slotRenderFactory=new WeakMap,this.nativeNodeCaches=new rr,this.viewUpdatedEvent=new j,this.viewUpdateBeforeEvent=new j,this.oldVDom=null,this.slotIdAttrKey="__textbus-slot-id__",this.readonlyStateChanged=!1,this.subscription=new _,this.renderedComponents=[],this.onViewUpdated=this.viewUpdatedEvent.asObservable(),this.onViewUpdateBefore=this.viewUpdateBeforeEvent.asObservable(),this.subscription=e.onReadonlyStateChange.subscribe((()=>{t.component&&(this.readonlyStateChanged=!0,this.render(),this.readonlyStateChanged=!1)}))}render(){const e=this.rootComponentRef.component;if(this.viewUpdateBeforeEvent.next(),e.changeMarker.changed||this.readonlyStateChanged){const t=e.changeMarker.dirty,n=this.componentRender(e);if(new On("html",null,[n]),t||this.readonlyStateChanged)if(this.oldVDom){const t=this.nativeNodeCaches.get(this.oldVDom),r=this.diffAndUpdate(n,this.oldVDom,e);t!==r&&this.nativeRenderer.replace(r,t)}else{const e=this.patch(n);this.nativeRenderer.appendChild(this.rootComponentRef.host,e)}this.oldVDom=n}Promise.resolve().then((()=>{let e=this.renderedComponents.length-1;for(;e>-1;){const t=this.renderedComponents[e];e--,Gt(t,"onViewChecked")}this.renderedComponents=[],this.viewUpdatedEvent.next()}))}getVNodeByComponent(e){return this.componentVNode.get(e)}getVNodeBySlot(e){return this.slotRootVNodeCaches.get(e)}getNativeNodeByVNode(e){return this.nativeNodeCaches.get(e)}getVNodeByNativeNode(e){return this.nativeNodeCaches.get(e)}getLocationByVNode(e){return e instanceof _n&&(e=this.slotRootVNodeCaches.get(e)),this.vNodeLocation.get(e)}getLocationByNativeNode(e){const t=this.nativeNodeCaches.get(e);return this.vNodeLocation.get(t)||null}getVNodesBySlot(e){return this.slotVNodesCaches.get(e)||[]}destroy(){this.subscription.unsubscribe()}sortAndCleanNativeNode(e,t,n){let r=0;for(;;){const n=t[r];if(!n)break;const o=this.nativeRenderer.getChildByIndex(e,r);r++,o?o!==n&&this.nativeRenderer.insertBefore(n,o):this.nativeRenderer.appendChild(e,n)}for(;;){const t=this.nativeRenderer.getChildByIndex(e,r);if(!t)break;const o=new Vt(n,t);Gt(n,"onDirtyViewClean",o),o.isPrevented?r++:this.nativeRenderer.remove(t)}return e}diffAndUpdate(e,t,n){const r=this.diffNodeAndUpdate(e,t),o=this.diffChildrenAndUpdate(e,t,n);return this.sortAndCleanNativeNode(r,o,n)}diffChildrenAndUpdate(e,t,n){const r=e.children,o=t.children,s=this.diffIdenticalChildrenToEnd(r,o,n),i=this.diffIdenticalChildrenToBegin(r,o,n),a=this.diffChildrenToEnd(r,o,n),l=this.diffChildrenToBegin(r,o,n);return o.forEach((e=>{const t=this.nativeNodeCaches.get(e);t&&this.nativeRenderer.remove(t)})),[...s,...a,...r.map((e=>this.renderedVNode.has(e)?this.nativeNodeCaches.get(e):this.patch(e))),...l,...i]}diffIdenticalChildrenToEnd(e,t,n){const r=[];for(;e.length&&t.length;){const o=e[0],s=t[0];if(!(o instanceof On&&s instanceof On))break;{if(this.renderedVNode.has(o)){e.shift(),r.push(this.nativeNodeCaches.get(o));continue}if(o.tagName!==s.tagName)break;const{isChanged:i}=nr(o,s);if(i)break;e.shift(),t.shift();let a=this.nativeNodeCaches.get(s);a?(this.nativeNodeCaches.set(o,a),this.renderedVNode.set(o,!0)):a=this.createElement(o);const l=this.diffChildrenAndUpdate(o,s,n);r.push(this.sortAndCleanNativeNode(a,l,n))}}return r}diffIdenticalChildrenToBegin(e,t,n){const r=[];for(;e.length&&t.length;){const o=e[e.length-1],s=t[t.length-1];if(!(o instanceof On&&s instanceof On))break;{if(this.renderedVNode.has(o)){e.pop(),r.push(this.nativeNodeCaches.get(o));continue}if(o.tagName!==s.tagName)break;const{isChanged:i}=nr(o,s);if(i)break;e.pop(),t.pop();let a=this.nativeNodeCaches.get(s);a?(this.nativeNodeCaches.set(o,a),this.renderedVNode.set(o,!0)):a=this.createElement(o);const l=this.diffChildrenAndUpdate(o,s,n);r.push(this.sortAndCleanNativeNode(a,l,n))}}return r.reverse()}diffChildrenToEnd(e,t,n){const r=[];for(;e.length&&t.length;){const o=e[0],s=t[0];if(o instanceof On){if(this.renderedVNode.has(o)){e.shift(),r.push(this.nativeNodeCaches.get(o));continue}if(!(s instanceof On&&o.tagName===s.tagName))break;{const i=this.diffAndUpdate(o,s,n);r.push(i),e.shift(),t.shift()}}else{if(this.renderedVNode.has(o)){e.shift(),r.push(this.nativeNodeCaches.get(o));continue}if(!(s instanceof Tn&&o.textContent===s.textContent))break;{const n=this.nativeNodeCaches.get(s);this.nativeNodeCaches.set(o,n),r.push(n),this.nativeRenderer.syncTextContent(n,o.textContent),e.shift(),t.shift()}}}return r}diffChildrenToBegin(e,t,n){const r=[];for(;e.length&&t.length;){const o=e[e.length-1],s=t[t.length-1];if(o instanceof On){if(this.renderedVNode.has(o)){e.pop(),r.push(this.nativeNodeCaches.get(o));continue}if(!(s instanceof On&&o.tagName===s.tagName))break;{const i=this.diffAndUpdate(o,s,n);r.push(i),e.pop(),t.pop()}}else{if(this.renderedVNode.has(o)){e.pop(),r.push(this.nativeNodeCaches.get(o));continue}if(!(s instanceof Tn&&o.textContent===s.textContent))break;{const n=this.nativeNodeCaches.get(s);this.nativeNodeCaches.set(o,n),r.push(n),this.nativeRenderer.syncTextContent(n,o.textContent),e.pop(),t.pop()}}}return r.reverse()}diffNodeAndUpdate(e,t){let n=this.nativeNodeCaches.get(t);if(t.tagName!==e.tagName)n=this.createElement(e);else{const{styleChanges:r,attrChanges:o,classesChanges:s,listenerChanges:i}=nr(e,t);r.remove.forEach((e=>this.nativeRenderer.removeStyle(n,e))),r.set.forEach((e=>this.nativeRenderer.setStyle(n,e[0],e[1]))),o.remove.forEach((e=>this.nativeRenderer.removeAttribute(n,e))),o.set.forEach((([e,t])=>{e!==this.slotIdAttrKey&&("ref"===e&&t instanceof Ot?t.current=n:this.nativeRenderer.setAttribute(n,e,t))})),s.remove.forEach((e=>this.nativeRenderer.removeClass(n,e))),s.add.forEach((e=>this.nativeRenderer.addClass(n,e))),i.remove.forEach((e=>{this.nativeRenderer.unListen(n,e[0],e[1])})),i.add.forEach((e=>{this.nativeRenderer.listen(n,e[0],e[1])})),this.renderedVNode.set(e,!0),this.nativeNodeCaches.set(e,n)}return n}patch(e){if(e instanceof On){const t=this.createElement(e);return e.children.forEach((e=>{this.renderedVNode.get(e)?this.nativeRenderer.appendChild(t,this.nativeNodeCaches.get(e)):this.nativeRenderer.appendChild(t,this.patch(e))})),t}return this.createTextNode(e)}extractVNodesBySlot(e,t,n){for(const r of t){const t=this.getLocationByVNode(r);if(t){if(t.slot!==e)break;n.push(r),r instanceof On&&this.extractVNodesBySlot(e,r.children,n)}}return n}componentRender(e){if(this.renderedComponents.push(e),e.changeMarker.dirty||this.readonlyStateChanged){const t=e.extends.render(((t,n)=>this.slotRender(e,t,(e=>{const r=this.extractVNodesBySlot(t,e,[]);return this.slotVNodesCaches.set(t,r),n(e)}))),this.controller.readonly?zn.Readonly:zn.Editing);return er(t,!1),this.componentVNode.set(e,t),e.changeMarker.rendered(),t}if(e.changeMarker.changed){const t=this.componentVNode.get(e);e.slots.toArray().forEach((n=>{if(!n.changeMarker.changed)return;const r=n.changeMarker.dirty,o=this.slotRootVNodeCaches.get(n),s=this.slotRenderFactory.get(n),i=this.slotRender(e,n,s);if(r){t===o&&(this.componentVNode.set(e,i),er(i,!1)),o.parentNode.replaceChild(i,o);const r=this.nativeNodeCaches.get(o),s=this.diffAndUpdate(i,o,e);this.nativeNodeCaches.set(s,i),this.slotRootVNodeCaches.set(n,i),r!==s&&this.nativeRenderer.replace(s,r)}})),e.changeMarker.rendered()}return this.componentVNode.get(e)}slotRender(e,t,n){if(!(t instanceof _n))throw Qn(`${t} of the component \`${e.name}\` is not a Slot instance.`);if("function"!=typeof n)throw Qn(`component \`${e.name}\` slot render is not a function.`);if(t.changeMarker.dirty||this.readonlyStateChanged){this.slotRenderFactory.set(t,n);const r=t.createFormatTree();let o=r.children?this.createVDomByFormatTree(t,r.children):this.createVDomByContent(t,r.startIndex,r.endIndex);r.formats&&(o=[this.createVDomByOverlapFormats(r.formats,o,t)]);const s=n(o);if(!(s instanceof On))throw Qn(`component \`${e.name}\` slot rendering does not return a VElement.`);for(const[e,n]of t.getAttributes())e.render(s,n,this.controller.readonly?zn.Readonly:zn.Editing);return s.attrs.set(this.slotIdAttrKey,t.id),er(s,!0),this.vNodeLocation.set(s,{slot:t,startIndex:0,endIndex:t.length}),t.changeMarker.rendered(),this.slotRootVNodeCaches.set(t,s),s}return t.sliceContent().filter((e=>"string"!=typeof e)).forEach((e=>{if(!e.changeMarker.changed)return;const n=e.changeMarker.dirty,r=this.componentVNode.get(e),o=this.componentRender(e),s=t.indexOf(e);if(this.vNodeLocation.set(o,{slot:t,startIndex:s,endIndex:s+1}),n){r.parentNode.replaceChild(o,r);const t=this.nativeNodeCaches.get(r),n=this.diffAndUpdate(o,r,e);t!==n&&this.nativeRenderer.replace(n,t)}})),t.changeMarker.rendered(),this.slotRootVNodeCaches.get(t)}createVDomByFormatTree(e,t){var n;const r=[];for(const o of t)if(null===(n=o.formats)||void 0===n?void 0:n.length){const t=o.children?this.createVDomByFormatTree(e,o.children):this.createVDomByContent(e,o.startIndex,o.endIndex),n=this.createVDomByOverlapFormats(o.formats,t,e);r.push(n)}else r.push(...this.createVDomByContent(e,o.startIndex,o.endIndex));return r}createVDomByOverlapFormats(e,t,n){const r=[];let o=null;for(let s=e.length-1;s>-1;s--){const i=e[s],a=i.formatter.render(t,i.value,this.controller.readonly?zn.Readonly:zn.Editing);if(!a)throw Qn(`Formatter \`${i.formatter.name}\` must return an VElement!`);a instanceof On?(o=a,this.vNodeLocation.set(a,{slot:n,startIndex:i.startIndex,endIndex:i.endIndex}),t=[a]):r.push({item:i,render:a})}for(const e of r){const{render:r,item:s}=e;o||(o=En(r.fallbackTagName),o.appendChild(...t),this.vNodeLocation.set(o,{slot:n,startIndex:s.startIndex,endIndex:s.endIndex})),r.attach(o)}return o}createVDomByContent(e,t,n){const r=e.sliceContent(t,n).map((e=>"string"==typeof e?e.match(/\n|[^\n]+/g):e)).flat();return r.map((n=>{let r,o;return"string"==typeof n?"\n"===n?(r=new On("br"),o=1):(r=new Tn(n),o=n.length):(o=1,r=this.componentRender(n)),this.vNodeLocation.set(r,{slot:e,startIndex:t,endIndex:t+o}),t+=o,r}))}createElement(e){this.renderedVNode.set(e,!0);const t=this.nativeRenderer.createElement(e.tagName);return e.attrs.forEach(((e,n)=>{n!==this.slotIdAttrKey&&("ref"!==n?this.nativeRenderer.setAttribute(t,n,e):e instanceof Ot&&(e.current=t))})),e.styles.forEach(((e,n)=>{this.nativeRenderer.setStyle(t,n,e)})),e.classes.forEach((e=>this.nativeRenderer.addClass(t,e))),Object.keys(e.listeners).forEach((n=>{this.nativeRenderer.listen(t,n,e.listeners[n])})),this.nativeNodeCaches.set(t,e),t}createTextNode(e){this.renderedVNode.set(e,!0);const t=this.nativeRenderer.createTextNode(e.textContent);return this.nativeNodeCaches.set(t,e),t}};var sr,ir;St([M(),At("design:type",gt)],or.prototype,"nativeRenderer",void 0),or=St([b(),At("design:paramtypes",[qn,bt])],or),function(e){e[e.History=0]="History",e[e.Local=1]="Local",e[e.Remote=2]="Remote"}(ir||(ir={}));let ar=sr=class{get lastChangesHasLocalUpdate(){return this._lastChangesHasLocalUpdate}get lastChangesHasRemoteUpdate(){return this._lastChangesHasRemoteUpdate}constructor(e,t,n){this.rootComponentRef=e,this.selection=t,this.renderer=n,this._lastChangesHasLocalUpdate=!0,this._lastChangesHasRemoteUpdate=!1,this.changeFromRemote=!1,this.changeFromHistory=!1,this.instanceList=new Set,this.docChangedEvent=new j,this.docChangeEvent=new j,this.subs=[],this.onDocChanged=this.docChangedEvent.asObservable(),this.onDocChange=this.docChangeEvent.asObservable()}remoteUpdateTransact(e){this.changeFromRemote=!0,e(),this.changeFromRemote=!1}historyApplyTransact(e){this.changeFromHistory=!0,e(),this.changeFromHistory=!1}run(){const e=this.rootComponentRef.component,t=e.changeMarker;this.renderer.render();let n=!0;this.subs.push(t.onForceChange.pipe(U()).subscribe((()=>{this.renderer.render()})),t.onChange.pipe(H((e=>(n&&(n=!1,this.docChangeEvent.next()),{from:this.changeFromRemote?ir.Remote:this.changeFromHistory?ir.History:ir.Local,operation:e}))),U()).subscribe((e=>{n=!0,this.renderer.render(),this._lastChangesHasRemoteUpdate=!1,this._lastChangesHasLocalUpdate=!1,e.forEach((e=>{e.from===ir.Remote?this._lastChangesHasRemoteUpdate=!0:this._lastChangesHasLocalUpdate=!0})),this.selection.restore(this._lastChangesHasLocalUpdate),this.docChangedEvent.next(e)})),t.onChildComponentRemoved.subscribe((e=>{this.instanceList.add(e)})),this.renderer.onViewUpdated.subscribe((()=>{this.instanceList.forEach((t=>{let n=t;for(;n;){const e=n.parentComponent;if(!e)break;n=e}n!==e&&sr.invokeChildComponentDestroyHook(n)})),this.instanceList.clear()})))}destroy(){this.subs.forEach((e=>e.unsubscribe())),sr.invokeChildComponentDestroyHook(this.rootComponentRef.component),this.subs=[]}static invokeChildComponentDestroyHook(e){e.slots.toArray().forEach((e=>{e.sliceContent().forEach((e=>{"string"!=typeof e&&sr.invokeChildComponentDestroyHook(e)}))})),Gt(e,"onDestroy")}};ar=sr=St([b(),At("design:paramtypes",[bt,Vn,or])],ar);class lr{}function cr(e,t){const n=[];return Object.keys(e).forEach((r=>{const o=t.getFormatter(r);if(o){const t=e[r];Array.isArray(t)?t.forEach((e=>{n.push([o,e])})):n.push([o,e[r]])}})),n}let ur=class extends lr{get canBack(){return this.historySequence.length>0&&this.index>0}get canForward(){return this.historySequence.length>0&&this.index<this.historySequence.length}constructor(e,t,n,r,o){super(),this.stackSize=e,this.root=t,this.scheduler=n,this.selection=r,this.registry=o,this.index=0,this.historySequence=[],this.changeEvent=new j,this.backEvent=new j,this.forwardEvent=new j,this.pushEvent=new j,this.subscription=null,this.forceChangeSubscription=null,this.onChange=this.changeEvent.asObservable(),this.onBack=this.backEvent.asObservable(),this.onForward=this.forwardEvent.asObservable(),this.onPush=this.pushEvent.asObservable()}listen(){this.record()}forward(){this.canForward&&(this.scheduler.historyApplyTransact((()=>{const e=this.historySequence[this.index];this.apply(e,!1),this.selection.usePaths(e.afterPaths)})),this.index++,this.forwardEvent.next(),this.changeEvent.next())}back(){this.canBack&&(this.scheduler.historyApplyTransact((()=>{const e=this.historySequence[this.index-1];this.apply(e,!0),this.selection.usePaths(e.beforePaths)})),this.index--,this.backEvent.next(),this.changeEvent.next())}clear(){this.historySequence=[],this.index=0,this.changeEvent.next()}destroy(){var e;this.historySequence=[],null===(e=this.forceChangeSubscription)||void 0===e||e.unsubscribe(),this.subscription&&this.subscription.unsubscribe()}record(){let e=this.selection.getPaths();this.scheduler.onDocChanged.pipe(H((e=>{const t=[];for(const n of e){if(n.from!==ir.Local)continue;const e=n.operation,r=e.apply.filter((e=>"apply"!==e.type||e.record)),o=e.unApply.filter((e=>"apply"!==e.type||e.record));r.length&&o.length&&t.push({path:e.path,apply:r,unApply:o})}return t}))).subscribe((t=>{if(!t.length)return;this.historySequence.length=this.index,this.index++;const n=this.selection.getPaths();this.historySequence.push({operations:t.map((e=>({path:[...e.path],apply:e.apply.map((e=>"insert"===e.type||"insertSlot"===e.type?Object.assign(Object.assign({},e),{ref:null}):e)),unApply:e.unApply.map((e=>"insert"===e.type||"insertSlot"===e.type?Object.assign(Object.assign({},e),{ref:null}):e))}))),beforePaths:e,afterPaths:n}),this.historySequence.length>this.stackSize&&(this.historySequence.shift(),this.index--),e=n,this.pushEvent.next(),this.changeEvent.next()}))}apply(e,t){let n=e.operations;t&&(n=[...n].reverse()),n.forEach((e=>{const n=[...e.path],r=n.length%2==1,o=t?e.unApply:e.apply;if(r){const e=this.selection.findSlotByPaths(n);o.forEach((t=>{if("retain"!==t.type)if("delete"!==t.type)if("apply"!==t.type)if("attrSet"!==t.type)if("attrRemove"!==t.type){if("insert"===t.type){const n=t.formats;let r;n&&(r=cr(n,this.registry));const o="string"==typeof t.content?t.content:this.registry.createComponent(t.content);r?e.insert(o,r):e.insert(o)}}else{const n=this.registry.getAttribute(t.name);n&&e.removeAttribute(n)}else{const n=this.registry.getAttribute(t.name);n&&e.setAttribute(n,t.value)}else e.updateState((e=>{mt(e,t.patches)}));else e.delete(t.count);else{const n=t.formats;if(n){const r=cr(n,this.registry);e.retain(t.offset,r)}else e.retain(t.offset)}}))}else{const e=this.selection.findComponentByPaths(n);o.forEach((t=>{if("retain"!==t.type)if("delete"!==t.type){if("insertSlot"===t.type){const n=this.registry.createSlot(t.slot);e.slots.insert(n)}"apply"!==t.type||e.updateState((e=>mt(e,t.patches)))}else e.slots.delete(t.count);else e.slots.retain(t.offset)}))}}))}};ur=St([b(),Tt(0,S(kt)),At("design:paramtypes",[Number,bt,ar,Vn,$n])],ur);let hr=class{constructor(e,t,n,r,o){this.components=e,this.markdownDetect=t,this.commander=n,this.injector=r,this.selection=o,this.shortcutList=[],this.zenCodingInterceptors=[],e.forEach((e=>{const t=e.zenCoding;t&&this.zenCodingInterceptors.push(this.createZenCodingEx(e,t))}))}addZenCodingInterceptor(e){return this.zenCodingInterceptors.push(e),{remove:()=>{const t=this.zenCodingInterceptors.indexOf(e);t>-1&&this.zenCodingInterceptors.splice(t,1)}}}execShortcut(e){if(!this.selection.isSelected)return!1;const t=e.key,n=this.selection.commonAncestorSlot;if(this.markdownDetect&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&n===this.selection.startSlot&&n===this.selection.endSlot)for(let e=this.zenCodingInterceptors.length-1;e>-1;e--){const r=this.zenCodingInterceptors[e];if(r.try(t)){const e=n.sliceContent();let t=e[0];if(e.length>1||"string"!=typeof t)continue;if(t=t.replace(/\n$/,""),r.match(t)){if(!r.action(t))break;return!0}}}const r=this.selection.commonAncestorComponent;if(r){const t=this.handleShortcut(e,r.shortcutList.map((e=>this.createShortcutEx(e))));if(t)return!0}return this.handleShortcut(e,this.shortcutList)}addShortcut(e){const t=this.createShortcutEx(e);return this.shortcutList.push(t),{remove:()=>{const e=this.shortcutList.indexOf(t);e>-1&&this.shortcutList.splice(e,1)}}}handleShortcut(e,t){for(let n=t.length-1;n>-1;n--){const r=t[n],o=r.config;if(r.test(e.key)&&!!o.keymap.altKey===e.altKey&&!!o.keymap.shiftKey===e.shiftKey&&!!o.keymap.ctrlKey===e.ctrlKey&&!1!==o.action(e.key))return!0}return!1}createZenCodingEx(e,t){const n=this.selection,r=this.commander;return{match(e){return"function"==typeof t.match?t.match(e):t.match.test(e)},try(e){return"string"==typeof t.key?e.toLowerCase()===t.key.toLowerCase():"function"==typeof t.key?t.key(e):Array.isArray(t.key)?t.key.some((t=>t.toLowerCase()===e.toLowerCase())):t.key.test(e)},action:o=>{const s=n.commonAncestorSlot,i=t.generateInitData(o,this.injector),a=e.createInstance(this.injector,i);if(s.schema.includes(a.type))n.selectSlot(s),r.delete(),r.insert(a);else{const e=s.parent;if(e&&e.slots.length>1)return!1;if(!(null==e?void 0:e.parent))return!1;n.selectComponent(e),r.delete(),r.insert(a)}const l=a.slots.first;if(l)n.setPosition(l,0);else if(a.parent){const e=a.parent.indexOf(a);n.setPosition(a.parent,e+1)}return!0}}}createShortcutEx(e){const t=e.keymap.key;return{config:e,test(e){return"string"==typeof t?e.toLowerCase()===t.toLowerCase():Array.isArray(t)?t.some((t=>e.toLowerCase()===t.toLowerCase())):"function"==typeof t.match?t.match(e):t.match.test(e)}}}};hr=St([b(),Tt(0,S(vt)),Tt(1,S(wt)),At("design:paramtypes",[Array,Boolean,Zn,x,Vn])],hr);let dr=class{constructor(e){this.rootComponentRef=e,this.componentVNode=new WeakMap,this.slotVNodeCaches=new WeakMap,this.slotRenderFactory=new WeakMap}render(){const e=this.componentRender(this.rootComponentRef.component);return new On("body",null,[e]),e}componentRender(e){if(e.changeMarker.outputDirty){const t=e.extends.render(((e,t)=>this.slotRender(e,t)),zn.Output);return e.changeMarker.outputRendered(),this.componentVNode.set(e,t),t}const t=this.componentVNode.get(e);return e.slots.toArray().forEach((n=>{if(!n.changeMarker.outputChanged)return;const r=n.changeMarker.outputDirty,o=this.slotVNodeCaches.get(n),s=this.slotRenderFactory.get(n),i=this.slotRender(n,s);r&&(t===o&&this.componentVNode.set(e,i),o.parentNode.replaceChild(i,o),this.slotVNodeCaches.set(n,i))})),e.changeMarker.outputRendered(),this.componentVNode.get(e)}slotRender(e,t){if(e.changeMarker.outputDirty){this.slotRenderFactory.set(e,t);const n=e.createFormatTree();let r=n.children?this.createVDomByFormatTree(e,n.children):this.createVDomByContent(e,n.startIndex,n.endIndex);n.formats&&(r=[this.createVDomByOverlapFormats(n.formats,r)]);const o=t(r);for(const[t,n]of e.getAttributes())t.render(o,n,zn.Output);return e.changeMarker.outputRendered(),this.slotVNodeCaches.set(e,o),o}return e.sliceContent().filter((e=>"string"!=typeof e)).forEach((e=>{if(!e.changeMarker.outputChanged)return;const t=e.changeMarker.outputDirty,n=this.componentVNode.get(e),r=this.componentRender(e);t&&n.parentNode.replaceChild(r,n)})),e.changeMarker.outputRendered(),this.slotVNodeCaches.get(e)}createVDomByFormatTree(e,t){var n;const r=[];for(const o of t)if(null===(n=o.formats)||void 0===n?void 0:n.length){const t=o.children?this.createVDomByFormatTree(e,o.children):this.createVDomByContent(e,o.startIndex,o.endIndex),n=this.createVDomByOverlapFormats(o.formats,t);r.push(n)}else r.push(...this.createVDomByContent(e,o.startIndex,o.endIndex));return r}createVDomByOverlapFormats(e,t){const n=[];let r=null;for(let o=e.length-1;o>-1;o--){const s=e[o],i=s.formatter.render(t,s.value,zn.Output);i instanceof On?(r=i,t=[i]):n.push(i)}for(const e of n)r||(r=En(e.fallbackTagName),r.appendChild(...t)),e.attach(r);return r}createVDomByContent(e,t,n){const r=e.sliceContent(t,n).map((e=>"string"==typeof e?e.match(/\n|[^\n]+/g):e)).flat();return r.map((e=>{let n,r;return"string"==typeof e?"\n"===e?(n=new On("br"),r=1):(n=new Tn(e),r=e.length):(r=1,n=this.componentRender(e)),t+=r,n}))}};var pr;dr=St([b(),At("design:paramtypes",[bt])],dr),function(e){e.Normal="Normal",e.Disabled="Disabled",e.Enabled="Enabled"}(pr||(pr={}));let mr=class{constructor(e){this.selection=e}queryFormat(e){if(!this.selection.isSelected)return{state:pr.Normal,value:null};const t=this.selection.getSelectedScopes().map((t=>this.getStatesByRange(t.slot,e,t.startIndex,t.endIndex)));return this.mergeState(t)}queryAttribute(e){if(!this.selection.isSelected)return{state:pr.Normal,value:null};let t;if(this.selection.isCollapsed){const e=this.selection.commonAncestorSlot;t=[{slot:e,startIndex:0,endIndex:e.length}]}else t=this.selection.getSelectedScopes();const n=t.map((t=>{const n=t.slot.sliceContent(t.startIndex,t.endIndex),r=[];let o=!1;if(n.forEach((e=>{"string"!=typeof e?r.push(e):o=!0})),o)return t.slot.hasAttribute(e)?{state:pr.Enabled,value:t.slot.getAttribute(e)}:{state:pr.Normal,value:null};const s=[];for(const n of r){const r=n.slots;if(0===r.length){if(!t.slot.hasAttribute(e))return{state:pr.Normal,value:null};s.push({state:pr.Enabled,value:t.slot.getAttribute(e)})}for(const t of r.toArray()){if(!t.hasAttribute(e))return{state:pr.Normal,value:null};s.push({state:pr.Enabled,value:t.getAttribute(e)})}}return this.mergeState(s)}));return this.mergeState(n)}queryComponent(e,t){if(!this.selection.isSelected)return{state:pr.Normal,value:null};const n=this.selection.getRanges().map((n=>{var r;let o=Vn.getCommonAncestorComponent(n.startSlot,n.endSlot);for(;o;){if(o.name===e.name&&(!t||t(o)))return{state:pr.Enabled,value:o};o=(null===(r=o.parent)||void 0===r?void 0:r.parent)||null}return{state:pr.Normal,value:null}}));return this.mergeState(n)}queryWrappedComponent(e){const t=this.selection;if(!t.isSelected||t.isCollapsed)return{state:pr.Normal,value:null};const n=t.getRanges(),r=[];for(const t of n){const{startSlot:n,endSlot:o,startOffset:s,endOffset:i}=t;if(n!==o||i-s>1)return{state:pr.Normal,value:null};const a=n.getContentAtIndex(s);if("string"==typeof a||a.name!==e.name)return{state:pr.Normal,value:null};r.push(a)}return{state:pr.Enabled,value:r[0]}}getStatesByRange(e,t,n,r){if(n===r){const o=0===n?e.getFormatRangesByFormatter(t,0,1).shift():e.getFormatRangesByFormatter(t,n-1,r).shift();return o?{state:pr.Enabled,value:o.value}:null}const o=e.sliceContent(n,r),s=[];let i=n;for(const n of o){if("string"==typeof n||0===n.slots.length){const r=e.getFormatRangesByFormatter(t,i,i+n.length);let o=i;for(const e of r){if(o!==e.startIndex)return{state:pr.Normal,value:null};s.push({state:pr.Enabled,value:e.value}),o=e.endIndex}if(o!==i+n.length)return{state:pr.Normal,value:null}}else n.slots.toArray().forEach((e=>{s.push(this.getStatesByRange(e,t,0,e.length))}));i+=n.length}return this.mergeState(s)}mergeState(e){const t=e.filter((e=>e)),n=t.filter((e=>e.state!==pr.Normal));return e.length!==n.length?{state:pr.Normal,value:null}:n.length?{state:pr.Enabled,value:n[0].value}:{state:pr.Normal,value:null}}};mr=St([b(),At("design:paramtypes",[Vn])],mr);const fr=ft("Starter");class gr extends L{constructor(e){super(new C,[],gr.diScope),this.config=e,this.beforeDestroyCallbacks=[],this.isDestroyed=!1;const{plugins:t,providers:n}=this.mergeModules(e);this.plugins=t.map((e=>e())),this.staticProviders=n,this.normalizedProviders=this.staticProviders.map((e=>B(e)))}mount(e,t){var n,r,o;return function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}l((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){const s=this.get(bt);s.component=t,s.host=e;const i=[];null===(n=this.config.imports)||void 0===n||n.forEach((e=>{if("function"==typeof e.setup){const t=e.setup(this);i.push(t||null)}})),i.push((null===(o=(r=this.config).setup)||void 0===o?void 0:o.call(r,this))||null);const a=yield Promise.all(i);if(this.isDestroyed)return this;a.forEach((e=>{e&&this.beforeDestroyCallbacks.push(e)}));const l=this.get(ar);return this.get(lr).listen(),l.run(),this.plugins.forEach((e=>e.setup(this))),this}))}destroy(){this.isDestroyed=!0,this.plugins.forEach((e=>{var t;return null===(t=e.onDestroy)||void 0===t?void 0:t.call(e)})),this.beforeDestroyCallbacks.forEach((e=>{e()})),[this.get(lr),this.get(Vn),this.get(ar),this.get(or)].forEach((e=>{e.destroy()}))}mergeModules(e){var t;const n=[...e.providers||[]],r=[...e.components||[]],o=[...e.attributes||[]],s=[...e.formatters||[]],i=[...e.plugins||[]];return null===(t=e.imports)||void 0===t||t.forEach((e=>{n.push(...e.providers||[]),r.push(...e.components||[]),s.push(...e.formatters||[]),i.push(...e.plugins||[])})),{providers:[...n,{provide:Ct,useValue:!!e.readonly},{provide:kt,useValue:"number"==typeof e.historyStackSize?e.historyStackSize:500},{provide:vt,useValue:r},{provide:xt,useValue:o},{provide:yt,useValue:s},{provide:wt,useValue:e.zenCoding},{provide:bt,useValue:{}},{provide:lr,useClass:ur},qn,ar,Zn,hr,dr,mr,or,Vn,$n,{provide:gr,useFactory:()=>this},{provide:x,useFactory:()=>this},{provide:Hn,useFactory(){throw fr("You must implement the `NativeSelectionBridge` interface to start Textbus!")}},{provide:gt,useFactory(){throw fr("You must implement the `NativeRenderer` interface to start Textbus!")}}],plugins:i}}}function br(e,t={}){const n=document.createElement(e);return t.classes&&n.classList.add(...t.classes),t.attrs&&Object.keys(t.attrs).forEach((e=>{n.setAttribute(e,t.attrs[e])})),t.props&&Object.keys(t.props).forEach((e=>{n[e]=t.props[e]})),t.styles&&Object.assign(n.style,t.styles),t.children&&t.children.filter((e=>e)).forEach((e=>{n.appendChild(e)})),t.on&&Object.keys(t.on).forEach((e=>{n.addEventListener(e,t.on[e])})),n}function vr(e){return document.createTextNode(e)}function yr(e){let{startContainer:t,startOffset:n}=e;if(t.nodeType===Node.TEXT_NODE){if(n>0)return e.getBoundingClientRect();const r=t.parentNode;n=Array.from(r.childNodes).indexOf(t),t=r}const r=t.childNodes[n-1];if(r){if(r.nodeType===Node.ELEMENT_NODE&&"br"!==r.nodeName.toLowerCase()){const e=r.getBoundingClientRect();return{left:e.right,top:e.top,width:e.width,height:e.height}}if(r.nodeType===Node.TEXT_NODE){const e=document.createRange();return e.setStart(r,r.textContent.length),e.setEnd(r,r.textContent.length),e.getBoundingClientRect()}}const o=t.childNodes[n];let s=!1;if(!o){const e=t.lastChild;if(e&&e.nodeType===Node.ELEMENT_NODE){const t=e.getBoundingClientRect();return{left:t.right,top:t.top,width:t.width,height:t.height}}}if(o){if(o.nodeType===Node.ELEMENT_NODE&&"br"!==o.nodeName.toLowerCase())return o.getBoundingClientRect();s=!0}const i=t.ownerDocument.createElement("span");i.innerText="",i.style.display="inline-block",s?t.insertBefore(i,o):t.appendChild(i);const a=i.getBoundingClientRect();return t.removeChild(i),a}gr.diScope=new g("Textbus");const xr=()=>/win(dows|32|64)/i.test(navigator.userAgent),wr=()=>/mac os/i.test(navigator.userAgent),kr=()=>/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent),Cr=()=>/Firefox/.test(navigator.userAgent),Sr=()=>/Android|iPhone|iPad/.test(navigator.userAgent);function Tr(e,t,n,r){var o,s=arguments.length,i=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,n,i):o(t,n))||i);return s>3&&i&&Object.defineProperty(t,n,i),i}function Ar(e,t){return function(n,r){t(n,r,e)}}function Er(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}const Mr=new v("EDITOR_OPTIONS"),Br=new v("VIEW_CONTAINER"),Rr=new v("VIEW_DOCUMENT"),Or=new v("VIEW_MASK");class Nr{}let Ir=class{constructor(e,t,n,r,o,s,i){this.config=e,this.injector=t,this.controller=n,this.selection=r,this.rootComponentRef=o,this.input=s,this.renderer=i,this.nativeSelection=document.getSelection(),this.selectionMaskElement=br("style"),this.selectionChangeEvent=new j,this.subs=[],this.connector=null,this.ignoreSelectionChange=!1,this.changeFromUser=!1,this.docContainer=t.get(Rr),this.maskContainer=t.get(Or),this.onSelectionChange=this.selectionChangeEvent.asObservable().pipe(ce((()=>!n.readonly))),document.head.appendChild(this.selectionMaskElement),this.sub=this.onSelectionChange.subscribe((e=>{e?s.focus(e,this.changeFromUser):s.blur()})),this.sub.add(K(document,"focusin").subscribe((t=>{let n=t.target;if(/^(input|textarea|select)$/i.test(n.nodeName)){if("input"===n.tagName.toLowerCase()&&/^(range|date)$/.test(n.type))return;this.ignoreSelectionChange=!0}else if(!e.useContentEditable)for(;n;){if("true"===n.contentEditable)return void(this.ignoreSelectionChange=!0);n=n.parentNode}}))),this.sub.add(K(document,"focusout").subscribe((()=>{this.ignoreSelectionChange=!1})))}connect(e){this.disConnect(),this.connector=e,this.syncSelection(e),this.listen(e)}disConnect(){this.connector=null,this.unListen()}getRect(e){const{focus:t,anchor:n}=this.getPositionByRange({focusOffset:e.offset,anchorOffset:e.offset,focusSlot:e.slot,anchorSlot:e.slot});if(!t||!n)return null;const r=document.createRange();return r.setStart(t.node,t.offset),r.collapse(),yr(r)}restore(e,t){if(this.changeFromUser=t,this.ignoreSelectionChange||!this.connector)return;if(this.unListen(),!e)return this.nativeSelection.removeAllRanges(),this.selectionChangeEvent.next(null),void this.listen(this.connector);const{focus:n,anchor:r}=this.getPositionByRange(e);if(!n||!r)return this.nativeSelection.removeAllRanges(),this.selectionChangeEvent.next(null),void this.listen(this.connector);if(this.nativeSelection.setBaseAndExtent(r.node,r.offset,n.node,n.offset),this.nativeSelection.rangeCount){const e=this.nativeSelection.getRangeAt(0);this.selectionChangeEvent.next(e)}else this.selectionChangeEvent.next(null);const o=()=>{this.connector&&this.listen(this.connector)};"function"==typeof requestIdleCallback?requestIdleCallback(o):setTimeout(o,30)}destroy(){this.sub.unsubscribe()}getPositionByRange(e){let t,n;try{return t=this.findSelectedNodeAndOffset(e.focusSlot,e.focusOffset),n=t,e.anchorSlot===e.focusSlot&&e.anchorOffset===e.focusOffset||(n=this.findSelectedNodeAndOffset(e.anchorSlot,e.anchorOffset)),{focus:t,anchor:n}}catch(e){return{focus:null,anchor:null}}}getPreviousLinePositionByCurrent(e){return this.getLinePosition(e,!1)}getNextLinePositionByCurrent(e){return this.getLinePosition(e,!0)}getLinePosition(e,t){let n;return clearTimeout(this.cacheCaretPositionTimer),this.oldCaretPosition||(this.oldCaretPosition=this.getRect(e)),n=t?this.getNextLinePositionByOffset(e,this.oldCaretPosition.left):this.getPreviousLinePositionByOffset(e,this.oldCaretPosition.left),this.cacheCaretPositionTimer=setTimeout((()=>{this.oldCaretPosition=null}),3e3),n}getPreviousLinePositionByOffset(e,t){let n,r,o=!1,s=0,i=t,a=e.slot,l=e.offset,c=this.getRect({slot:a,offset:l}).top,u=0;for(;;){s++,n=this.selection.getPreviousPositionByPosition(a,l),a=n.slot,l=n.offset;const e=this.getRect(n);if(!o){if(e.left>i||e.top+e.height<=c)o=!0;else if(e.left===i&&e.top===c)return n;i=e.left,c=e.top}if(o){if(e.left<t)return n;if(r&&e.left>=u)return r;u=e.left,r=n}if(s>1e4)break}return n||{offset:0,slot:a}}getNextLinePositionByOffset(e,t){let n=!1,r=0,o=t,s=e.slot,i=e.offset;const a=this.getRect({slot:s,offset:i});let l,c=a.top,u=0;for(;;){r++;const e=this.selection.getNextPositionByPosition(s,i);s=e.slot,i=e.offset;const h=this.getRect(e);if(!n){if(h.left<o||h.top>=c+a.height)n=!0;else if(h.left===o&&h.top===c)return e;o=h.left,c=h.top,l=e}if(n){if(h.left>t)return l;if(l&&h.left<=u)return l;l=e,u=h.left}if(r>1e4)break}return l||{offset:s.length,slot:s}}unListen(){this.subs.forEach((e=>e.unsubscribe())),this.subs=[]}listen(e){if(!this.config.useContentEditable){const e=this.nativeSelection;this.subs.push(K(this.docContainer,"mousedown").subscribe((t=>{this.ignoreSelectionChange||2===t.button||t.shiftKey||e.removeAllRanges()})))}this.subs.push(K(document,"selectionchange").subscribe((()=>{this.syncSelection(e)})))}syncSelection(e){var t;const n=this.nativeSelection;if(this.changeFromUser=!0,this.ignoreSelectionChange||this.input.composition||0===n.rangeCount||!this.docContainer.contains(n.anchorNode)||0===this.rootComponentRef.component.slots.length)return;const r=n.getRangeAt(0),o=r.cloneRange(),s=n.focusNode===o.endContainer&&n.focusOffset===o.endOffset,i=n.focusNode===o.startContainer&&n.focusOffset===o.startOffset;if(!this.docContainer.contains(n.focusNode))if(s){const e=this.renderer.getVNodeBySlot(this.rootComponentRef.component.slots.first);if(!e)return;const t=this.renderer.getNativeNodeByVNode(e);if(!t)return;o.setEndAfter(t.lastChild)}else{const e=this.renderer.getVNodeBySlot(this.rootComponentRef.component.slots.last);if(!e)return;const t=this.renderer.getNativeNodeByVNode(e);if(!t)return;o.setStartBefore(t.firstChild)}const a=this.getCorrectedPosition(o.startContainer,o.startOffset,i),l=o.collapsed?a:this.getCorrectedPosition(o.endContainer,o.endOffset,s);if([Node.ELEMENT_NODE,Node.TEXT_NODE].includes(null===(t=o.commonAncestorContainer)||void 0===t?void 0:t.nodeType)&&a&&l){const t=s?{anchorSlot:a.slot,anchorOffset:a.offset,focusSlot:l.slot,focusOffset:l.offset}:{focusSlot:a.slot,focusOffset:a.offset,anchorSlot:l.slot,anchorOffset:l.offset},{focus:c,anchor:u}=this.getPositionByRange(t);if(c&&u){let s=u,a=c;i&&(s=c,a=u),o.startContainer===s.node&&o.startOffset===s.offset||o.setStart(s.node,s.offset),o.endContainer===a.node&&o.endOffset===a.offset||o.setEnd(a.node,a.offset),e.setSelection(t),n.isCollapsed&&(r.setStart(s.node,s.offset),r.setEnd(a.node,a.offset)),this.selectionChangeEvent.next(o)}else e.setSelection(null)}else e.setSelection(null)}findSelectedNodeAndOffset(e,t){const n=e.getContentAtIndex(t-1),r=this.renderer.getVNodesBySlot(e);if(n){if("string"!=typeof n){const e=this.renderer.getVNodeByComponent(n),t=this.renderer.getNativeNodeByVNode(e);return{node:t.parentNode,offset:Array.from(t.parentNode.childNodes).indexOf(t)+1}}if("\n"===n)for(const e of r)if(!(e instanceof Tn)&&"br"===e.tagName){const n=this.renderer.getLocationByVNode(e);if(n&&n.endIndex===t){const t=this.renderer.getNativeNodeByVNode(e),n=t.parentNode;return{node:n,offset:Array.from(n.childNodes).indexOf(t)+1}}}}const o=e.getContentAtIndex(t);if(o&&"string"!=typeof o){const e=this.renderer.getVNodeByComponent(o),t=this.renderer.getNativeNodeByVNode(e);return{node:t.parentNode,offset:Array.from(t.parentNode.childNodes).indexOf(t)}}for(const e of r){if(e instanceof On){if("br"===e.tagName){const n=this.renderer.getLocationByVNode(e);if(n&&n.startIndex===t){const t=this.renderer.getNativeNodeByVNode(e),n=t.parentNode;return{node:n,offset:Array.from(n.childNodes).indexOf(t)}}}continue}const n=this.renderer.getLocationByVNode(e);if(n&&t>=n.startIndex&&t<=n.endIndex)return{node:this.renderer.getNativeNodeByVNode(e),offset:t-n.startIndex}}return null}getCorrectedPosition(e,t,n,r=[]){if(r.push(e),e.nodeType===Node.ELEMENT_NODE){const o=this.renderer.getLocationByNativeNode(e),s=e.childNodes[t];if(s){const e=this.renderer.getLocationByNativeNode(s);return e&&o?{slot:e.slot,offset:e.startIndex}:this.findFocusNode(s,n,r)}const i=e.childNodes[t-1];if(i){const e=this.renderer.getLocationByNativeNode(i);if(e&&o)return{slot:e.slot,offset:e.endIndex}}if(o)return{slot:o.slot,offset:o.endIndex};const a=n?e.nextSibling:e.previousSibling;return a?this.findFocusNode(a,n,r):this.findFocusNodeByParent(e,n,r)}if(e.nodeType===Node.TEXT_NODE){const o=this.renderer.getLocationByNativeNode(e);if(o)return{slot:o.slot,offset:o.startIndex+t};const s=n?e.nextSibling:e.previousSibling;return s?this.findFocusNode(s,n,r):this.findFocusNodeByParent(e,n,r)}return null}findFocusNode(e,t=!1,n=[]){if(n.includes(e)){const r=t?e.nextSibling:e.previousSibling;return r?this.findFocusNode(r,t,n):this.findFocusNodeByParent(e,t,n)}n.push(e);const r=this.renderer.getLocationByNativeNode(e);if(r)return{slot:r.slot,offset:t?r.startIndex:r.endIndex};const o=t?e.firstChild:e.lastChild;if(o)return this.findFocusNode(o,t,n);const s=t?e.nextSibling:e.previousSibling;return s?this.findFocusNode(s,t,n):this.findFocusNodeByParent(e,t,n)}findFocusNodeByParent(e,t,n){const r=e.parentNode;if(r){const o=this.renderer.getLocationByNativeNode(r);return o?{slot:o.slot,offset:t?o.endIndex:o.startIndex}:(n.push(e),this.findFocusNode(r,t,n))}return null}};Ir=Tr([b(),Ar(0,S(Mr)),Er("design:paramtypes",[Object,x,qn,Vn,bt,Nr,or])],Ir);class Pr{}let Lr=class{constructor(e,t,n,r,o){this.injector=e,this.nativeSelection=t,this.scheduler=n,this.selection=r,this.awarenessDelegate=o,this.host=br("div",{styles:{position:"absolute",left:0,top:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:1}}),this.canvasContainer=br("div",{styles:{position:"absolute",left:0,top:0,width:"100%",height:"100%",overflow:"hidden"}}),this.canvas=br("canvas",{styles:{position:"absolute",opacity:.5,left:0,top:0,width:"100%",height:document.documentElement.clientHeight+"px",pointerEvents:"none"}}),this.context=this.canvas.getContext("2d"),this.tooltips=br("div",{styles:{position:"absolute",left:0,top:0,width:"100%",height:"100%",pointerEvents:"none",fontSize:"12px",zIndex:10}}),this.onRectsChange=new j,this.subscription=new _,this.currentSelection=[],this.container=e.get(Br),this.canvasContainer.append(this.canvas),this.host.append(this.canvasContainer,this.tooltips),this.container.prepend(this.host),this.subscription.add(this.onRectsChange.subscribe((e=>{for(const t of e)this.context.fillStyle=t.color,this.context.beginPath(),this.context.rect(t.left,t.top,t.width,t.height),this.context.fill(),this.context.closePath()})),K(window,"resize").subscribe((()=>{this.canvas.style.height=document.documentElement.clientHeight+"px",this.refresh()})),this.scheduler.onDocChanged.subscribe((()=>{this.refresh()})))}refresh(){this.draw(this.currentSelection)}destroy(){this.subscription.unsubscribe()}draw(e){this.currentSelection=e;const t=this.container.getBoundingClientRect();this.canvas.style.top=-1*t.top+"px",this.canvas.width=this.canvas.offsetWidth,this.canvas.height=this.canvas.offsetHeight,this.context.clearRect(0,0,this.canvas.width,this.canvas.height);const n=[];e.filter((e=>e.paths.anchor.length&&e.paths.focus.length)).forEach((e=>{const r=[...e.paths.anchor],o=[...e.paths.focus],s=r.pop(),i=this.selection.findSlotByPaths(r),a=o.pop(),l=this.selection.findSlotByPaths(o);if(!i||!l)return;const{focus:c,anchor:u}=this.nativeSelection.getPositionByRange({focusOffset:a,anchorOffset:s,focusSlot:l,anchorSlot:i});if(!c||!u)return;const h=document.createRange();h.setStart(u.node,u.offset),h.setEnd(c.node,c.offset),u.node===c.node&&u.offset===c.offset||!h.collapsed||(h.setStart(c.node,c.offset),h.setEnd(u.node,u.offset));let d=!1;this.awarenessDelegate&&(d=this.awarenessDelegate.getRects({focusOffset:a,anchorOffset:s,focusSlot:l,anchorSlot:i},h)),d||(d=h.getClientRects());const p=[];for(let n=d.length-1;n>=0;n--){const r=d[n];p.push({id:e.id,color:e.color,username:e.username,left:r.left-t.left,top:r.top,width:r.width,height:r.height})}this.onRectsChange.next(p);const m=h.cloneRange();m.setStart(c.node,c.offset),m.collapse(!0);const f=yr(m),g={id:e.id,username:e.username,color:e.color,left:f.left-t.left,top:f.top-t.top,width:1,height:f.height};g.left<0||g.top<0||g.left>t.width||n.push(g)})),this.drawUserCursor(n)}drawUserCursor(e){for(let t=0;t<e.length;t++){const n=e[t],{cursor:r,userTip:o,anchor:s}=this.getUserCursor(t);Object.assign(r.style,{left:n.left+"px",top:n.top+"px",width:n.width+"px",height:n.height+"px",background:n.color,display:"block"}),s.style.background=n.color,o.innerText=n.username,o.style.background=n.color}for(let t=e.length;t<this.tooltips.children.length;t++)this.tooltips.removeChild(this.tooltips.children[t])}getUserCursor(e){let t=this.tooltips.children[e];if(t){const e=t.children[0];return{cursor:t,anchor:e,userTip:e.children[0]}}const n=br("span",{styles:{position:"absolute",left:"50%",transform:"translateX(-50%)",marginBottom:"2px",bottom:"100%",whiteSpace:"nowrap",color:"#fff",boxShadow:"0 1px 2px rgba(0,0,0,.1)",opacity:.8,borderRadius:"3px",padding:"3px 5px",pointerEvents:"none"}}),r=br("span",{styles:{position:"absolute",top:"-2px",left:"-2px",width:"5px",height:"5px",borderRadius:"50%",pointerEvents:"auto",pointer:"cursor"},children:[n]});return t=br("span",{styles:{position:"absolute"},children:[r]}),this.tooltips.append(t),{cursor:t,anchor:r,userTip:n}}};var Fr;Lr=Tr([b(),Ar(4,E()),Er("design:paramtypes",[x,Ir,ar,Vn,Pr])],Lr);let zr=Fr=class{constructor(){this.isSVG=new RegExp(`^(${["animate","animateMotion","animateTransform","circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","title","tspan","use","view"].join("|")})$`,"i"),this.xlinkNameSpace="http://www.w3.org/1999/xlink",this.possibleXlinkNames={xlinkActuate:"xlink:actuate",xlinkactuate:"xlink:actuate","xlink:actuate":"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkarcrole:"xlink:arcrole","xlink:arcrole":"xlink:arcrole",xlinkHref:"xlink:href",xlinkhref:"xlink:href","xlink:href":"xlink:href",xlinkRole:"xlink:role",xlinkrole:"xlink:role","xlink:role":"xlink:role",xlinkShow:"xlink:show",xlinkshow:"xlink:show","xlink:show":"xlink:show",xlinkTitle:"xlink:title",xlinktitle:"xlink:title","xlink:title":"xlink:title",xlinkType:"xlink:type",xlinktype:"xlink:type","xlink:type":"xlink:type"},this.booleanProps={input:["disabled","readonly"],select:["disabled","readonly"],option:["disabled","selected"],button:["disabled"],video:["controls","autoplay","loop","muted"],audio:["controls","autoplay","loop","muted"]},this.valueProps={input:["value"],option:["value"],video:["src"],audio:["src"]}}listen(e,t,n){e.addEventListener(t,n)}unListen(e,t,n){e.removeEventListener(t,n)}createTextNode(e){return document.createTextNode(Fr.replaceEmpty(e))}createElement(e){return this.isSVG.test(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}appendChild(e,t){e.appendChild(t)}remove(e){var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)}insertBefore(e,t){t.parentNode.insertBefore(e,t)}getChildByIndex(e,t){return e.childNodes[t]||null}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,n){e.style[t]=null!=n?n:""}syncTextContent(e,t){const n=Fr.replaceEmpty(t);e.textContent!==n&&(e.textContent=n)}removeStyle(e,t){e.style[t]=""}setAttribute(e,t,n){if(this.possibleXlinkNames[t])return void this.setXlinkAttribute(e,this.possibleXlinkNames[t],n);e.setAttribute(t,n);const r=e.tagName.toLowerCase(),o=this.booleanProps[r],s=this.valueProps[r];o&&o.includes(t)&&(e[t]=Boolean(n)),s&&s.includes(t)&&(e[t]=n)}removeAttribute(e,t){this.possibleXlinkNames[t]&&this.removeXlinkAttribute(e,this.possibleXlinkNames[t]),e.removeAttribute(t);const n=e.tagName.toLowerCase(),r=this.booleanProps[n],o=this.valueProps[n];r&&r.includes(t)&&(e[t]=!1),o&&o.includes(t)&&(e[t]="")}setXlinkAttribute(e,t,n){e.setAttributeNS(this.xlinkNameSpace,t,n)}removeXlinkAttribute(e,t){e.removeAttributeNS(this.xlinkNameSpace,t)}replace(e,t){t.parentNode.replaceChild(e,t)}copy(){document.execCommand("copy")}static replaceEmpty(e){return e.replace(/\s\s+/g,(e=>" "+Array.from({length:e.length-1}).fill(" ").join(""))).replace(/^\s|\s$/g," ")}};var Dr;zr=Fr=Tr([b()],zr);let _r=Dr=class{static parseHTML(e){return(new DOMParser).parseFromString(e,"text/html").body}constructor(e,t){var n;this.options=e,this.injector=t;const r=[...e.componentLoaders||[]],o=[...e.formatLoaders||[]],s=[...e.attributeLoaders||[]];null===(n=e.imports)||void 0===n||n.forEach((e=>{r.push(...e.componentLoaders||[]),o.push(...e.formatLoaders||[])})),this.componentLoaders=r,this.formatLoaders=o,this.attributeLoaders=s}parseDoc(e,t){const n=Dr.parseHTML(e);return t.read(n,this.injector,((e,t,n=t)=>this.readSlot(e,t,n)))}parse(e,t){const n=Dr.parseHTML(e);return this.readFormats(n,t)}readComponent(e,t){if(e.nodeType===Node.ELEMENT_NODE){if("BR"===e.tagName)return void t.insert("\n");for(const n of this.componentLoaders)if(n.match(e)){const r=n.read(e,this.injector,((e,t,n=t)=>this.readSlot(e,t,n)));return r instanceof _n?void r.toDelta().forEach((e=>t.insert(e.insert,e.formats))):void t.insert(r)}this.readFormats(e,t)}else if(e.nodeType===Node.TEXT_NODE){const n=e.textContent;if(/^\s*[\r\n]+\s*$/.test(n))return;t.insert(n)}}readFormats(e,t){const n=this.formatLoaders.filter((t=>t.match(e))).map((t=>t.read(e))),r=t.index;Array.from(e.childNodes).forEach((e=>{this.readComponent(e,t)}));const o=t.index;return this.applyFormats(t,n.map((e=>({formatter:e.formatter,value:e.value,startIndex:r,endIndex:o})))),t.retain(o),t}readSlot(e,t,n){return this.attributeLoaders.filter((e=>e.match(t))).forEach((n=>{const r=n.read(t);e.setAttribute(r.attribute,r.value)})),this.readFormats(n,e),e}applyFormats(e,t){e.background((()=>{t.forEach((t=>{e.retain(t.startIndex),e.retain(t.endIndex-t.startIndex,t.formatter,t.value)}))}))}};_r=Dr=Tr([b(),Ar(0,S(Mr)),Er("design:paramtypes",[Object,x])],_r);class qr{get rect(){return this.caret.getBoundingClientRect()}set display(e){this._display=e,this.caret.style.visibility=e?"visible":"hidden"}get display(){return this._display}constructor(e,t){this.scheduler=e,this.editorMask=t,this.compositionState=null,this.compositionElement=br("span",{styles:{textDecoration:"underline"}}),this.timer=null,this.oldPosition=null,this._display=!0,this.flashing=!0,this.subs=[],this.subscription=new _,this.positionChangeEvent=new j,this.styleChangeEvent=new j,this.oldRange=null,this.isFixed=!1,this.onPositionChange=this.positionChangeEvent.pipe(V()),this.onStyleChange=this.styleChangeEvent.asObservable(),this.elementRef=br("div",{styles:{position:"absolute",width:"2px",pointerEvents:"none"},children:[this.caret=br("span",{styles:{width:"100%",height:"100%",position:"absolute",left:0,top:0}})]}),this.subscription.add(K(document,"mousedown").subscribe((()=>{this.flashing=!1})),K(document,"mouseup").subscribe((()=>{this.flashing=!0}))),this.editorMask.appendChild(this.elementRef)}refresh(e=!1){this.isFixed=e,this.oldRange&&this.show(this.oldRange,!1),this.isFixed=!1}show(e,t){const n=this.elementRef.getBoundingClientRect();if(this.oldPosition={top:n.top,left:n.left,height:n.height},this.oldRange=e,(t||this.scheduler.lastChangesHasLocalUpdate)&&clearTimeout(this.timer),this.updateCursorPosition(e),e.collapsed){if(t||this.scheduler.lastChangesHasLocalUpdate){this.display=!0;const e=()=>{this.display=!this.display||!this.flashing,this.timer=setTimeout(e,400)};clearTimeout(this.timer),this.timer=setTimeout(e,400)}}else this.display=!1,clearTimeout(this.timer)}hide(){this.display=!1,clearTimeout(this.timer),this.positionChangeEvent.next(null)}destroy(){clearTimeout(this.timer),this.subscription.unsubscribe(),this.subs.forEach((e=>e.unsubscribe()))}correctScrollTop(e){this.subs.forEach((e=>e.unsubscribe())),this.subs=[];const t=this.scheduler;let n=!0;function r(t){const{top:n,bottom:r}=e.getLimit(),o=t.top;if(o+t.height>r){const n=o-r+t.height;e.setOffset(n)}else t.top<n&&e.setOffset(-(n-t.top))}let o=!1;this.subs.push(e.onScroll.subscribe((()=>{if(this.oldPosition){const e=this.rect;this.oldPosition.top=e.top,this.oldPosition.left=e.left,this.oldPosition.height=e.height}})),K(document,"mousedown",!0).subscribe((()=>{o=!0})),K(document,"mouseup",!0).subscribe((()=>{o=!1})),t.onDocChange.subscribe((()=>{n=!0})),this.onPositionChange.subscribe((s=>{if(s)if(n){if(t.lastChangesHasLocalUpdate)r(s);else if(this.oldPosition){const t=Math.floor(s.top-this.oldPosition.top);e.setOffset(t)}}else if(!o)if(this.isFixed&&this.oldPosition){const t=Math.floor(s.top-this.oldPosition.top);e.setOffset(t)}else r(s);n=!1})))}updateCursorPosition(e){const t=e.startContainer,n=t.nodeType===Node.ELEMENT_NODE?t:t.parentNode;if((null==n?void 0:n.nodeType)!==Node.ELEMENT_NODE)return void this.positionChangeEvent.next(null);if(this.compositionState){const t=this.compositionElement;t.innerText=this.compositionState.data,(e=e.cloneRange()).insertNode(t),e.selectNodeContents(t),e.collapse()}const r=yr(e),{fontSize:o,lineHeight:s,color:i}=getComputedStyle(n);let a;if(isNaN(+s)){const e=parseFloat(s);a=isNaN(e)?parseFloat(o):e}else a=parseFloat(o)*parseFloat(s);const l=Math.floor(Math.max(a,r.height));let c=r.top;r.height<a&&(c-=(a-r.height)/2),c=Math.floor(c);const u=this.editorMask.getBoundingClientRect(),h=Math.floor(c-u.top),d=Math.floor(r.left-u.left);Object.assign(this.elementRef.style,{left:d+"px",top:h+"px",height:l+"px",lineHeight:l+"px",fontSize:o}),this.caret.style.backgroundColor=i,this.styleChangeEvent.next({height:l+"px",lineHeight:l+"px",fontSize:o}),this.positionChangeEvent.next({left:d,top:c,height:l})}}let jr=class extends Nr{set disabled(e){this._disabled=e,e&&this.textarea&&(this.textarea.disabled=e)}get disabled(){return this._disabled}constructor(e,t,n,r,o,s,i){super(),this.parser=e,this.keyboard=t,this.commander=n,this.selection=r,this.controller=o,this.scheduler=s,this.injector=i,this.composition=!1,this.compositionState=null,this.caret=new qr(this.scheduler,this.injector.get(Or)),this.isSafari=kr(),this.isFirefox=Cr(),this.isMac=wr(),this.isWindows=xr(),this._disabled=!1,this.container=this.createEditableFrame(),this.subscription=new _,this.textarea=null,this.isFocus=!1,this.nativeFocus=!1,this.isSougouPinYin=!1,this.onReady=new Promise((e=>{this.subscription.add(K(this.container,"load").subscribe((()=>{const t=this.container.contentDocument;t.open(),t.write('\n<!DOCTYPE html>\n<html>\n<head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">\n <meta http-equiv="X-UA-Compatible" content="ie=edge">\n <title>Textbus</title>\n <style>\n html {position: fixed; left:0; overflow: hidden}\n html, body{height: 100%;width:100%}\n body{margin:0; overflow: hidden}\n textarea{width: 2000px;height: 100%;opacity: 0; padding: 0; outline: none; border: none; position: absolute; left:0; top:0;}\n </style>\n</head>\n<body>\n</body>\n</html>\n'),t.close(),this.doc=t,this.init(),e()})),o.onReadonlyStateChange.subscribe((()=>{o.readonly&&this.blur()})))})),this.caret.elementRef.append(this.container)}focus(e,t){var n;this.disabled||this.caret.show(e,t),this.controller.readonly||(this.isFocus||(null===(n=this.textarea)||void 0===n||n.focus(),setTimeout((()=>{var e,t,n;!this.nativeFocus&&this.isFocus&&(this.subscription.unsubscribe(),null===(t=null===(e=this.textarea)||void 0===e?void 0:e.parentNode)||void 0===t||t.removeChild(this.textarea),this.subscription=new _,this.init(),null===(n=this.textarea)||void 0===n||n.focus())}))),this.isFocus=!0)}blur(){var e;this.caret.hide(),null===(e=this.textarea)||void 0===e||e.blur(),this.isFocus=!1}destroy(){this.caret.destroy(),this.subscription.unsubscribe()}init(){const e=this.doc,t=e.body,n=e.createElement("textarea");n.disabled=this.disabled,t.appendChild(n),this.textarea=n,this.subscription.add(K(n,"blur").subscribe((()=>{this.isFocus=!1,this.nativeFocus=!1,this.caret.hide()})),K(n,"focus").subscribe((()=>{this.nativeFocus=!0})),this.caret.onStyleChange.subscribe((e=>{Object.assign(n.style,e)}))),this.handleInput(n),this.handleShortcut(n),this.handleDefaultActions(n)}handleDefaultActions(e){this.subscription.add(K(document,"copy").subscribe((e=>{const t=this.selection;if(t.isSelected&&t.startSlot===t.endSlot&&t.endOffset-t.startOffset==1&&"object"==typeof t.startSlot.getContentAtIndex(t.startOffset)){const t=e.clipboardData,n=document.getSelection().getRangeAt(0),r=document.createElement("div"),o=n.cloneContents();r.append(o),t.setData("text/html",r.innerHTML),t.setData("text",r.innerText),e.preventDefault()}})),K(e,"paste").subscribe((e=>{const t=e.clipboardData.getData("Text"),n=Array.from(e.clipboardData.files);if(n.length)return Promise.all(n.filter((e=>/image/i.test(e.type))).map((e=>{const t=new FileReader;return new Promise((n=>{t.onload=e=>{n(e.target.result)},t.readAsDataURL(e)}))}))).then((e=>{const n=e.map((e=>`<img src=${e}>`)).join("");this.handlePaste(n,t)})),void e.preventDefault();const r=this.doc.createElement("div");r.style.cssText="width:1px; height:10px; overflow: hidden; position: fixed; left: 50%; top: 50%; opacity:0",r.contentEditable="true",this.doc.body.appendChild(r),r.focus(),setTimeout((()=>{let e=r.innerHTML;!e&&t&&this.isFirefox&&(e=t),this.handlePaste(e,t),this.doc.body.removeChild(r)}))})))}handlePaste(e,t){const n=this.parser.parse(e,new _n([Fn.BlockComponent,Fn.InlineComponent,Fn.Text]));this.commander.paste(n,t)}handleShortcut(e){let t=!1,n=!1;this.subscription.add(K(e,"compositionstart").subscribe((()=>{t=!0})),K(e,"compositionend").subscribe((()=>{t=!1})),K(e,"beforeinput").subscribe((e=>{this.isSafari&&"insertFromComposition"===e.inputType&&(n=!0)})),K(e,"keydown").pipe(ce((()=>this.isSafari&&n?(n=!1,!1):!t))).subscribe((e=>{let t=e.key;"Process"===t&&/Digit\d/.test(e.code)&&e.shiftKey&&(t=")!@#$%^Z&*(".charAt(+e.code.substring(5)),this.isSougouPinYin=!0,e.preventDefault()),this.keyboard.execShortcut({key:t,altKey:e.altKey,shiftKey:e.shiftKey,ctrlKey:this.isMac?e.metaKey:e.ctrlKey})&&e.preventDefault()})))}handleInput(e){let t=0;this.subscription.add(K(e,"compositionstart").subscribe((()=>{this.composition=!0,this.caret.compositionState=this.compositionState=null,t=this.selection.startOffset;const e=this.selection.startSlot,n=new Vt(e,{index:t});Gt(e.parent,"onCompositionStart",n)})),K(e,"compositionupdate").subscribe((e=>{if(" "===e.data)return;const n=this.selection.startSlot;this.caret.compositionState=this.compositionState={slot:n,index:t,data:e.data},this.caret.refresh(!0);const r=new Vt(n,{index:t,data:e.data});Gt(n.parent,"onCompositionUpdate",r)})));let n=!1;this.subscription.add(J(K(e,"beforeinput").pipe(ce((e=>(e.preventDefault(),!(this.isFirefox&&"insertFromPaste"===e.inputType||(this.isSafari?(n="insertFromComposition"===e.inputType,"insertText"!==e.inputType&&"insertFromComposition"!==e.inputType):e.isComposing||!e.data))))),H((e=>e.data))),this.isSafari?new q:K(e,"compositionend").pipe(H((t=>(n=!0,t.preventDefault(),e.value="",t.data))),ce((()=>{const e=this.isSougouPinYin;return this.isSougouPinYin=!1,!e})))).subscribe((e=>{var t;if(this.composition=!1,this.caret.compositionState=this.compositionState=null,null===(t=this.caret.compositionElement.parentNode)||void 0===t||t.removeChild(this.caret.compositionElement),e&&this.commander.write(e),n){const e=this.selection.startSlot;if(e){const t=new Vt(e,null);Gt(e.parent,"onCompositionEnd",t)}}n=!1})))}createEditableFrame(){return br("iframe",{attrs:{scrolling:"no"},styles:{border:"none",width:"100%",display:"block",height:"100%",position:"relative",top:this.isWindows?"3px":"0"}})}};jr=Tr([b(),Er("design:paramtypes",[_r,hr,Zn,Vn,qn,ar,x])],jr);class Hr{set nativeRange(e){if(this._nativeRange=e,e){const t=e.cloneRange();t.collapse(!0);const n=yr(t);this.positionChangeEvent.next({left:n.left,top:n.top,height:n.height})}else this.positionChangeEvent.next(null)}get nativeRange(){return this._nativeRange}get rect(){if(this.nativeRange){const e=this.nativeRange.cloneRange();return e.collapse(!0),yr(e)}return{left:0,top:0,width:0,height:0}}constructor(e){this.scheduler=e,this.oldPosition=null,this._nativeRange=null,this.subs=[],this.positionChangeEvent=new j,this.onPositionChange=this.positionChangeEvent.pipe(V())}refresh(){}correctScrollTop(e){this.destroy();const t=this.scheduler;let n=!0;function r(t){const{top:n,bottom:r}=e.getLimit(),o=t.top;if(o+t.height>r){const n=o-r+t.height;e.setOffset(n)}else t.top<n&&e.setOffset(-(n-t.top))}let o=!1;this.subs.push(e.onScroll.subscribe((()=>{if(this.oldPosition){const e=this.rect;this.oldPosition.top=e.top,this.oldPosition.left=e.left,this.oldPosition.height=e.height}})),K(document,"mousedown",!0).subscribe((()=>{o=!0})),K(document,"mouseup",!0).subscribe((()=>{o=!1})),t.onDocChange.subscribe((()=>{n=!0})),this.onPositionChange.subscribe((s=>{if(s)if(n){if(t.lastChangesHasLocalUpdate)r(s);else if(this.oldPosition){const t=Math.floor(s.top-this.oldPosition.top);e.setOffset(t)}}else if(!o)if(this.oldPosition){const t=Math.floor(s.top-this.oldPosition.top);e.setOffset(t)}else r(s);n=!1})))}destroy(){this.subs.forEach((e=>e.unsubscribe())),this.subs=[]}}let Vr=class extends Nr{set disabled(e){this._disabled=e,this.controller.readonly?this.documentView.contentEditable="false":this.documentView.contentEditable=e?"false":"true"}get disabled(){return this._disabled}constructor(e,t,n,r,o,s,i,a){super(),this.injector=e,this.parser=t,this.scheduler=n,this.selection=r,this.keyboard=o,this.renderer=s,this.commander=i,this.controller=a,this.caret=new Hr(this.scheduler),this.composition=!1,this.compositionState=null,this.onReady=Promise.resolve(),this._disabled=!1,this.nativeSelection=document.getSelection(),this.subscription=new _,this.nativeRange=null,this.isSafari=kr(),this.isMac=wr(),this.isMobileBrowser=Sr(),this.isSougouPinYin=!1,this.documentView=e.get(Rr),a.readonly||(this.documentView.contentEditable="true"),this.subscription.add(a.onReadonlyStateChange.subscribe((()=>{this.documentView.contentEditable=a.readonly?"false":"true"}))),this.handleShortcut(this.documentView),this.handleInput(this.documentView),this.handleDefaultActions(this.documentView)}focus(e){this.controller.readonly||(this.caret.nativeRange=e,this.nativeRange=e)}blur(){if(this.nativeRange&&this.nativeSelection.rangeCount>0&&this.nativeSelection.getRangeAt(0)===this.nativeRange)return this.nativeSelection.removeAllRanges(),void(this.nativeRange=null)}destroy(){this.caret.destroy(),this.subscription.unsubscribe()}handleDefaultActions(e){this.subscription.add(K(document,"copy").subscribe((e=>{const t=this.selection;if(t.isSelected&&t.startSlot===t.endSlot&&t.endOffset-t.startOffset==1&&"object"==typeof t.startSlot.getContentAtIndex(t.startOffset)){const t=e.clipboardData,n=document.getSelection().getRangeAt(0),r=document.createElement("div"),o=n.cloneContents();r.append(o),t.setData("text/html",r.innerHTML),t.setData("text",r.innerText),e.preventDefault()}})),K(e,"paste").subscribe((e=>{const t=e.clipboardData.getData("Text"),n=Array.from(e.clipboardData.files);if(n.length)return Promise.all(n.filter((e=>/image/i.test(e.type))).map((e=>{const t=new FileReader;return new Promise((n=>{t.onload=e=>{n(e.target.result)},t.readAsDataURL(e)}))}))).then((e=>{const n=e.map((e=>`<img src=${e}>`)).join("");this.handlePaste(n,t)})),void e.preventDefault();const r=document.createElement("div");r.style.cssText="width:1px; height:10px; overflow: hidden; position: fixed; left: 50%; top: 50%; opacity:0",r.contentEditable="true",document.body.appendChild(r),r.focus(),setTimeout((()=>{const e=r.innerHTML;this.handlePaste(e,t),document.body.removeChild(r)}))})))}handlePaste(e,t){const n=this.parser.parse(e,new _n([Fn.BlockComponent,Fn.InlineComponent,Fn.Text]));this.commander.paste(n,t)}handleShortcut(e){let t=!1,n=!1;this.subscription.add(K(e,"compositionstart").subscribe((()=>{t=!0})),K(e,"compositionend").subscribe((()=>{t=!1})),K(e,"beforeinput").subscribe((e=>{this.isSafari&&"insertFromComposition"===e.inputType&&(n=!0)})),K(e,"keydown").pipe(ce((()=>this.isSafari&&n?(n=!1,!1):!t))).subscribe((e=>{let t=e.key;"Process"===t&&"Digit2"===e.code&&(t="@",this.isSougouPinYin=!0,e.preventDefault()),this.keyboard.execShortcut({key:t,altKey:e.altKey,shiftKey:e.shiftKey,ctrlKey:this.isMac?e.metaKey:e.ctrlKey})&&e.preventDefault()})))}handleInput(e){let t=0,n=!1;this.subscription.add(K(e,"compositionstart").subscribe((()=>{this.composition=!0,this.compositionState=null,t=this.selection.startOffset;const e=this.selection.startSlot,n=new Vt(e,{index:t});Gt(e.parent,"onCompositionStart",n)})),K(e,"compositionupdate").subscribe((e=>{const n=this.selection.startSlot;this.compositionState={slot:n,index:t,data:e.data};const r=new Vt(n,{index:t,data:e.data});Gt(n.parent,"onCompositionUpdate",r)})),J(K(e,"beforeinput").pipe(H((e=>{var t;if(e.preventDefault(),"insertCompositionText"===e.inputType)return null;if("insertReplacementText"===e.inputType){const n=e.getTargetRanges()[0],r=this.renderer.getLocationByNativeNode(n.startContainer),o=this.selection.startSlot;return this.selection.setBaseAndExtent(o,r.startIndex+n.startOffset,o,r.startIndex+n.endOffset),this.commander.delete(),(null===(t=e.dataTransfer)||void 0===t?void 0:t.getData("text"))||e.data||null}if(n="insertFromComposition"===e.inputType,n&&this.composition){if(!this.isMobileBrowser)return null;this.composition=!1,this.compositionState=null}return this.isSafari&&("insertText"===e.inputType||n)||!e.isComposing&&e.data?e.data:null})),ce((e=>e))),!this.isMobileBrowser&&this.isSafari?new q:K(e,"compositionend").pipe(ce((()=>this.composition)),H((e=>(n=!0,e.preventDefault(),e.data))),ce((()=>{const e=this.isSougouPinYin;return this.isSougouPinYin=!1,!e})))).subscribe((e=>{if(this.composition=!1,this.compositionState=null,e&&this.commander.write(e),n){const e=this.selection.startSlot;if(e){const t=new Vt(e,null);Gt(e.parent,"onCompositionEnd",t)}}n=!1})))}};var $r;Vr=Tr([b(),Er("design:paramtypes",[x,_r,ar,Vn,hr,or,Zn,qn])],Vr);let Ur=$r=class{constructor(){this.singleTagTest=new RegExp(`^(${$r.singleTags.join("|")})$`,"i")}transform(e){return e.children.map((e=>this.vDomToHTMLString(e))).join("")}vDomToHTMLString(e){const t=$r.simpleXSSFilter;if(e instanceof Tn)return this.replaceEmpty(t.text(e.textContent),"&nbsp;");const n=Array.from(e.styles.keys()).filter((t=>{const n=e.styles.get(t);return!(null==n||""===n)})).map((n=>{const r=n.replace(/(?=[A-Z])/g,"-").toLowerCase();return t.attrValue(`${r}:${e.styles.get(n)}`)})).join(";"),r=Array.from(e.attrs.keys()).filter((t=>"ref"!==t&&!1!==e.attrs.get(t))).map((n=>{const r=t.attrName(n),o=e.attrs.get(n);return!0===o?`${r}`:`${r}="${t.attrValue(`${o}`)}"`}));n&&r.push(`style="${n}"`),e.classes&&e.classes.size&&r.push(`class="${t.attrValue(Array.from(e.classes).join(" "))}"`);let o=r.join(" ");if(o=o?" "+o:"",this.singleTagTest.test(e.tagName))return`<${e.tagName}${o}>`;const s=e.children.map((e=>this.vDomToHTMLString(e))).join("");return[`<${e.tagName}${o}>`,s,`</${e.tagName}>`].join("")}replaceEmpty(e,t){return e.replace(/\s\s+/g,(e=>" "+Array.from({length:e.length-1}).fill(t).join(""))).replace(/^\s|\s$/g,t)}};Ur.singleTags="br,img,hr".split(","),Ur.simpleXSSFilter={text(e){return e.replace(/[><&]/g,(e=>({"<":"&lt;",">":"&gt;","&":"&amp;"}[e])))},attrName(e){return e.replace(/[><"'&]/g,(e=>({"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","&":"&amp;"}[e])))},attrValue(e){return e.replace(/["']/g,(e=>({'"':"&quot;","'":"&#x27;"}[e])))}},Ur=$r=Tr([b()],Ur);const Gr=ft("CoreEditor");class Wr extends gr{get readonly(){return this.controller.readonly}set readonly(e){this.controller.readonly=e}isFocus(){return this._isFocus}constructor(e,t,n={}){const r="textbus-"+Number((Math.random()+"").substring(2)).toString(16),{doc:o,mask:s,wrapper:i}=Wr.createLayout(r,n.minHeight),a=[{provide:Mr,useValue:n},{provide:Br,useValue:i},{provide:Rr,useValue:o},{provide:Or,useValue:s},{provide:gt,useExisting:zr},{provide:Hn,useExisting:Ir},{provide:Nr,useClass:n.useContentEditable?Vr:jr},{provide:Wr,useFactory:()=>this}];super(Object.assign(Object.assign({},n),{plugins:n.plugins||[],providers:[...n.providers||[],...a,zr,_r,Ir,Ur,Lr],setup:n.setup})),this.rootComponent=e,this.rootComponentLoader=t,this.options=n,this.destroyed=!1,this.isReady=!1,this.changeEvent=new j,this.subs=[],this._isFocus=!1,this.resourceNodes=[],this.focusEvent=new j,this.blurEvent=new j,this.saveEvent=new j,this.styleSheet="",this.scripts=[],this.links=[],this.id=r,this.workbench=i,this.onChange=this.changeEvent.asObservable(),this.onFocus=this.focusEvent.asObservable(),this.onBlur=this.blurEvent.asObservable(),this.onSave=this.saveEvent.asObservable(),this.controller=this.get(qn)}mount(e){const t=Object.create(null,{mount:{get:()=>super.mount}});return function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}l((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){if(this.destroyed)throw Gr("the editor instance is destroyed!");if(this.destroyed)return this;const n=this.get(_r),r=this.get($n),o=this.get(Rr);let s;this.initDefaultShortcut();const i=this.options.content;s=i?"string"==typeof i?n.parseDoc(i,this.rootComponentLoader):r.createComponentByFactory(i,this.rootComponent):this.rootComponent.createInstance(this),this.initDocStyleSheetsAndScripts(this.options),e.appendChild(this.workbench),yield t.mount.call(this,o,s);const a=this.get(or),l=this.get(Nr);return this.subs.push(a.onViewUpdated.subscribe((()=>{this.changeEvent.next()})),l.caret.onPositionChange.pipe(H((e=>!!e)),V()).subscribe((e=>{e?(this._isFocus=!0,this.focusEvent.next()):(this._isFocus=!1,this.blurEvent.next())}))),this.isReady=!0,this.options.autoFocus&&l.onReady.then((()=>{this.focus()})),this}))}focus(){this.guardReady();const e=this.get(Vn),t=this.get(bt);if(e.commonAncestorSlot)return void e.restore();const n=e.findFirstPosition(t.component.slots.get(0));e.setPosition(n.slot,n.offset),e.restore()}blur(){if(this.isReady){const e=this.get(Vn);e.unSelect(),e.restore()}}getResources(){var e;return{styleSheets:(null===(e=this.options)||void 0===e?void 0:e.styleSheets)||[],styleSheet:this.styleSheet,links:this.links,scripts:this.scripts}}getHTML(){this.guardReady();const e=this.get(dr),t=this.get(Ur),n=e.render();return t.transform(n)}getJSON(){return this.guardReady(),this.get(bt).component.toJSON()}destroy(){var e;this.destroyed||(this.destroyed=!0,this.subs.forEach((e=>e.unsubscribe())),[Nr].forEach((e=>{this.get(e).destroy()})),super.destroy(),null===(e=this.workbench.parentNode)||void 0===e||e.removeChild(this.workbench),this.resourceNodes.forEach((e=>{var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)})))}replaceContent(e){this.guardReady();const t=this.get(_r),n=this.get($n),r=this.get(bt),o=this.get(Vn),s=this.rootComponentLoader;let i;i="string"==typeof e?t.parseDoc(e,s):n.createComponentByFactory(e,this.rootComponent),o.unSelect(),r.component.slots.clean(),r.component.slots.push(...i.slots.toArray()),Gt(i,"onDestroy")}guardReady(){if(this.destroyed)throw Gr("the editor instance is destroyed!");if(!this.isReady)throw Gr("please wait for the editor to initialize before getting the content!")}initDefaultShortcut(){const e=this.get(Vn),t=this.get(hr),n=this.get(lr),r=this.get(Zn);t.addShortcut({keymap:{key:"s",ctrlKey:!0},action:()=>{this.saveEvent.next()}}),t.addShortcut({keymap:{key:"Enter"},action:()=>{r.break()}}),t.addShortcut({keymap:{key:"Enter",shiftKey:!0},action:()=>{const t=e.startOffset,n=e.startSlot,o=t===n.length||n.isEmpty,s=o?"\n\n":"\n";r.insert(s)&&o&&e.setPosition(n,t+1)}}),t.addShortcut({keymap:{key:["Delete","Backspace"]},action:e=>{r.delete("Backspace"===e)}}),t.addShortcut({keymap:{key:["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]},action:t=>{switch(t){case"ArrowLeft":e.toPrevious();break;case"ArrowRight":e.toNext();break;case"ArrowUp":e.toPreviousLine();break;case"ArrowDown":e.toNextLine()}}}),t.addShortcut({keymap:{key:["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"],shiftKey:!0},action:t=>{switch(t){case"ArrowLeft":e.wrapToBefore();break;case"ArrowRight":e.wrapToAfter();break;case"ArrowUp":e.wrapToPreviousLine();break;case"ArrowDown":e.wrapToNextLine()}}}),t.addShortcut({keymap:{key:"Tab"},action:()=>{r.insert(" ")}}),t.addShortcut({keymap:{key:"a",ctrlKey:!0},action:()=>{e.selectAll()}}),t.addShortcut({keymap:{key:"c",ctrlKey:!0},action:()=>{r.copy()}}),t.addShortcut({keymap:{key:"x",ctrlKey:!0},action:()=>{r.cut()}}),t.addShortcut({keymap:{key:"z",ctrlKey:!0},action:()=>{n.back()}}),t.addShortcut({keymap:{key:"z",ctrlKey:!0,shiftKey:!0},action:()=>{n.forward()}})}initDocStyleSheetsAndScripts(e){var t;const n=[];null===(t=e.imports)||void 0===t||t.forEach((e=>{n.push(...e.componentLoaders||[])})),n.push(...e.componentLoaders||[]);const r=n.filter((e=>e.resources)).map((e=>e.resources)),o=[],s=[];r.forEach((e=>{var t,n;Array.isArray(e.links)&&this.links.push(...e.links),o.push((null===(t=e.styles)||void 0===t?void 0:t.join(""))||""),s.push((null===(n=e.editModeStyles)||void 0===n?void 0:n.join(""))||"")})),this.links.forEach((e=>{const t=document.createElement("link");Object.assign(t,e),this.resourceNodes.push(t),document.head.appendChild(t)}));const i=document.createElement("style");o.push(...e.styleSheets||[]),s.push(`#${this.id} *::selection{background-color: rgba(18, 150, 219, .2); color:inherit}`,...e.editingStyleSheets||[]),this.styleSheet=Wr.cssMin(o.join("")),i.innerHTML=this.styleSheet+Wr.cssMin(s.join("")),this.resourceNodes.push(i),document.head.append(i),r.filter((e=>{var t;return null===(t=e.scripts)||void 0===t?void 0:t.length})).map((e=>e.scripts)).flat().forEach((e=>{if(e){const t=document.createElement("script");t.src=e,this.scripts.push(e),document.head.appendChild(t),this.resourceNodes.push(t)}}))}static createLayout(e,t="100%"){const n=br("div",{styles:{cursor:"text",wordBreak:"break-all",boxSizing:"border-box",minHeight:t,flex:1,outline:"none"},attrs:{"data-textbus-view":Rr},props:{id:e}}),r=br("div",{attrs:{"data-textbus-view":Or},styles:{position:"absolute",left:0,right:0,top:0,bottom:0,zIndex:1,pointerEvents:"none",overflow:"hidden"}});return{wrapper:br("div",{attrs:{"data-textbus-view":Br},styles:{display:"flex",minHeight:"100%",position:"relative",flexDirection:"column"},children:[n,r]}),doc:n,mask:r}}static cssMin(e){return e.replace(/\s*(?=[>{}:;,[])/g,"").replace(/([>{}:;,])\s*/g,"$1").replace(/;}/g,"}").replace(/\s+/," ").trim()}}const Kr=document.createElement("div"),Yr=[];for(let e=0;e<8;e++){const e=document.createElement("button");e.type="button",Yr.push(e)}const Xr=br("div",{classes:["textbus-image-video-resize"],children:[...Yr,Kr]});let Jr=null;function Zr(e,t){const n=zt(),r=Dt(),o=n.get(Vn),s=n.get(Br),i=n.get(or),a=Dt();let l=!1;const c=[];c.push(i.onViewUpdated.subscribe((()=>{l&&Jr&&Qr(Jr.current,s.getBoundingClientRect())})),o.onChange.subscribe((()=>{var e,t;const n=null===(e=a.parent)||void 0===e?void 0:e.indexOf(a);o.startSlot===a.parent&&o.endSlot===a.parent&&o.startOffset===n&&o.endOffset===n+1||(l=!1,null===(t=Xr.parentNode)||void 0===t||t.removeChild(Xr))})),K(Xr,"mousedown").subscribe((n=>{if(Jr!==e||!(null==Jr?void 0:Jr.current))return;s.style.pointerEvents="none";const r=e.current.getBoundingClientRect(),o=n.clientX,i=n.clientY,a=r.width,l=r.height,c=Math.sqrt(a*a+l*l);let u=a,h=l;const d=Yr.indexOf(n.target),p=K(document,"mousemove").subscribe((e=>{const t=e.clientX,n=e.clientY,r=t-o,p=n-i;let m,f,g,b;switch(d){case 0:case 4:g=a+r,b=l+p,m=Math.sqrt(g*g+b*b),f=m/c,0===d&&(f=1-(f-1)),u=a*f,h=l*f;break;case 2:g=a+r,b=l-p,m=Math.sqrt(g*g+b*b),f=m/c,u=a*f,h=l*f;break;case 6:g=a-r,b=l+p,m=Math.sqrt(g*g+b*b),m=Math.sqrt(g*g+b*b),f=m/c,u=a*f,h=l*f;break;case 1:h=l-p;break;case 5:h=l+p;break;case 3:u=a+r;break;case 7:u=a-r}Jr.current.style.width=u+"px",Jr.current.style.height=h+"px",Qr(Jr.current,s.getBoundingClientRect())})),m=K(document,"mouseup").subscribe((()=>{t({width:u+"px",height:h+"px"}),s.style.pointerEvents="",p.unsubscribe(),m.unsubscribe()}))}))),an((()=>{c.push(K(e.current,"click").subscribe((t=>{Jr=e,l=!0,o.selectComponent(r,!0),Qr(e.current,s.getBoundingClientRect()),s.appendChild(Xr),t.stopPropagation()})))})),fn((()=>{var e;l=!1,null===(e=Xr.parentNode)||void 0===e||e.removeChild(Xr),c.forEach((e=>e.unsubscribe()))}))}function Qr(e,t){const n=e.getBoundingClientRect();Xr.style.cssText=`left: ${n.left-t.left}px; top: ${n.top-t.top}px; width: ${n.width}px; height: ${n.height}px;`,Kr.innerText=`${Math.round(n.width)}px * ${Math.round(n.height)}px`}const eo=Ft({type:Fn.BlockComponent,name:"ParagraphComponent",setup(e){const t=zt(),n=_t((null==e?void 0:e.slots)||[new _n([Fn.Text,Fn.InlineComponent])]);return n.length||n.push(new _n([Fn.Text,Fn.InlineComponent])),ao(t,n),{render(e){return e(n.get(0),(e=>On.createElement("p",null,e)))}}}}),to={match(e){return"P"===e.tagName},read(e,t,n){const r=n(new _n([Fn.Text,Fn.InlineComponent]),e);return eo.createInstance(t,{slots:[r]})}};class no{constructor(e,t){this.target=e,this.rule=t,this.validators=[],this.excludeValidators=[],t.tags&&this.validators.push(this.makeTagsMatcher(t.tags)),t.styles&&this.validators.push(this.makeStyleMatcher(t.styles)),t.attrs&&this.validators.push(this.makeAttrsMatcher(t.attrs)),t.excludeStyles&&this.excludeValidators.push(this.makeStyleMatcher(t.excludeStyles)),t.excludeAttrs&&this.excludeValidators.push(this.makeAttrsMatcher(t.excludeAttrs))}match(e){return!(this.rule.filter&&!this.rule.filter(e))&&(!this.excludeValidators.map((t=>t(e))).includes(!0)&&this.validators.map((t=>t(e))).includes(!0))}extractFormatData(e,t){const n={};t.attrs&&t.attrs.forEach((t=>{n[t]=e.getAttribute(t)}));const r={};return t.styleName&&(Array.isArray(t.styleName)?t.styleName:[t.styleName]).forEach((t=>{const n=e.style[t];n&&(r[t]=n)})),{tag:t.tag?e.nodeName.toLowerCase():null,attrs:Object.keys(n).length?n:null,styles:r}}makeTagsMatcher(e){return t=>{const n=t.nodeName.toLowerCase();return Array.isArray(e)?e.includes(n):e.test(n)}}makeAttrsMatcher(e){return t=>e.map((e=>e.value?t.getAttribute(e.key)===e.value:t.hasAttribute(e.key))).includes(!0)}makeStyleMatcher(e){return t=>!Object.keys(e).map((n=>{const r=Array.isArray(e[n])?e[n]:[e[n]];let o=t.style[n];return"fontFamily"===n&&"string"==typeof o&&(o=o.replace(/['"]/g,"")),!!o&&r.map((e=>e instanceof RegExp?e.test(o):e===o)).includes(!0)})).includes(!1)}}class ro extends no{constructor(e){super(e,{tags:["a"]})}read(e){return{formatter:this.target,value:this.extractFormatData(e,{attrs:["target","href","data-href"]}).attrs}}}class oo{constructor(){this.name="link",this.columned=!1}render(e,t,n){return n!==zn.Editing?new On("a",{target:t.target,href:t.href||t["data-href"]},e):new On("a",{target:t.target,"data-href":t.href||t["data-href"]},e)}}const so=new oo,io=new ro(so);function ao(e,t){const n=e.get(Vn),r=e.get(Zn),o=Dt();dn((s=>{var i;const a=o.parent,l=a.indexOf(o);a.retain(l+1);const c=t.get(0),u=c.cut(s.data.index).toDelta(),h=new _n([Fn.Text,Fn.InlineComponent]);let d=0;for(;d<u.length;){const e=u[d];if(!h.insert(e.insert,e.formats))break;d++}h.isEmpty&&h.applyFormat(so,{startIndex:0,endIndex:1,value:null});const p=eo.createInstance(e,{slots:[h]}),m=a.getContentAtIndex(l-1);if(l===a.length-1&&m&&"string"!=typeof m&&["BlockComponent","ParagraphComponent","HeadingComponent"].includes(m.name)&&(null===(i=m.slots.get(0))||void 0===i?void 0:i.isEmpty)&&c.isEmpty&&h.isEmpty){const e=a.parentSlot;if(e){const t=e.indexOf(o.parentComponent);a.retain(a.index-2),a.delete(2),e.retain(t+1),e.insert(p)}}for(p.parent||a.insert(p),n.selectLastPosition(p);d<u.length;){const e=u[d];d++,r.insert(e.insert,e.formats)}n.setPosition(p.slots.get(0),0),s.preventDefault()}))}var lo,co=function(){function e(e){if(this.anchors=[],e.length<4)throw new Error("[Bezier]: the parameters should not be less than 4.");if(e.length%2!=0)throw new Error("[Bezier]: the parameter should be an even number.");for(var t={x:null,y:null},n=0;n<e.length;n++)n%2?(t.y=e[n],this.anchors.push(t),t={x:null,y:null}):t.x=e[n]}return e.prototype.update=function(t,n){for(var r=this.anchors;r.length>1;)"function"==typeof n&&n(r),r=e.next(r,t);return r[0]},e.next=function(e,t){for(var n=[],r=0;r<e.length-1;r++){var o=e[r],s=e[r+1];n.push({x:(s.x-o.x)*t+o.x,y:(s.y-o.y)*t+o.y})}return n},e}(),uo=(lo=function(e,t){return lo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},lo(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}lo(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),ho=function(e){function t(n,r,o,s){var i=e.call(this,[0,0,t.guard0To1(n),r,t.guard0To1(o),s,1,1])||this;return i.precision=1e-6,i}return uo(t,e),t.prototype.update=function(t,n){var r=this.newton(t);return e.prototype.update.call(this,r,n)},t.prototype.newton=function(t){for(var n=t,r=1;;){var o=e.prototype.update.call(this,t).x-n;if(Math.abs(o)<this.precision)return t;var s=void 0;o<0?s=(t+r)/2:(s=t/2,r=t),t=s}},t.guard0To1=function(e){return e<0?0:e>1?1:e},t}(co);function po(e=1,t=1){return new _n([Fn.InlineComponent,Fn.Text],{rowspan:t,colspan:e})}function mo(e,t){let n,r,o,s;e:for(let r=0;r<t.length;r++){const s=t[r].cellsPosition;for(let t=0;t<s.length;t++)if(s[t].cell===e){n=r,o=t;break e}}e:for(let n=t.length-1;n>-1;n--){const o=t[n].cellsPosition;for(let t=o.length-1;t>-1;t--)if(o[t].cell===e){r=n,s=t;break e}}return{minRow:n,maxRow:r,minColumn:o,maxColumn:s}}function fo(e,t,n,r,o){const s=-Math.max(...o.slice(e,n+1).map((e=>e.cellsPosition[t].offsetColumn))),i=Math.max(...o.slice(e,n+1).map((e=>e.cellsPosition[r].cell.state.colspan-(e.cellsPosition[r].offsetColumn+1)))),a=-Math.max(...o[e].cellsPosition.slice(t,r+1).map((e=>e.offsetRow))),l=Math.max(...o[n].cellsPosition.slice(t,r+1).map((e=>e.cell.state.rowspan-(e.offsetRow+1))));if(s||a||i||l)return fo(e+a,t+s,n+l,r+i,o);const c=o[e].cellsPosition[t],u=o[n].cellsPosition[r],h=o.slice(c.rowIndex,u.rowIndex+1).map((e=>e.cellsPosition.slice(c.columnIndex,u.columnIndex+1))).reduce(((e,t)=>e.concat(t))).map((e=>e.cell));return{selectedCells:Array.from(new Set(h)),startPosition:c,endPosition:u}}function go(e){const t=[];e.forEach(((e,n)=>{t[n]||(t[n]=[]);const r=t[n];let o=0;e.forEach((e=>{for(;r[o];)o++;let s=1;for(;s<e.state.colspan&&!r[o+s];)s++;e.updateState((t=>{t.rowspan=e.state.rowspan,t.colspan=s}));for(let r=n,i=e.state.rowspan+n;r<i;r++){t[r]||(t[r]=[]);const n=t[r];for(let t=o,r=o+s;t<r;t++)n[t]=e}o+=s}))}));const n=Math.max(...t.map((e=>e.length)));t.forEach((e=>{for(let t=0;t<n;t++)e[t]||(e[t]=po())}));const r=[];return t.map((e=>e.filter((e=>!r.includes(e)&&(r.push(e),!0)))))}function bo(e,t){const n=[];let r=0,o=0;for(let s=0;s<e.length;s++){const i=e[s],a=i.state,l=n[r];if(l){let e=!0;for(let n=0;n<t;n++)if(!l[n]){o=n,e=!1;break}if(e){o=0,r++,s--;continue}}for(let e=r;e<a.rowspan+r;e++){n[e]||(n[e]=[]);const t=n[e];for(let e=o;e<a.colspan+o;e++)t[e]=i}o=a.colspan+o-1,o===t-1&&(o=0,r++)}const s=[];return n.map((e=>e.filter((e=>!s.includes(e)&&(s.push(e),!0)))))}function vo(e){const t=[];for(let n=0;n<e.length;n++){const r=[];e[n].forEach(((t,o)=>{r.push({row:e[n],beforeCell:e[n][o-1],afterCell:e[n][o+1],offsetColumn:0,offsetRow:0,columnIndex:o,rowIndex:n,cell:t})})),t.push({beforeRow:e[n-1]||null,afterRow:e[n+1]||null,cellsPosition:r,cells:e[n]})}let n=!1,r=0;const o=[];do{let e=0;for(n=!1;e<t.length;){const s=t[e],i=s.cellsPosition[r];if(i){let a;if(i.rowIndex=e,i.columnIndex=r,i.offsetColumn+1<i.cell.state.colspan&&(a=`${e}*${r+1}`,-1===o.indexOf(a)&&(s.cellsPosition.splice(r+1,0,{beforeCell:i.beforeCell,afterCell:i.afterCell,cell:i.cell,row:s.cells,rowIndex:e,columnIndex:r,offsetColumn:i.offsetColumn+1,offsetRow:i.offsetRow}),o.push(a))),i.offsetRow+1<i.cell.state.rowspan&&(a=`${e+1}*${r}`,-1===o.indexOf(a))){let n=t[e+1];n||(n=Object.assign(Object.assign({},s),{cells:[],cellsPosition:[]}),t.push(n));const l=n.cellsPosition[r-1],c=n.cellsPosition[r];n.cellsPosition.splice(r,0,{beforeCell:l?l.cell:null,afterCell:c?c.cell:null,row:n.cells,cell:i.cell,offsetColumn:i.offsetColumn,offsetRow:i.offsetRow+1,rowIndex:e,columnIndex:r}),o.push(a)}n=!0}e++}r++}while(n);return t}function yo(e,t){for(var n;t;){if(e.slots.has(t))return t;t=null===(n=t.parent)||void 0===n?void 0:n.parent}return null}function xo(e,t,n,r){const o=vo(bo(n.slots.toArray(),r)),s=n.slots;if(e===s.first&&t===s.last){const e=o[o.length-1].cellsPosition,t=o.map((e=>e.cellsPosition)).flat().map((e=>e.cell));return{startPosition:o[0].cellsPosition[0],endPosition:e[e.length-1],selectedCells:Array.from(new Set(t))}}const i=mo(e,o),a=mo(t,o);return fo(Math.min(i.minRow,a.minRow),Math.min(i.minColumn,a.minColumn),Math.max(i.maxRow,a.maxRow),Math.max(i.maxColumn,a.maxColumn),o)}function wo(e,t,n,r){const o=zt(),s=o.get(or),i=o.get(Vn),a=o.get(Br),l=new ho(.25,.1,.25,.1),c=Dt(),u=[t.onChange.subscribe((e=>{n=e}))],h=br("div",{classes:["textbus-table-editor-mask"]});let d,p=!1;function m(){var e;p=!1,null===(e=h.parentNode)||void 0===e||e.removeChild(h)}function f(e){if(i.commonAncestorComponent===c){const t=a.getBoundingClientRect(),o=yo(c,i.startSlot),u=yo(c,i.endSlot);if(o&&u){const i=function(e,t,o){const i=xo(e,t,c,n.columnCount);r(i);const u=i.startPosition,m=i.endPosition,f=s.getNativeNodeByVNode(s.getVNodeBySlot(u.cell)),g=s.getNativeNodeByVNode(s.getVNodeBySlot(m.cell));if(!f||!g)return i;const b=f.getBoundingClientRect(),v=g.getBoundingClientRect(),y=h.getBoundingClientRect();return h.style.background=e===t?"none":"",p?function(e,t){function n(e){return e<0?Math.ceil(e):Math.floor(e)}cancelAnimationFrame(d);let r=0;const o=()=>{r++;const s=l.update(r/6).y,i=e.left+n((t.left-e.left)*s),a=e.top+n((t.top-e.top)*s),c=e.width+n((t.width-e.width)*s),u=e.height+n((t.height-e.height)*s);h.style.left=i+"px",h.style.top=a+"px",h.style.width=c+"px",h.style.height=u+"px",r<6&&(d=requestAnimationFrame(o))};d=requestAnimationFrame(o)}({left:y.left-o.left,top:y.top-o.top,width:y.width,height:y.height},{left:b.left-o.left,top:b.top-o.top,width:v.left+v.width-b.left,height:v.top+v.height-b.top}):(a.appendChild(h),p=!0,h.style.left=b.left-o.left+"px",h.style.top=b.top-o.top+"px",h.style.width=v.left+v.width-b.left+"px",h.style.height=v.top+v.height-b.top+"px"),i}(o,u,t);o!==u&&(null==e||e.useRanges(i.selectedCells.map((e=>({slot:e,startIndex:0,endIndex:e.length})))))}}else m()}gn((e=>{f(e)})),u.push(J(i.onChange,s.onViewUpdated).pipe(se(1)).subscribe((()=>{f()}))),fn((()=>{u.forEach((e=>e.unsubscribe())),m()}))}var ko;let Co=ko=class{constructor(e,t){this.defaultConfig=e,this.customConfig=t}get(e){const t=this.parse(e),n=this.getLabelByTokens(this.customConfig,t);if("string"==typeof n)return n;const r=this.getLabelByTokens(this.defaultConfig,t);return"string"==typeof r?r:""}getContext(e){const t=this.parse(e),n=this.getLabelByTokens(this.customConfig,t)||{},r=this.getLabelByTokens(this.defaultConfig,t)||{};return new ko(r,n)}joinTemplate(e,...t){return e.replace(/{\d+}/g,(e=>t[e.replace(/{\s*|\s*}/g,"")]||e))}parse(e){return e.split(/[.\[\]'"]+/g).map((e=>e.trim())).filter((e=>e))}getLabelByTokens(e,t){if(!e||0===t.length)return null;let n=e;for(let e=0;e<t.length;e++)if(n=n[t[e]],void 0===n)return null;return n}};Co=ko=function(e,t,n,r){var o,s=arguments.length,i=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,n,i):o(t,n))||i);return s>3&&i&&Object.defineProperty(t,n,i),i}([b(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Object,Object])],Co);const So=Ft({type:Fn.BlockComponent,name:"AlertComponent",setup(e){const t=_t((null==e?void 0:e.slots)||[]);let n=(null==e?void 0:e.state)||{type:"primary",fill:!1};const r=qt(n),o=zt().get(Co),s=r.onChange.subscribe((e=>{n=e}));fn((()=>{s.unsubscribe()})),0===t.length&&t.push(new _n([Fn.InlineComponent,Fn.Text]));const i=o.getContext("components.alertComponent.contextMenu");return on((e=>{e.useMenus([{label:n.fill?i.get("noFill"):i.get("fill"),onClick(){r.update((e=>{e.fill=!n.fill}))}},{label:i.get("type"),submenu:"default,primary,info,success,warning,danger,dark,gray".split(",").map((e=>({label:e,onClick(){r.update((t=>{t.type=e}))}})))}])})),{render(e){const r=["tb-alert"];return n.fill&&r.push("tb-alert-fill"),n.type&&r.push("tb-alert-"+n.type),On.createElement("tb-alert",{"data-type":n.type,class:r.join(" ")},e(t.get(0),(e=>On.createElement("div",null,e))))}}}}),To={match(e){return"tb-alert"===e.tagName.toLowerCase()},read(e,t,n){return So.createInstance(t,{state:{fill:e.classList.contains("tb-alert-fill"),type:e.dataset.type||""},slots:[n(new _n([Fn.InlineComponent,Fn.Text]),e.children[0]||document.createElement("div"))]})}},Ao=Ft({name:"AudioComponent",type:Fn.InlineComponent,setup(e){let t=(null==e?void 0:e.state)||{src:"",autoplay:!1,controls:!0};const n=qt(t);return n.onChange.subscribe((e=>{t=e})),{render(){return On.createElement("audio",{src:t.src,autoplay:t.autoplay,controls:t.controls})},toJSON(){return Object.assign({},t)},mergeProps(e){t=n.update((t=>{Object.assign(t,e)}))}}}}),Eo={match(e){return"audio"===e.nodeName.toLowerCase()},read(e,t){return Ao.createInstance(t,{state:{src:e.src,autoplay:e.autoplay,controls:e.controls}})}},Mo=Ft({type:Fn.BlockComponent,name:"BlockComponent",setup(e){const t=zt(),n=_t((null==e?void 0:e.slots)||[new _n([Fn.Text,Fn.InlineComponent,Fn.BlockComponent])]);return n.length||n.push(new _n([Fn.Text,Fn.InlineComponent,Fn.BlockComponent])),ao(t,n),{render(e){return e(n.get(0),(e=>On.createElement("div",null,e)))}}}}),Bo={match(e){return"DIV"===e.tagName},read(e,t,n){const r=n(new _n([Fn.Text,Fn.BlockComponent,Fn.InlineComponent]),e),o=r.sliceContent().some((e=>"string"==typeof e||e.type===Fn.InlineComponent));return o?Mo.createInstance(t,{slots:[r]}):r}},Ro=Ft({type:Fn.BlockComponent,name:"BlockquoteComponent",zenCoding:{key:" ",match:/^>$/,generateInitData(){return{slots:[new _n([Fn.Text,Fn.InlineComponent,Fn.BlockComponent])]}}},setup(e){const t=_t((null==e?void 0:e.slots)||[new _n([Fn.Text,Fn.InlineComponent,Fn.BlockComponent])]);return t.length||t.push(new _n([Fn.Text,Fn.InlineComponent,Fn.BlockComponent])),{render(e){return e(t.get(0),(e=>On.createElement("div",{class:"tb-blockquote"},e)))}}}}),Oo={resources:{styles:[""]},match(e){return"BLOCKQUOTE"===e.tagName},read(e,t,n){const r=n(new _n([Fn.Text,Fn.BlockComponent,Fn.InlineComponent]),e);return Ro.createInstance(t,{slots:[r]})}},No=Ft({type:Fn.BlockComponent,name:"HeadingComponent",zenCoding:{key:" ",match(e){return/^#{1,6}$/.test(e)},generateInitData(e){return{state:"h"+e.length}}},setup(e){const t=zt(),n=_t((null==e?void 0:e.slots)||[new _n([Fn.Text,Fn.InlineComponent])]);return n.length||n.push(new _n([Fn.Text,Fn.InlineComponent])),ao(t,n),{type:(null==e?void 0:e.state)||"h1",render(t){return t(n.get(0),(t=>{const n=(null==e?void 0:e.state)||"h1";return On.createElement(n,null,t)}))}}}}),Io={match(e){return/^h[1-6]$/i.test(e.tagName)},read(e,t,n){const r=n(new _n([Fn.Text,Fn.InlineComponent]),e);return No.createInstance(t,{slots:[r],state:e.tagName.toLowerCase()})}};class Po{constructor(e){this.config=e,this.completeEvent=new j,this.cancelEvent=new j,this.onComplete=this.completeEvent.asObservable(),this.onCancel=this.cancelEvent.asObservable(),this.elementRef=br("form",{classes:[e.mini?"textbus-form-mini":"textbus-form"],attrs:{novalidate:!0,autocomplete:"off"}}),e.title&&this.elementRef.appendChild(br("h3",{classes:["textbus-form-title"],children:[vr(e.title)]})),this.elementRef.appendChild(this.body=br("div",{attrs:{novalidate:"novalidate"},classes:e.mini?[]:["textbus-form-body"],children:e.items.map((e=>e.elementRef))}));const t=e.mini?[br("button",{attrs:{type:"submit"},classes:["textbus-btn","textbus-btn-block","textbus-btn-primary"],children:[vr(this.config.confirmBtnText||"确定")]})]:[br("button",{attrs:{type:"submit"},classes:["textbus-btn","textbus-btn-primary"],children:[vr(this.config.confirmBtnText||"确定")]}),(()=>{const e=br("button",{classes:["textbus-btn","textbus-btn-default"],attrs:{type:"button"},children:[vr(this.config.cancelBtnText||"取消")]});return e.addEventListener("click",(()=>{this.cancelEvent.next()})),e})()];this.elementRef.appendChild(this.footer=br("div",{classes:["textbus-form-footer"],children:t})),this.elementRef.addEventListener("submit",(t=>{t.preventDefault();const n={};for(const t of e.items){if(!t.validate())return;const e=t.getAttr();e&&(n[e.name]=e.value)}this.completeEvent.next(n)}))}addItem(e,t){if("number"==typeof t){const n=this.config.items[t];if(n)return this.config.items.splice(t,0,e),void this.elementRef.insertBefore(e.elementRef,n.elementRef)}this.config.items.push(e),this.body.appendChild(e.elementRef)}removeItem(e){var t;const n=this.config.items.indexOf(e);n>-1&&(this.config.items.splice(n,1),null===(t=e.elementRef.parentNode)||void 0===t||t.removeChild(e.elementRef))}reset(){this.config.items.forEach((e=>{e.reset()}))}update(e){Object.keys(e).forEach((t=>{this.config.items.forEach((n=>{n.name===t&&n.update(e[t])}))}))}}class Lo{constructor(e){this.config=e,this.elementRef=br("div",{classes:["textbus-form-group"],children:[br("div",{classes:["textbus-control-label"],children:[vr(this.config.label)]}),br("div",{classes:["textbus-control-value"],children:[br("button",{classes:["textbus-btn","textbus-btn-dark"],attrs:{type:"button"},on:{click:()=>{this.config.onClick()}},children:[br("span",{classes:this.config.iconClasses}),vr(" "+this.config.btnText)]})]})]}),this.name=this.config.name}reset(){}update(){}getAttr(){return{name:this.name,value:this.config.value}}validate(){return!0}}class Fo{constructor(e){this.config=e,this.elementRef=document.createElement("input"),this.name=e.name,this.value=e.value,this.elementRef.type="hidden",this.elementRef.value=e.value+""}reset(){}update(){}getAttr(){return{name:this.name,value:this.value}}validate(){return!0}}class zo{constructor(e){this.config=e,this.elementRef=document.createElement("div"),this.name=e.name,this.elementRef.classList.add("textbus-form-group"),this.elementRef.innerHTML=`\n <div class="textbus-control-label">${e.label}</div>\n <div class="textbus-control-value">\n <div class="textbus-input-group textbus-input-block">\n <input name="${e.name}" class="textbus-form-control textbus-input-block" placeholder="${e.placeholder||""}" type="number" value="${e.value||""}">\n </div>\n <div class="textbus-control-feedback-invalid"></div>\n </div>`,this.input=this.elementRef.querySelector("input"),this.feedbackEle=this.elementRef.querySelector(".textbus-control-feedback-invalid")}reset(){this.input.value=this.config.value||null}update(e){this.input.value=(null!=e?e:this.config.value)||""}getAttr(){return{name:this.config.name,value:Number(this.input.value)}}validate(){var e,t;const n=null===(t=(e=this.config).validateFn)||void 0===t?void 0:t.call(e,this.getAttr().value);return this.feedbackEle.innerText=n||"",!n}}class Do{constructor(e){this.config=e,this.elementRef=document.createElement("div"),this.name=e.name,this.elementRef.classList.add("textbus-form-group"),this.elementRef.innerHTML=`\n <div class="textbus-control-label">${e.label}</div>\n <div class="textbus-control-static">\n <div>${e.values.map((t=>`<label>\n <input type="radio" ${t.default?'checked="checked"':""} name="${e.name}" value="${t.value}">\n ${t.label}\n </label>`)).join("")}</div>\n <div class="textbus-control-feedback-invalid"></div>\n </div>\n `,this.inputs=Array.from(this.elementRef.querySelectorAll("input")),this.feedbackEle=this.elementRef.querySelector(".textbus-control-feedback-invalid")}reset(){const e=this.config.values;for(let t=0;t<e.length;t++)this.inputs[t].checked=!!e[t].default}update(e){const t=this.config.values;let n=!1;for(let r=0;r<t.length;r++){if(t[r].value===e){this.inputs[r].checked=!0,n=!0;break}this.inputs[r].checked=!0}n||this.config.values.forEach(((e,t)=>{e.default&&(this.inputs[t].checked=!0)}))}getAttr(){const e=this.inputs;let t;for(let n=0;n<e.length;n++)if(e[n].checked){t=this.config.values[n].value;break}return{name:this.config.name,value:t}}validate(){var e,t;const n=null===(t=(e=this.config).validateFn)||void 0===t?void 0:t.call(e,this.getAttr().value);return this.feedbackEle.innerText=n||"",!n}}class _o{constructor(e){this.config=e,this.elementRef=document.createElement("div"),this.name=e.name,this.elementRef.classList.add("textbus-form-group"),this.elementRef.innerHTML=`\n <div class="textbus-control-label">${e.label}</div>\n <div class="textbus-control-value">\n <select class="textbus-form-control" name="${e.name}">${e.options.map((e=>`<option ${e.selected?"selected":""} value="${e.value}">${e.label}</option>`)).join("")}</select>\n </div>\n <div class="textbus-control-feedback-invalid"></div>`,this.select=this.elementRef.querySelector("select"),this.feedbackEle=this.elementRef.querySelector(".textbus-control-feedback-invalid")}reset(){let e;this.config.options.forEach((t=>{t.selected&&(e=t.value)})),this.update(e)}update(e){this.config.options.forEach(((t,n)=>{this.select.options.item(n).selected=t.value===e}))}getAttr(){return{name:this.config.name,value:this.select.value}}validate(){var e,t;const n=null===(t=(e=this.config).validateFn)||void 0===t?void 0:t.call(e,this.getAttr().value);return this.feedbackEle.innerText=n||"",!n}}class qo{constructor(e){this.config=e,this.elementRef=br("div",{classes:["textbus-form-group"],children:[e.label?br("div",{classes:["textbus-control-label"],children:[vr(e.label)]}):null,br("div",{classes:["textbus-control-value"],children:["string"==typeof e.content?vr(e.content):e.content]})]})}reset(){}update(){}getAttr(){return null}validate(){return!0}}class jo{constructor(e){this.config=e,this.elementRef=document.createElement("div"),this.name=e.name,this.elementRef.classList.add("textbus-form-group"),this.elementRef.innerHTML=`\n <div class="textbus-control-label"></div>\n <div class="textbus-control-static">\n <label><input name="${e.name}" type="checkbox" ${e.checked?'checked="checked"':""}> ${e.label}</label>\n <div class="textbus-control-feedback-invalid"></div>\n </div>\n `,this.input=this.elementRef.querySelector("input"),this.feedbackEle=this.elementRef.querySelector(".textbus-control-feedback-invalid")}reset(){this.input.checked=this.config.checked}update(e){this.input.checked="boolean"==typeof e?e:this.config.checked}getAttr(){return{name:this.name,value:this.input.checked}}validate(){var e,t;const n=null===(t=(e=this.config).validateFn)||void 0===t?void 0:t.call(e,this.getAttr().value);return this.feedbackEle.innerText=n||"",!n}}class Ho{constructor(e){this.config=e,this.elementRef=document.createElement("div"),this.name=e.name,this.elementRef.classList.add("textbus-form-group"),this.elementRef.innerHTML=`\n <div class="textbus-control-label">${e.label}</div>\n <div class="textbus-control-value">\n <div class="textbus-input-group textbus-input-block">\n <input name="${e.name}" class="textbus-form-control textbus-input-block" placeholder="${e.placeholder||""}" type="text" value="${e.value||""}">${e.canUpload?`<button type="button" class="textbus-btn textbus-btn-dark" title="${e.uploadBtnText||""}">\n <span class="textbus-icon-upload"></span>\n </button>`:""}\n </div>\n <div class="textbus-control-feedback-invalid"></div>\n </div>`,this.input=this.elementRef.querySelector("input"),this.feedbackEle=this.elementRef.querySelector(".textbus-control-feedback-invalid"),e.canUpload&&(this.btn=this.elementRef.querySelector("button"),this.btn.addEventListener("click",(()=>{var e;this.btn.classList.add("textbus-btn-loading"),this.input.disabled=!0,this.btn.children[0].className="textbus-icon-loading",this.sub&&this.sub.unsubscribe(),this.sub=null===(e=this.config.fileUploader)||void 0===e?void 0:e.upload({uploadType:this.config.uploadType,currentValue:this.input.value,multiple:!1}).subscribe({next:e=>{this.update(e)},error:()=>{this.uploaded()},complete:()=>{this.uploaded()}})})))}reset(){this.input.value=this.config.value||""}update(e){this.uploaded(),this.input.value=(null!=e?e:this.config.value)||""}getAttr(){return{name:this.config.name,value:this.input.value}}validate(){var e,t;const n=null===(t=(e=this.config).validateFn)||void 0===t?void 0:t.call(e,this.getAttr().value);return this.feedbackEle.innerText=n||"",!n}uploaded(){this.sub&&this.sub.unsubscribe(),this.input.disabled=!1,this.btn&&(this.btn.classList.remove("textbus-btn-loading"),this.btn.children[0].className="textbus-icon-upload")}}class Vo{constructor(e){this.config=e,this.elementRef=document.createElement("div"),this.name=e.name,this.elementRef.classList.add("textbus-form-group"),this.elementRef.innerHTML=`\n <div class="textbus-control-label">${e.label}</div>\n <div class="textbus-control-value">\n <div class="textbus-input-group textbus-input-block">\n <textarea name="${e.name}" style="width: ${e.width||"auto"}; height: ${e.height||"auto"}" class="textbus-form-control textbus-input-block" placeholder="${e.placeholder||""}">${e.value||""}</textarea>\n </div>\n <div class="textbus-control-feedback-invalid"></div>\n </div>`,this.input=this.elementRef.querySelector("textarea"),this.feedbackEle=this.elementRef.querySelector(".textbus-control-feedback-invalid")}reset(){this.input.value=this.config.value}update(e){this.uploaded(),this.input.value=(null!=e?e:this.config.value)||""}getAttr(){return{name:this.config.name,value:this.input.value}}validate(){var e,t;const n=null===(t=(e=this.config).validateFn)||void 0===t?void 0:t.call(e,this.getAttr().value);return this.feedbackEle.innerText=n||"",!n}uploaded(){this.sub&&this.sub.unsubscribe(),this.input.disabled=!1,this.btn&&(this.btn.classList.remove("textbus-btn-loading"),this.btn.children[0].className="textbus-icon-upload")}}class $o{}let Uo=class{constructor(e){this.controller=e,this.timer=null,this.subs=[],this.elementRef=br("div",{classes:["textbus-dialog"],children:[this.dialogWrapper=br("div",{classes:["textbus-dialog-wrapper"]})]}),document.body.appendChild(this.elementRef),this.subs.push(this.controller.onReadonlyStateChange.subscribe((()=>{this.controller.readonly&&this.hide()})))}show(e){this.dialogWrapper.innerHTML="",this.dialogWrapper.appendChild(e),this.elementRef.classList.add("textbus-dialog-active"),this.timer=setTimeout((()=>{this.dialogWrapper.classList.add("textbus-dialog-wrapper-active")}),200)}hide(){this.dialogWrapper.classList.remove("textbus-dialog-wrapper-active"),this.timer=setTimeout((()=>{this.elementRef.classList.remove("textbus-dialog-active"),this.dialogWrapper.innerHTML=""}),200)}destroy(){var e;clearTimeout(this.timer),this.subs.forEach((e=>e.unsubscribe())),null===(e=this.elementRef.parentNode)||void 0===e||e.removeChild(this.elementRef)}};Uo=function(e,t,n,r){var o,s=arguments.length,i=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,n,i):o(t,n))||i);return s>3&&i&&Object.defineProperty(t,n,i),i}([b(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],Uo);class Go{constructor(e){this.name="margin",this.inputs=[],this.elementRef=br("div",{classes:["textbus-form-group"],children:[br("label",{classes:["textbus-control-label"],children:[vr(e)]}),br("div",{classes:["textbus-control-static"],children:[br("div",{classes:["textbus-toolbar-image-margin-setter"],children:Array.from({length:4}).fill(null).map((()=>br("input",{attrs:{type:"text",value:"0"},classes:["textbus-form-control"]})))})]})]}),this.inputs=Array.from(this.elementRef.querySelectorAll("input"))}reset(){this.inputs.forEach((e=>e.value=""))}update(e){this.reset(),e&&(e+"").split(/\s+/g).forEach(((e,t)=>{this.inputs[t].value=e}))}getAttr(){return{name:this.name,value:this.inputs.map((e=>Number(e.value)?e.value+"px":e.value||"0")).join(" ")}}validate(){return!0}}class Wo{constructor(e,t){this.name=e,this.i18n=t,this.inputs=[],this.elementRef=br("div",{classes:["textbus-form-group"],children:[br("label",{classes:["textbus-control-label"],children:[vr(t.get("label"))]}),br("div",{classes:["textbus-control-value"],children:[br("div",{classes:["textbus-toolbar-image-size-setter"],children:[br("input",{attrs:{type:"text",placeholder:t.get("widthPlaceholder")},classes:["textbus-form-control"]}),vr(" * "),br("input",{attrs:{type:"text",placeholder:t.get("heightPlaceholder")},classes:["textbus-form-control"]})]})]})]}),this.inputs=Array.from(this.elementRef.querySelectorAll("input"))}reset(){this.inputs.forEach((e=>e.value=""))}update(e){this.inputs[0].value=(null==e?void 0:e.width)||"",this.inputs[1].value=(null==e?void 0:e.height)||""}getAttr(){return{name:this.name,value:{width:this.inputs[0].value,height:this.inputs[1].value}}}validate(){return!0}}const Ko=Ft({type:Fn.InlineComponent,name:"ImgComponent",setup(e){let t=(null==e?void 0:e.state)||{src:""};const n=qt(t);n.onChange.subscribe((e=>{t=e}));const r=jt();Zr(r,(e=>{n.update((t=>{Object.assign(t,e)}))}));const o=zt(),s=o.get($o),i=o.get(Co),a=o.get(Uo),l=i.getContext("components.imageComponent.contextMenu");return on((e=>{e.useMenus([{label:l.get("title"),iconClasses:["textbus-icon-image"],onClick(){const e=new Po({title:l.get("title"),cancelBtnText:l.get("cancelBtnText"),confirmBtnText:l.get("confirmBtnText"),items:[new Ho({label:l.get("linkLabel"),name:"src",placeholder:l.get("linkInputPlaceholder"),canUpload:!0,uploadType:"image",uploadBtnText:l.get("uploadBtnText"),fileUploader:s,validateFn(e){return!e&&l.get("validateErrorMessage")}}),new Wo("size",l.getContext("sizeSetter")),new Wo("maxSize",l.getContext("maxSizeSetter")),new Do({label:l.get("float.label"),name:"float",values:[{label:l.get("float.noFloatLabel"),value:"none",default:!0},{label:l.get("float.floatToLeftLabel"),value:"left"},{label:l.get("float.floatToRightLabel"),value:"right"}]}),new Go(l.get("marginLabel"))]});e.update({src:t.src,margin:t.margin,float:t.float,size:{width:t.width,height:t.height},maxSize:{width:t.maxWidth,height:t.maxHeight}}),a.show(e.elementRef);const r=new _;r.add(e.onComplete.subscribe((e=>{const t={src:e.src,margin:e.margin,float:e.float,maxWidth:e.maxSize.width,maxHeight:e.maxSize.height,width:e.size.width,height:e.size.height};n.update((e=>{Object.assign(e,t)})),a.hide(),r.unsubscribe()}))),r.add(e.onCancel.subscribe((()=>{a.hide(),r.unsubscribe()})))}}])})),{render(){return On.createElement("img",{src:t.src,ref:r,class:"tb-img",style:{width:t.width,height:t.height,maxWidth:t.maxWidth,maxHeight:t.maxHeight,margin:t.margin,float:t.float}})}}}}),Yo={match(e){return"IMG"===e.tagName},read(e,t){const n=e.style;return Ko.createInstance(t,{state:{src:e.getAttribute("src")||"",width:n.width,height:n.height,margin:n.margin,float:n.float,maxWidth:n.maxWidth,maxHeight:n.maxHeight}})}},Xo="data:image/svg+xml;charset=UTF-8,"+encodeURIComponent('<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg"><g><rect fill="#555" height="100%" width="100%"/></g><g><text font-family="Helvetica, Arial, sans-serif" font-size="24" y="50%" x="50%" text-anchor="middle" dominant-baseline="middle" stroke-width="0" stroke="#000" fill="#000000">Image</text></g></svg>'),Jo=Ft({type:Fn.BlockComponent,separable:!1,name:"ImageCardComponent",setup(e){let t=(null==e?void 0:e.state)||{src:Xo,height:"200px"};const n=qt(t),r=zt(),o=r.get(Uo),s=r.get(Zn),i=r.get(Vn),a=r.get(Co),l=r.get($o),c=_t((null==e?void 0:e.slots)||[]);if(0===c.length){const e=new _n([Fn.Text]);e.insert("图片名称"),c.push(e)}const u=n.onChange.subscribe((e=>{t=e}));fn((()=>{u.unsubscribe()}));const h=Dt();dn((e=>{const t=e.target.cutTo(new _n([Fn.InlineComponent,Fn.Text]),e.data.index),n=eo.createInstance(r,{slots:[t]});s.insertAfter(n,h),e.preventDefault(),i.selectFirstPosition(n)}));const d=a.getContext("components.imageCardComponent.setting");function p(){const e=new Po({title:d.get("title"),confirmBtnText:d.get("confirmBtnText"),cancelBtnText:d.get("cancelBtnText"),items:[new Ho({label:d.get("srcLabel"),uploadType:"image",canUpload:!0,value:t.src,name:"src",placeholder:d.get("srcPlaceholder"),fileUploader:l}),new Ho({label:d.get("heightLabel"),name:"height",value:t.height,placeholder:d.get("heightPlaceholder")})]});o.show(e.elementRef),e.onComplete.subscribe((e=>{n.update((t=>{Object.assign(t,e)})),o.hide()})),e.onCancel.subscribe((()=>{o.hide()}))}return{render(e){return On.createElement("tb-image-card",{"data-src":t.src,"data-height":t.height},On.createElement("div",{onClick:p},On.createElement("img",{src:t.src,style:{height:t.height}})),e(c.get(0),(e=>On.createElement("p",null,e))))}}}}),Zo={match(e){return"tb-image-card"===e.nodeName.toLowerCase()},read(e,t,n){const r=e.querySelector("p"),o=new _n([Fn.Text]);return Jo.createInstance(t,{state:{height:e.dataset.height,src:e.dataset.src},slots:[r?n(o,r):o]})}};function Qo(e){const t=new _n([Fn.Text,Fn.InlineComponent,Fn.BlockComponent]),n=No.createInstance(e);n.slots.first.insert("Hello, world!");const r=eo.createInstance(e);r.slots.first.insert("你好,我是 Textbus一个给你带来全新体验的富文本开发框架。");const o=eo.createInstance(e);return o.slots.first.insert("现在我们开始吧!"),t.insert(n),t.insert(r),t.insert(o),t}const es=Ft({type:Fn.BlockComponent,name:"JumbotronComponent",setup(e){const t=_t((null==e?void 0:e.slots)||[]),n=zt(),r=n.get(Uo),o=n.get(Co),s=n.get($o);0===t.length&&t.push(Qo(n));let i=(null==e?void 0:e.state)||{minHeight:"200px",backgroundImage:"",backgroundPosition:"center",backgroundSize:"cover"};const a=qt(i),l=a.onChange.subscribe((e=>{i=e}));fn((()=>{l.unsubscribe()}));const c=o.getContext("components.jumbotronComponent").getContext("setting.form");function u(){const e=new Po({title:c.get("title"),confirmBtnText:c.get("confirmBtnText"),cancelBtnText:c.get("cancelBtnText"),items:[new Ho({name:"minHeight",value:"200px",placeholder:c.get("minHeightInputPlaceholder"),label:c.get("minHeightLabel")}),new Ho({label:c.get("backgroundImageLabel"),name:"backgroundImage",value:i.backgroundImage,placeholder:c.get("backgroundImageInputPlaceholder"),canUpload:!0,uploadType:"image",fileUploader:s,uploadBtnText:c.get("uploadBtnText"),validateFn(e){return!e&&c.get("validateErrorMessage")}})]});r.show(e.elementRef);const t=e.onComplete.subscribe((e=>{a.update((t=>{Object.assign(t,e)})),r.hide(),t.unsubscribe(),n.unsubscribe()})),n=e.onCancel.subscribe((()=>{r.hide(),t.unsubscribe(),n.unsubscribe()}))}return{render(e,n){return On.createElement("tb-jumbotron",{style:{backgroundImage:i.backgroundImage?`url("${i.backgroundImage}")`:null,backgroundSize:i.backgroundSize||"cover",backgroundPosition:i.backgroundPosition||"center",minHeight:i.minHeight}},n===zn.Editing&&On.createElement("button",{type:"button",class:"tb-jumbotron-setting",onClick:u},On.createElement("span",{class:"textbus-icon-setting"})),e(t.get(0),(e=>On.createElement("div",null,e))))}}}}),ts={match(e){return"tb-jumbotron"===e.nodeName.toLowerCase()},read(e,t,n){const r=e.style;return es.createInstance(t,{state:{backgroundImage:(r.backgroundImage||"").replace(/^url\(['"]?|['"]?\)$/g,""),backgroundSize:r.backgroundSize,backgroundPosition:r.backgroundPosition,minHeight:r.minHeight},slots:[n(new _n([Fn.BlockComponent,Fn.InlineComponent,Fn.Text]),e.children[0]||document.createElement("div"))]})}};class ns{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new ns(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class rs{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new rs(t,ns.range(this,e))}}class os{constructor(e,t){this.position=void 0;var n,r="KaTeX parse error: "+e,o=t&&t.loc;if(o&&o.start<=o.end){var s=o.lexer.input;n=o.start;var i=o.end;n===s.length?r+=" at end of input: ":r+=" at position "+(n+1)+": ";var a=s.slice(n,i).replace(/[^]/g,"$&̲");r+=(n>15?"…"+s.slice(n-15,n):s.slice(0,n))+a+(i+15<s.length?s.slice(i,i+15)+"…":s.slice(i))}var l=new Error(r);return l.name="ParseError",l.__proto__=os.prototype,l.position=n,l}}os.prototype.__proto__=Error.prototype;var ss=/([A-Z])/g,is={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},as=/[&><"']/g,ls=function e(t){return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},cs=function(e,t){return-1!==e.indexOf(t)},us=function(e,t){return void 0===e?t:e},hs=function(e){return String(e).replace(as,(e=>is[e]))},ds=function(e){return e.replace(ss,"-$1").toLowerCase()},ps=ls,ms=function(e){var t=ls(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},fs=function(e){var t=/^\s*([^\\/#]*?)(?::|&#0*58|&#x0*3a)/i.exec(e);return null!=t?t[1]:"_relative"},gs={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function bs(e){if(e.default)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if("string"!=typeof n)return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class vs{constructor(e){for(var t in this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{},gs)if(gs.hasOwnProperty(t)){var n=gs[t];this[t]=void 0!==e[t]?n.processor?n.processor(e[t]):e[t]:bs(n)}}reportNonstrict(e,t,n){var r=this.strict;if("function"==typeof r&&(r=r(e,t,n)),r&&"ignore"!==r){if(!0===r||"error"===r)throw new os("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n);"warn"===r?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,n){var r=this.strict;if("function"==typeof r)try{r=r(e,t,n)}catch(e){r="error"}return!(!r||"ignore"===r||!0!==r&&"error"!==r&&("warn"===r?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]"),1)))}isTrusted(e){e.url&&!e.protocol&&(e.protocol=fs(e.url));var t="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(t)}}class ys{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return xs[ws[this.id]]}sub(){return xs[ks[this.id]]}fracNum(){return xs[Cs[this.id]]}fracDen(){return xs[Ss[this.id]]}cramp(){return xs[Ts[this.id]]}text(){return xs[As[this.id]]}isTight(){return this.size>=2}}var xs=[new ys(0,0,!1),new ys(1,0,!0),new ys(2,1,!1),new ys(3,1,!0),new ys(4,2,!1),new ys(5,2,!0),new ys(6,3,!1),new ys(7,3,!0)],ws=[4,5,4,5,6,7,6,7],ks=[5,5,5,5,7,7,7,7],Cs=[2,3,4,5,6,7,6,7],Ss=[3,3,5,5,7,7,7,7],Ts=[1,1,3,3,5,5,7,7],As=[0,1,2,3,2,3,2,3],Es={DISPLAY:xs[0],TEXT:xs[2],SCRIPT:xs[4],SCRIPTSCRIPT:xs[6]},Ms=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}],Bs=[];function Rs(e){for(var t=0;t<Bs.length;t+=2)if(e>=Bs[t]&&e<=Bs[t+1])return!0;return!1}Ms.forEach((e=>e.blocks.forEach((e=>Bs.push(...e)))));var Os={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};class Ns{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return cs(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map((e=>e.toText())).join("")}}var Is={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Ps={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Ls={"Å":"A","Ð":"D","Þ":"o","å":"a","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function Fs(e,t,n){if(!Is[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),o=Is[t][r];if(!o&&e[0]in Ls&&(r=Ls[e[0]].charCodeAt(0),o=Is[t][r]),o||"text"!==n||Rs(r)&&(o=Is[t][77]),o)return{depth:o[0],height:o[1],italic:o[2],skew:o[3],width:o[4]}}var zs={},Ds=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],_s=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],qs=function(e,t){return t.size<2?e:Ds[e-1][t.size-1]};class js{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||js.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=_s[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return new js(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:qs(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:_s[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=qs(js.BASESIZE,e);return this.size===t&&this.textSize===js.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==js.BASESIZE?["sizing","reset-size"+this.size,"size"+js.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!zs[t=e>=5?0:e>=3?1:2]){var n=zs[t]={cssEmPerMu:Ps.quad[t]/18};for(var r in Ps)Ps.hasOwnProperty(r)&&(n[r]=Ps[r][t])}return zs[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}js.BASESIZE=6;var Hs={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},Vs={ex:!0,em:!0,mu:!0},$s=function(e){return"string"!=typeof e&&(e=e.unit),e in Hs||e in Vs||"ex"===e},Us=function(e,t){var n;if(e.unit in Hs)n=Hs[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)n=t.fontMetrics().cssEmPerMu;else{var r;if(r=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)n=r.fontMetrics().xHeight;else{if("em"!==e.unit)throw new os("Invalid unit: '"+e.unit+"'");n=r.fontMetrics().quad}r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},Gs=function(e){return+e.toFixed(4)+"em"},Ws=function(e){return e.filter((e=>e)).join(" ")},Ks=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var r=t.getColor();r&&(this.style.color=r)}},Ys=function(e){var t=document.createElement(e);for(var n in t.className=Ws(this.classes),this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var r in this.attributes)this.attributes.hasOwnProperty(r)&&t.setAttribute(r,this.attributes[r]);for(var o=0;o<this.children.length;o++)t.appendChild(this.children[o].toNode());return t},Xs=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+hs(Ws(this.classes))+'"');var n="";for(var r in this.style)this.style.hasOwnProperty(r)&&(n+=ds(r)+":"+this.style[r]+";");for(var o in n&&(t+=' style="'+hs(n)+'"'),this.attributes)this.attributes.hasOwnProperty(o)&&(t+=" "+o+'="'+hs(this.attributes[o])+'"');t+=">";for(var s=0;s<this.children.length;s++)t+=this.children[s].toMarkup();return t+"</"+e+">"};class Js{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,Ks.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return cs(this.classes,e)}toNode(){return Ys.call(this,"span")}toMarkup(){return Xs.call(this,"span")}}class Zs{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Ks.call(this,t,r),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return cs(this.classes,e)}toNode(){return Ys.call(this,"a")}toMarkup(){return Xs.call(this,"a")}}class Qs{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=n}hasClass(e){return cs(this.classes,e)}toNode(){var e=document.createElement("img");for(var t in e.src=this.src,e.alt=this.alt,e.className="mord",this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e="<img src='"+this.src+" 'alt='"+this.alt+"' ",t="";for(var n in this.style)this.style.hasOwnProperty(n)&&(t+=ds(n)+":"+this.style[n]+";");return t&&(e+=' style="'+hs(t)+'"'),e+"'/>"}}var ei={"î":"ı̂","ï":"ı̈","í":"ı́","ì":"ı̀"};class ti{constructor(e,t,n,r,o,s,i,a){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=o||0,this.width=s||0,this.classes=i||[],this.style=a||{},this.maxFontSize=0;var l=function(e){for(var t=0;t<Ms.length;t++)for(var n=Ms[t],r=0;r<n.blocks.length;r++){var o=n.blocks[r];if(e>=o[0]&&e<=o[1])return n.name}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=ei[this.text])}hasClass(e){return cs(this.classes,e)}toNode(){var e=document.createTextNode(this.text),t=null;for(var n in this.italic>0&&((t=document.createElement("span")).style.marginRight=Gs(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=Ws(this.classes)),this.style)this.style.hasOwnProperty(n)&&((t=t||document.createElement("span")).style[n]=this.style[n]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=hs(Ws(this.classes)),t+='"');var n="";for(var r in this.italic>0&&(n+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(r)&&(n+=ds(r)+":"+this.style[r]+";");n&&(e=!0,t+=' style="'+hs(n)+'"');var o=hs(this.text);return e?(t+=">",t+=o,t+="</span>"):o}}class ni{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+"='"+this.attributes[t]+"'");e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+"</svg>"}}class ri{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","path");return this.alternate?e.setAttribute("d",this.alternate):e.setAttribute("d",Os[this.pathName]),e}toMarkup(){return this.alternate?"<path d='"+this.alternate+"'/>":"<path d='"+Os[this.pathName]+"'/>"}}class oi{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+"='"+this.attributes[t]+"'");return e+"/>"}}function si(e){if(e instanceof ti)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}var ii={bin:1,close:1,inner:1,open:1,punct:1,rel:1},ai={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},li={math:{},text:{}};function ci(e,t,n,r,o,s){li[e][o]={font:t,group:n,replace:r},s&&r&&(li[e][r]=li[e][o])}var ui="math",hi="text",di="main",pi="ams",mi="accent-token",fi="bin",gi="close",bi="inner",vi="mathord",yi="op-token",xi="open",wi="punct",ki="rel",Ci="spacing",Si="textord";ci(ui,di,ki,"≡","\\equiv",!0),ci(ui,di,ki,"≺","\\prec",!0),ci(ui,di,ki,"≻","\\succ",!0),ci(ui,di,ki,"","\\sim",!0),ci(ui,di,ki,"⊥","\\perp"),ci(ui,di,ki,"⪯","\\preceq",!0),ci(ui,di,ki,"⪰","\\succeq",!0),ci(ui,di,ki,"≃","\\simeq",!0),ci(ui,di,ki,"","\\mid",!0),ci(ui,di,ki,"≪","\\ll",!0),ci(ui,di,ki,"≫","\\gg",!0),ci(ui,di,ki,"≍","\\asymp",!0),ci(ui,di,ki,"∥","\\parallel"),ci(ui,di,ki,"⋈","\\bowtie",!0),ci(ui,di,ki,"⌣","\\smile",!0),ci(ui,di,ki,"⊑","\\sqsubseteq",!0),ci(ui,di,ki,"⊒","\\sqsupseteq",!0),ci(ui,di,ki,"≐","\\doteq",!0),ci(ui,di,ki,"⌢","\\frown",!0),ci(ui,di,ki,"∋","\\ni",!0),ci(ui,di,ki,"∝","\\propto",!0),ci(ui,di,ki,"⊢","\\vdash",!0),ci(ui,di,ki,"⊣","\\dashv",!0),ci(ui,di,ki,"∋","\\owns"),ci(ui,di,wi,".","\\ldotp"),ci(ui,di,wi,"⋅","\\cdotp"),ci(ui,di,Si,"#","\\#"),ci(hi,di,Si,"#","\\#"),ci(ui,di,Si,"&","\\&"),ci(hi,di,Si,"&","\\&"),ci(ui,di,Si,"ℵ","\\aleph",!0),ci(ui,di,Si,"∀","\\forall",!0),ci(ui,di,Si,"ℏ","\\hbar",!0),ci(ui,di,Si,"∃","\\exists",!0),ci(ui,di,Si,"∇","\\nabla",!0),ci(ui,di,Si,"♭","\\flat",!0),ci(ui,di,Si,"","\\ell",!0),ci(ui,di,Si,"♮","\\natural",!0),ci(ui,di,Si,"♣","\\clubsuit",!0),ci(ui,di,Si,"℘","\\wp",!0),ci(ui,di,Si,"♯","\\sharp",!0),ci(ui,di,Si,"♢","\\diamondsuit",!0),ci(ui,di,Si,"","\\Re",!0),ci(ui,di,Si,"♡","\\heartsuit",!0),ci(ui,di,Si,"","\\Im",!0),ci(ui,di,Si,"♠","\\spadesuit",!0),ci(ui,di,Si,"§","\\S",!0),ci(hi,di,Si,"§","\\S"),ci(ui,di,Si,"¶","\\P",!0),ci(hi,di,Si,"¶","\\P"),ci(ui,di,Si,"†","\\dag"),ci(hi,di,Si,"†","\\dag"),ci(hi,di,Si,"†","\\textdagger"),ci(ui,di,Si,"‡","\\ddag"),ci(hi,di,Si,"‡","\\ddag"),ci(hi,di,Si,"‡","\\textdaggerdbl"),ci(ui,di,gi,"⎱","\\rmoustache",!0),ci(ui,di,xi,"⎰","\\lmoustache",!0),ci(ui,di,gi,"⟯","\\rgroup",!0),ci(ui,di,xi,"⟮","\\lgroup",!0),ci(ui,di,fi,"∓","\\mp",!0),ci(ui,di,fi,"⊖","\\ominus",!0),ci(ui,di,fi,"⊎","\\uplus",!0),ci(ui,di,fi,"⊓","\\sqcap",!0),ci(ui,di,fi,"","\\ast"),ci(ui,di,fi,"⊔","\\sqcup",!0),ci(ui,di,fi,"◯","\\bigcirc",!0),ci(ui,di,fi,"∙","\\bullet",!0),ci(ui,di,fi,"‡","\\ddagger"),ci(ui,di,fi,"≀","\\wr",!0),ci(ui,di,fi,"⨿","\\amalg"),ci(ui,di,fi,"&","\\And"),ci(ui,di,ki,"⟵","\\longleftarrow",!0),ci(ui,di,ki,"⇐","\\Leftarrow",!0),ci(ui,di,ki,"⟸","\\Longleftarrow",!0),ci(ui,di,ki,"⟶","\\longrightarrow",!0),ci(ui,di,ki,"⇒","\\Rightarrow",!0),ci(ui,di,ki,"⟹","\\Longrightarrow",!0),ci(ui,di,ki,"↔","\\leftrightarrow",!0),ci(ui,di,ki,"⟷","\\longleftrightarrow",!0),ci(ui,di,ki,"⇔","\\Leftrightarrow",!0),ci(ui,di,ki,"⟺","\\Longleftrightarrow",!0),ci(ui,di,ki,"↦","\\mapsto",!0),ci(ui,di,ki,"⟼","\\longmapsto",!0),ci(ui,di,ki,"↗","\\nearrow",!0),ci(ui,di,ki,"↩","\\hookleftarrow",!0),ci(ui,di,ki,"↪","\\hookrightarrow",!0),ci(ui,di,ki,"↘","\\searrow",!0),ci(ui,di,ki,"↼","\\leftharpoonup",!0),ci(ui,di,ki,"⇀","\\rightharpoonup",!0),ci(ui,di,ki,"↙","\\swarrow",!0),ci(ui,di,ki,"↽","\\leftharpoondown",!0),ci(ui,di,ki,"⇁","\\rightharpoondown",!0),ci(ui,di,ki,"↖","\\nwarrow",!0),ci(ui,di,ki,"⇌","\\rightleftharpoons",!0),ci(ui,pi,ki,"≮","\\nless",!0),ci(ui,pi,ki,"","\\@nleqslant"),ci(ui,pi,ki,"","\\@nleqq"),ci(ui,pi,ki,"⪇","\\lneq",!0),ci(ui,pi,ki,"≨","\\lneqq",!0),ci(ui,pi,ki,"","\\@lvertneqq"),ci(ui,pi,ki,"⋦","\\lnsim",!0),ci(ui,pi,ki,"⪉","\\lnapprox",!0),ci(ui,pi,ki,"⊀","\\nprec",!0),ci(ui,pi,ki,"⋠","\\npreceq",!0),ci(ui,pi,ki,"⋨","\\precnsim",!0),ci(ui,pi,ki,"⪹","\\precnapprox",!0),ci(ui,pi,ki,"≁","\\nsim",!0),ci(ui,pi,ki,"","\\@nshortmid"),ci(ui,pi,ki,"∤","\\nmid",!0),ci(ui,pi,ki,"⊬","\\nvdash",!0),ci(ui,pi,ki,"⊭","\\nvDash",!0),ci(ui,pi,ki,"⋪","\\ntriangleleft"),ci(ui,pi,ki,"⋬","\\ntrianglelefteq",!0),ci(ui,pi,ki,"⊊","\\subsetneq",!0),ci(ui,pi,ki,"","\\@varsubsetneq"),ci(ui,pi,ki,"⫋","\\subsetneqq",!0),ci(ui,pi,ki,"","\\@varsubsetneqq"),ci(ui,pi,ki,"≯","\\ngtr",!0),ci(ui,pi,ki,"","\\@ngeqslant"),ci(ui,pi,ki,"","\\@ngeqq"),ci(ui,pi,ki,"⪈","\\gneq",!0),ci(ui,pi,ki,"≩","\\gneqq",!0),ci(ui,pi,ki,"","\\@gvertneqq"),ci(ui,pi,ki,"⋧","\\gnsim",!0),ci(ui,pi,ki,"⪊","\\gnapprox",!0),ci(ui,pi,ki,"⊁","\\nsucc",!0),ci(ui,pi,ki,"⋡","\\nsucceq",!0),ci(ui,pi,ki,"⋩","\\succnsim",!0),ci(ui,pi,ki,"⪺","\\succnapprox",!0),ci(ui,pi,ki,"≆","\\ncong",!0),ci(ui,pi,ki,"","\\@nshortparallel"),ci(ui,pi,ki,"∦","\\nparallel",!0),ci(ui,pi,ki,"⊯","\\nVDash",!0),ci(ui,pi,ki,"⋫","\\ntriangleright"),ci(ui,pi,ki,"⋭","\\ntrianglerighteq",!0),ci(ui,pi,ki,"","\\@nsupseteqq"),ci(ui,pi,ki,"⊋","\\supsetneq",!0),ci(ui,pi,ki,"","\\@varsupsetneq"),ci(ui,pi,ki,"⫌","\\supsetneqq",!0),ci(ui,pi,ki,"","\\@varsupsetneqq"),ci(ui,pi,ki,"⊮","\\nVdash",!0),ci(ui,pi,ki,"⪵","\\precneqq",!0),ci(ui,pi,ki,"⪶","\\succneqq",!0),ci(ui,pi,ki,"","\\@nsubseteqq"),ci(ui,pi,fi,"⊴","\\unlhd"),ci(ui,pi,fi,"⊵","\\unrhd"),ci(ui,pi,ki,"↚","\\nleftarrow",!0),ci(ui,pi,ki,"↛","\\nrightarrow",!0),ci(ui,pi,ki,"⇍","\\nLeftarrow",!0),ci(ui,pi,ki,"⇏","\\nRightarrow",!0),ci(ui,pi,ki,"↮","\\nleftrightarrow",!0),ci(ui,pi,ki,"⇎","\\nLeftrightarrow",!0),ci(ui,pi,ki,"△","\\vartriangle"),ci(ui,pi,Si,"ℏ","\\hslash"),ci(ui,pi,Si,"▽","\\triangledown"),ci(ui,pi,Si,"◊","\\lozenge"),ci(ui,pi,Si,"Ⓢ","\\circledS"),ci(ui,pi,Si,"®","\\circledR"),ci(hi,pi,Si,"®","\\circledR"),ci(ui,pi,Si,"∡","\\measuredangle",!0),ci(ui,pi,Si,"∄","\\nexists"),ci(ui,pi,Si,"℧","\\mho"),ci(ui,pi,Si,"Ⅎ","\\Finv",!0),ci(ui,pi,Si,"⅁","\\Game",!0),ci(ui,pi,Si,"","\\backprime"),ci(ui,pi,Si,"▲","\\blacktriangle"),ci(ui,pi,Si,"▼","\\blacktriangledown"),ci(ui,pi,Si,"■","\\blacksquare"),ci(ui,pi,Si,"⧫","\\blacklozenge"),ci(ui,pi,Si,"★","\\bigstar"),ci(ui,pi,Si,"∢","\\sphericalangle",!0),ci(ui,pi,Si,"∁","\\complement",!0),ci(ui,pi,Si,"ð","\\eth",!0),ci(hi,di,Si,"ð","ð"),ci(ui,pi,Si,"","\\diagup"),ci(ui,pi,Si,"╲","\\diagdown"),ci(ui,pi,Si,"□","\\square"),ci(ui,pi,Si,"□","\\Box"),ci(ui,pi,Si,"◊","\\Diamond"),ci(ui,pi,Si,"¥","\\yen",!0),ci(hi,pi,Si,"¥","\\yen",!0),ci(ui,pi,Si,"✓","\\checkmark",!0),ci(hi,pi,Si,"✓","\\checkmark"),ci(ui,pi,Si,"ℶ","\\beth",!0),ci(ui,pi,Si,"ℸ","\\daleth",!0),ci(ui,pi,Si,"ℷ","\\gimel",!0),ci(ui,pi,Si,"ϝ","\\digamma",!0),ci(ui,pi,Si,"ϰ","\\varkappa"),ci(ui,pi,xi,"┌","\\@ulcorner",!0),ci(ui,pi,gi,"┐","\\@urcorner",!0),ci(ui,pi,xi,"└","\\@llcorner",!0),ci(ui,pi,gi,"┘","\\@lrcorner",!0),ci(ui,pi,ki,"≦","\\leqq",!0),ci(ui,pi,ki,"⩽","\\leqslant",!0),ci(ui,pi,ki,"⪕","\\eqslantless",!0),ci(ui,pi,ki,"≲","\\lesssim",!0),ci(ui,pi,ki,"⪅","\\lessapprox",!0),ci(ui,pi,ki,"≊","\\approxeq",!0),ci(ui,pi,fi,"⋖","\\lessdot"),ci(ui,pi,ki,"⋘","\\lll",!0),ci(ui,pi,ki,"≶","\\lessgtr",!0),ci(ui,pi,ki,"⋚","\\lesseqgtr",!0),ci(ui,pi,ki,"⪋","\\lesseqqgtr",!0),ci(ui,pi,ki,"≑","\\doteqdot"),ci(ui,pi,ki,"≓","\\risingdotseq",!0),ci(ui,pi,ki,"≒","\\fallingdotseq",!0),ci(ui,pi,ki,"∽","\\backsim",!0),ci(ui,pi,ki,"⋍","\\backsimeq",!0),ci(ui,pi,ki,"⫅","\\subseteqq",!0),ci(ui,pi,ki,"⋐","\\Subset",!0),ci(ui,pi,ki,"⊏","\\sqsubset",!0),ci(ui,pi,ki,"≼","\\preccurlyeq",!0),ci(ui,pi,ki,"⋞","\\curlyeqprec",!0),ci(ui,pi,ki,"≾","\\precsim",!0),ci(ui,pi,ki,"⪷","\\precapprox",!0),ci(ui,pi,ki,"⊲","\\vartriangleleft"),ci(ui,pi,ki,"⊴","\\trianglelefteq"),ci(ui,pi,ki,"⊨","\\vDash",!0),ci(ui,pi,ki,"⊪","\\Vvdash",!0),ci(ui,pi,ki,"⌣","\\smallsmile"),ci(ui,pi,ki,"⌢","\\smallfrown"),ci(ui,pi,ki,"≏","\\bumpeq",!0),ci(ui,pi,ki,"≎","\\Bumpeq",!0),ci(ui,pi,ki,"≧","\\geqq",!0),ci(ui,pi,ki,"⩾","\\geqslant",!0),ci(ui,pi,ki,"⪖","\\eqslantgtr",!0),ci(ui,pi,ki,"≳","\\gtrsim",!0),ci(ui,pi,ki,"⪆","\\gtrapprox",!0),ci(ui,pi,fi,"⋗","\\gtrdot"),ci(ui,pi,ki,"⋙","\\ggg",!0),ci(ui,pi,ki,"≷","\\gtrless",!0),ci(ui,pi,ki,"⋛","\\gtreqless",!0),ci(ui,pi,ki,"⪌","\\gtreqqless",!0),ci(ui,pi,ki,"≖","\\eqcirc",!0),ci(ui,pi,ki,"≗","\\circeq",!0),ci(ui,pi,ki,"≜","\\triangleq",!0),ci(ui,pi,ki,"","\\thicksim"),ci(ui,pi,ki,"≈","\\thickapprox"),ci(ui,pi,ki,"⫆","\\supseteqq",!0),ci(ui,pi,ki,"⋑","\\Supset",!0),ci(ui,pi,ki,"⊐","\\sqsupset",!0),ci(ui,pi,ki,"≽","\\succcurlyeq",!0),ci(ui,pi,ki,"⋟","\\curlyeqsucc",!0),ci(ui,pi,ki,"≿","\\succsim",!0),ci(ui,pi,ki,"⪸","\\succapprox",!0),ci(ui,pi,ki,"⊳","\\vartriangleright"),ci(ui,pi,ki,"⊵","\\trianglerighteq"),ci(ui,pi,ki,"⊩","\\Vdash",!0),ci(ui,pi,ki,"","\\shortmid"),ci(ui,pi,ki,"∥","\\shortparallel"),ci(ui,pi,ki,"≬","\\between",!0),ci(ui,pi,ki,"⋔","\\pitchfork",!0),ci(ui,pi,ki,"∝","\\varpropto"),ci(ui,pi,ki,"◀","\\blacktriangleleft"),ci(ui,pi,ki,"∴","\\therefore",!0),ci(ui,pi,ki,"∍","\\backepsilon"),ci(ui,pi,ki,"▶","\\blacktriangleright"),ci(ui,pi,ki,"∵","\\because",!0),ci(ui,pi,ki,"⋘","\\llless"),ci(ui,pi,ki,"⋙","\\gggtr"),ci(ui,pi,fi,"⊲","\\lhd"),ci(ui,pi,fi,"⊳","\\rhd"),ci(ui,pi,ki,"≂","\\eqsim",!0),ci(ui,di,ki,"⋈","\\Join"),ci(ui,pi,ki,"≑","\\Doteq",!0),ci(ui,pi,fi,"∔","\\dotplus",!0),ci(ui,pi,fi,"","\\smallsetminus"),ci(ui,pi,fi,"⋒","\\Cap",!0),ci(ui,pi,fi,"⋓","\\Cup",!0),ci(ui,pi,fi,"⩞","\\doublebarwedge",!0),ci(ui,pi,fi,"⊟","\\boxminus",!0),ci(ui,pi,fi,"⊞","\\boxplus",!0),ci(ui,pi,fi,"⋇","\\divideontimes",!0),ci(ui,pi,fi,"⋉","\\ltimes",!0),ci(ui,pi,fi,"⋊","\\rtimes",!0),ci(ui,pi,fi,"⋋","\\leftthreetimes",!0),ci(ui,pi,fi,"⋌","\\rightthreetimes",!0),ci(ui,pi,fi,"⋏","\\curlywedge",!0),ci(ui,pi,fi,"⋎","\\curlyvee",!0),ci(ui,pi,fi,"⊝","\\circleddash",!0),ci(ui,pi,fi,"⊛","\\circledast",!0),ci(ui,pi,fi,"⋅","\\centerdot"),ci(ui,pi,fi,"⊺","\\intercal",!0),ci(ui,pi,fi,"⋒","\\doublecap"),ci(ui,pi,fi,"⋓","\\doublecup"),ci(ui,pi,fi,"⊠","\\boxtimes",!0),ci(ui,pi,ki,"⇢","\\dashrightarrow",!0),ci(ui,pi,ki,"⇠","\\dashleftarrow",!0),ci(ui,pi,ki,"⇇","\\leftleftarrows",!0),ci(ui,pi,ki,"⇆","\\leftrightarrows",!0),ci(ui,pi,ki,"⇚","\\Lleftarrow",!0),ci(ui,pi,ki,"↞","\\twoheadleftarrow",!0),ci(ui,pi,ki,"↢","\\leftarrowtail",!0),ci(ui,pi,ki,"↫","\\looparrowleft",!0),ci(ui,pi,ki,"⇋","\\leftrightharpoons",!0),ci(ui,pi,ki,"↶","\\curvearrowleft",!0),ci(ui,pi,ki,"↺","\\circlearrowleft",!0),ci(ui,pi,ki,"↰","\\Lsh",!0),ci(ui,pi,ki,"⇈","\\upuparrows",!0),ci(ui,pi,ki,"↿","\\upharpoonleft",!0),ci(ui,pi,ki,"⇃","\\downharpoonleft",!0),ci(ui,di,ki,"⊶","\\origof",!0),ci(ui,di,ki,"⊷","\\imageof",!0),ci(ui,pi,ki,"⊸","\\multimap",!0),ci(ui,pi,ki,"↭","\\leftrightsquigarrow",!0),ci(ui,pi,ki,"⇉","\\rightrightarrows",!0),ci(ui,pi,ki,"⇄","\\rightleftarrows",!0),ci(ui,pi,ki,"↠","\\twoheadrightarrow",!0),ci(ui,pi,ki,"↣","\\rightarrowtail",!0),ci(ui,pi,ki,"↬","\\looparrowright",!0),ci(ui,pi,ki,"↷","\\curvearrowright",!0),ci(ui,pi,ki,"↻","\\circlearrowright",!0),ci(ui,pi,ki,"↱","\\Rsh",!0),ci(ui,pi,ki,"⇊","\\downdownarrows",!0),ci(ui,pi,ki,"↾","\\upharpoonright",!0),ci(ui,pi,ki,"⇂","\\downharpoonright",!0),ci(ui,pi,ki,"⇝","\\rightsquigarrow",!0),ci(ui,pi,ki,"⇝","\\leadsto"),ci(ui,pi,ki,"⇛","\\Rrightarrow",!0),ci(ui,pi,ki,"↾","\\restriction"),ci(ui,di,Si,"","`"),ci(ui,di,Si,"$","\\$"),ci(hi,di,Si,"$","\\$"),ci(hi,di,Si,"$","\\textdollar"),ci(ui,di,Si,"%","\\%"),ci(hi,di,Si,"%","\\%"),ci(ui,di,Si,"_","\\_"),ci(hi,di,Si,"_","\\_"),ci(hi,di,Si,"_","\\textunderscore"),ci(ui,di,Si,"∠","\\angle",!0),ci(ui,di,Si,"∞","\\infty",!0),ci(ui,di,Si,"","\\prime"),ci(ui,di,Si,"△","\\triangle"),ci(ui,di,Si,"Γ","\\Gamma",!0),ci(ui,di,Si,"Δ","\\Delta",!0),ci(ui,di,Si,"Θ","\\Theta",!0),ci(ui,di,Si,"Λ","\\Lambda",!0),ci(ui,di,Si,"Ξ","\\Xi",!0),ci(ui,di,Si,"Π","\\Pi",!0),ci(ui,di,Si,"Σ","\\Sigma",!0),ci(ui,di,Si,"Υ","\\Upsilon",!0),ci(ui,di,Si,"Φ","\\Phi",!0),ci(ui,di,Si,"Ψ","\\Psi",!0),ci(ui,di,Si,"Ω","\\Omega",!0),ci(ui,di,Si,"A","Α"),ci(ui,di,Si,"B","Β"),ci(ui,di,Si,"E","Ε"),ci(ui,di,Si,"Z","Ζ"),ci(ui,di,Si,"H","Η"),ci(ui,di,Si,"I","Ι"),ci(ui,di,Si,"K","Κ"),ci(ui,di,Si,"M","Μ"),ci(ui,di,Si,"N","Ν"),ci(ui,di,Si,"O","Ο"),ci(ui,di,Si,"P","Ρ"),ci(ui,di,Si,"T","Τ"),ci(ui,di,Si,"X","Χ"),ci(ui,di,Si,"¬","\\neg",!0),ci(ui,di,Si,"¬","\\lnot"),ci(ui,di,Si,"","\\top"),ci(ui,di,Si,"⊥","\\bot"),ci(ui,di,Si,"∅","\\emptyset"),ci(ui,pi,Si,"∅","\\varnothing"),ci(ui,di,vi,"α","\\alpha",!0),ci(ui,di,vi,"β","\\beta",!0),ci(ui,di,vi,"γ","\\gamma",!0),ci(ui,di,vi,"δ","\\delta",!0),ci(ui,di,vi,"ϵ","\\epsilon",!0),ci(ui,di,vi,"ζ","\\zeta",!0),ci(ui,di,vi,"η","\\eta",!0),ci(ui,di,vi,"θ","\\theta",!0),ci(ui,di,vi,"ι","\\iota",!0),ci(ui,di,vi,"κ","\\kappa",!0),ci(ui,di,vi,"λ","\\lambda",!0),ci(ui,di,vi,"μ","\\mu",!0),ci(ui,di,vi,"ν","\\nu",!0),ci(ui,di,vi,"ξ","\\xi",!0),ci(ui,di,vi,"ο","\\omicron",!0),ci(ui,di,vi,"π","\\pi",!0),ci(ui,di,vi,"ρ","\\rho",!0),ci(ui,di,vi,"σ","\\sigma",!0),ci(ui,di,vi,"τ","\\tau",!0),ci(ui,di,vi,"υ","\\upsilon",!0),ci(ui,di,vi,"ϕ","\\phi",!0),ci(ui,di,vi,"χ","\\chi",!0),ci(ui,di,vi,"ψ","\\psi",!0),ci(ui,di,vi,"ω","\\omega",!0),ci(ui,di,vi,"ε","\\varepsilon",!0),ci(ui,di,vi,"ϑ","\\vartheta",!0),ci(ui,di,vi,"ϖ","\\varpi",!0),ci(ui,di,vi,"ϱ","\\varrho",!0),ci(ui,di,vi,"ς","\\varsigma",!0),ci(ui,di,vi,"φ","\\varphi",!0),ci(ui,di,fi,"","*",!0),ci(ui,di,fi,"+","+"),ci(ui,di,fi,"","-",!0),ci(ui,di,fi,"⋅","\\cdot",!0),ci(ui,di,fi,"∘","\\circ",!0),ci(ui,di,fi,"÷","\\div",!0),ci(ui,di,fi,"±","\\pm",!0),ci(ui,di,fi,"×","\\times",!0),ci(ui,di,fi,"∩","\\cap",!0),ci(ui,di,fi,"","\\cup",!0),ci(ui,di,fi,"","\\setminus",!0),ci(ui,di,fi,"∧","\\land"),ci(ui,di,fi,"","\\lor"),ci(ui,di,fi,"∧","\\wedge",!0),ci(ui,di,fi,"","\\vee",!0),ci(ui,di,Si,"√","\\surd"),ci(ui,di,xi,"⟨","\\langle",!0),ci(ui,di,xi,"","\\lvert"),ci(ui,di,xi,"∥","\\lVert"),ci(ui,di,gi,"?","?"),ci(ui,di,gi,"!","!"),ci(ui,di,gi,"⟩","\\rangle",!0),ci(ui,di,gi,"","\\rvert"),ci(ui,di,gi,"∥","\\rVert"),ci(ui,di,ki,"=","="),ci(ui,di,ki,":",":"),ci(ui,di,ki,"≈","\\approx",!0),ci(ui,di,ki,"≅","\\cong",!0),ci(ui,di,ki,"≥","\\ge"),ci(ui,di,ki,"≥","\\geq",!0),ci(ui,di,ki,"←","\\gets"),ci(ui,di,ki,">","\\gt",!0),ci(ui,di,ki,"∈","\\in",!0),ci(ui,di,ki,"","\\@not"),ci(ui,di,ki,"⊂","\\subset",!0),ci(ui,di,ki,"⊃","\\supset",!0),ci(ui,di,ki,"⊆","\\subseteq",!0),ci(ui,di,ki,"⊇","\\supseteq",!0),ci(ui,pi,ki,"⊈","\\nsubseteq",!0),ci(ui,pi,ki,"⊉","\\nsupseteq",!0),ci(ui,di,ki,"⊨","\\models"),ci(ui,di,ki,"←","\\leftarrow",!0),ci(ui,di,ki,"≤","\\le"),ci(ui,di,ki,"≤","\\leq",!0),ci(ui,di,ki,"<","\\lt",!0),ci(ui,di,ki,"→","\\rightarrow",!0),ci(ui,di,ki,"→","\\to"),ci(ui,pi,ki,"≱","\\ngeq",!0),ci(ui,pi,ki,"≰","\\nleq",!0),ci(ui,di,Ci," ","\\ "),ci(ui,di,Ci," ","\\space"),ci(ui,di,Ci," ","\\nobreakspace"),ci(hi,di,Ci," ","\\ "),ci(hi,di,Ci," "," "),ci(hi,di,Ci," ","\\space"),ci(hi,di,Ci," ","\\nobreakspace"),ci(ui,di,Ci,null,"\\nobreak"),ci(ui,di,Ci,null,"\\allowbreak"),ci(ui,di,wi,",",","),ci(ui,di,wi,";",";"),ci(ui,pi,fi,"⊼","\\barwedge",!0),ci(ui,pi,fi,"⊻","\\veebar",!0),ci(ui,di,fi,"⊙","\\odot",!0),ci(ui,di,fi,"⊕","\\oplus",!0),ci(ui,di,fi,"⊗","\\otimes",!0),ci(ui,di,Si,"∂","\\partial",!0),ci(ui,di,fi,"⊘","\\oslash",!0),ci(ui,pi,fi,"⊚","\\circledcirc",!0),ci(ui,pi,fi,"⊡","\\boxdot",!0),ci(ui,di,fi,"△","\\bigtriangleup"),ci(ui,di,fi,"▽","\\bigtriangledown"),ci(ui,di,fi,"†","\\dagger"),ci(ui,di,fi,"⋄","\\diamond"),ci(ui,di,fi,"⋆","\\star"),ci(ui,di,fi,"◃","\\triangleleft"),ci(ui,di,fi,"▹","\\triangleright"),ci(ui,di,xi,"{","\\{"),ci(hi,di,Si,"{","\\{"),ci(hi,di,Si,"{","\\textbraceleft"),ci(ui,di,gi,"}","\\}"),ci(hi,di,Si,"}","\\}"),ci(hi,di,Si,"}","\\textbraceright"),ci(ui,di,xi,"{","\\lbrace"),ci(ui,di,gi,"}","\\rbrace"),ci(ui,di,xi,"[","\\lbrack",!0),ci(hi,di,Si,"[","\\lbrack",!0),ci(ui,di,gi,"]","\\rbrack",!0),ci(hi,di,Si,"]","\\rbrack",!0),ci(ui,di,xi,"(","\\lparen",!0),ci(ui,di,gi,")","\\rparen",!0),ci(hi,di,Si,"<","\\textless",!0),ci(hi,di,Si,">","\\textgreater",!0),ci(ui,di,xi,"⌊","\\lfloor",!0),ci(ui,di,gi,"⌋","\\rfloor",!0),ci(ui,di,xi,"⌈","\\lceil",!0),ci(ui,di,gi,"⌉","\\rceil",!0),ci(ui,di,Si,"\\","\\backslash"),ci(ui,di,Si,"","|"),ci(ui,di,Si,"","\\vert"),ci(hi,di,Si,"|","\\textbar",!0),ci(ui,di,Si,"∥","\\|"),ci(ui,di,Si,"∥","\\Vert"),ci(hi,di,Si,"∥","\\textbardbl"),ci(hi,di,Si,"~","\\textasciitilde"),ci(hi,di,Si,"\\","\\textbackslash"),ci(hi,di,Si,"^","\\textasciicircum"),ci(ui,di,ki,"↑","\\uparrow",!0),ci(ui,di,ki,"⇑","\\Uparrow",!0),ci(ui,di,ki,"↓","\\downarrow",!0),ci(ui,di,ki,"⇓","\\Downarrow",!0),ci(ui,di,ki,"↕","\\updownarrow",!0),ci(ui,di,ki,"⇕","\\Updownarrow",!0),ci(ui,di,yi,"∐","\\coprod"),ci(ui,di,yi,"","\\bigvee"),ci(ui,di,yi,"⋀","\\bigwedge"),ci(ui,di,yi,"⨄","\\biguplus"),ci(ui,di,yi,"⋂","\\bigcap"),ci(ui,di,yi,"","\\bigcup"),ci(ui,di,yi,"∫","\\int"),ci(ui,di,yi,"∫","\\intop"),ci(ui,di,yi,"∬","\\iint"),ci(ui,di,yi,"∭","\\iiint"),ci(ui,di,yi,"∏","\\prod"),ci(ui,di,yi,"∑","\\sum"),ci(ui,di,yi,"⨂","\\bigotimes"),ci(ui,di,yi,"⨁","\\bigoplus"),ci(ui,di,yi,"⨀","\\bigodot"),ci(ui,di,yi,"∮","\\oint"),ci(ui,di,yi,"∯","\\oiint"),ci(ui,di,yi,"∰","\\oiiint"),ci(ui,di,yi,"⨆","\\bigsqcup"),ci(ui,di,yi,"∫","\\smallint"),ci(hi,di,bi,"…","\\textellipsis"),ci(ui,di,bi,"…","\\mathellipsis"),ci(hi,di,bi,"…","\\ldots",!0),ci(ui,di,bi,"…","\\ldots",!0),ci(ui,di,bi,"⋯","\\@cdots",!0),ci(ui,di,bi,"⋱","\\ddots",!0),ci(ui,di,Si,"⋮","\\varvdots"),ci(ui,di,mi,"ˊ","\\acute"),ci(ui,di,mi,"ˋ","\\grave"),ci(ui,di,mi,"¨","\\ddot"),ci(ui,di,mi,"~","\\tilde"),ci(ui,di,mi,"ˉ","\\bar"),ci(ui,di,mi,"˘","\\breve"),ci(ui,di,mi,"ˇ","\\check"),ci(ui,di,mi,"^","\\hat"),ci(ui,di,mi,"⃗","\\vec"),ci(ui,di,mi,"˙","\\dot"),ci(ui,di,mi,"˚","\\mathring"),ci(ui,di,vi,"","\\@imath"),ci(ui,di,vi,"","\\@jmath"),ci(ui,di,Si,"ı","ı"),ci(ui,di,Si,"ȷ","ȷ"),ci(hi,di,Si,"ı","\\i",!0),ci(hi,di,Si,"ȷ","\\j",!0),ci(hi,di,Si,"ß","\\ss",!0),ci(hi,di,Si,"æ","\\ae",!0),ci(hi,di,Si,"œ","\\oe",!0),ci(hi,di,Si,"ø","\\o",!0),ci(hi,di,Si,"Æ","\\AE",!0),ci(hi,di,Si,"Œ","\\OE",!0),ci(hi,di,Si,"Ø","\\O",!0),ci(hi,di,mi,"ˊ","\\'"),ci(hi,di,mi,"ˋ","\\`"),ci(hi,di,mi,"ˆ","\\^"),ci(hi,di,mi,"˜","\\~"),ci(hi,di,mi,"ˉ","\\="),ci(hi,di,mi,"˘","\\u"),ci(hi,di,mi,"˙","\\."),ci(hi,di,mi,"¸","\\c"),ci(hi,di,mi,"˚","\\r"),ci(hi,di,mi,"ˇ","\\v"),ci(hi,di,mi,"¨",'\\"'),ci(hi,di,mi,"˝","\\H"),ci(hi,di,mi,"◯","\\textcircled");var Ti={"--":!0,"---":!0,"``":!0,"''":!0};ci(hi,di,Si,"","--",!0),ci(hi,di,Si,"","\\textendash"),ci(hi,di,Si,"—","---",!0),ci(hi,di,Si,"—","\\textemdash"),ci(hi,di,Si,"","`",!0),ci(hi,di,Si,"","\\textquoteleft"),ci(hi,di,Si,"","'",!0),ci(hi,di,Si,"","\\textquoteright"),ci(hi,di,Si,"“","``",!0),ci(hi,di,Si,"“","\\textquotedblleft"),ci(hi,di,Si,"”","''",!0),ci(hi,di,Si,"”","\\textquotedblright"),ci(ui,di,Si,"°","\\degree",!0),ci(hi,di,Si,"°","\\degree"),ci(hi,di,Si,"°","\\textdegree",!0),ci(ui,di,Si,"£","\\pounds"),ci(ui,di,Si,"£","\\mathsterling",!0),ci(hi,di,Si,"£","\\pounds"),ci(hi,di,Si,"£","\\textsterling",!0),ci(ui,pi,Si,"✠","\\maltese"),ci(hi,pi,Si,"✠","\\maltese");for(var Ai='0123456789/@."',Ei=0;Ei<Ai.length;Ei++){var Mi=Ai.charAt(Ei);ci(ui,di,Si,Mi,Mi)}for(var Bi='0123456789!@*()-=+";:?/.,',Ri=0;Ri<Bi.length;Ri++){var Oi=Bi.charAt(Ri);ci(hi,di,Si,Oi,Oi)}for(var Ni="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Ii=0;Ii<Ni.length;Ii++){var Pi=Ni.charAt(Ii);ci(ui,di,vi,Pi,Pi),ci(hi,di,Si,Pi,Pi)}ci(ui,pi,Si,"C",""),ci(hi,pi,Si,"C",""),ci(ui,pi,Si,"H",""),ci(hi,pi,Si,"H",""),ci(ui,pi,Si,"N",""),ci(hi,pi,Si,"N",""),ci(ui,pi,Si,"P",""),ci(hi,pi,Si,"P",""),ci(ui,pi,Si,"Q",""),ci(hi,pi,Si,"Q",""),ci(ui,pi,Si,"R",""),ci(hi,pi,Si,"R",""),ci(ui,pi,Si,"Z",""),ci(hi,pi,Si,"Z",""),ci(ui,di,vi,"h",""),ci(hi,di,vi,"h","");for(var Li="",Fi=0;Fi<Ni.length;Fi++){var zi=Ni.charAt(Fi);ci(ui,di,vi,zi,Li=String.fromCharCode(55349,56320+Fi)),ci(hi,di,Si,zi,Li),ci(ui,di,vi,zi,Li=String.fromCharCode(55349,56372+Fi)),ci(hi,di,Si,zi,Li),ci(ui,di,vi,zi,Li=String.fromCharCode(55349,56424+Fi)),ci(hi,di,Si,zi,Li),ci(ui,di,vi,zi,Li=String.fromCharCode(55349,56580+Fi)),ci(hi,di,Si,zi,Li),ci(ui,di,vi,zi,Li=String.fromCharCode(55349,56736+Fi)),ci(hi,di,Si,zi,Li),ci(ui,di,vi,zi,Li=String.fromCharCode(55349,56788+Fi)),ci(hi,di,Si,zi,Li),ci(ui,di,vi,zi,Li=String.fromCharCode(55349,56840+Fi)),ci(hi,di,Si,zi,Li),ci(ui,di,vi,zi,Li=String.fromCharCode(55349,56944+Fi)),ci(hi,di,Si,zi,Li),Fi<26&&(ci(ui,di,vi,zi,Li=String.fromCharCode(55349,56632+Fi)),ci(hi,di,Si,zi,Li),ci(ui,di,vi,zi,Li=String.fromCharCode(55349,56476+Fi)),ci(hi,di,Si,zi,Li))}ci(ui,di,vi,"k",Li=String.fromCharCode(55349,56668)),ci(hi,di,Si,"k",Li);for(var Di=0;Di<10;Di++){var _i=Di.toString();ci(ui,di,vi,_i,Li=String.fromCharCode(55349,57294+Di)),ci(hi,di,Si,_i,Li),ci(ui,di,vi,_i,Li=String.fromCharCode(55349,57314+Di)),ci(hi,di,Si,_i,Li),ci(ui,di,vi,_i,Li=String.fromCharCode(55349,57324+Di)),ci(hi,di,Si,_i,Li),ci(ui,di,vi,_i,Li=String.fromCharCode(55349,57334+Di)),ci(hi,di,Si,_i,Li)}for(var qi="ÐÞþ",ji=0;ji<qi.length;ji++){var Hi=qi.charAt(ji);ci(ui,di,vi,Hi,Hi),ci(hi,di,Si,Hi,Hi)}var Vi=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["","",""],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],$i=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],Ui=function(e,t,n){return li[n][e]&&li[n][e].replace&&(e=li[n][e].replace),{value:e,metrics:Fs(e,t,n)}},Gi=function(e,t,n,r,o){var s,i=Ui(e,t,n),a=i.metrics;if(e=i.value,a){var l=a.italic;("text"===n||r&&"mathit"===r.font)&&(l=0),s=new ti(e,a.height,a.depth,l,a.skew,a.width,o)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"' and mode '"+n+"'"),s=new ti(e,0,0,0,0,0,o);if(r){s.maxFontSize=r.sizeMultiplier,r.style.isTight()&&s.classes.push("mtight");var c=r.getColor();c&&(s.style.color=c)}return s},Wi=(e,t)=>{if(Ws(e.classes)!==Ws(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(1===e.classes.length){var n=e.classes[0];if("mbin"===n||"mord"===n)return!1}for(var r in e.style)if(e.style.hasOwnProperty(r)&&e.style[r]!==t.style[r])return!1;for(var o in t.style)if(t.style.hasOwnProperty(o)&&e.style[o]!==t.style[o])return!1;return!0},Ki=function(e){for(var t=0,n=0,r=0,o=0;o<e.children.length;o++){var s=e.children[o];s.height>t&&(t=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>r&&(r=s.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},Yi=function(e,t,n,r){var o=new Js(e,t,n,r);return Ki(o),o},Xi=(e,t,n,r)=>new Js(e,t,n,r),Ji=function(e){var t=new Ns(e);return Ki(t),t},Zi=function(e,t,n){var r="";switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return r+"-"+("textbf"===t&&"textit"===n?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular")},Qi={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},ea={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},ta={fontMap:Qi,makeSymbol:Gi,mathsym:function(e,t,n,r){return void 0===r&&(r=[]),"boldsymbol"===n.font&&Ui(e,"Main-Bold",t).metrics?Gi(e,"Main-Bold",t,n,r.concat(["mathbf"])):"\\"===e||"main"===li[t][e].font?Gi(e,"Main-Regular",t,n,r):Gi(e,"AMS-Regular",t,n,r.concat(["amsrm"]))},makeSpan:Yi,makeSvgSpan:Xi,makeLineSpan:function(e,t,n){var r=Yi([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=Gs(r.height),r.maxFontSize=1,r},makeAnchor:function(e,t,n,r){var o=new Zs(e,t,n,r);return Ki(o),o},makeFragment:Ji,wrapFragment:function(e,t){return e instanceof Ns?Yi([],[e],t):e},makeVList:function(e,t){for(var{children:n,depth:r}=function(e){if("individualShift"===e.positionType){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,o=r,s=1;s<t.length;s++){var i=-t[s].shift-o-t[s].elem.depth,a=i-(t[s-1].elem.height+t[s-1].elem.depth);o+=i,n.push({type:"kern",size:a}),n.push(t[s])}return{children:n,depth:r}}var l;if("top"===e.positionType){for(var c=e.positionData,u=0;u<e.children.length;u++){var h=e.children[u];c-="kern"===h.type?h.size:h.elem.height+h.elem.depth}l=c}else if("bottom"===e.positionType)l=-e.positionData;else{var d=e.children[0];if("elem"!==d.type)throw new Error('First child must have type "elem".');if("shift"===e.positionType)l=-d.elem.depth-e.positionData;else{if("firstBaseline"!==e.positionType)throw new Error("Invalid positionType "+e.positionType+".");l=-d.elem.depth}}return{children:e.children,depth:l}}(e),o=0,s=0;s<n.length;s++){var i=n[s];if("elem"===i.type){var a=i.elem;o=Math.max(o,a.maxFontSize,a.height)}}o+=2;var l=Yi(["pstrut"],[]);l.style.height=Gs(o);for(var c=[],u=r,h=r,d=r,p=0;p<n.length;p++){var m=n[p];if("kern"===m.type)d+=m.size;else{var f=m.elem,g=m.wrapperClasses||[],b=m.wrapperStyle||{},v=Yi(g,[l,f],void 0,b);v.style.top=Gs(-o-d-f.depth),m.marginLeft&&(v.style.marginLeft=m.marginLeft),m.marginRight&&(v.style.marginRight=m.marginRight),c.push(v),d+=f.height+f.depth}u=Math.min(u,d),h=Math.max(h,d)}var y,x=Yi(["vlist"],c);if(x.style.height=Gs(h),u<0){var w=Yi([],[]),k=Yi(["vlist"],[w]);k.style.height=Gs(-u);var C=Yi(["vlist-s"],[new ti("")]);y=[Yi(["vlist-r"],[x,C]),Yi(["vlist-r"],[k])]}else y=[Yi(["vlist-r"],[x])];var S=Yi(["vlist-t"],y);return 2===y.length&&S.classes.push("vlist-t2"),S.height=h,S.depth=-u,S},makeOrd:function(e,t,n){var r=e.mode,o=e.text,s=["mord"],i="math"===r||"text"===r&&t.font,a=i?t.font:t.fontFamily;if(55349===o.charCodeAt(0)){var[l,c]=function(e,t){var n=1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536,r="math"===t?0:1;if(119808<=n&&n<120484){var o=Math.floor((n-119808)/26);return[Vi[o][2],Vi[o][r]]}if(120782<=n&&n<=120831){var s=Math.floor((n-120782)/10);return[$i[s][2],$i[s][r]]}if(120485===n||120486===n)return[Vi[0][2],Vi[0][r]];if(120486<n&&n<120782)return["",""];throw new os("Unsupported character: "+e)}(o,r);return Gi(o,l,r,t,s.concat(c))}if(a){var u,h;if("boldsymbol"===a){var d=function(e,t,n,r,o){return"textord"!==o&&Ui(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(o,r,0,0,n);u=d.fontName,h=[d.fontClass]}else i?(u=Qi[a].fontName,h=[a]):(u=Zi(a,t.fontWeight,t.fontShape),h=[a,t.fontWeight,t.fontShape]);if(Ui(o,u,r).metrics)return Gi(o,u,r,t,s.concat(h));if(Ti.hasOwnProperty(o)&&"Typewriter"===u.slice(0,10)){for(var p=[],m=0;m<o.length;m++)p.push(Gi(o[m],u,r,t,s.concat(h)));return Ji(p)}}if("mathord"===n)return Gi(o,"Math-Italic",r,t,s.concat(["mathnormal"]));if("textord"===n){var f=li[r][o]&&li[r][o].font;if("ams"===f){var g=Zi("amsrm",t.fontWeight,t.fontShape);return Gi(o,g,r,t,s.concat("amsrm",t.fontWeight,t.fontShape))}if("main"!==f&&f){var b=Zi(f,t.fontWeight,t.fontShape);return Gi(o,b,r,t,s.concat(b,t.fontWeight,t.fontShape))}var v=Zi("textrm",t.fontWeight,t.fontShape);return Gi(o,v,r,t,s.concat(t.fontWeight,t.fontShape))}throw new Error("unexpected type: "+n+" in makeOrd")},makeGlue:(e,t)=>{var n=Yi(["mspace"],[],t),r=Us(e,t);return n.style.marginRight=Gs(r),n},staticSvg:function(e,t){var[n,r,o]=ea[e],s=new ri(n),i=new ni([s],{width:Gs(r),height:Gs(o),style:"width:"+Gs(r),viewBox:"0 0 "+1e3*r+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),a=Xi(["overlay"],[i],t);return a.height=o,a.style.height=Gs(o),a.style.width=Gs(r),a},svgData:ea,tryCombineChars:e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof ti&&r instanceof ti&&Wi(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e}},na={number:3,unit:"mu"},ra={number:4,unit:"mu"},oa={number:5,unit:"mu"},sa={mord:{mop:na,mbin:ra,mrel:oa,minner:na},mop:{mord:na,mop:na,mrel:oa,minner:na},mbin:{mord:ra,mop:ra,mopen:ra,minner:ra},mrel:{mord:oa,mop:oa,mopen:oa,minner:oa},mopen:{},mclose:{mop:na,mbin:ra,mrel:oa,minner:na},mpunct:{mord:na,mop:na,mrel:oa,mopen:na,mclose:na,mpunct:na,minner:na},minner:{mord:na,mop:na,mbin:ra,mrel:oa,mopen:na,mpunct:na,minner:na}},ia={mord:{mop:na},mop:{mord:na,mop:na},mbin:{},mrel:{},mopen:{},mclose:{mop:na},mpunct:{},minner:{mop:na}},aa={},la={},ca={};function ua(e){for(var{type:t,names:n,props:r,handler:o,htmlBuilder:s,mathmlBuilder:i}=e,a={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:void 0===r.allowedInMath||r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:o},l=0;l<n.length;++l)aa[n[l]]=a;t&&(s&&(la[t]=s),i&&(ca[t]=i))}function ha(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;ua({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var da=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e},pa=function(e){return"ordgroup"===e.type?e.body:[e]},ma=ta.makeSpan,fa=["leftmost","mbin","mopen","mrel","mop","mpunct"],ga=["rightmost","mrel","mclose","mpunct"],ba={display:Es.DISPLAY,text:Es.TEXT,script:Es.SCRIPT,scriptscript:Es.SCRIPTSCRIPT},va={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},ya=function(e,t,n,r){void 0===r&&(r=[null,null]);for(var o=[],s=0;s<e.length;s++){var i=Ta(e[s],t);if(i instanceof Ns){var a=i.children;o.push(...a)}else o.push(i)}if(ta.tryCombineChars(o),!n)return o;var l=t;if(1===e.length){var c=e[0];"sizing"===c.type?l=t.havingSize(c.size):"styling"===c.type&&(l=t.havingStyle(ba[c.style]))}var u=ma([r[0]||"leftmost"],[],t),h=ma([r[1]||"rightmost"],[],t),d="root"===n;return xa(o,((e,t)=>{var n=t.classes[0],r=e.classes[0];"mbin"===n&&cs(ga,r)?t.classes[0]="mord":"mbin"===r&&cs(fa,n)&&(e.classes[0]="mord")}),{node:u},h,d),xa(o,((e,t)=>{var n=Ca(t),r=Ca(e),o=n&&r?e.hasClass("mtight")?ia[n][r]:sa[n][r]:null;if(o)return ta.makeGlue(o,l)}),{node:u},h,d),o},xa=function e(t,n,r,o,s){o&&t.push(o);for(var i=0;i<t.length;i++){var a=t[i],l=wa(a);if(l)e(l.children,n,r,null,s);else{var c=!a.hasClass("mspace");if(c){var u=n(a,r.node);u&&(r.insertAfter?r.insertAfter(u):(t.unshift(u),i++))}c?r.node=a:s&&a.hasClass("newline")&&(r.node=ma(["leftmost"])),r.insertAfter=(e=>n=>{t.splice(e+1,0,n),i++})(i)}}o&&t.pop()},wa=function(e){return e instanceof Ns||e instanceof Zs||e instanceof Js&&e.hasClass("enclosing")?e:null},ka=function e(t,n){var r=wa(t);if(r){var o=r.children;if(o.length){if("right"===n)return e(o[o.length-1],"right");if("left"===n)return e(o[0],"left")}}return t},Ca=function(e,t){return e?(t&&(e=ka(e,t)),va[e.classes[0]]||null):null},Sa=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return ma(t.concat(n))},Ta=function(e,t,n){if(!e)return ma();if(la[e.type]){var r=la[e.type](e,t);if(n&&t.size!==n.size){r=ma(t.sizingClasses(n),[r],t);var o=t.sizeMultiplier/n.sizeMultiplier;r.height*=o,r.depth*=o}return r}throw new os("Got group of unknown type: '"+e.type+"'")};function Aa(e,t){var n=ma(["base"],e,t),r=ma(["strut"]);return r.style.height=Gs(n.height+n.depth),n.depth&&(r.style.verticalAlign=Gs(-n.depth)),n.children.unshift(r),n}function Ea(e,t){var n=null;1===e.length&&"tag"===e[0].type&&(n=e[0].tag,e=e[0].body);var r,o=ya(e,t,"root");2===o.length&&o[1].hasClass("tag")&&(r=o.pop());for(var s,i=[],a=[],l=0;l<o.length;l++)if(a.push(o[l]),o[l].hasClass("mbin")||o[l].hasClass("mrel")||o[l].hasClass("allowbreak")){for(var c=!1;l<o.length-1&&o[l+1].hasClass("mspace")&&!o[l+1].hasClass("newline");)l++,a.push(o[l]),o[l].hasClass("nobreak")&&(c=!0);c||(i.push(Aa(a,t)),a=[])}else o[l].hasClass("newline")&&(a.pop(),a.length>0&&(i.push(Aa(a,t)),a=[]),i.push(o[l]));a.length>0&&i.push(Aa(a,t)),n?((s=Aa(ya(n,t,!0))).classes=["tag"],i.push(s)):r&&i.push(r);var u=ma(["katex-html"],i);if(u.setAttribute("aria-hidden","true"),s){var h=s.children[0];h.style.height=Gs(u.height+u.depth),u.depth&&(h.style.verticalAlign=Gs(-u.depth))}return u}function Ma(e){return new Ns(e)}class Ba{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=Ws(this.classes));for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=hs(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+hs(Ws(this.classes))+'"'),e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+"</"+this.type+">"}toText(){return this.children.map((e=>e.toText())).join("")}}class Ra{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return hs(this.toText())}toText(){return this.text}}var Oa={MathNode:Ba,TextNode:Ra,SpaceNode:class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?"":e>=.1666&&e<=.1667?"":e>=.2222&&e<=.2223?"":e>=.2777&&e<=.2778?"":e>=-.05556&&e<=-.05555?"":e>=-.1667&&e<=-.1666?"":e>=-.2223&&e<=-.2222?"":e>=-.2778&&e<=-.2777?"":null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Gs(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Gs(this.width)+'"/>'}toText(){return this.character?this.character:" "}},newDocumentFragment:Ma},Na=function(e,t,n){return!li[t][e]||!li[t][e].replace||55349===e.charCodeAt(0)||Ti.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.slice(4,6)||n.font&&"tt"===n.font.slice(4,6))||(e=li[t][e].replace),new Oa.TextNode(e)},Ia=function(e){return 1===e.length?e[0]:new Oa.MathNode("mrow",e)},Pa=function(e,t){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";var n=t.font;if(!n||"mathnormal"===n)return null;var r=e.mode;if("mathit"===n)return"italic";if("boldsymbol"===n)return"textord"===e.type?"bold":"bold-italic";if("mathbf"===n)return"bold";if("mathbb"===n)return"double-struck";if("mathfrak"===n)return"fraktur";if("mathscr"===n||"mathcal"===n)return"script";if("mathsf"===n)return"sans-serif";if("mathtt"===n)return"monospace";var o=e.text;return cs(["\\imath","\\jmath"],o)?null:(li[r][o]&&li[r][o].replace&&(o=li[r][o].replace),Fs(o,ta.fontMap[n].fontName,r)?ta.fontMap[n].variant:null)},La=function(e,t,n){if(1===e.length){var r=za(e[0],t);return n&&r instanceof Ba&&"mo"===r.type&&(r.setAttribute("lspace","0em"),r.setAttribute("rspace","0em")),[r]}for(var o,s=[],i=0;i<e.length;i++){var a=za(e[i],t);if(a instanceof Ba&&o instanceof Ba){if("mtext"===a.type&&"mtext"===o.type&&a.getAttribute("mathvariant")===o.getAttribute("mathvariant")){o.children.push(...a.children);continue}if("mn"===a.type&&"mn"===o.type){o.children.push(...a.children);continue}if("mi"===a.type&&1===a.children.length&&"mn"===o.type){var l=a.children[0];if(l instanceof Ra&&"."===l.text){o.children.push(...a.children);continue}}else if("mi"===o.type&&1===o.children.length){var c=o.children[0];if(c instanceof Ra&&"̸"===c.text&&("mo"===a.type||"mi"===a.type||"mn"===a.type)){var u=a.children[0];u instanceof Ra&&u.text.length>0&&(u.text=u.text.slice(0,1)+"̸"+u.text.slice(1),s.pop())}}}s.push(a),o=a}return s},Fa=function(e,t,n){return Ia(La(e,t,n))},za=function(e,t){if(!e)return new Oa.MathNode("mrow");if(ca[e.type])return ca[e.type](e,t);throw new os("Got group of unknown type: '"+e.type+"'")};function Da(e,t,n,r,o){var s,i=La(e,n);s=1===i.length&&i[0]instanceof Ba&&cs(["mrow","mtable"],i[0].type)?i[0]:new Oa.MathNode("mrow",i);var a=new Oa.MathNode("annotation",[new Oa.TextNode(t)]);a.setAttribute("encoding","application/x-tex");var l=new Oa.MathNode("semantics",[s,a]),c=new Oa.MathNode("math",[l]);return c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block"),ta.makeSpan([o?"katex":"katex-mathml"],[c])}var _a={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},qa={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},ja=function(e){var t=new Oa.MathNode("mo",[new Oa.TextNode(_a[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Ha=function(e,t){var{span:n,minWidth:r,height:o}=function(){var n=4e5,r=e.label.slice(1);if(cs(["widehat","widecheck","widetilde","utilde"],r)){var o,s,i,a="ordgroup"===(p=e.base).type?p.body.length:1;if(a>5)"widehat"===r||"widecheck"===r?(o=420,n=2364,i=.42,s=r+"4"):(o=312,n=2340,i=.34,s="tilde4");else{var l=[1,1,2,2,3,3][a];"widehat"===r||"widecheck"===r?(n=[0,1062,2364,2364,2364][l],o=[0,239,300,360,420][l],i=[0,.24,.3,.3,.36,.42][l],s=r+l):(n=[0,600,1033,2339,2340][l],o=[0,260,286,306,312][l],i=[0,.26,.286,.3,.306,.34][l],s="tilde"+l)}var c=new ri(s),u=new ni([c],{width:"100%",height:Gs(i),viewBox:"0 0 "+n+" "+o,preserveAspectRatio:"none"});return{span:ta.makeSvgSpan([],[u],t),minWidth:0,height:i}}var h,d,p,m=[],f=qa[r],[g,b,v]=f,y=v/1e3,x=g.length;if(1===x)h=["hide-tail"],d=[f[3]];else if(2===x)h=["halfarrow-left","halfarrow-right"],d=["xMinYMin","xMaxYMin"];else{if(3!==x)throw new Error("Correct katexImagesData or update code here to support\n "+x+" children.");h=["brace-left","brace-center","brace-right"],d=["xMinYMin","xMidYMin","xMaxYMin"]}for(var w=0;w<x;w++){var k=new ri(g[w]),C=new ni([k],{width:"400em",height:Gs(y),viewBox:"0 0 "+n+" "+v,preserveAspectRatio:d[w]+" slice"}),S=ta.makeSvgSpan([h[w]],[C],t);if(1===x)return{span:S,minWidth:b,height:y};S.style.height=Gs(y),m.push(S)}return{span:ta.makeSpan(["stretchy"],m,t),minWidth:b,height:y}}();return n.height=o,n.style.height=Gs(o),r>0&&(n.style.minWidth=Gs(r)),n};function Va(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function $a(e){var t=Ua(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Ua(e){return e&&("atom"===e.type||ai.hasOwnProperty(e.type))?e:null}var Ga=(e,t)=>{var n,r,o;e&&"supsub"===e.type?(n=(r=Va(e.base,"accent")).base,e.base=n,o=function(e){if(e instanceof Js)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(Ta(e,t)),e.base=r):n=(r=Va(e,"accent")).base;var s=Ta(n,t.havingCrampedStyle()),i=0;if(r.isShifty&&ms(n)){var a=ps(n);i=si(Ta(a,t.havingCrampedStyle())).skew}var l,c="\\c"===r.label,u=c?s.height+s.depth:Math.min(s.height,t.fontMetrics().xHeight);if(r.isStretchy)l=Ha(r,t),l=ta.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:l,wrapperClasses:["svg-align"],wrapperStyle:i>0?{width:"calc(100% - "+Gs(2*i)+")",marginLeft:Gs(2*i)}:void 0}]},t);else{var h,d;"\\vec"===r.label?(h=ta.staticSvg("vec",t),d=ta.svgData.vec[1]):((h=si(h=ta.makeOrd({mode:r.mode,text:r.label},t,"textord"))).italic=0,d=h.width,c&&(u+=h.depth)),l=ta.makeSpan(["accent-body"],[h]);var p="\\textcircled"===r.label;p&&(l.classes.push("accent-full"),u=s.height);var m=i;p||(m-=d/2),l.style.left=Gs(m),"\\textcircled"===r.label&&(l.style.top=".2em"),l=ta.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-u},{type:"elem",elem:l}]},t)}var f=ta.makeSpan(["mord","accent"],[l],t);return o?(o.children[0]=f,o.height=Math.max(f.height,o.height),o.classes[0]="mord",o):f},Wa=(e,t)=>{var n=e.isStretchy?ja(e.label):new Oa.MathNode("mo",[Na(e.label,e.mode)]),r=new Oa.MathNode("mover",[za(e.base,t),n]);return r.setAttribute("accent","true"),r},Ka=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map((e=>"\\"+e)).join("|"));ua({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=da(t[0]),r=!Ka.test(e.funcName),o=!r||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:o,base:n}},htmlBuilder:Ga,mathmlBuilder:Wa}),ua({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return"math"===r&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:Ga,mathmlBuilder:Wa}),ua({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:o}},htmlBuilder:(e,t)=>{var n=Ta(e.base,t),r=Ha(e,t),o="\\utilde"===e.label?.12:0,s=ta.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:o},{type:"elem",elem:n}]},t);return ta.makeSpan(["mord","accentunder"],[s],t)},mathmlBuilder:(e,t)=>{var n=ja(e.label),r=new Oa.MathNode("munder",[za(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var Ya=e=>{var t=new Oa.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};ua({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:o}=e;return{type:"xArrow",mode:r.mode,label:o,body:t[0],below:n[0]}},htmlBuilder(e,t){var n,r=t.style,o=t.havingStyle(r.sup()),s=ta.wrapFragment(Ta(e.body,o,t),t),i="\\x"===e.label.slice(0,2)?"x":"cd";s.classes.push(i+"-arrow-pad"),e.below&&(o=t.havingStyle(r.sub()),(n=ta.wrapFragment(Ta(e.below,o,t),t)).classes.push(i+"-arrow-pad"));var a,l=Ha(e,t),c=-t.fontMetrics().axisHeight+.5*l.height,u=-t.fontMetrics().axisHeight-.5*l.height-.111;if((s.depth>.25||"\\xleftequilibrium"===e.label)&&(u-=s.depth),n){var h=-t.fontMetrics().axisHeight+n.height+.5*l.height+.111;a=ta.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:l,shift:c},{type:"elem",elem:n,shift:h}]},t)}else a=ta.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:l,shift:c}]},t);return a.children[0].children[0].children[1].classes.push("svg-align"),ta.makeSpan(["mrel","x-arrow"],[a],t)},mathmlBuilder(e,t){var n,r=ja(e.label);if(r.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var o=Ya(za(e.body,t));if(e.below){var s=Ya(za(e.below,t));n=new Oa.MathNode("munderover",[r,s,o])}else n=new Oa.MathNode("mover",[r,o])}else if(e.below){var i=Ya(za(e.below,t));n=new Oa.MathNode("munder",[r,i])}else n=Ya(),n=new Oa.MathNode("mover",[r,n]);return n}});var Xa=ta.makeSpan;function Ja(e,t){var n=ya(e.body,t,!0);return Xa([e.mclass],n,t)}function Za(e,t){var n,r=La(e.body,t);return"minner"===e.mclass?n=new Oa.MathNode("mpadded",r):"mord"===e.mclass?e.isCharacterBox?(n=r[0]).type="mi":n=new Oa.MathNode("mi",r):(e.isCharacterBox?(n=r[0]).type="mo":n=new Oa.MathNode("mo",r),"mbin"===e.mclass?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):"mpunct"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):"mopen"===e.mclass||"mclose"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0em"):"minner"===e.mclass&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}ua({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:pa(o),isCharacterBox:ms(o)}},htmlBuilder:Ja,mathmlBuilder:Za});var Qa=e=>{var t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==t.type||"bin"!==t.family&&"rel"!==t.family?"mord":"m"+t.family};ua({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Qa(t[0]),body:pa(t[1]),isCharacterBox:ms(t[1])}}}),ua({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var n,{parser:r,funcName:o}=e,s=t[1],i=t[0];n="\\stackrel"!==o?Qa(s):"mrel";var a={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==o,body:pa(s)},l={type:"supsub",mode:i.mode,base:a,sup:"\\underset"===o?null:i,sub:"\\underset"===o?i:null};return{type:"mclass",mode:r.mode,mclass:n,body:[l],isCharacterBox:ms(l)}},htmlBuilder:Ja,mathmlBuilder:Za}),ua({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Qa(t[0]),body:pa(t[0])}},htmlBuilder(e,t){var n=ya(e.body,t,!0),r=ta.makeSpan([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=La(e.body,t),r=new Oa.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var el={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},tl=e=>"textord"===e.type&&"@"===e.text;function nl(e,t,n){var r=el[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":var o={type:"atom",text:r,mode:"math",family:"rel"},s={type:"ordgroup",mode:"math",body:[n.callFunction("\\\\cdleft",[t[0]],[]),n.callFunction("\\Big",[o],[]),n.callFunction("\\\\cdright",[t[1]],[])]};return n.callFunction("\\\\cdparent",[s],[]);case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return n.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}}}ua({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=ta.wrapFragment(Ta(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=Gs(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Oa.MathNode("mrow",[za(e.label,t)]);return(n=new Oa.MathNode("mpadded",[n])).setAttribute("width","0"),"left"===e.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),(n=new Oa.MathNode("mstyle",[n])).setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),ua({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=ta.wrapFragment(Ta(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new Oa.MathNode("mrow",[za(e.fragment,t)])}}),ua({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=Va(t[0],"ordgroup").body,o="",s=0;s<r.length;s++)o+=Va(r[s],"textord").text;var i,a=parseInt(o);if(isNaN(a))throw new os("\\@char has non-numeric argument "+o);if(a<0||a>=1114111)throw new os("\\@char with invalid code point "+o);return a<=65535?i=String.fromCharCode(a):(a-=65536,i=String.fromCharCode(55296+(a>>10),56320+(1023&a))),{type:"textord",mode:n.mode,text:i}}});var rl=(e,t)=>{var n=ya(e.body,t.withColor(e.color),!1);return ta.makeFragment(n)},ol=(e,t)=>{var n=La(e.body,t.withColor(e.color)),r=new Oa.MathNode("mstyle",n);return r.setAttribute("mathcolor",e.color),r};ua({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=Va(t[0],"color-token").color,o=t[1];return{type:"color",mode:n.mode,color:r,body:pa(o)}},htmlBuilder:rl,mathmlBuilder:ol}),ua({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,o=Va(t[0],"color-token").color;n.gullet.macros.set("\\current@color",o);var s=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:o,body:s}},htmlBuilder:rl,mathmlBuilder:ol}),ua({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:1,argTypes:["size"],allowedInText:!0},handler(e,t,n){var{parser:r}=e,o=n[0],s=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:s,size:o&&Va(o,"size").value}},htmlBuilder(e,t){var n=ta.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=Gs(Us(e.size,t)))),n},mathmlBuilder(e,t){var n=new Oa.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",Gs(Us(e.size,t)))),n}});var sl={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},il=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new os("Expected a control sequence",e);return t},al=(e,t,n,r)=>{var o=e.gullet.macros.get(n.text);null==o&&(n.noexpand=!0,o={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,o,r)};ua({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(sl[r.text])return"\\global"!==n&&"\\\\globallong"!==n||(r.text=sl[r.text]),Va(t.parseFunction(),"internal");throw new os("Invalid token after macro prefix",r)}}),ua({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),o=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(o))throw new os("Expected a control sequence",r);for(var s,i=0,a=[[]];"{"!==t.gullet.future().text;)if("#"===(r=t.gullet.popToken()).text){if("{"===t.gullet.future().text){s=t.gullet.future(),a[i].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new os('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new os('Argument number "'+r.text+'" out of order');i++,a.push([])}else{if("EOF"===r.text)throw new os("Expected a macro definition");a[i].push(r.text)}var{tokens:l}=t.gullet.consumeArg();return s&&l.unshift(s),"\\edef"!==n&&"\\xdef"!==n||(l=t.gullet.expandTokens(l)).reverse(),t.gullet.macros.set(o,{tokens:l,numArgs:i,delimiters:a},n===sl[n]),{type:"internal",mode:t.mode}}}),ua({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=il(t.gullet.popToken());t.gullet.consumeSpaces();var o=(e=>{var t=e.gullet.popToken();return"="===t.text&&" "===(t=e.gullet.popToken()).text&&(t=e.gullet.popToken()),t})(t);return al(t,r,o,"\\\\globallet"===n),{type:"internal",mode:t.mode}}}),ua({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=il(t.gullet.popToken()),o=t.gullet.popToken(),s=t.gullet.popToken();return al(t,r,s,"\\\\globalfuture"===n),t.gullet.pushToken(s),t.gullet.pushToken(o),{type:"internal",mode:t.mode}}});var ll=function(e,t,n){var r=Fs(li.math[e]&&li.math[e].replace||e,t,n);if(!r)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return r},cl=function(e,t,n,r){var o=n.havingBaseStyle(t),s=ta.makeSpan(r.concat(o.sizingClasses(n)),[e],n),i=o.sizeMultiplier/n.sizeMultiplier;return s.height*=i,s.depth*=i,s.maxFontSize=o.sizeMultiplier,s},ul=function(e,t,n){var r=t.havingBaseStyle(n),o=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Gs(o),e.height-=o,e.depth+=o},hl=function(e,t,n,r,o,s){var i=function(e,t,n,r){return ta.makeSymbol(e,"Size"+t+"-Regular",n,r)}(e,t,o,r),a=cl(ta.makeSpan(["delimsizing","size"+t],[i],r),Es.TEXT,r,s);return n&&ul(a,r,Es.TEXT),a},dl=function(e,t,n){return{type:"elem",elem:ta.makeSpan(["delimsizinginner","Size1-Regular"===t?"delim-size1":"delim-size4"],[ta.makeSpan([],[ta.makeSymbol(e,t,n)])])}},pl=function(e,t,n){var r=Is["Size4-Regular"][e.charCodeAt(0)]?Is["Size4-Regular"][e.charCodeAt(0)][4]:Is["Size1-Regular"][e.charCodeAt(0)][4],o=new ri("inner",function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145zM367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z";case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257zM478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z";default:return""}}(e,Math.round(1e3*t))),s=new ni([o],{width:Gs(r),height:Gs(t),style:"width:"+Gs(r),viewBox:"0 0 "+1e3*r+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),i=ta.makeSvgSpan([],[s],n);return i.height=t,i.style.height=Gs(t),i.style.width=Gs(r),{type:"elem",elem:i}},ml={type:"kern",size:-.008},fl=["|","\\lvert","\\rvert","\\vert"],gl=["\\|","\\lVert","\\rVert","\\Vert"],bl=function(e,t,n,r,o,s){var i,a,l,c,u="",h=0;i=l=c=e,a=null;var d="Size1-Regular";"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?i=l="⏐":"\\Downarrow"===e?i=l="‖":"\\updownarrow"===e?(i="\\uparrow",l="⏐",c="\\downarrow"):"\\Updownarrow"===e?(i="\\Uparrow",l="‖",c="\\Downarrow"):cs(fl,e)?(l="",u="vert",h=333):cs(gl,e)?(l="∥",u="doublevert",h=556):"["===e||"\\lbrack"===e?(i="⎡",l="⎢",c="⎣",d="Size4-Regular",u="lbrack",h=667):"]"===e||"\\rbrack"===e?(i="⎤",l="⎥",c="⎦",d="Size4-Regular",u="rbrack",h=667):"\\lfloor"===e||"⌊"===e?(l=i="⎢",c="⎣",d="Size4-Regular",u="lfloor",h=667):"\\lceil"===e||"⌈"===e?(i="⎡",l=c="⎢",d="Size4-Regular",u="lceil",h=667):"\\rfloor"===e||"⌋"===e?(l=i="⎥",c="⎦",d="Size4-Regular",u="rfloor",h=667):"\\rceil"===e||"⌉"===e?(i="⎤",l=c="⎥",d="Size4-Regular",u="rceil",h=667):"("===e||"\\lparen"===e?(i="⎛",l="⎜",c="⎝",d="Size4-Regular",u="lparen",h=875):")"===e||"\\rparen"===e?(i="⎞",l="⎟",c="⎠",d="Size4-Regular",u="rparen",h=875):"\\{"===e||"\\lbrace"===e?(i="⎧",a="⎨",c="⎩",l="⎪",d="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(i="⎫",a="⎬",c="⎭",l="⎪",d="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(i="⎧",c="⎩",l="⎪",d="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(i="⎫",c="⎭",l="⎪",d="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(i="⎧",c="⎭",l="⎪",d="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(i="⎫",c="⎩",l="⎪",d="Size4-Regular");var p=ll(i,d,o),m=p.height+p.depth,f=ll(l,d,o),g=f.height+f.depth,b=ll(c,d,o),v=b.height+b.depth,y=0,x=1;if(null!==a){var w=ll(a,d,o);y=w.height+w.depth,x=2}var k=m+v+y,C=k+Math.max(0,Math.ceil((t-k)/(x*g)))*x*g,S=r.fontMetrics().axisHeight;n&&(S*=r.sizeMultiplier);var T=C/2-S,A=[];if(u.length>0){var E=C-m-v,M=Math.round(1e3*C),B=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z\nM367 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v602 h84z\nM403 1759 V0 H319 V1759 v"+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+t+" v602 h84z";case"lparen":return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(t+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(t+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}}(u,Math.round(1e3*E)),R=new ri(u,B),O=(h/1e3).toFixed(3)+"em",N=(M/1e3).toFixed(3)+"em",I=new ni([R],{width:O,height:N,viewBox:"0 0 "+h+" "+M}),P=ta.makeSvgSpan([],[I],r);P.height=M/1e3,P.style.width=O,P.style.height=N,A.push({type:"elem",elem:P})}else{if(A.push(dl(c,d,o)),A.push(ml),null===a){var L=C-m-v+.016;A.push(pl(l,L,r))}else{var F=(C-m-v-y)/2+.016;A.push(pl(l,F,r)),A.push(ml),A.push(dl(a,d,o)),A.push(ml),A.push(pl(l,F,r))}A.push(ml),A.push(dl(i,d,o))}var z=r.havingBaseStyle(Es.TEXT),D=ta.makeVList({positionType:"bottom",positionData:T,children:A},z);return cl(ta.makeSpan(["delimsizing","mult"],[D],z),Es.TEXT,r,s)},vl=.08,yl=function(e,t,n,r,o){var s=function(e,t,n){t*=1e3;var r="";switch(e){case"sqrtMain":r=function(e,t){return"M95,"+(622+e+80)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" 80h400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize1":r=function(e,t){return"M263,"+(601+e+80)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" 80h400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize2":r=function(e,t){return"M983 "+(10+e+80)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" 80h400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize3":r=function(e,t){return"M424,"+(2398+e+80)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" 80\nh400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize4":r=function(e,t){return"M473,"+(2713+e+80)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" 80h400000v"+(40+e)+"H1017.7z"}(t);break;case"sqrtTall":r=function(e,t,n){return"M702 "+(e+80)+"H400000"+(40+e)+"\nH742v"+(n-54-80-e)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 80H400000v"+(40+e)+"H742z"}(t,0,n)}return r}(e,r,n),i=new ri(e,s),a=new ni([i],{width:"400em",height:Gs(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return ta.makeSvgSpan(["hide-tail"],[a],o)},xl=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],wl=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],kl=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Cl=[0,1.2,1.8,2.4,3],Sl=[{type:"small",style:Es.SCRIPTSCRIPT},{type:"small",style:Es.SCRIPT},{type:"small",style:Es.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Tl=[{type:"small",style:Es.SCRIPTSCRIPT},{type:"small",style:Es.SCRIPT},{type:"small",style:Es.TEXT},{type:"stack"}],Al=[{type:"small",style:Es.SCRIPTSCRIPT},{type:"small",style:Es.SCRIPT},{type:"small",style:Es.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],El=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},Ml=function(e,t,n,r){for(var o=Math.min(2,3-r.style.size);o<n.length&&"stack"!==n[o].type;o++){var s=ll(e,El(n[o]),"math"),i=s.height+s.depth;if("small"===n[o].type&&(i*=r.havingBaseStyle(n[o].style).sizeMultiplier),i>t)return n[o]}return n[n.length-1]},Bl=function(e,t,n,r,o,s){var i;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),i=cs(kl,e)?Sl:cs(xl,e)?Al:Tl;var a=Ml(e,t,i,r);return"small"===a.type?function(e,t,n,r,o,s){var i=ta.makeSymbol(e,"Main-Regular",o,r),a=cl(i,t,r,s);return n&&ul(a,r,t),a}(e,a.style,n,r,o,s):"large"===a.type?hl(e,a.size,n,r,o,s):bl(e,t,n,r,o,s)},Rl={sqrtImage:function(e,t){var n,r,o=t.havingBaseSizing(),s=Ml("\\surd",e*o.sizeMultiplier,Al,o),i=o.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),l=0,c=0,u=0;return"small"===s.type?(e<1?i=1:e<1.4&&(i=.7),c=(1+a)/i,(n=yl("sqrtMain",l=(1+a+vl)/i,u=1e3+1e3*a+80,a,t)).style.minWidth="0.853em",r=.833/i):"large"===s.type?(u=1080*Cl[s.size],c=(Cl[s.size]+a)/i,l=(Cl[s.size]+a+vl)/i,(n=yl("sqrtSize"+s.size,l,u,a,t)).style.minWidth="1.02em",r=1/i):(l=e+a+vl,c=e+a,u=Math.floor(1e3*e+a)+80,(n=yl("sqrtTall",l,u,a,t)).style.minWidth="0.742em",r=1.056),n.height=c,n.style.height=Gs(l),{span:n,advanceWidth:r,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},sizedDelim:function(e,t,n,r,o){if("<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),cs(xl,e)||cs(kl,e))return hl(e,t,!1,n,r,o);if(cs(wl,e))return bl(e,Cl[t],!1,n,r,o);throw new os("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:Cl,customSizedDelim:Bl,leftRightDelim:function(e,t,n,r,o,s){var i=r.fontMetrics().axisHeight*r.sizeMultiplier,a=5/r.fontMetrics().ptPerEm,l=Math.max(t-i,n+i),c=Math.max(l/500*901,2*l-a);return Bl(e,c,!0,r,o,s)}},Ol={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},Nl=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Il(e,t){var n=Ua(e);if(n&&cs(Nl,n.text))return n;throw new os(n?"Invalid delimiter '"+n.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function Pl(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ua({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=Il(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:Ol[e.funcName].size,mclass:Ol[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?ta.makeSpan([e.mclass]):Rl.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(Na(e.delim,e.mode));var n=new Oa.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=Gs(Rl.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}}),ua({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&"string"!=typeof n)throw new os("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Il(t[0],e).text,color:n}}}),ua({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Il(t[0],e),r=e.parser;++r.leftrightDepth;var o=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var s=Va(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:o,left:n.text,right:s.delim,rightColor:s.color}},htmlBuilder:(e,t)=>{Pl(e);for(var n,r,o=ya(e.body,t,!0,["mopen","mclose"]),s=0,i=0,a=!1,l=0;l<o.length;l++)o[l].isMiddle?a=!0:(s=Math.max(o[l].height,s),i=Math.max(o[l].depth,i));if(s*=t.sizeMultiplier,i*=t.sizeMultiplier,n="."===e.left?Sa(t,["mopen"]):Rl.leftRightDelim(e.left,s,i,t,e.mode,["mopen"]),o.unshift(n),a)for(var c=1;c<o.length;c++){var u=o[c].isMiddle;u&&(o[c]=Rl.leftRightDelim(u.delim,s,i,u.options,e.mode,[]))}if("."===e.right)r=Sa(t,["mclose"]);else{var h=e.rightColor?t.withColor(e.rightColor):t;r=Rl.leftRightDelim(e.right,s,i,h,e.mode,["mclose"])}return o.push(r),ta.makeSpan(["minner"],o,t)},mathmlBuilder:(e,t)=>{Pl(e);var n=La(e.body,t);if("."!==e.left){var r=new Oa.MathNode("mo",[Na(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if("."!==e.right){var o=new Oa.MathNode("mo",[Na(e.right,e.mode)]);o.setAttribute("fence","true"),e.rightColor&&o.setAttribute("mathcolor",e.rightColor),n.push(o)}return Ia(n)}}),ua({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Il(t[0],e);if(!e.parser.leftrightDepth)throw new os("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if("."===e.delim)n=Sa(t,[]);else{n=Rl.sizedDelim(e.delim,1,t,e.mode,[]);var r={delim:e.delim,options:t};n.isMiddle=r}return n},mathmlBuilder:(e,t)=>{var n="\\vert"===e.delim||"|"===e.delim?Na("|","text"):Na(e.delim,e.mode),r=new Oa.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Ll=(e,t)=>{var n,r,o=ta.wrapFragment(Ta(e.body,t),t),s=e.label.slice(1),i=t.sizeMultiplier,a=0,l=ms(e.body);if("sout"===s)(n=ta.makeSpan(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/i,a=-.5*t.fontMetrics().xHeight;else if("phase"===s){var c=Us({number:.6,unit:"pt"},t),u=Us({number:.35,unit:"ex"},t);i/=t.havingBaseSizing().sizeMultiplier;var h=o.height+o.depth+c+u;o.style.paddingLeft=Gs(h/2+c);var d=Math.floor(1e3*h*i),p=function(e){return"M400000 "+e+" H0 L"+e/2+" 0 l65 45 L145 "+(e-80)+" H400000z"}(d),m=new ni([new ri("phase",p)],{width:"400em",height:Gs(d/1e3),viewBox:"0 0 400000 "+d,preserveAspectRatio:"xMinYMin slice"});(n=ta.makeSvgSpan(["hide-tail"],[m],t)).style.height=Gs(h),a=o.depth+c+u}else{/cancel/.test(s)?l||o.classes.push("cancel-pad"):"angl"===s?o.classes.push("anglpad"):o.classes.push("boxpad");var f=0,g=0,b=0;/box/.test(s)?(b=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),g=f=t.fontMetrics().fboxsep+("colorbox"===s?0:b)):"angl"===s?(f=4*(b=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness)),g=Math.max(0,.25-o.depth)):g=f=l?.2:0,n=function(e,t,n,r,o){var s,i=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(s=ta.makeSpan(["stretchy",t],[],o),"fbox"===t){var a=o.color&&o.getColor();a&&(s.style.borderColor=a)}}else{var l=[];/^[bx]cancel$/.test(t)&&l.push(new oi({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new oi({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new ni(l,{width:"100%",height:Gs(i)});s=ta.makeSvgSpan([],[c],o)}return s.height=i,s.style.height=Gs(i),s}(o,s,f,g,t),/fbox|boxed|fcolorbox/.test(s)?(n.style.borderStyle="solid",n.style.borderWidth=Gs(b)):"angl"===s&&.049!==b&&(n.style.borderTopWidth=Gs(b),n.style.borderRightWidth=Gs(b)),a=o.depth+g,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)r=ta.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:a},{type:"elem",elem:o,shift:0}]},t);else{var v=/cancel|phase/.test(s)?["svg-align"]:[];r=ta.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:n,shift:a,wrapperClasses:v}]},t)}return/cancel/.test(s)&&(r.height=o.height,r.depth=o.depth),/cancel/.test(s)&&!l?ta.makeSpan(["mord","cancel-lap"],[r],t):ta.makeSpan(["mord"],[r],t)},Fl=(e,t)=>{var n=0,r=new Oa.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[za(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),"\\fcolorbox"===e.label){var o=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+o+"em solid "+String(e.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};ua({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:r,funcName:o}=e,s=Va(t[0],"color-token").color,i=t[1];return{type:"enclose",mode:r.mode,label:o,backgroundColor:s,body:i}},htmlBuilder:Ll,mathmlBuilder:Fl}),ua({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:o}=e,s=Va(t[0],"color-token").color,i=Va(t[1],"color-token").color,a=t[2];return{type:"enclose",mode:r.mode,label:o,backgroundColor:i,borderColor:s,body:a}},htmlBuilder:Ll,mathmlBuilder:Fl}),ua({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}}),ua({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];return{type:"enclose",mode:n.mode,label:r,body:o}},htmlBuilder:Ll,mathmlBuilder:Fl}),ua({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var zl={};function Dl(e){for(var{type:t,names:n,props:r,handler:o,htmlBuilder:s,mathmlBuilder:i}=e,a={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:o},l=0;l<n.length;++l)zl[n[l]]=a;s&&(la[t]=s),i&&(ca[t]=i)}var _l={};function ql(e,t){_l[e]=t}function jl(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for("\\relax"===n&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);"\\hline"===n||"\\hdashline"===n;)e.consume(),t.push("\\hdashline"===n),e.consumeSpaces(),n=e.fetch().text;return t}var Hl=e=>{if(!e.parser.settings.displayMode)throw new os("{"+e.envName+"} can be used only in display mode.")};function Vl(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function $l(e,t,n){var{hskipBeforeAndAfter:r,addJot:o,cols:s,arraystretch:i,colSeparationType:a,autoTag:l,singleRow:c,emptySingleRow:u,maxNumCols:h,leqno:d}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!i){var p=e.gullet.expandMacroAsText("\\arraystretch");if(null==p)i=1;else if(!(i=parseFloat(p))||i<0)throw new os("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var m=[],f=[m],g=[],b=[],v=null!=l?[]:void 0;function y(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function x(){v&&(e.gullet.macros.get("\\df@tag")?(v.push(e.subparse([new rs("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):v.push(Boolean(l)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(y(),b.push(jl(e));;){var w=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),w={type:"ordgroup",mode:e.mode,body:w},n&&(w={type:"styling",mode:e.mode,style:n,body:[w]}),m.push(w);var k=e.fetch().text;if("&"===k){if(h&&m.length===h){if(c||a)throw new os("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else{if("\\end"===k){x(),1===m.length&&"styling"===w.type&&0===w.body[0].body.length&&(f.length>1||!u)&&f.pop(),b.length<f.length+1&&b.push([]);break}if("\\\\"!==k)throw new os("Expected & or \\\\ or \\cr or \\end",e.nextToken);e.consume();var C=void 0;" "!==e.gullet.future().text&&(C=e.parseSizeGroup(!0)),g.push(C?C.value:null),x(),b.push(jl(e)),m=[],f.push(m),y()}}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:o,arraystretch:i,body:f,cols:s,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:b,colSeparationType:a,tags:v,leqno:d}}function Ul(e){return"d"===e.slice(0,1)?"display":"text"}var Gl=function(e,t){var n,r,o=e.body.length,s=e.hLinesBeforeRow,i=0,a=new Array(o),l=[],c=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),u=1/t.fontMetrics().ptPerEm,h=5*u;e.colSeparationType&&"small"===e.colSeparationType&&(h=t.havingStyle(Es.SCRIPT).sizeMultiplier/t.sizeMultiplier*.2778);var d="CD"===e.colSeparationType?Us({number:3,unit:"ex"},t):12*u,p=3*u,m=e.arraystretch*d,f=.7*m,g=.3*m,b=0;function v(e){for(var t=0;t<e.length;++t)t>0&&(b+=.25),l.push({pos:b,isDashed:e[t]})}for(v(s[0]),n=0;n<e.body.length;++n){var y=e.body[n],x=f,w=g;i<y.length&&(i=y.length);var k=new Array(y.length);for(r=0;r<y.length;++r){var C=Ta(y[r],t);w<C.depth&&(w=C.depth),x<C.height&&(x=C.height),k[r]=C}var S=e.rowGaps[n],T=0;S&&(T=Us(S,t))>0&&(w<(T+=g)&&(w=T),T=0),e.addJot&&(w+=p),k.height=x,k.depth=w,b+=x,k.pos=b,b+=w+T,a[n]=k,v(s[n+1])}var A,E,M=b/2+t.fontMetrics().axisHeight,B=e.cols||[],R=[],O=[];if(e.tags&&e.tags.some((e=>e)))for(n=0;n<o;++n){var N=a[n],I=N.pos-M,P=e.tags[n],L=void 0;(L=!0===P?ta.makeSpan(["eqn-num"],[],t):ta.makeSpan([],!1===P?[]:ya(P,t,!0),t)).depth=N.depth,L.height=N.height,O.push({type:"elem",elem:L,shift:I})}for(r=0,E=0;r<i||E<B.length;++r,++E){for(var F=B[E]||{},z=!0;"separator"===F.type;){if(z||((A=ta.makeSpan(["arraycolsep"],[])).style.width=Gs(t.fontMetrics().doubleRuleSep),R.push(A)),"|"!==F.separator&&":"!==F.separator)throw new os("Invalid separator type: "+F.separator);var D="|"===F.separator?"solid":"dashed",_=ta.makeSpan(["vertical-separator"],[],t);_.style.height=Gs(b),_.style.borderRightWidth=Gs(c),_.style.borderRightStyle=D,_.style.margin="0 "+Gs(-c/2);var q=b-M;q&&(_.style.verticalAlign=Gs(-q)),R.push(_),F=B[++E]||{},z=!1}if(!(r>=i)){var j=void 0;(r>0||e.hskipBeforeAndAfter)&&0!==(j=us(F.pregap,h))&&((A=ta.makeSpan(["arraycolsep"],[])).style.width=Gs(j),R.push(A));var H=[];for(n=0;n<o;++n){var V=a[n],$=V[r];if($){var U=V.pos-M;$.depth=V.depth,$.height=V.height,H.push({type:"elem",elem:$,shift:U})}}H=ta.makeVList({positionType:"individualShift",children:H},t),H=ta.makeSpan(["col-align-"+(F.align||"c")],[H]),R.push(H),(r<i-1||e.hskipBeforeAndAfter)&&0!==(j=us(F.postgap,h))&&((A=ta.makeSpan(["arraycolsep"],[])).style.width=Gs(j),R.push(A))}}if(a=ta.makeSpan(["mtable"],R),l.length>0){for(var G=ta.makeLineSpan("hline",t,c),W=ta.makeLineSpan("hdashline",t,c),K=[{type:"elem",elem:a,shift:0}];l.length>0;){var Y=l.pop(),X=Y.pos-M;Y.isDashed?K.push({type:"elem",elem:W,shift:X}):K.push({type:"elem",elem:G,shift:X})}a=ta.makeVList({positionType:"individualShift",children:K},t)}if(0===O.length)return ta.makeSpan(["mord"],[a],t);var J=ta.makeVList({positionType:"individualShift",children:O},t);return J=ta.makeSpan(["tag"],[J],t),ta.makeFragment([a,J])},Wl={c:"center ",l:"left ",r:"right "},Kl=function(e,t){for(var n=[],r=new Oa.MathNode("mtd",[],["mtr-glue"]),o=new Oa.MathNode("mtd",[],["mml-eqn-num"]),s=0;s<e.body.length;s++){for(var i=e.body[s],a=[],l=0;l<i.length;l++)a.push(new Oa.MathNode("mtd",[za(i[l],t)]));e.tags&&e.tags[s]&&(a.unshift(r),a.push(r),e.leqno?a.unshift(o):a.push(o)),n.push(new Oa.MathNode("mtr",a))}var c=new Oa.MathNode("mtable",n),u=.5===e.arraystretch?.1:.16+e.arraystretch-1+(e.addJot?.09:0);c.setAttribute("rowspacing",Gs(u));var h="",d="";if(e.cols&&e.cols.length>0){var p=e.cols,m="",f=!1,g=0,b=p.length;"separator"===p[0].type&&(h+="top ",g=1),"separator"===p[p.length-1].type&&(h+="bottom ",b-=1);for(var v=g;v<b;v++)"align"===p[v].type?(d+=Wl[p[v].align],f&&(m+="none "),f=!0):"separator"===p[v].type&&f&&(m+="|"===p[v].separator?"solid ":"dashed ",f=!1);c.setAttribute("columnalign",d.trim()),/[sd]/.test(m)&&c.setAttribute("columnlines",m.trim())}if("align"===e.colSeparationType){for(var y=e.cols||[],x="",w=1;w<y.length;w++)x+=w%2?"0em ":"1em ";c.setAttribute("columnspacing",x.trim())}else"alignat"===e.colSeparationType||"gather"===e.colSeparationType?c.setAttribute("columnspacing","0em"):"small"===e.colSeparationType?c.setAttribute("columnspacing","0.2778em"):"CD"===e.colSeparationType?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var k="",C=e.hLinesBeforeRow;h+=C[0].length>0?"left ":"",h+=C[C.length-1].length>0?"right ":"";for(var S=1;S<C.length-1;S++)k+=0===C[S].length?"none ":C[S][0]?"dashed ":"solid ";return/[sd]/.test(k)&&c.setAttribute("rowlines",k.trim()),""!==h&&(c=new Oa.MathNode("menclose",[c])).setAttribute("notation",h.trim()),e.arraystretch&&e.arraystretch<1&&(c=new Oa.MathNode("mstyle",[c])).setAttribute("scriptlevel","1"),c},Yl=function(e,t){-1===e.envName.indexOf("ed")&&Hl(e);var n,r=[],o=e.envName.indexOf("at")>-1?"alignat":"align",s="split"===e.envName,i=$l(e.parser,{cols:r,addJot:!0,autoTag:s?void 0:Vl(e.envName),emptySingleRow:!0,colSeparationType:o,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display"),a=0,l={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){for(var c="",u=0;u<t[0].body.length;u++)c+=Va(t[0].body[u],"textord").text;n=Number(c),a=2*n}var h=!a;i.body.forEach((function(e){for(var t=1;t<e.length;t+=2){var r=Va(e[t],"styling");Va(r.body[0],"ordgroup").body.unshift(l)}if(h)a<e.length&&(a=e.length);else{var o=e.length/2;if(n<o)throw new os("Too many math in a row: expected "+n+", but got "+o,e[0])}}));for(var d=0;d<a;++d){var p="r",m=0;d%2==1?p="l":d>0&&h&&(m=1),r[d]={type:"align",align:p,pregap:m,postgap:0}}return i.colSeparationType=h?"align":"alignat",i};Dl({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=(Ua(t[0])?[t[0]]:Va(t[0],"ordgroup").body).map((function(e){var t=$a(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"};throw new os("Unknown column alignment: "+t,e)})),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return $l(e.parser,r,Ul(e.envName))},htmlBuilder:Gl,mathmlBuilder:Kl}),Dl({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if("*"===e.envName.charAt(e.envName.length-1)){var o=e.parser;if(o.consumeSpaces(),"["===o.fetch().text){if(o.consume(),o.consumeSpaces(),n=o.fetch().text,-1==="lcr".indexOf(n))throw new os("Expected l or c or r",o.nextToken);o.consume(),o.consumeSpaces(),o.expect("]"),o.consume(),r.cols=[{type:"align",align:n}]}}var s=$l(e.parser,r,Ul(e.envName)),i=Math.max(0,...s.body.map((e=>e.length)));return s.cols=new Array(i).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[s],left:t[0],right:t[1],rightColor:void 0}:s},htmlBuilder:Gl,mathmlBuilder:Kl}),Dl({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t=$l(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:Gl,mathmlBuilder:Kl}),Dl({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=(Ua(t[0])?[t[0]]:Va(t[0],"ordgroup").body).map((function(e){var t=$a(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new os("Unknown column alignment: "+t,e)}));if(n.length>1)throw new os("{subarray} can contain only one column");var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if((r=$l(e.parser,r,"script")).body.length>0&&r.body[0].length>1)throw new os("{subarray} can contain only one column");return r},htmlBuilder:Gl,mathmlBuilder:Kl}),Dl({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=$l(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},Ul(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Gl,mathmlBuilder:Kl}),Dl({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Yl,htmlBuilder:Gl,mathmlBuilder:Kl}),Dl({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){cs(["gather","gather*"],e.envName)&&Hl(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Vl(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return $l(e.parser,t,"display")},htmlBuilder:Gl,mathmlBuilder:Kl}),Dl({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Yl,htmlBuilder:Gl,mathmlBuilder:Kl}),Dl({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Hl(e);var t={autoTag:Vl(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return $l(e.parser,t,"display")},htmlBuilder:Gl,mathmlBuilder:Kl}),Dl({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Hl(e),function(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if("&"!==n&&"\\\\"!==n){if("\\end"===n){0===t[t.length-1].length&&t.pop();break}throw new os("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}for(var r,o,s=[],i=[s],a=0;a<t.length;a++){for(var l=t[a],c={type:"styling",body:[],mode:"math",style:"display"},u=0;u<l.length;u++)if(tl(l[u])){s.push(c);var h=$a(l[u+=1]).text,d=new Array(2);if(d[0]={type:"ordgroup",mode:"math",body:[]},d[1]={type:"ordgroup",mode:"math",body:[]},"=|.".indexOf(h)>-1);else{if(!("<>AV".indexOf(h)>-1))throw new os('Expected one of "<>AV=|." after @',l[u]);for(var p=0;p<2;p++){for(var m=!0,f=u+1;f<l.length;f++){if(o=h,("mathord"===(r=l[f]).type||"atom"===r.type)&&r.text===o){m=!1,u=f;break}if(tl(l[f]))throw new os("Missing a "+h+" character to complete a CD arrow.",l[f]);d[p].body.push(l[f])}if(m)throw new os("Missing a "+h+" character to complete a CD arrow.",l[u])}}var g={type:"styling",body:[nl(h,d,e)],mode:"math",style:"display"};s.push(g),c={type:"styling",body:[],mode:"math",style:"display"}}else c.body.push(l[u]);a%2==0?s.push(c):s.shift(),s=[],i.push(s)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25}),colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}(e.parser)},htmlBuilder:Gl,mathmlBuilder:Kl}),ql("\\nonumber","\\gdef\\@eqnsw{0}"),ql("\\notag","\\nonumber"),ua({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new os(e.funcName+" valid only within array environment")}});var Xl=zl;ua({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];if("ordgroup"!==o.type)throw new os("Invalid environment name",o);for(var s="",i=0;i<o.body.length;++i)s+=Va(o.body[i],"textord").text;if("\\begin"===r){if(!Xl.hasOwnProperty(s))throw new os("No such environment: "+s,o);var a=Xl[s],{args:l,optArgs:c}=n.parseArguments("\\begin{"+s+"}",a),u={mode:n.mode,envName:s,parser:n},h=a.handler(u,l,c);n.expect("\\end",!1);var d=n.nextToken,p=Va(n.parseFunction(),"environment");if(p.name!==s)throw new os("Mismatch: \\begin{"+s+"} matched by \\end{"+p.name+"}",d);return h}return{type:"environment",mode:n.mode,name:s,nameGroup:o}}});var Jl=(e,t)=>{var n=e.font,r=t.withFont(n);return Ta(e.body,r)},Zl=(e,t)=>{var n=e.font,r=t.withFont(n);return za(e.body,r)},Ql={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};ua({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=da(t[0]),s=r;return s in Ql&&(s=Ql[s]),{type:"font",mode:n.mode,font:s.slice(1),body:o}},htmlBuilder:Jl,mathmlBuilder:Zl}),ua({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0],o=ms(r);return{type:"mclass",mode:n.mode,mclass:Qa(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:o}}}),ua({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:o}=e,{mode:s}=n,i=n.parseExpression(!0,o);return{type:"font",mode:s,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:i}}},htmlBuilder:Jl,mathmlBuilder:Zl});var ec=(e,t)=>{var n=t;return"display"===e?n=n.id>=Es.SCRIPT.id?n.text():Es.DISPLAY:"text"===e&&n.size===Es.DISPLAY.size?n=Es.TEXT:"script"===e?n=Es.SCRIPT:"scriptscript"===e&&(n=Es.SCRIPTSCRIPT),n},tc=(e,t)=>{var n,r=ec(e.size,t.style),o=r.fracNum(),s=r.fracDen();n=t.havingStyle(o);var i=Ta(e.numer,n,t);if(e.continued){var a=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;i.height=i.height<a?a:i.height,i.depth=i.depth<l?l:i.depth}n=t.havingStyle(s);var c,u,h,d,p,m,f,g,b,v,y=Ta(e.denom,n,t);if(e.hasBarLine?(e.barSize?(u=Us(e.barSize,t),c=ta.makeLineSpan("frac-line",t,u)):c=ta.makeLineSpan("frac-line",t),u=c.height,h=c.height):(c=null,u=0,h=t.fontMetrics().defaultRuleThickness),r.size===Es.DISPLAY.size||"display"===e.size?(d=t.fontMetrics().num1,p=u>0?3*h:7*h,m=t.fontMetrics().denom1):(u>0?(d=t.fontMetrics().num2,p=h):(d=t.fontMetrics().num3,p=3*h),m=t.fontMetrics().denom2),c){var x=t.fontMetrics().axisHeight;d-i.depth-(x+.5*u)<p&&(d+=p-(d-i.depth-(x+.5*u))),x-.5*u-(y.height-m)<p&&(m+=p-(x-.5*u-(y.height-m))),f=ta.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:m},{type:"elem",elem:c,shift:-(x-.5*u)},{type:"elem",elem:i,shift:-d}]},t)}else{var w=d-i.depth-(y.height-m);w<p&&(d+=.5*(p-w),m+=.5*(p-w)),f=ta.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:m},{type:"elem",elem:i,shift:-d}]},t)}return n=t.havingStyle(r),f.height*=n.sizeMultiplier/t.sizeMultiplier,f.depth*=n.sizeMultiplier/t.sizeMultiplier,g=r.size===Es.DISPLAY.size?t.fontMetrics().delim1:r.size===Es.SCRIPTSCRIPT.size?t.havingStyle(Es.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,b=null==e.leftDelim?Sa(t,["mopen"]):Rl.customSizedDelim(e.leftDelim,g,!0,t.havingStyle(r),e.mode,["mopen"]),v=e.continued?ta.makeSpan([]):null==e.rightDelim?Sa(t,["mclose"]):Rl.customSizedDelim(e.rightDelim,g,!0,t.havingStyle(r),e.mode,["mclose"]),ta.makeSpan(["mord"].concat(n.sizingClasses(t)),[b,ta.makeSpan(["mfrac"],[f]),v],t)},nc=(e,t)=>{var n=new Oa.MathNode("mfrac",[za(e.numer,t),za(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var r=Us(e.barSize,t);n.setAttribute("linethickness",Gs(r))}}else n.setAttribute("linethickness","0px");var o=ec(e.size,t.style);if(o.size!==t.style.size){n=new Oa.MathNode("mstyle",[n]);var s=o.size===Es.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",s),n.setAttribute("scriptlevel","0")}if(null!=e.leftDelim||null!=e.rightDelim){var i=[];if(null!=e.leftDelim){var a=new Oa.MathNode("mo",[new Oa.TextNode(e.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(n),null!=e.rightDelim){var l=new Oa.MathNode("mo",[new Oa.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),i.push(l)}return Ia(i)}return n};ua({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var n,{parser:r,funcName:o}=e,s=t[0],i=t[1],a=null,l=null,c="auto";switch(o){case"\\dfrac":case"\\frac":case"\\tfrac":n=!0;break;case"\\\\atopfrac":n=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=!1,a="(",l=")";break;case"\\\\bracefrac":n=!1,a="\\{",l="\\}";break;case"\\\\brackfrac":n=!1,a="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(o){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text"}return{type:"genfrac",mode:r.mode,continued:!1,numer:s,denom:i,hasBarLine:n,leftDelim:a,rightDelim:l,size:c,barSize:null}},htmlBuilder:tc,mathmlBuilder:nc}),ua({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0],s=t[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:o,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),ua({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var t,{parser:n,funcName:r,token:o}=e;switch(r){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:t,token:o}}});var rc=["display","text","script","scriptscript"],oc=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};ua({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var n,{parser:r}=e,o=t[4],s=t[5],i=da(t[0]),a="atom"===i.type&&"open"===i.family?oc(i.text):null,l=da(t[1]),c="atom"===l.type&&"close"===l.family?oc(l.text):null,u=Va(t[2],"size"),h=null;n=!!u.isBlank||(h=u.value).number>0;var d="auto",p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var m=Va(p.body[0],"textord");d=rc[Number(m.text)]}}else p=Va(p,"textord"),d=rc[Number(p.text)];return{type:"genfrac",mode:r.mode,numer:o,denom:s,continued:!1,hasBarLine:n,barSize:h,leftDelim:a,rightDelim:c,size:d}},htmlBuilder:tc,mathmlBuilder:nc}),ua({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:o}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Va(t[0],"size").value,token:o}}}),ua({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0],s=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}(Va(t[1],"infix").size),i=t[2],a=s.number>0;return{type:"genfrac",mode:n.mode,numer:o,denom:i,continued:!1,hasBarLine:a,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:tc,mathmlBuilder:nc});var sc=(e,t)=>{var n,r,o=t.style;"supsub"===e.type?(n=e.sup?Ta(e.sup,t.havingStyle(o.sup()),t):Ta(e.sub,t.havingStyle(o.sub()),t),r=Va(e.base,"horizBrace")):r=Va(e,"horizBrace");var s,i=Ta(r.base,t.havingBaseStyle(Es.DISPLAY)),a=Ha(r,t);if(r.isOver?(s=ta.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:a}]},t)).children[0].children[0].children[1].classes.push("svg-align"):(s=ta.makeVList({positionType:"bottom",positionData:i.depth+.1+a.height,children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:i}]},t)).children[0].children[0].children[0].classes.push("svg-align"),n){var l=ta.makeSpan(["mord",r.isOver?"mover":"munder"],[s],t);s=r.isOver?ta.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},t):ta.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},t)}return ta.makeSpan(["mord",r.isOver?"mover":"munder"],[s],t)};ua({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:t[0]}},htmlBuilder:sc,mathmlBuilder:(e,t)=>{var n=ja(e.label);return new Oa.MathNode(e.isOver?"mover":"munder",[za(e.base,t),n])}}),ua({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],o=Va(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:o})?{type:"href",mode:n.mode,href:o,body:pa(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=ya(e.body,t,!1);return ta.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=Fa(e.body,t);return n instanceof Ba||(n=new Ba("mrow",[n])),n.setAttribute("href",e.href),n}}),ua({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=Va(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var o=[],s=0;s<r.length;s++){var i=r[s];"~"===i&&(i="\\textasciitilde"),o.push({type:"textord",mode:"text",text:i})}var a={type:"text",mode:n.mode,font:"\\texttt",body:o};return{type:"href",mode:n.mode,href:r,body:pa(a)}}}),ua({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:pa(t[0])}},htmlBuilder(e,t){var n=ya(e.body,t,!1);return ta.makeFragment(n)},mathmlBuilder(e,t){return new Oa.MathNode("mrow",La(e.body,t))}}),ua({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var n,{parser:r,funcName:o,token:s}=e,i=Va(t[0],"raw").string,a=t[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(o){case"\\htmlClass":l.class=i,n={command:"\\htmlClass",class:i};break;case"\\htmlId":l.id=i,n={command:"\\htmlId",id:i};break;case"\\htmlStyle":l.style=i,n={command:"\\htmlStyle",style:i};break;case"\\htmlData":for(var c=i.split(","),u=0;u<c.length;u++){var h=c[u].split("=");if(2!==h.length)throw new os("Error parsing key-value for \\htmlData");l["data-"+h[0].trim()]=h[1].trim()}n={command:"\\htmlData",attributes:l};break;default:throw new Error("Unrecognized html command")}return r.settings.isTrusted(n)?{type:"html",mode:r.mode,attributes:l,body:pa(a)}:r.formatUnsupportedCmd(o)},htmlBuilder:(e,t)=>{var n=ya(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var o=ta.makeSpan(r,n,t);for(var s in e.attributes)"class"!==s&&e.attributes.hasOwnProperty(s)&&o.setAttribute(s,e.attributes[s]);return o},mathmlBuilder:(e,t)=>Fa(e.body,t)}),ua({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:pa(t[0]),mathml:pa(t[1])}},htmlBuilder:(e,t)=>{var n=ya(e.html,t,!1);return ta.makeFragment(n)},mathmlBuilder:(e,t)=>Fa(e.mathml,t)});var ic=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new os("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!$s(n))throw new os("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};ua({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,o={number:0,unit:"em"},s={number:.9,unit:"em"},i={number:0,unit:"em"},a="";if(n[0])for(var l=Va(n[0],"raw").string.split(","),c=0;c<l.length;c++){var u=l[c].split("=");if(2===u.length){var h=u[1].trim();switch(u[0].trim()){case"alt":a=h;break;case"width":o=ic(h);break;case"height":s=ic(h);break;case"totalheight":i=ic(h);break;default:throw new os("Invalid key: '"+u[0]+"' in \\includegraphics.")}}}var d=Va(t[0],"url").url;return""===a&&(a=(a=(a=d).replace(/^.*[\\/]/,"")).substring(0,a.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:d})?{type:"includegraphics",mode:r.mode,alt:a,width:o,height:s,totalheight:i,src:d}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=Us(e.height,t),r=0;e.totalheight.number>0&&(r=Us(e.totalheight,t)-n);var o=0;e.width.number>0&&(o=Us(e.width,t));var s={height:Gs(n+r)};o>0&&(s.width=Gs(o)),r>0&&(s.verticalAlign=Gs(-r));var i=new Qs(e.src,e.alt,s);return i.height=n,i.depth=r,i},mathmlBuilder:(e,t)=>{var n=new Oa.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var r=Us(e.height,t),o=0;if(e.totalheight.number>0&&(o=Us(e.totalheight,t)-r,n.setAttribute("valign",Gs(-o))),n.setAttribute("height",Gs(r+o)),e.width.number>0){var s=Us(e.width,t);n.setAttribute("width",Gs(s))}return n.setAttribute("src",e.src),n}}),ua({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,o=Va(t[0],"size");if(n.settings.strict){var s="m"===r[1],i="mu"===o.value.unit;s?(i||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, not "+o.value.unit+" units"),"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):i&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:o.value}},htmlBuilder(e,t){return ta.makeGlue(e.dimension,t)},mathmlBuilder(e,t){var n=Us(e.dimension,t);return new Oa.SpaceNode(n)}}),ua({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:o}},htmlBuilder:(e,t)=>{var n;"clap"===e.alignment?(n=ta.makeSpan([],[Ta(e.body,t)]),n=ta.makeSpan(["inner"],[n],t)):n=ta.makeSpan(["inner"],[Ta(e.body,t)]);var r=ta.makeSpan(["fix"],[]),o=ta.makeSpan([e.alignment],[n,r],t),s=ta.makeSpan(["strut"]);return s.style.height=Gs(o.height+o.depth),o.depth&&(s.style.verticalAlign=Gs(-o.depth)),o.children.unshift(s),o=ta.makeSpan(["thinbox"],[o],t),ta.makeSpan(["mord","vbox"],[o],t)},mathmlBuilder:(e,t)=>{var n=new Oa.MathNode("mpadded",[za(e.body,t)]);if("rlap"!==e.alignment){var r="llap"===e.alignment?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}}),ua({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,o=r.mode;r.switchMode("math");var s="\\("===n?"\\)":"$",i=r.parseExpression(!1,s);return r.expect(s),r.switchMode(o),{type:"styling",mode:r.mode,style:"text",body:i}}}),ua({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new os("Mismatched "+e.funcName)}});var ac=(e,t)=>{switch(t.style.size){case Es.DISPLAY.size:return e.display;case Es.TEXT.size:return e.text;case Es.SCRIPT.size:return e.script;case Es.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};ua({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:pa(t[0]),text:pa(t[1]),script:pa(t[2]),scriptscript:pa(t[3])}},htmlBuilder:(e,t)=>{var n=ac(e,t),r=ya(n,t,!1);return ta.makeFragment(r)},mathmlBuilder:(e,t)=>{var n=ac(e,t);return Fa(n,t)}});var lc=(e,t,n,r,o,s,i)=>{e=ta.makeSpan([],[e]);var a,l,c,u=n&&ms(n);if(t){var h=Ta(t,r.havingStyle(o.sup()),r);l={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-h.depth)}}if(n){var d=Ta(n,r.havingStyle(o.sub()),r);a={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}if(l&&a){var p=r.fontMetrics().bigOpSpacing5+a.elem.height+a.elem.depth+a.kern+e.depth+i;c=ta.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:Gs(-s)},{type:"kern",size:a.kern},{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:Gs(s)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(a){var m=e.height-i;c=ta.makeVList({positionType:"top",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:Gs(-s)},{type:"kern",size:a.kern},{type:"elem",elem:e}]},r)}else{if(!l)return e;var f=e.depth+i;c=ta.makeVList({positionType:"bottom",positionData:f,children:[{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:Gs(s)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}var g=[c];if(a&&0!==s&&!u){var b=ta.makeSpan(["mspace"],[],r);b.style.marginRight=Gs(s),g.unshift(b)}return ta.makeSpan(["mop","op-limits"],g,r)},cc=["\\smallint"],uc=(e,t)=>{var n,r,o,s=!1;"supsub"===e.type?(n=e.sup,r=e.sub,o=Va(e.base,"op"),s=!0):o=Va(e,"op");var i,a=t.style,l=!1;if(a.size===Es.DISPLAY.size&&o.symbol&&!cs(cc,o.name)&&(l=!0),o.symbol){var c=l?"Size2-Regular":"Size1-Regular",u="";if("\\oiint"!==o.name&&"\\oiiint"!==o.name||(u=o.name.slice(1),o.name="oiint"===u?"\\iint":"\\iiint"),i=ta.makeSymbol(o.name,c,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),u.length>0){var h=i.italic,d=ta.staticSvg(u+"Size"+(l?"2":"1"),t);i=ta.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:0},{type:"elem",elem:d,shift:l?.08:0}]},t),o.name="\\"+u,i.classes.unshift("mop"),i.italic=h}}else if(o.body){var p=ya(o.body,t,!0);1===p.length&&p[0]instanceof ti?(i=p[0]).classes[0]="mop":i=ta.makeSpan(["mop"],p,t)}else{for(var m=[],f=1;f<o.name.length;f++)m.push(ta.mathsym(o.name[f],o.mode,t));i=ta.makeSpan(["mop"],m,t)}var g=0,b=0;return(i instanceof ti||"\\oiint"===o.name||"\\oiiint"===o.name)&&!o.suppressBaseShift&&(g=(i.height-i.depth)/2-t.fontMetrics().axisHeight,b=i.italic),s?lc(i,n,r,t,a,b,g):(g&&(i.style.position="relative",i.style.top=Gs(g)),i)},hc=(e,t)=>{var n;if(e.symbol)n=new Ba("mo",[Na(e.name,e.mode)]),cs(cc,e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Ba("mo",La(e.body,t));else{n=new Ba("mi",[new Ra(e.name.slice(1))]);var r=new Ba("mo",[Na("","text")]);n=e.parentIsSupSub?new Ba("mrow",[n,r]):Ma([n,r])}return n},dc={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","":"\\bigvee","⋂":"\\bigcap","":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ua({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","","⋂","","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=r;return 1===o.length&&(o=dc[o]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:o}},htmlBuilder:uc,mathmlBuilder:hc}),ua({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:pa(r)}},htmlBuilder:uc,mathmlBuilder:hc});var pc={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ua({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:uc,mathmlBuilder:hc}),ua({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:uc,mathmlBuilder:hc}),ua({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e,r=n;return 1===r.length&&(r=pc[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:uc,mathmlBuilder:hc});var mc=(e,t)=>{var n,r,o,s,i=!1;if("supsub"===e.type?(n=e.sup,r=e.sub,o=Va(e.base,"operatorname"),i=!0):o=Va(e,"operatorname"),o.body.length>0){for(var a=o.body.map((e=>{var t=e.text;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e})),l=ya(a,t.withFont("mathrm"),!0),c=0;c<l.length;c++){var u=l[c];u instanceof ti&&(u.text=u.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}s=ta.makeSpan(["mop"],l,t)}else s=ta.makeSpan(["mop"],[],t);return i?lc(s,n,r,t,t.style,0,0):s};function fc(e,t,n){for(var r=ya(e,t,!1),o=t.sizeMultiplier/n.sizeMultiplier,s=0;s<r.length;s++){var i=r[s].classes.indexOf("sizing");i<0?Array.prototype.push.apply(r[s].classes,t.sizingClasses(n)):r[s].classes[i+1]==="reset-size"+t.size&&(r[s].classes[i+1]="reset-size"+n.size),r[s].height*=o,r[s].depth*=o}return ta.makeFragment(r)}ua({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0];return{type:"operatorname",mode:n.mode,body:pa(o),alwaysHandleSupSub:"\\operatornamewithlimits"===r,limits:!1,parentIsSupSub:!1}},htmlBuilder:mc,mathmlBuilder:(e,t)=>{for(var n=La(e.body,t.withFont("mathrm")),r=!0,o=0;o<n.length;o++){var s=n[o];if(s instanceof Oa.SpaceNode);else if(s instanceof Oa.MathNode)switch(s.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":var i=s.children[0];1===s.children.length&&i instanceof Oa.TextNode?i.text=i.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break;default:r=!1}else r=!1}if(r){var a=n.map((e=>e.toText())).join("");n=[new Oa.TextNode(a)]}var l=new Oa.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new Oa.MathNode("mo",[Na("","text")]);return e.parentIsSupSub?new Oa.MathNode("mrow",[l,c]):Oa.newDocumentFragment([l,c])}}),ql("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),ha({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?ta.makeFragment(ya(e.body,t,!1)):ta.makeSpan(["mord"],ya(e.body,t,!0),t)},mathmlBuilder(e,t){return Fa(e.body,t,!0)}}),ua({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=Ta(e.body,t.havingCrampedStyle()),r=ta.makeLineSpan("overline-line",t),o=t.fontMetrics().defaultRuleThickness,s=ta.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*o},{type:"elem",elem:r},{type:"kern",size:o}]},t);return ta.makeSpan(["mord","overline"],[s],t)},mathmlBuilder(e,t){var n=new Oa.MathNode("mo",[new Oa.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Oa.MathNode("mover",[za(e.body,t),n]);return r.setAttribute("accent","true"),r}}),ua({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:pa(r)}},htmlBuilder:(e,t)=>{var n=ya(e.body,t.withPhantom(),!1);return ta.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=La(e.body,t);return new Oa.MathNode("mphantom",n)}}),ua({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=ta.makeSpan([],[Ta(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r<n.children.length;r++)n.children[r].height=0,n.children[r].depth=0;return n=ta.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t),ta.makeSpan(["mord"],[n],t)},mathmlBuilder:(e,t)=>{var n=La(pa(e.body),t),r=new Oa.MathNode("mphantom",n),o=new Oa.MathNode("mpadded",[r]);return o.setAttribute("height","0px"),o.setAttribute("depth","0px"),o}}),ua({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=ta.makeSpan(["inner"],[Ta(e.body,t.withPhantom())]),r=ta.makeSpan(["fix"],[]);return ta.makeSpan(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=La(pa(e.body),t),r=new Oa.MathNode("mphantom",n),o=new Oa.MathNode("mpadded",[r]);return o.setAttribute("width","0px"),o}}),ua({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=Va(t[0],"size").value,o=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:o}},htmlBuilder(e,t){var n=Ta(e.body,t),r=Us(e.dy,t);return ta.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new Oa.MathNode("mpadded",[za(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}}),ua({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),ua({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,o=n[0],s=Va(t[0],"size"),i=Va(t[1],"size");return{type:"rule",mode:r.mode,shift:o&&Va(o,"size").value,width:s.value,height:i.value}},htmlBuilder(e,t){var n=ta.makeSpan(["mord","rule"],[],t),r=Us(e.width,t),o=Us(e.height,t),s=e.shift?Us(e.shift,t):0;return n.style.borderRightWidth=Gs(r),n.style.borderTopWidth=Gs(o),n.style.bottom=Gs(s),n.width=r,n.height=o+s,n.depth=-s,n.maxFontSize=1.125*o*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=Us(e.width,t),r=Us(e.height,t),o=e.shift?Us(e.shift,t):0,s=t.color&&t.getColor()||"black",i=new Oa.MathNode("mspace");i.setAttribute("mathbackground",s),i.setAttribute("width",Gs(n)),i.setAttribute("height",Gs(r));var a=new Oa.MathNode("mpadded",[i]);return o>=0?a.setAttribute("height",Gs(o)):(a.setAttribute("height",Gs(o)),a.setAttribute("depth",Gs(-o))),a.setAttribute("voffset",Gs(o)),a}});var gc=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];ua({type:"sizing",names:gc,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:o}=e,s=o.parseExpression(!1,n);return{type:"sizing",mode:o.mode,size:gc.indexOf(r)+1,body:s}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return fc(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=La(e.body,n),o=new Oa.MathNode("mstyle",r);return o.setAttribute("mathsize",Gs(n.sizeMultiplier)),o}}),ua({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,o=!1,s=!1,i=n[0]&&Va(n[0],"ordgroup");if(i)for(var a="",l=0;l<i.body.length;++l)if("t"===(a=i.body[l].text))o=!0;else{if("b"!==a){o=!1,s=!1;break}s=!0}else o=!0,s=!0;var c=t[0];return{type:"smash",mode:r.mode,body:c,smashHeight:o,smashDepth:s}},htmlBuilder:(e,t)=>{var n=ta.makeSpan([],[Ta(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var r=0;r<n.children.length;r++)n.children[r].height=0;if(e.smashDepth&&(n.depth=0,n.children))for(var o=0;o<n.children.length;o++)n.children[o].depth=0;var s=ta.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t);return ta.makeSpan(["mord"],[s],t)},mathmlBuilder:(e,t)=>{var n=new Oa.MathNode("mpadded",[za(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),ua({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,o=n[0],s=t[0];return{type:"sqrt",mode:r.mode,body:s,index:o}},htmlBuilder(e,t){var n=Ta(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=ta.wrapFragment(n,t);var r=t.fontMetrics().defaultRuleThickness,o=r;t.style.id<Es.TEXT.id&&(o=t.fontMetrics().xHeight);var s=r+o/4,i=n.height+n.depth+s+r,{span:a,ruleWidth:l,advanceWidth:c}=Rl.sqrtImage(i,t),u=a.height-l;u>n.height+n.depth+s&&(s=(s+u-n.height-n.depth)/2);var h=a.height-n.height-s-l;n.style.paddingLeft=Gs(c);var d=ta.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+h)},{type:"elem",elem:a},{type:"kern",size:l}]},t);if(e.index){var p=t.havingStyle(Es.SCRIPTSCRIPT),m=Ta(e.index,p,t),f=.6*(d.height-d.depth),g=ta.makeVList({positionType:"shift",positionData:-f,children:[{type:"elem",elem:m}]},t),b=ta.makeSpan(["root"],[g]);return ta.makeSpan(["mord","sqrt"],[b,d],t)}return ta.makeSpan(["mord","sqrt"],[d],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new Oa.MathNode("mroot",[za(n,t),za(r,t)]):new Oa.MathNode("msqrt",[za(n,t)])}});var bc={display:Es.DISPLAY,text:Es.TEXT,script:Es.SCRIPT,scriptscript:Es.SCRIPTSCRIPT};ua({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:o}=e,s=o.parseExpression(!0,n),i=r.slice(1,r.length-5);return{type:"styling",mode:o.mode,style:i,body:s}},htmlBuilder(e,t){var n=bc[e.style],r=t.havingStyle(n).withFont("");return fc(e.body,r,t)},mathmlBuilder(e,t){var n=bc[e.style],r=t.havingStyle(n),o=La(e.body,r),s=new Oa.MathNode("mstyle",o),i={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return s.setAttribute("scriptlevel",i[0]),s.setAttribute("displaystyle",i[1]),s}}),ha({type:"supsub",htmlBuilder(e,t){var n=function(e,t){var n=e.base;return n?"op"===n.type?n.limits&&(t.style.size===Es.DISPLAY.size||n.alwaysHandleSupSub)?uc:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(t.style.size===Es.DISPLAY.size||n.limits)?mc:null:"accent"===n.type?ms(n.base)?Ga:null:"horizBrace"===n.type&&!e.sub===n.isOver?sc:null:null}(e,t);if(n)return n(e,t);var r,o,s,{base:i,sup:a,sub:l}=e,c=Ta(i,t),u=t.fontMetrics(),h=0,d=0,p=i&&ms(i);if(a){var m=t.havingStyle(t.style.sup());r=Ta(a,m,t),p||(h=c.height-m.fontMetrics().supDrop*m.sizeMultiplier/t.sizeMultiplier)}if(l){var f=t.havingStyle(t.style.sub());o=Ta(l,f,t),p||(d=c.depth+f.fontMetrics().subDrop*f.sizeMultiplier/t.sizeMultiplier)}s=t.style===Es.DISPLAY?u.sup1:t.style.cramped?u.sup3:u.sup2;var g,b=t.sizeMultiplier,v=Gs(.5/u.ptPerEm/b),y=null;if(o){var x=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof ti||x)&&(y=Gs(-c.italic))}if(r&&o){h=Math.max(h,s,r.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var w=4*u.defaultRuleThickness;if(h-r.depth-(o.height-d)<w){d=w-(h-r.depth)+o.height;var k=.8*u.xHeight-(h-r.depth);k>0&&(h+=k,d-=k)}g=ta.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:d,marginRight:v,marginLeft:y},{type:"elem",elem:r,shift:-h,marginRight:v}]},t)}else if(o){d=Math.max(d,u.sub1,o.height-.8*u.xHeight),g=ta.makeVList({positionType:"shift",positionData:d,children:[{type:"elem",elem:o,marginLeft:y,marginRight:v}]},t)}else{if(!r)throw new Error("supsub must have either sup or sub.");h=Math.max(h,s,r.depth+.25*u.xHeight),g=ta.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:r,marginRight:v}]},t)}var C=Ca(c,"right")||"mord";return ta.makeSpan([C],[c,ta.makeSpan(["msupsub"],[g])],t)},mathmlBuilder(e,t){var n,r=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(r=!0,n=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var o,s=[za(e.base,t)];if(e.sub&&s.push(za(e.sub,t)),e.sup&&s.push(za(e.sup,t)),r)o=n?"mover":"munder";else if(e.sub)if(e.sup){var i=e.base;o=i&&"op"===i.type&&i.limits&&t.style===Es.DISPLAY||i&&"operatorname"===i.type&&i.alwaysHandleSupSub&&(t.style===Es.DISPLAY||i.limits)?"munderover":"msubsup"}else{var a=e.base;o=a&&"op"===a.type&&a.limits&&(t.style===Es.DISPLAY||a.alwaysHandleSupSub)||a&&"operatorname"===a.type&&a.alwaysHandleSupSub&&(a.limits||t.style===Es.DISPLAY)?"munder":"msub"}else{var l=e.base;o=l&&"op"===l.type&&l.limits&&(t.style===Es.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===Es.DISPLAY)?"mover":"msup"}return new Oa.MathNode(o,s)}}),ha({type:"atom",htmlBuilder(e,t){return ta.mathsym(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new Oa.MathNode("mo",[Na(e.text,e.mode)]);if("bin"===e.family){var r=Pa(e,t);"bold-italic"===r&&n.setAttribute("mathvariant",r)}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var vc={mi:"italic",mn:"normal",mtext:"normal"};ha({type:"mathord",htmlBuilder(e,t){return ta.makeOrd(e,t,"mathord")},mathmlBuilder(e,t){var n=new Oa.MathNode("mi",[Na(e.text,e.mode,t)]),r=Pa(e,t)||"italic";return r!==vc[n.type]&&n.setAttribute("mathvariant",r),n}}),ha({type:"textord",htmlBuilder(e,t){return ta.makeOrd(e,t,"textord")},mathmlBuilder(e,t){var n,r=Na(e.text,e.mode,t),o=Pa(e,t)||"normal";return n="text"===e.mode?new Oa.MathNode("mtext",[r]):/[0-9]/.test(e.text)?new Oa.MathNode("mn",[r]):"\\prime"===e.text?new Oa.MathNode("mo",[r]):new Oa.MathNode("mi",[r]),o!==vc[n.type]&&n.setAttribute("mathvariant",o),n}});var yc={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},xc={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};ha({type:"spacing",htmlBuilder(e,t){if(xc.hasOwnProperty(e.text)){var n=xc[e.text].className||"";if("text"===e.mode){var r=ta.makeOrd(e,t,"textord");return r.classes.push(n),r}return ta.makeSpan(["mspace",n],[ta.mathsym(e.text,e.mode,t)],t)}if(yc.hasOwnProperty(e.text))return ta.makeSpan(["mspace",yc[e.text]],[],t);throw new os('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){if(!xc.hasOwnProperty(e.text)){if(yc.hasOwnProperty(e.text))return new Oa.MathNode("mspace");throw new os('Unknown type of space "'+e.text+'"')}return new Oa.MathNode("mtext",[new Oa.TextNode(" ")])}});var wc=()=>{var e=new Oa.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};ha({type:"tag",mathmlBuilder(e,t){var n=new Oa.MathNode("mtable",[new Oa.MathNode("mtr",[wc(),new Oa.MathNode("mtd",[Fa(e.body,t)]),wc(),new Oa.MathNode("mtd",[Fa(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var kc={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Cc={"\\textbf":"textbf","\\textmd":"textmd"},Sc={"\\textit":"textit","\\textup":"textup"},Tc=(e,t)=>{var n=e.font;return n?kc[n]?t.withTextFontFamily(kc[n]):Cc[n]?t.withTextFontWeight(Cc[n]):t.withTextFontShape(Sc[n]):t};ua({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];return{type:"text",mode:n.mode,body:pa(o),font:r}},htmlBuilder(e,t){var n=Tc(e,t),r=ya(e.body,n,!0);return ta.makeSpan(["mord","text"],r,n)},mathmlBuilder(e,t){var n=Tc(e,t);return Fa(e.body,n)}}),ua({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Ta(e.body,t),r=ta.makeLineSpan("underline-line",t),o=t.fontMetrics().defaultRuleThickness,s=ta.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:o},{type:"elem",elem:r},{type:"kern",size:3*o},{type:"elem",elem:n}]},t);return ta.makeSpan(["mord","underline"],[s],t)},mathmlBuilder(e,t){var n=new Oa.MathNode("mo",[new Oa.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Oa.MathNode("munder",[za(e.body,t),n]);return r.setAttribute("accentunder","true"),r}}),ua({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Ta(e.body,t),r=t.fontMetrics().axisHeight,o=.5*(n.height-r-(n.depth+r));return ta.makeVList({positionType:"shift",positionData:o,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){return new Oa.MathNode("mpadded",[za(e.body,t)],["vcenter"])}}),ua({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new os("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=Ac(e),r=[],o=t.havingStyle(t.style.text()),s=0;s<n.length;s++){var i=n[s];"~"===i&&(i="\\textasciitilde"),r.push(ta.makeSymbol(i,"Typewriter-Regular",e.mode,o,["mord","texttt"]))}return ta.makeSpan(["mord","text"].concat(o.sizingClasses(t)),ta.tryCombineChars(r),o)},mathmlBuilder(e,t){var n=new Oa.TextNode(Ac(e)),r=new Oa.MathNode("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var Ac=e=>e.body.replace(/ /g,e.star?"␣":" "),Ec=aa,Mc=new RegExp("[̀-ͯ]+$");class Bc{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp("([ \r\n\t]+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧‪-퟿豈-￿][̀-ͯ]*|[\ud800-\udbff][\udc00-\udfff][̀-ͯ]*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|(\\\\[a-zA-Z@]+)[ \r\n\t]*|\\\\[^\ud800-\udfff])","g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new rs("EOF",new ns(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new os("Unexpected character: '"+e[t]+"'",new rs(e[t],new ns(this,t,t+1)));var r=n[6]||n[3]||(n[2]?"\\ ":" ");if(14===this.catcodes[r]){var o=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===o?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=o+1,this.lex()}return new rs(r,new ns(this,t,this.tokenRegex.lastIndex))}}class Rc{constructor(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new os("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(null==e[t]?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(void 0===n&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var o=this.undefStack[this.undefStack.length-1];o&&!o.hasOwnProperty(e)&&(o[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}var Oc=_l;ql("\\noexpand",(function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}})),ql("\\expandafter",(function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}})),ql("\\@firstoftwo",(function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}})),ql("\\@secondoftwo",(function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}})),ql("\\@ifnextchar",(function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return 1===t[0].length&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}})),ql("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),ql("\\TextOrMath",(function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}}));var Nc={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ql("\\char",(function(e){var t,n=e.popToken(),r="";if("'"===n.text)t=8,n=e.popToken();else if('"'===n.text)t=16,n=e.popToken();else if("`"===n.text)if("\\"===(n=e.popToken()).text[0])r=n.text.charCodeAt(1);else{if("EOF"===n.text)throw new os("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(null==(r=Nc[n.text])||r>=t)throw new os("Invalid base-"+t+" digit "+n.text);for(var o;null!=(o=Nc[e.future().text])&&o<t;)r*=t,r+=o,e.popToken()}return"\\@char{"+r+"}"}));var Ic=(e,t,n)=>{var r=e.consumeArg().tokens;if(1!==r.length)throw new os("\\newcommand's first argument must be a macro name");var o=r[0].text,s=e.isDefined(o);if(s&&!t)throw new os("\\newcommand{"+o+"} attempting to redefine "+o+"; use \\renewcommand");if(!s&&!n)throw new os("\\renewcommand{"+o+"} when command "+o+" does not yet exist; use \\newcommand");var i=0;if(1===(r=e.consumeArg().tokens).length&&"["===r[0].text){for(var a="",l=e.expandNextToken();"]"!==l.text&&"EOF"!==l.text;)a+=l.text,l=e.expandNextToken();if(!a.match(/^\s*[0-9]+\s*$/))throw new os("Invalid number of arguments: "+a);i=parseInt(a),r=e.consumeArg().tokens}return e.macros.set(o,{tokens:r,numArgs:i}),""};ql("\\newcommand",(e=>Ic(e,!1,!0))),ql("\\renewcommand",(e=>Ic(e,!0,!1))),ql("\\providecommand",(e=>Ic(e,!0,!0))),ql("\\message",(e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map((e=>e.text)).join("")),""})),ql("\\errmessage",(e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map((e=>e.text)).join("")),""})),ql("\\show",(e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Ec[n],li.math[n],li.text[n]),""})),ql("\\bgroup","{"),ql("\\egroup","}"),ql("~","\\nobreakspace"),ql("\\lq","`"),ql("\\rq","'"),ql("\\aa","\\r a"),ql("\\AA","\\r A"),ql("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),ql("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),ql("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),ql("","\\mathscr{B}"),ql("","\\mathscr{E}"),ql("","\\mathscr{F}"),ql("","\\mathscr{H}"),ql("","\\mathscr{I}"),ql("","\\mathscr{L}"),ql("","\\mathscr{M}"),ql("","\\mathscr{R}"),ql("","\\mathfrak{C}"),ql("","\\mathfrak{H}"),ql("","\\mathfrak{Z}"),ql("\\Bbbk","\\Bbb{k}"),ql("·","\\cdotp"),ql("\\llap","\\mathllap{\\textrm{#1}}"),ql("\\rlap","\\mathrlap{\\textrm{#1}}"),ql("\\clap","\\mathclap{\\textrm{#1}}"),ql("\\mathstrut","\\vphantom{(}"),ql("\\underbar","\\underline{\\text{#1}}"),ql("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),ql("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),ql("\\ne","\\neq"),ql("≠","\\neq"),ql("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),ql("∉","\\notin"),ql("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),ql("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),ql("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),ql("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),ql("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),ql("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),ql("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),ql("⟂","\\perp"),ql("‼","\\mathclose{!\\mkern-0.8mu!}"),ql("∌","\\notni"),ql("⌜","\\ulcorner"),ql("⌝","\\urcorner"),ql("⌞","\\llcorner"),ql("⌟","\\lrcorner"),ql("©","\\copyright"),ql("®","\\textregistered"),ql("","\\textregistered"),ql("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),ql("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),ql("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),ql("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),ql("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),ql("⋮","\\vdots"),ql("\\varGamma","\\mathit{\\Gamma}"),ql("\\varDelta","\\mathit{\\Delta}"),ql("\\varTheta","\\mathit{\\Theta}"),ql("\\varLambda","\\mathit{\\Lambda}"),ql("\\varXi","\\mathit{\\Xi}"),ql("\\varPi","\\mathit{\\Pi}"),ql("\\varSigma","\\mathit{\\Sigma}"),ql("\\varUpsilon","\\mathit{\\Upsilon}"),ql("\\varPhi","\\mathit{\\Phi}"),ql("\\varPsi","\\mathit{\\Psi}"),ql("\\varOmega","\\mathit{\\Omega}"),ql("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),ql("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),ql("\\boxed","\\fbox{$\\displaystyle{#1}$}"),ql("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),ql("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),ql("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var Pc={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};ql("\\dots",(function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in Pc?t=Pc[n]:("\\not"===n.slice(0,4)||n in li.math&&cs(["bin","rel"],li.math[n].group))&&(t="\\dotsb"),t}));var Lc={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ql("\\dotso",(function(e){return e.future().text in Lc?"\\ldots\\,":"\\ldots"})),ql("\\dotsc",(function(e){var t=e.future().text;return t in Lc&&","!==t?"\\ldots\\,":"\\ldots"})),ql("\\cdots",(function(e){return e.future().text in Lc?"\\@cdots\\,":"\\@cdots"})),ql("\\dotsb","\\cdots"),ql("\\dotsm","\\cdots"),ql("\\dotsi","\\!\\cdots"),ql("\\dotsx","\\ldots\\,"),ql("\\DOTSI","\\relax"),ql("\\DOTSB","\\relax"),ql("\\DOTSX","\\relax"),ql("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),ql("\\,","\\tmspace+{3mu}{.1667em}"),ql("\\thinspace","\\,"),ql("\\>","\\mskip{4mu}"),ql("\\:","\\tmspace+{4mu}{.2222em}"),ql("\\medspace","\\:"),ql("\\;","\\tmspace+{5mu}{.2777em}"),ql("\\thickspace","\\;"),ql("\\!","\\tmspace-{3mu}{.1667em}"),ql("\\negthinspace","\\!"),ql("\\negmedspace","\\tmspace-{4mu}{.2222em}"),ql("\\negthickspace","\\tmspace-{5mu}{.277em}"),ql("\\enspace","\\kern.5em "),ql("\\enskip","\\hskip.5em\\relax"),ql("\\quad","\\hskip1em\\relax"),ql("\\qquad","\\hskip2em\\relax"),ql("\\tag","\\@ifstar\\tag@literal\\tag@paren"),ql("\\tag@paren","\\tag@literal{({#1})}"),ql("\\tag@literal",(e=>{if(e.macros.get("\\df@tag"))throw new os("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"})),ql("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),ql("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),ql("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),ql("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),ql("\\newline","\\\\\\relax"),ql("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Fc=Gs(Is["Main-Regular"]["T".charCodeAt(0)][1]-.7*Is["Main-Regular"]["A".charCodeAt(0)][1]);ql("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+Fc+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),ql("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+Fc+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),ql("\\hspace","\\@ifstar\\@hspacer\\@hspace"),ql("\\@hspace","\\hskip #1\\relax"),ql("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),ql("\\ordinarycolon",":"),ql("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),ql("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),ql("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),ql("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),ql("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),ql("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),ql("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),ql("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),ql("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),ql("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),ql("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),ql("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),ql("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),ql("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),ql("∷","\\dblcolon"),ql("∹","\\eqcolon"),ql("≔","\\coloneqq"),ql("≕","\\eqqcolon"),ql("⩴","\\Coloneqq"),ql("\\ratio","\\vcentcolon"),ql("\\coloncolon","\\dblcolon"),ql("\\colonequals","\\coloneqq"),ql("\\coloncolonequals","\\Coloneqq"),ql("\\equalscolon","\\eqqcolon"),ql("\\equalscoloncolon","\\Eqqcolon"),ql("\\colonminus","\\coloneq"),ql("\\coloncolonminus","\\Coloneq"),ql("\\minuscolon","\\eqcolon"),ql("\\minuscoloncolon","\\Eqcolon"),ql("\\coloncolonapprox","\\Colonapprox"),ql("\\coloncolonsim","\\Colonsim"),ql("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ql("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ql("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ql("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ql("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),ql("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),ql("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),ql("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),ql("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),ql("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),ql("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),ql("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),ql("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),ql("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),ql("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),ql("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),ql("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),ql("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),ql("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),ql("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),ql("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),ql("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),ql("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),ql("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),ql("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),ql("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),ql("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),ql("\\imath","\\html@mathml{\\@imath}{ı}"),ql("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),ql("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),ql("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),ql("⟦","\\llbracket"),ql("⟧","\\rrbracket"),ql("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),ql("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),ql("⦃","\\lBrace"),ql("⦄","\\rBrace"),ql("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),ql("⦵","\\minuso"),ql("\\darr","\\downarrow"),ql("\\dArr","\\Downarrow"),ql("\\Darr","\\Downarrow"),ql("\\lang","\\langle"),ql("\\rang","\\rangle"),ql("\\uarr","\\uparrow"),ql("\\uArr","\\Uparrow"),ql("\\Uarr","\\Uparrow"),ql("\\N","\\mathbb{N}"),ql("\\R","\\mathbb{R}"),ql("\\Z","\\mathbb{Z}"),ql("\\alef","\\aleph"),ql("\\alefsym","\\aleph"),ql("\\Alpha","\\mathrm{A}"),ql("\\Beta","\\mathrm{B}"),ql("\\bull","\\bullet"),ql("\\Chi","\\mathrm{X}"),ql("\\clubs","\\clubsuit"),ql("\\cnums","\\mathbb{C}"),ql("\\Complex","\\mathbb{C}"),ql("\\Dagger","\\ddagger"),ql("\\diamonds","\\diamondsuit"),ql("\\empty","\\emptyset"),ql("\\Epsilon","\\mathrm{E}"),ql("\\Eta","\\mathrm{H}"),ql("\\exist","\\exists"),ql("\\harr","\\leftrightarrow"),ql("\\hArr","\\Leftrightarrow"),ql("\\Harr","\\Leftrightarrow"),ql("\\hearts","\\heartsuit"),ql("\\image","\\Im"),ql("\\infin","\\infty"),ql("\\Iota","\\mathrm{I}"),ql("\\isin","\\in"),ql("\\Kappa","\\mathrm{K}"),ql("\\larr","\\leftarrow"),ql("\\lArr","\\Leftarrow"),ql("\\Larr","\\Leftarrow"),ql("\\lrarr","\\leftrightarrow"),ql("\\lrArr","\\Leftrightarrow"),ql("\\Lrarr","\\Leftrightarrow"),ql("\\Mu","\\mathrm{M}"),ql("\\natnums","\\mathbb{N}"),ql("\\Nu","\\mathrm{N}"),ql("\\Omicron","\\mathrm{O}"),ql("\\plusmn","\\pm"),ql("\\rarr","\\rightarrow"),ql("\\rArr","\\Rightarrow"),ql("\\Rarr","\\Rightarrow"),ql("\\real","\\Re"),ql("\\reals","\\mathbb{R}"),ql("\\Reals","\\mathbb{R}"),ql("\\Rho","\\mathrm{P}"),ql("\\sdot","\\cdot"),ql("\\sect","\\S"),ql("\\spades","\\spadesuit"),ql("\\sub","\\subset"),ql("\\sube","\\subseteq"),ql("\\supe","\\supseteq"),ql("\\Tau","\\mathrm{T}"),ql("\\thetasym","\\vartheta"),ql("\\weierp","\\wp"),ql("\\Zeta","\\mathrm{Z}"),ql("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),ql("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),ql("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),ql("\\bra","\\mathinner{\\langle{#1}|}"),ql("\\ket","\\mathinner{|{#1}\\rangle}"),ql("\\braket","\\mathinner{\\langle{#1}\\rangle}"),ql("\\Bra","\\left\\langle#1\\right|"),ql("\\Ket","\\left|#1\\right\\rangle");var zc=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,o=t.consumeArg().tokens,s=t.consumeArg().tokens,i=t.macros.get("|"),a=t.macros.get("\\|");t.macros.beginGroup();var l=t=>n=>{e&&(n.macros.set("|",i),o.length&&n.macros.set("\\|",a));var s=t;return!t&&o.length&&"|"===n.future().text&&(n.popToken(),s=!0),{tokens:s?o:r,numArgs:0}};t.macros.set("|",l(!1)),o.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,u=t.expandTokens([...s,...c,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};ql("\\bra@ket",zc(!1)),ql("\\bra@set",zc(!0)),ql("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),ql("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),ql("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),ql("\\angln","{\\angl n}"),ql("\\blue","\\textcolor{##6495ed}{#1}"),ql("\\orange","\\textcolor{##ffa500}{#1}"),ql("\\pink","\\textcolor{##ff00af}{#1}"),ql("\\red","\\textcolor{##df0030}{#1}"),ql("\\green","\\textcolor{##28ae7b}{#1}"),ql("\\gray","\\textcolor{gray}{#1}"),ql("\\purple","\\textcolor{##9d38bd}{#1}"),ql("\\blueA","\\textcolor{##ccfaff}{#1}"),ql("\\blueB","\\textcolor{##80f6ff}{#1}"),ql("\\blueC","\\textcolor{##63d9ea}{#1}"),ql("\\blueD","\\textcolor{##11accd}{#1}"),ql("\\blueE","\\textcolor{##0c7f99}{#1}"),ql("\\tealA","\\textcolor{##94fff5}{#1}"),ql("\\tealB","\\textcolor{##26edd5}{#1}"),ql("\\tealC","\\textcolor{##01d1c1}{#1}"),ql("\\tealD","\\textcolor{##01a995}{#1}"),ql("\\tealE","\\textcolor{##208170}{#1}"),ql("\\greenA","\\textcolor{##b6ffb0}{#1}"),ql("\\greenB","\\textcolor{##8af281}{#1}"),ql("\\greenC","\\textcolor{##74cf70}{#1}"),ql("\\greenD","\\textcolor{##1fab54}{#1}"),ql("\\greenE","\\textcolor{##0d923f}{#1}"),ql("\\goldA","\\textcolor{##ffd0a9}{#1}"),ql("\\goldB","\\textcolor{##ffbb71}{#1}"),ql("\\goldC","\\textcolor{##ff9c39}{#1}"),ql("\\goldD","\\textcolor{##e07d10}{#1}"),ql("\\goldE","\\textcolor{##a75a05}{#1}"),ql("\\redA","\\textcolor{##fca9a9}{#1}"),ql("\\redB","\\textcolor{##ff8482}{#1}"),ql("\\redC","\\textcolor{##f9685d}{#1}"),ql("\\redD","\\textcolor{##e84d39}{#1}"),ql("\\redE","\\textcolor{##bc2612}{#1}"),ql("\\maroonA","\\textcolor{##ffbde0}{#1}"),ql("\\maroonB","\\textcolor{##ff92c6}{#1}"),ql("\\maroonC","\\textcolor{##ed5fa6}{#1}"),ql("\\maroonD","\\textcolor{##ca337c}{#1}"),ql("\\maroonE","\\textcolor{##9e034e}{#1}"),ql("\\purpleA","\\textcolor{##ddd7ff}{#1}"),ql("\\purpleB","\\textcolor{##c6b9fc}{#1}"),ql("\\purpleC","\\textcolor{##aa87ff}{#1}"),ql("\\purpleD","\\textcolor{##7854ab}{#1}"),ql("\\purpleE","\\textcolor{##543b78}{#1}"),ql("\\mintA","\\textcolor{##f5f9e8}{#1}"),ql("\\mintB","\\textcolor{##edf2df}{#1}"),ql("\\mintC","\\textcolor{##e0e5cc}{#1}"),ql("\\grayA","\\textcolor{##f6f7f7}{#1}"),ql("\\grayB","\\textcolor{##f0f1f2}{#1}"),ql("\\grayC","\\textcolor{##e3e5e6}{#1}"),ql("\\grayD","\\textcolor{##d6d8da}{#1}"),ql("\\grayE","\\textcolor{##babec2}{#1}"),ql("\\grayF","\\textcolor{##888d93}{#1}"),ql("\\grayG","\\textcolor{##626569}{#1}"),ql("\\grayH","\\textcolor{##3b3e40}{#1}"),ql("\\grayI","\\textcolor{##21242c}{#1}"),ql("\\kaBlue","\\textcolor{##314453}{#1}"),ql("\\kaGreen","\\textcolor{##71B307}{#1}");var Dc={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class _c{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new Rc(Oc,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Bc(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:r,end:n}=this.consumeArg(["]"]))}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new rs("EOF",n.loc)),this.pushTokens(r),t.range(n,"")}consumeSpaces(){for(;" "===this.future().text;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r,o=this.future(),s=0,i=0;do{if(r=this.popToken(),t.push(r),"{"===r.text)++s;else if("}"===r.text){if(-1==--s)throw new os("Extra }",r)}else if("EOF"===r.text)throw new os("Unexpected end of input in a macro argument, expected '"+(e&&n?e[i]:"}")+"'",r);if(e&&n)if((0===s||1===s&&"{"===e[i])&&r.text===e[i]){if(++i===e.length){t.splice(-i,i);break}}else i=0}while(0!==s||n);return"{"===o.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:o,end:r}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new os("The length of delimiters doesn't match the number of args!");for(var n=t[0],r=0;r<n.length;r++){var o=this.popToken();if(n[r]!==o.text)throw new os("Use of the macro doesn't match its definition",o)}}for(var s=[],i=0;i<e;i++)s.push(this.consumeArg(t&&t[i+1]).tokens);return s}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(null==r||e&&r.unexpandable){if(e&&null==r&&"\\"===n[0]&&!this.isDefined(n))throw new os("Undefined control sequence: "+n);return this.pushToken(t),t}if(this.expansionCount++,this.expansionCount>this.settings.maxExpand)throw new os("Too many expansions: infinite loop or need to increase maxExpand setting");var o=r.tokens,s=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs)for(var i=(o=o.slice()).length-1;i>=0;--i){var a=o[i];if("#"===a.text){if(0===i)throw new os("Incomplete placeholder at end of macro body",a);if("#"===(a=o[--i]).text)o.splice(i+1,1);else{if(!/^[1-9]$/.test(a.text))throw new os("Not a valid argument number",a);o.splice(i,2,...s[+a.text-1])}}}return this.pushTokens(o),o}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;){var e=this.expandOnce();if(e instanceof rs)return e.treatAsRelax&&(e.text="\\relax"),this.stack.pop()}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new rs(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;){var r=this.expandOnce(!0);r instanceof rs&&(r.treatAsRelax&&(r.noexpand=!1,r.treatAsRelax=!1),t.push(this.stack.pop()))}return t}expandMacroAsText(e){var t=this.expandMacro(e);return t?t.map((e=>e.text)).join(""):t}_getExpansion(e){var t=this.macros.get(e);if(null==t)return t;if(1===e.length){var n=this.lexer.catcodes[e];if(null!=n&&13!==n)return}var r="function"==typeof t?t(this):t;if("string"==typeof r){var o=0;if(-1!==r.indexOf("#"))for(var s=r.replace(/##/g,"");-1!==s.indexOf("#"+(o+1));)++o;for(var i=new Bc(r,this.settings),a=[],l=i.lex();"EOF"!==l.text;)a.push(l),l=i.lex();return a.reverse(),{tokens:a,numArgs:o}}return r}isDefined(e){return this.macros.has(e)||Ec.hasOwnProperty(e)||li.math.hasOwnProperty(e)||li.text.hasOwnProperty(e)||Dc.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:Ec.hasOwnProperty(e)&&!Ec[e].primitive}}var qc=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,jc=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g","ʰ":"h","ⁱ":"i","ʲ":"j","ᵏ":"k","ˡ":"l","ᵐ":"m","ⁿ":"n","ᵒ":"o","ᵖ":"p","ʳ":"r","ˢ":"s","ᵗ":"t","ᵘ":"u","ᵛ":"v","ʷ":"w","ˣ":"x","ʸ":"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Hc={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Vc={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","ḉ":"ḉ","č":"č","ĉ":"ĉ","ċ":"ċ","ç":"ç","ď":"ď","ḋ":"ḋ","ḑ":"ḑ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ḝ":"ḝ","ě":"ě","ê":"ê","ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ȩ":"ȩ","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ģ":"ģ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","ḩ":"ḩ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ķ":"ķ","ĺ":"ĺ","ľ":"ľ","ļ":"ļ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ņ":"ņ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ","ŏ":"ŏ","ǒ":"ǒ","ô":"ô","ố":"ố","ồ":"ồ","ỗ":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","ṕ":"ṕ","ṗ":"ṗ","ŕ":"ŕ","ř":"ř","ṙ":"ṙ","ŗ":"ŗ","ś":"ś","ṥ":"ṥ","š":"š","ṧ":"ṧ","ŝ":"ŝ","ṡ":"ṡ","ş":"ş","ẗ":"ẗ","ť":"ť","ṫ":"ṫ","ţ":"ţ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","ṹ":"ṹ","ū":"ū","ṻ":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","ṽ":"ṽ","ẃ":"ẃ","ẁ":"ẁ","ẅ":"ẅ","ŵ":"ŵ","ẇ":"ẇ","ẘ":"ẘ","ẍ":"ẍ","ẋ":"ẋ","ý":"ý","ỳ":"ỳ","ÿ":"ÿ","ỹ":"ỹ","ȳ":"ȳ","ŷ":"ŷ","ẏ":"ẏ","ẙ":"ẙ","ź":"ź","ž":"ž","ẑ":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","Ắ":"Ắ","Ằ":"Ằ","Ẵ":"Ẵ","Ǎ":"Ǎ","Â":"Â","Ấ":"Ấ","Ầ":"Ầ","Ẫ":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","Ḃ":"Ḃ","Ć":"Ć","Ḉ":"Ḉ","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ç":"Ç","Ď":"Ď","Ḋ":"Ḋ","Ḑ":"Ḑ","É":"É","È":"È","Ë":"Ë","Ẽ":"Ẽ","Ē":"Ē","Ḗ":"Ḗ","Ḕ":"Ḕ","Ĕ":"Ĕ","Ḝ":"Ḝ","Ě":"Ě","Ê":"Ê","Ế":"Ế","Ề":"Ề","Ễ":"Ễ","Ė":"Ė","Ȩ":"Ȩ","Ḟ":"Ḟ","Ǵ":"Ǵ","Ḡ":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","Ģ":"Ģ","Ḧ":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","Ḣ":"Ḣ","Ḩ":"Ḩ","Í":"Í","Ì":"Ì","Ï":"Ï","Ḯ":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","Ḱ":"Ḱ","Ǩ":"Ǩ","Ķ":"Ķ","Ĺ":"Ĺ","Ľ":"Ľ","Ļ":"Ļ","Ḿ":"Ḿ","Ṁ":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","Ṅ":"Ṅ","Ņ":"Ņ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","Ṍ":"Ṍ","Ṏ":"Ṏ","Ȭ":"Ȭ","Ō":"Ō","Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ","Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ŗ":"Ŗ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ş":"Ş","Ť":"Ť","Ṫ":"Ṫ","Ţ":"Ţ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"};class $c{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new _c(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new os("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new rs("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){"math"===this.mode&&this.consumeSpaces();var r=this.fetch();if(-1!==$c.endOfExpression.indexOf(r.text))break;if(t&&r.text===t)break;if(e&&Ec[r.text]&&Ec[r.text].infix)break;var o=this.parseAtom(t);if(!o)break;"internal"!==o.type&&n.push(o)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t,n=-1,r=0;r<e.length;r++)if("infix"===e[r].type){if(-1!==n)throw new os("only one infix operator per group",e[r].token);n=r,t=e[r].replaceWith}if(-1!==n&&t){var o,s,i=e.slice(0,n),a=e.slice(n+1);return o=1===i.length&&"ordgroup"===i[0].type?i[0]:{type:"ordgroup",mode:this.mode,body:i},s=1===a.length&&"ordgroup"===a[0].type?a[0]:{type:"ordgroup",mode:this.mode,body:a},["\\\\abovefrac"===t?this.callFunction(t,[o,e[n],s],[]):this.callFunction(t,[o,s],[])]}return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var r=this.parseGroup(e);if(!r)throw new os("Expected group after '"+n+"'",t);return r}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var r={type:"text",mode:this.mode,body:t};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t,n,r=this.parseGroup("atom",e);if("text"===this.mode)return r;for(;;){this.consumeSpaces();var o=this.fetch();if("\\limits"===o.text||"\\nolimits"===o.text){if(r&&"op"===r.type){var s="\\limits"===o.text;r.limits=s,r.alwaysHandleSupSub=!0}else{if(!r||"operatorname"!==r.type)throw new os("Limit controls must follow a math operator",o);r.alwaysHandleSupSub&&(r.limits="\\limits"===o.text)}this.consume()}else if("^"===o.text){if(t)throw new os("Double superscript",o);t=this.handleSupSubscript("superscript")}else if("_"===o.text){if(n)throw new os("Double subscript",o);n=this.handleSupSubscript("subscript")}else if("'"===o.text){if(t)throw new os("Double superscript",o);var i={type:"textord",mode:this.mode,text:"\\prime"},a=[i];for(this.consume();"'"===this.fetch().text;)a.push(i),this.consume();"^"===this.fetch().text&&a.push(this.handleSupSubscript("superscript")),t={type:"ordgroup",mode:this.mode,body:a}}else{if(!jc[o.text])break;var l=jc[o.text],c=qc.test(o.text);for(this.consume();;){var u=this.fetch().text;if(!jc[u])break;if(qc.test(u)!==c)break;this.consume(),l+=jc[u]}var h=new $c(l,this.settings).parse();c?n={type:"ordgroup",mode:"math",body:h}:t={type:"ordgroup",mode:"math",body:h}}}return t||n?{type:"supsub",mode:this.mode,base:r,sup:t,sub:n}:r}parseFunction(e,t){var n=this.fetch(),r=n.text,o=Ec[r];if(!o)return null;if(this.consume(),t&&"atom"!==t&&!o.allowedInArgument)throw new os("Got function '"+r+"' with no arguments"+(t?" as "+t:""),n);if("text"===this.mode&&!o.allowedInText)throw new os("Can't use function '"+r+"' in text mode",n);if("math"===this.mode&&!1===o.allowedInMath)throw new os("Can't use function '"+r+"' in math mode",n);var{args:s,optArgs:i}=this.parseArguments(r,o);return this.callFunction(r,s,i,n,e)}callFunction(e,t,n,r,o){var s={funcName:e,parser:this,token:r,breakOnTokenText:o},i=Ec[e];if(i&&i.handler)return i.handler(s,t,n);throw new os("No function handler for "+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(0===n)return{args:[],optArgs:[]};for(var r=[],o=[],s=0;s<n;s++){var i=t.argTypes&&t.argTypes[s],a=s<t.numOptionalArgs;(t.primitive&&null==i||"sqrt"===t.type&&1===s&&null==o[0])&&(i="primitive");var l=this.parseGroupOfType("argument to '"+e+"'",i,a);if(a)o.push(l);else{if(null==l)throw new os("Null argument, please report this as a bug");r.push(l)}}return{args:r,optArgs:o}}parseGroupOfType(e,t,n){switch(t){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":var r=this.parseArgumentGroup(n,"text");return null!=r?{type:"styling",mode:r.mode,body:[r],style:"text"}:null;case"raw":var o=this.parseStringGroup("raw",n);return null!=o?{type:"raw",mode:"text",string:o.text}:null;case"primitive":if(n)throw new os("A primitive argument cannot be optional");var s=this.parseGroup(e);if(null==s)throw new os("Expected group as "+e,this.fetch());return s;case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new os("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;" "===this.fetch().text;)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(null==n)return null;for(var r,o="";"EOF"!==(r=this.fetch()).text;)o+=r.text,this.consume();return this.consume(),n.text=o,n}parseRegexGroup(e,t){for(var n,r=this.fetch(),o=r,s="";"EOF"!==(n=this.fetch()).text&&e.test(s+n.text);)s+=(o=n).text,this.consume();if(""===s)throw new os("Invalid "+t+": '"+r.text+"'",r);return r.range(o,s)}parseColorGroup(e){var t=this.parseStringGroup("color",e);if(null==t)return null;var n=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new os("Invalid color: '"+t.text+"'",t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r="#"+r),{type:"color-token",mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),!(t=e||"{"===this.gullet.future().text?this.parseStringGroup("size",e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;e||0!==t.text.length||(t.text="0pt",n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new os("Invalid size: '"+t.text+"'",t);var o={number:+(r[1]+r[2]),unit:r[3]};if(!$s(o))throw new os("Invalid unit: '"+o.unit+"'",t);return{type:"size",mode:this.mode,value:o,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==t)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(null==n)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var o=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var s={type:"ordgroup",mode:this.mode,loc:n.loc,body:o};return t&&this.switchMode(r),s}parseGroup(e,t){var n,r=this.fetch(),o=r.text;if("{"===o||"\\begingroup"===o){this.consume();var s="{"===o?"}":"\\endgroup";this.gullet.beginGroup();var i=this.parseExpression(!1,s),a=this.fetch();this.expect(s),this.gullet.endGroup(),n={type:"ordgroup",mode:this.mode,loc:ns.range(r,a),body:i,semisimple:"\\begingroup"===o||void 0}}else if(null==(n=this.parseFunction(t,e)||this.parseSymbol())&&"\\"===o[0]&&!Dc.hasOwnProperty(o)){if(this.settings.throwOnError)throw new os("Undefined control sequence: "+o,r);n=this.formatUnsupportedCmd(o),this.consume()}return n}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n],o=r.text;"-"===o&&"-"===e[n+1].text&&(n+1<t&&"-"===e[n+2].text?(e.splice(n,3,{type:"textord",mode:"text",loc:ns.range(r,e[n+2]),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:ns.range(r,e[n+1]),text:"--"}),t-=1)),"'"!==o&&"`"!==o||e[n+1].text!==o||(e.splice(n,2,{type:"textord",mode:"text",loc:ns.range(r,e[n+1]),text:o+o}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r="*"===n.charAt(0);if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new os("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:n=n.slice(1,-1),star:r}}Vc.hasOwnProperty(t[0])&&!li[this.mode][t[0]]&&(this.settings.strict&&"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=Vc[t[0]]+t.slice(1));var o,s=Mc.exec(t);if(s&&("i"===(t=t.substring(0,s.index))?t="ı":"j"===t&&(t="ȷ")),li[this.mode][t]){this.settings.strict&&"math"===this.mode&&qi.indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var i,a=li[this.mode][t].group,l=ns.range(e);if(ii.hasOwnProperty(a)){var c=a;i={type:"atom",mode:this.mode,family:c,loc:l,text:t}}else i={type:a,mode:this.mode,loc:l,text:t};o=i}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(Rs(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),o={type:"textord",mode:"text",loc:ns.range(e),text:t}}if(this.consume(),s)for(var u=0;u<s[0].length;u++){var h=s[0][u];if(!Hc[h])throw new os("Unknown accent ' "+h+"'",e);var d=Hc[h][this.mode]||Hc[h].text;if(!d)throw new os("Accent "+h+" unsupported in "+this.mode+" mode",e);o={type:"accent",mode:this.mode,loc:ns.range(e),label:d,isStretchy:!1,isShifty:!0,base:o}}return o}}$c.endOfExpression=["}","\\endgroup","\\end","\\right","&"];"undefined"!=typeof document&&"CSS1Compat"!==document.compatMode&&"undefined"!=typeof console&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype.");var Uc=function(e,t){var n=new vs(t);try{return function(e,t,n){var r,o=function(e){return new js({style:e.displayMode?Es.DISPLAY:Es.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})}(n);if("mathml"===n.output)return Da(e,t,o,n.displayMode,!0);if("html"===n.output){var s=Ea(e,o);r=ta.makeSpan(["katex"],[s])}else{var i=Da(e,t,o,n.displayMode,!1),a=Ea(e,o);r=ta.makeSpan(["katex"],[i,a])}return function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=ta.makeSpan(n,[e])}return e}(r,n)}(function(e,t){if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new $c(e,t);delete n.gullet.macros.current["\\df@tag"];var r=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new os("\\tag works only in display equations");r=[{type:"tag",mode:"text",body:r,tag:n.subparse([new rs("\\df@tag")])}]}return r}(e,n),e,n)}catch(t){return function(e,t,n){if(n.throwOnError||!(e instanceof os))throw e;var r=ta.makeSpan(["katex-error"],[new ti(t)]);return r.setAttribute("title",e.toString()),r.setAttribute("style","color:"+n.errorColor),r}(t,e,n)}};const Gc="% \\f is defined as #1f(#2) using the macro\n\\f\\relax{x} = \\int_{-\\infty}^\\infty\n \\f\\hat\\xi\\,e^{2 \\pi i \\xi x}\n \\,d\\xi";function Wc(e){const t={};return e.getAttributeNames().forEach((n=>{t[n]=e.getAttribute(n)})),On.createElement(e.tagName.toLowerCase(),t,Array.from(e.childNodes).map((e=>e.nodeType===Node.ELEMENT_NODE?Wc(e):e.textContent||"")))}const Kc=Ft({type:Fn.InlineComponent,name:"KatexComponent",setup(e){let t=(null==e?void 0:e.state)||{source:Gc};t.source=t.source||Gc;const n=qt(t),r=n.onChange.subscribe((e=>{t=e})),o=zt(),s=o.get(Co),i=o.get(Uo),a=s.getContext("components.katexComponent.setter");function l(){const e=new Po({title:a.get("title"),cancelBtnText:a.get("cancelBtnText"),confirmBtnText:a.get("confirmBtnText"),items:[new Vo({name:"source",value:t.source,placeholder:a.get("placeholder"),label:a.get("label"),height:"260px",width:"400px"})]});i.show(e.elementRef),e.onComplete.subscribe((e=>{n.update((t=>{t.source=e.source})),i.hide()})),e.onCancel.subscribe((()=>i.hide()))}return fn((()=>{r.unsubscribe()})),{render(){let e;try{n=t.source,e=Uc(n,{displayMode:!0,leqno:!1,fleqn:!1,throwOnError:!0,errorColor:"#cc0000",strict:"warn",output:"html",trust:!1,macros:{"\\f":"#1f(#2)"}}).toMarkup()}catch(t){e=`<span style="color: red">${t.stack.split("\n").join("<br>")}</span>`}var n;const r=(new DOMParser).parseFromString(e,"text/html").body.children[0];return On.createElement("tb-katex",{source:encodeURIComponent(t.source),onClick:l},r?[Wc(r)]:[])}}}}),Yc={match(e){return"tb-katex"===e.tagName.toLowerCase()},read(e,t){return Kc.createInstance(t,{state:{source:decodeURIComponent(e.getAttribute("source")||"")}})}},Xc=Ft({type:Fn.BlockComponent,name:"ListComponent",separable:!0,zenCoding:{key:" ",match:/^(1\.|[+*])$/,generateInitData(e){return{state:/[-+*]/.test(e)?"ul":"ol"}}},setup(e){const t=zt(),n=t.get(Vn);let r=(null==e?void 0:e.state)||"ul";const o=qt(r).onChange.subscribe((e=>{r=e}));fn((()=>{o.unsubscribe()}));const s=_t((null==e?void 0:e.slots)||[new _n([Fn.Text,Fn.InlineComponent])]);return dn((e=>{if(e.target.isEmpty&&e.target===s.last){const r=eo.createInstance(t),o=n.commonAncestorComponent,i=o.parent,a=i.indexOf(o);return i.retain(a+1),s.length>1&&s.remove(s.last),i.insert(r),n.setPosition(r.slots.get(0),0),void e.preventDefault()}const r=e.target.cut(e.data.index);s.insertAfter(r,e.target),n.setPosition(r,0),e.preventDefault()})),{type:r,render(e){const t=r;return On.createElement(t,null,s.toArray().map((t=>e(t,(e=>On.createElement("li",{class:"tb-list-item"},e))))))},split(e,t){return{before:s.slice(0,e),middle:s.slice(e,t),after:s.slice(t)}}}}}),Jc={match(e){return"OL"===e.tagName||"UL"===e.tagName},read(e,t,n){const r=[],o=Array.from(e.childNodes);for(;o.length;){const e=new _n([Fn.Text,Fn.InlineComponent]);let t=o.shift(),s=null;for(;t;){if(/^li$/i.test(t.nodeName)){r.push(e),n(e,t);break}if(!s){if(t.nodeType===Node.TEXT_NODE&&(/^\s+$/.test(t.textContent)||""===t.textContent))break;s=document.createElement("li")}s.appendChild(t),t=o.shift()}s&&(r.push(e),n(e,s),s=null)}return Xc.createInstance(t,{slots:r,state:e.tagName.toLowerCase()})}};var Zc=n(652);function Qc(){let e=!1;const t=Dt();return Qt((()=>{e=!0,t.changeMarker.forceMarkDirtied()})),en((()=>{e=!1,t.changeMarker.forceMarkDirtied()})),function(t){return On.createElement("div",{class:"tb-component-toolbar",style:{display:e?"block":"none"},onMousedown:e=>(e.preventDefault(),!1)},On.createElement("div",{class:"tb-component-toolbar-inner"},t.children))}}n(301),n(425),n(925),n(586),n(719),n(751),n(664),n(779),n(531),n(494),n(158),n(219),n(784),n(107),n(633);var eu=n(608),tu=n.n(eu);function nu(e,t){let n=!1;const r=Dt();en((()=>{n=!1,r.changeMarker.forceMarkDirtied()}));let o=e.items.find((t=>t.value===e.defaultValue));const s=K(zt(Rr),"mousedown").subscribe((()=>{n&&(n=!1,r.changeMarker.forceMarkDirtied())}));return fn((()=>{s.unsubscribe()})),function(){return On.createElement("div",{class:tu()("textbus-toolbar-dropdown",{"textbus-toolbar-dropdown-open":n})},On.createElement("div",{class:"textbus-toolbar-dropdown-button"},On.createElement("span",{class:"textbus-toolbar-item textbus-toolbar-dropdown"},On.createElement("button",{class:"textbus-toolbar-button",type:"button",onClick:()=>{n=!n,r.changeMarker.forceMarkDirtied()}},On.createElement("span",{class:"textbus-toolbar-select-label"},null==o?void 0:o.label),On.createElement("span",{class:"textbus-dropdown-caret"})))),On.createElement("div",{class:"textbus-toolbar-dropdown-menu"},On.createElement("div",{class:"textbus-toolbar-select-options"},e.items.map((e=>On.createElement("button",{class:"textbus-toolbar-option",onMousedown:e=>e.stopPropagation(),type:"button",onClick:()=>{o=e,n=!1,t(e),r.changeMarker.forceMarkDirtied()}},On.createElement("span",{class:"textbus-toolbar-option-label"},e.label)))))))}}const ru={keyword:"keyword",string:"string",function:"function",number:"number",tag:"tag",comment:"comment",boolean:"boolean",operator:!1,builtin:"builtin",punctuation:!1,regex:"regex",selector:"selector",property:"attr-name","class-name":"class-name","attr-name":"attr-name","attr-value":"attr-value","template-punctuation":"string"},ou=[{label:"JavaScript",value:"JavaScript"},{label:"HTML",value:"HTML"},{label:"CSS",value:"CSS"},{label:"TypeScript",value:"TypeScript"},{label:"Java",value:"Java"},{label:"C",value:"C"},{label:"C++",value:"CPP"},{label:"C#",value:"CSharp"},{label:"Swift",value:"Swift"},{label:"Go",value:"Go"},{label:"JSON",value:"JSON"},{label:"Less",value:"Less"},{label:"SCSS",value:"SCSS"},{label:"Stylus",value:"Stylus"},{label:"Jsx",value:"Jsx"},{label:"Tsx",value:"Tsx"},{label:"",value:""}];class su{constructor(){this.name="code"+Math.random(),this.columned=!1}render(e,t){return new On("span",{class:"tb-hl-"+t},e)}}const iu=new su;function au(e){return{HTML:["\x3c!--","--\x3e"],JavaScript:["/*","*/"],CSS:["/*","*/"],TypeScript:["/*","*/"],Java:["/*","*/"],Swift:["/*","*/"],Go:["/*","*/"],JSON:["",""],Less:["/*","*/"],SCSS:["/*","*/"],Stylus:["/*","*/"],C:["/*","*/"],CPP:["/*","*/"],CSharp:["/*","*/"],Tsx:["/*","*/"],Jsx:["/*","*/"]}[e]||["",""]}function lu(e){return{HTML:Zc.languages.html,JavaScript:Zc.languages.javascript,CSS:Zc.languages.css,TypeScript:Zc.languages.typescript,Java:Zc.languages.java,Swift:Zc.languages.swift,JSON:Zc.languages.json,Go:Zc.languages.go,Ruby:Zc.languages.ruby,Less:Zc.languages.less,SCSS:Zc.languages.scss,Stylus:Zc.languages.stylus,C:Zc.languages.c,CPP:Zc.languages.cpp,CSharp:Zc.languages.csharp,Jsx:Zc.languages.jsx,Tsx:Zc.languages.tsx}[e]||null}function cu(e,t,n){e.forEach((e=>{if(e instanceof Zc.Token){const r=ru[e.type];t.retain(n),t.retain(e.length,iu,r||null),Array.isArray(e.content)&&cu(e.content,t,n)}n+=e.length}))}function uu(e,t,n,r,o){return e.map((e=>{let s=e.code;const i=du();if(i.updateState((n=>{n.blockCommentStart=t,n.emphasize=e.emphasize})),i.state.blockCommentStart&&(s=n+s),i.insert(s),o){const e=(0,Zc.tokenize)(s,o);cu(e,i,0),i.state.blockCommentStart&&(i.retain(0),i.delete(2));const a=e.pop();if(a&&"string"!=typeof a&&"comment"===a.type&&0===a.content.indexOf(n)){const e=r.replace(new RegExp(`[${r}]`,"g"),(e=>"\\"+e));i.updateState((t=>{t.blockCommentEnd=new RegExp(e+"$").test(a.content)})),t=!i.state.blockCommentEnd}else t=!1}else i.updateState((e=>{e.blockCommentEnd=!0}));return i}))}function hu(e,t,n,r,o,s=!1){const i=e.toArray();let a=i.indexOf(t);for(;a<i.length;a++){const e=i[a];let t=e.sliceContent()[0];e.state.blockCommentStart&&(t=r+t);const l=new _n([Fn.Text]);l.insert(t);const c=(0,Zc.tokenize)(t,n);cu(c,l,0),e.state.blockCommentStart&&(l.retain(0),l.delete(2)),e.retain(0),e.retain(e.length,iu,null),l.getFormats().forEach((t=>{e.retain(t.startIndex),e.retain(t.endIndex-t.startIndex,t.formatter,t.value)}));const u=c.pop();if(u&&"string"!=typeof u&&"comment"===u.type&&0===u.content.indexOf(r)){const t=o.replace(new RegExp(`[${o}]`,"g"),(e=>"\\"+e));e.updateState((e=>{e.blockCommentEnd=new RegExp(t+"$").test(u.content)}))}else e.updateState((e=>{e.blockCommentEnd=!0}));const h=i[a+1];if(h){if(!s&&h.state.blockCommentStart===!e.state.blockCommentEnd)break;h.updateState((t=>{t.blockCommentStart=!e.state.blockCommentEnd}))}}}function du(){return new _n([Fn.Text],{blockCommentEnd:!0,blockCommentStart:!1,emphasize:!1})}const pu=Ft({type:Fn.BlockComponent,name:"PreComponent",separable:!1,zenCoding:{key:"Enter",match(e){const t=ou.map((e=>e.label||e.value)).concat("js","ts").join("|").replace(/\+/,"\\+");return new RegExp(`^\`\`\`(${t})$`,"i").test(e)},generateInitData(e){const t=e.replace(/`/g,"").replace(/\+/,"\\+");for(const e of ou)if(new RegExp(`^${t}$`,"i").test(e.label||e.value))return{state:{lang:e.value,theme:""},slots:[du()]};return/^js$/i.test(t)?{state:{lang:"JavaScript",theme:""},slots:[du()]}:/^ts$/i.test(t)?{state:{lang:"TypeScript",theme:""},slots:[du()]}:{state:{lang:"",theme:""},slots:[du()]}}},setup(e={slots:[],state:{lang:"",theme:""}}){var t,n;let r=lu(e.state.lang),[o,s]=au(e.state.lang);const i=qt({lang:e.state.lang,theme:e.state.theme}),a=zt(),l=a.get(Co),c=a.get(Vn);i.onChange.subscribe((t=>{e.state.lang=t.lang,e.state.theme=t.theme,r=lu(t.lang),[o,s]=au(t.lang),d=!0,h.toArray().forEach((e=>{e.updateState((e=>{e.blockCommentStart=!1,e.blockCommentEnd=!1}))})),r?hu(h,h.get(0),r,o,s,!0):h.toArray().forEach((e=>{e.retain(0),e.retain(e.length,iu,null)})),d=!1}));const u=(e.slots||[du()]).map((e=>{var t;return{emphasize:(null===(t=e.state)||void 0===t?void 0:t.emphasize)||!1,code:e.toString()}})),h=_t(uu(u,!1,o,s,r));let d=!1;function p(){var e;const{startSlot:t,endSlot:n}=c;let r=h.indexOf(t);const o=h.indexOf(n)+1;for(;r<o;r++)null===(e=h.get(r))||void 0===e||e.updateState((e=>{e.emphasize=!0}))}function m(){var e;const{startSlot:t,endSlot:n}=c;let r=h.indexOf(t);const o=h.indexOf(n)+1;for(;r<o;r++)null===(e=h.get(r))||void 0===e||e.updateState((e=>{e.emphasize=!1}))}h.onChildSlotChange.subscribe((e=>{if(r&&!d){d=!0;const t=e.index;hu(h,e,r,o,s),e.retain(t),d=!1}})),Ht({keymap:{key:"/",ctrlKey:!0},action:()=>{const e=h.indexOf(c.startSlot),t=h.indexOf(c.endSlot),n=h.slice(e,t+1),r=n.every((e=>/^\s*\/\//.test(e.toString())));r?n.forEach((e=>{const t=e.toString(),n=t.indexOf("// "),r=t.indexOf("//");n>=0?(e.cut(n,n+3),e===c.anchorSlot&&c.setAnchor(e,c.startOffset-3),e===c.focusSlot&&c.setFocus(e,c.endOffset-3)):(e.cut(r,r+2),e===c.anchorSlot&&c.setAnchor(e,c.startOffset-2),e===c.focusSlot&&c.setFocus(e,c.endOffset-2))})):(n.forEach((e=>{e.retain(0),e.insert("// ")})),c.setBaseAndExtent(c.startSlot,c.startOffset+3,c.endSlot,c.endOffset+3))}}),dn((e=>{if(e.target.isEmpty&&e.target===h.last){const t=h.get(h.length-2);if(null==t?void 0:t.isEmpty){const n=eo.createInstance(a),r=c.commonAncestorComponent,o=r.parent,s=o.indexOf(r);return o.retain(s+1),h.remove(h.last),h.length>1&&h.remove(t),o.insert(n),c.setPosition(n.slots.get(0),0),void e.preventDefault()}}const t=e.target.cutTo(du(),e.data.index);if(h.insertAfter(t,e.target),r&&!d){d=!0;const e=t.index;hu(h,t,r,o,s),t.retain(e),d=!1}c.setPosition(t,0),e.preventDefault()})),on((t=>{t.useMenus([{iconClasses:["textbus-icon-source-code"],label:l.get("components.preComponent.contextMenuLabel"),submenu:ou.map((t=>({label:t.label||l.get("components.preComponent.defaultLang"),onClick(){t.value!==e.state.lang&&(e.state.lang=t.value,i.update((e=>{e.lang=t.value})))}})))},{label:l.get("components.preComponent.changeTheme"),submenu:[{label:"Light",onClick(){i.update((e=>{e.theme="light"}))}},{label:"Dark",onClick(){i.update((e=>{e.theme="dark"}))}}]},{label:l.get("components.preComponent.emphasize"),disabled:!c.isSelected,onClick:p},{label:l.get("components.preComponent.cancelEmphasize"),disabled:!c.isSelected,onClick:m}])})),rn((e=>{const t=[],n=e.data.text;let i="",a=!0;for(let e=0;e<n.length;e++){const r=n[e];"\r"===r?("\n"===n[e+1]&&e++,i&&(t.push(i),i=""),a?a=!1:t.push("")):"\n"===r?(i&&(t.push(i),i=""),a?a=!1:t.push("")):(a=!0,i+=r)}i&&t.push(i);const l=t.shift(),u=e.target;l&&u.insert(l);const d=h.indexOf(u);if(t.length){h.retain(d+1);const e=uu(t.map((e=>({code:e,emphasize:!1}))),!u.state.blockCommentEnd,o,s,r),n=e[e.length-1];h.insert(...e),c.setPosition(n,n.length)}else c.setPosition(u,u.index);e.preventDefault()}));const f=Qc(),g=nu({items:ou.map((e=>e.label?e:Object.assign(Object.assign({},e),{label:l.get("components.preComponent.defaultLang")}))),defaultValue:null===(t=e.state)||void 0===t?void 0:t.lang},(e=>{i.update((t=>{t.lang=e.value}))})),b=nu({items:[{label:"Light",value:"light"},{label:"Dark",value:"dark"}],defaultValue:null===(n=e.state)||void 0===n?void 0:n.theme},(e=>{i.update((t=>{t.theme=e.value}))}));return{render(t,n){let r="";ou.forEach((t=>{t.value===e.state.lang&&(r=t.label)}));const o=h.toArray().some((e=>{var t;return!0===(null===(t=e.state)||void 0===t?void 0:t.emphasize)}));return On.createElement("pre",{class:"tb-pre",lang:r,theme:e.state.theme||null},n===zn.Editing?On.createElement(f,null,On.createElement(g,null),On.createElement(b,null),On.createElement("button",{type:"button",class:"textbus-toolbar-button",onClick:p},l.get("components.preComponent.emphasize")),On.createElement("button",{type:"button",class:"textbus-toolbar-button",onClick:m},l.get("components.preComponent.cancelEmphasize"))):null,On.createElement("div",{class:"tb-pre-content"},On.createElement("div",{class:"tb-code-line-number-bg ",style:{width:Math.max(String(h.length).length,2.5)+"em"}}),On.createElement("div",{class:"tb-code-content"+(o?" tb-color-content-highlight":"")},h.toArray().map((e=>t(e,(t=>{var n;return On.createElement("div",{class:((null===(n=e.state)||void 0===n?void 0:n.emphasize)?"tb-code-line-emphasize ":"")+"tb-code-line"},t)}))))),On.createElement("span",{class:"tb-pre-lang"},r)))}}}}),mu={match(e){return"PRE"===e.tagName},read(e,t){const n=e.querySelectorAll(".tb-code-line");let r=[];return n.length?r=Array.from(n).map((e=>{const t=e.innerText.replace(/[\s\n]+$/,""),n=du();return n.updateState((t=>{t.emphasize=e.classList.contains("tb-code-line-emphasize")})),n.insert(t),n})):(e.querySelectorAll("br").forEach((e=>{e.parentNode.replaceChild(document.createTextNode("\n"),e)})),r=e.innerText.split("\n").map((e=>{const t=du();return t.insert(e),t}))),pu.createInstance(t,{state:{lang:e.getAttribute("lang")||"",theme:e.getAttribute("theme")||""},slots:r})}},fu="div,p,h1,h2,h3,h4,h5,h6,nav,header,footer,td,th,li,article".split(","),gu="span,em,i,s,del,sup,sub,u,strong,img".split(",");class bu extends no{constructor(e,t,n){super(t,n),this.attrName=e}match(e){return!!new RegExp(`^(${fu.join("|")})$`,"i").test(e.tagName)&&super.match(e)}read(e){var t;return{attribute:this.target,value:null===(t=this.extractFormatData(e,{attrs:[this.attrName]}).attrs)||void 0===t?void 0:t[this.attrName]}}}class vu{constructor(e,t){this.name=e,this.attrName=t}render(e,t){e.attrs.set(this.attrName,t)}}const yu=new vu("dir","dir"),xu=new bu("dir",yu,{attrs:[{key:"dir",value:["ltr","rtl"]}]});class wu extends no{constructor(e,t,n){super(t,n),this.styleName=e}match(e){return!!new RegExp(`^(${fu.join("|")})$`,"i").test(e.tagName)&&super.match(e)}read(e){return{attribute:this.target,value:this.extractFormatData(e,{styleName:this.styleName}).styles[this.styleName]}}}class ku{constructor(e,t){this.name=e,this.styleName=t}render(e,t){e.styles.set(this.styleName,t)}}const Cu=new ku("textIndent","textIndent"),Su=new ku("textAlign","textAlign"),Tu=new ku("blockBackgroundColor","backgroundColor"),Au=new wu("textIndent",Cu,{styles:{textIndent:/.+/}}),Eu=new wu("textAlign",Su,{styles:{textAlign:/.+/}}),Mu=new wu("backgroundColor",Tu,{styles:{backgroundColor:/.+/}});class Bu extends no{constructor(e,t){super(e,t)}read(){return{formatter:this.target,value:!0}}}class Ru{constructor(e,t,n){this.name=e,this.tagName=t,this.columned=n}render(e){return new On(this.tagName,null,e)}}const Ou=new Ru("bold","strong",!1),Nu=new Ru("italic","em",!1),Iu=new Ru("strikeThrough","del",!0),Pu=new Ru("underline","u",!0),Lu=new Ru("subscript","sub",!1),Fu=new Ru("superscript","sup",!1),zu=new Ru("code","code",!1),Du=new Bu(Ou,{tags:["strong","b"],styles:{fontWeight:["bold","500","600","700","800","900"]},excludeStyles:{fontWeight:["normal","lighter","100","200","300","400"]}}),_u=new Bu(Nu,{tags:["em","i"],styles:{fontStyle:["italic"]},excludeStyles:{fontStyle:/(?!italic).+/}}),qu=new Bu(Iu,{tags:["strike","del","s"],styles:{textDecoration:/\bline-through\b/}}),ju=new Bu(Pu,{tags:["u"],styles:{textDecoration:/\bunderline\b/}}),Hu=new Bu(Lu,{tags:["sub"]}),Vu=new Bu(Fu,{tags:["sup"]}),$u=new Bu(zu,{tags:["code"]});class Uu extends no{constructor(e,t,n){super(t,n),this.styleName=e}read(e){return{formatter:this.target,value:this.extractFormatData(e,{styleName:this.styleName}).styles[this.styleName]}}}class Gu{constructor(e,t){this.name=e,this.styleName=t,this.columned=!1}render(e,t){return{fallbackTagName:"span",attach:e=>{e.styles.set(this.styleName,t)}}}}const Wu=new Gu("letterSpacing","letterSpacing"),Ku=new Gu("fontFamily","fontFamily"),Yu=new Gu("lineHeight","lineHeight"),Xu=new Uu("letterSpacing",Wu,{styles:{letterSpacing:/.+/}}),Ju=new Uu("fontFamily",Ku,{styles:{fontFamily:/.+/}}),Zu=new Uu("lineHeight",Yu,{styles:{lineHeight:/.+/}});class Qu extends no{constructor(e,t,n){super(t,n),this.styleName=e}read(e){return{formatter:this.target,value:this.extractFormatData(e,{styleName:this.styleName}).styles[this.styleName]}}}class eh{constructor(e,t){this.name=e,this.styleName=t,this.columned=!1}render(e,t){return{fallbackTagName:"span",attach:e=>{e.styles.set(this.styleName,t)}}}}const th=new eh("color","color"),nh=new Qu("color",th,{styles:{color:/.+/}}),rh=new eh("fontSize","fontSize"),oh=new Qu("fontSize",rh,{styles:{fontSize:/.+/}});class sh extends no{constructor(e,t,n,r=!1){super(t,n),this.styleName=e,this.forceMatchTags=r}match(e){return!(this.forceMatchTags&&!new RegExp(`^(${gu.join("|")})$`,"i").test(e.tagName))&&super.match(e)}read(e){return{formatter:this.target,value:this.extractFormatData(e,{styleName:this.styleName}).styles[this.styleName]}}}class ih{constructor(e,t){this.name=e,this.styleName=t,this.columned=!1}render(e,t){if(1===e.length&&e[0]instanceof On){const n=e[0];if(n instanceof On){const e=new RegExp(`^(${gu.join("|")})$`,"i");if(n&&e.test(n.tagName))return n.styles.set(this.styleName,t),n}}return new On("span",{style:{[this.styleName]:t}},e)}}class ah extends ih{constructor(){super(...arguments),this.columned=!0}}const lh=new ih("verticalAlign","verticalAlign"),ch=new ah("textBackgroundColor","backgroundColor"),uh=new sh("verticalAlign",lh,{styles:{verticalAlign:/.+/}},!0),hh=new sh("backgroundColor",ch,{styles:{backgroundColor:/.+/}},!0);function dh(e){const t=new _n([Fn.Text,Fn.InlineComponent,Fn.BlockComponent]),n=Mo.createInstance(e);n.slots.first.insert("标题",[[rh,"18px"],[Ou,!0]]);const r=eo.createInstance(e);return r.slots.first.insert("描述信息..."),t.insert(n),t.insert(r),t}const ph=Ft({type:Fn.BlockComponent,name:"StepComponent",setup(e){let t=(null==e?void 0:e.state)||{step:0};const n=zt(),r=_t((null==e?void 0:e.slots)||[]);0===r.length&&r.push(dh(n));const o=qt(t),s=o.onChange.subscribe((e=>{t=e}));return fn((()=>{s.unsubscribe()})),{render(e,s){const i=t.step;return On.createElement("tb-step",{step:t.step},r.toArray().map(((t,a)=>{let l="tb-waiting";return a<i?l="tb-complete":a===i&&(l="tb-current"),On.createElement("div",{class:"tb-step-item "+l},On.createElement("div",{class:"tb-step-item-header"},On.createElement("div",{class:"tb-step-item-line"}),On.createElement("div",{class:"tb-step-item-icon",onClick:()=>{let e;e=a===i?a+1:a+1===i?a-1:a,o.update((t=>{t.step=e}))}},a+1)),e(t,(e=>On.createElement("div",{class:"tb-step-item-content"},e))),s===zn.Editing&&On.createElement("span",{class:"tb-step-item-add",onClick:()=>{r.insertByIndex(dh(n),a+1)}}))})))}}}}),mh={match(e){return"tb-step"===e.nodeName.toLowerCase()},read(e,t,n){return ph.createInstance(t,{state:{step:Number(e.getAttribute("step"))||0},slots:Array.from(e.children).map((e=>n(new _n([Fn.BlockComponent,Fn.InlineComponent,Fn.Text]),e.querySelector(".tb-step-item-content"))))})}};let fh=class extends Pr{constructor(e,t){super(),this.renderer=e,this.selection=t}getRects(e){const{focusSlot:t,anchorSlot:n}=e,r=this.selection.getPathsBySlot(t),o=this.selection.getPathsBySlot(n);let s,i;Vn.compareSelectionPaths(r,o)?(s=t,i=n):(s=n,i=t);const a=Vn.getCommonAncestorComponent(s,i);if((null==a?void 0:a.name)!==gh.name)return!1;const l=yo(a,s),c=yo(a,i),u=a.state,{startPosition:h,endPosition:d}=xo(l,c,a,u.columnCount),p=this.renderer,m=p.getNativeNodeByVNode(p.getVNodeBySlot(h.cell)).getBoundingClientRect(),f=p.getNativeNodeByVNode(p.getVNodeBySlot(d.cell)).getBoundingClientRect();return[{left:m.left,top:m.top,width:f.left+f.width-m.left,height:f.top+f.height-m.top}]}};fh=function(e,t,n,r){var o,s=arguments.length,i=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,n,i):o(t,n))||i);return s>3&&i&&Object.defineProperty(t,n,i),i}([b(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[or,Vn])],fh);const gh=Ft({type:Fn.BlockComponent,name:"TableComponent",separable:!1,setup(e={slots:Array.from({length:9}).fill(null).map((()=>po())),state:{columnCount:3,rowCount:3,useTextbusStyle:!1}}){var t;let n=bo(e.slots||[],e.state.columnCount);const r=zt(),o=r.get(Co),s=r.get(Vn),i=r.get(Zn);let a={columnCount:n[0].map((e=>e.state.colspan)).reduce(((e,t)=>e+t),0),useTextbusStyle:(null===(t=e.state)||void 0===t?void 0:t.useTextbusStyle)||!1,rowCount:n.length};const l=qt(a);l.onChange.subscribe((e=>{a=e}));const c=Dt(),u=_t(n.flat());let h,d,p=!1;wo(0,l,a,(e=>{h=e.startPosition,d=e.endPosition;const t=e.selectedCells.length>1;t!==p&&(p=t,c.changeMarker.forceMarkDirtied())})),ln((e=>{e.preventDefault()})),on((e=>{e.useMenus([{iconClasses:["textbus-icon-table"],label:o.get("components.tableComponent.contextMenuLabel"),submenu:[{iconClasses:["textbus-icon-table-add-column-left"],label:o.get("components.tableComponent.addColumnToLeft"),onClick(){f.addColumnToLeft()}},{iconClasses:["textbus-icon-table-add-column-right"],label:o.get("components.tableComponent.addColumnToRight"),onClick(){f.addColumnToRight()}},{iconClasses:["textbus-icon-table-add-row-top"],label:o.get("components.tableComponent.insertRowBefore"),onClick(){f.addRowToTop()}},{iconClasses:["textbus-icon-table-add-row-bottom"],label:o.get("components.tableComponent.insertRowAfter"),onClick(){f.addRowToBottom()}},{iconClasses:["textbus-icon-table-delete-column-left"],label:o.get("components.tableComponent.deleteColumns"),onClick(){f.deleteColumns()}},{iconClasses:["textbus-icon-table-delete-row-top"],label:o.get("components.tableComponent.deleteRows"),onClick(){f.deleteRows()}},{iconClasses:["textbus-icon-table-split-columns"],label:o.get("components.tableComponent.mergeCells"),onClick(){f.mergeCells()}},{iconClasses:["textbus-icon-table"],label:o.get("components.tableComponent.splitCells"),onClick(){f.splitCells()}}]},{iconClasses:["textbus-icon-table-remove"],label:o.get("components.tableComponent.contextMenuRemoveTable"),onClick(){i.removeComponent(c)}}])}));const m=Qc(),f={mergeCells(){if(!h||!d)return;const e=vo(n),t=h.rowIndex,r=h.columnIndex,o=d.rowIndex+1,i=d.columnIndex+1,a=e.slice(t,o).map((e=>e.cellsPosition.slice(r,i).filter((e=>0===e.offsetRow&&0===e.offsetColumn)))).reduce(((e,t)=>e.concat(t))),l=a.shift();l.cell.updateState((e=>{e.rowspan=o-t,e.colspan=i-r})),a.forEach((e=>{var t;u.remove(e.cell);const n=e.cell.getContentAtIndex(e.cell.length-1);if(e.cell.isEmpty||1===e.cell.length&&"string"!=typeof n&&(null===(t=n.slots.last)||void 0===t?void 0:t.isEmpty))return;const r=l.cell,o=r.isEmpty?0:r.length;r.retain(o),e.cell.cutTo(r),r.retain(o)}));const c=l.cell.getContentAtIndex(l.cell.length-1);if("string"!=typeof c){const e=c.slots.first;s.setPosition(e,e.length)}else s.setPosition(l.cell,0)},splitCells(){if(!h||!d)return;const e=vo(n),t=h.rowIndex,r=h.columnIndex,o=d.rowIndex+1,s=d.columnIndex+1,i=e.map(((e,n)=>n<t||n>=o?e.cellsPosition.map((e=>e.cell)):e.cellsPosition.map(((e,t)=>{if(t<r||t>=s)return e.cell;if(0===e.offsetRow&&0===e.offsetColumn){const t=e.cell.state;return(t.rowspan>1||t.colspan>1)&&e.cell.updateState((e=>{e.rowspan=1,e.colspan=1})),e.cell}return po()}))));Array.from(new Set(i.flat())).forEach(((e,t)=>{u.get(t)!==e&&u.insertByIndex(e,t)}))},deleteColumns(){if(!h||!d)return;const e=h.columnIndex,t=d.columnIndex;f.deleteColumnByIndex(e,t)},deleteRows(){if(!h||!d)return;const e=h.rowIndex,t=d.rowIndex;f.deleteRowByIndex(e,t)},addRowToBottom(){h&&d&&this.insertRow(d.rowIndex+1)},addRowToTop(){h&&d&&this.insertRow(h.rowIndex)},addColumnToRight(){h&&d&&this.insertColumn(d.columnIndex+1)},addColumnToLeft(){h&&d&&this.insertColumn(h.columnIndex)},deleteColumnByIndex(e,t){var r,o;if(1===a.columnCount)return void(null===(r=c.parent)||void 0===r||r.removeComponent(c));const s=vo(n);l.update((n=>{n.columnCount=a.columnCount-(t-e+1)})),s.forEach((n=>{for(let r=e;r<=t;r++){const o=n.cellsPosition[r],s=o.columnIndex-o.offsetColumn;if(s<e)s+o.cell.state.colspan>t?o.cell.updateState((n=>{n.colspan=o.cell.state.colspan-(t-e+1)})):o.cell.updateState((t=>{t.colspan=e-o.columnIndex}));else if(s+o.cell.state.colspan-1>t)o.cell.updateState((n=>{n.colspan=o.cell.state.colspan-(t-e+1)})),o.cell.cut();else{const e=o.row.indexOf(o.cell);e>-1&&o.row.splice(e,1),u.remove(o.cell)}}})),0===u.length&&(null===(o=c.parent)||void 0===o||o.removeComponent(c))},deleteRowByIndex(e,t){var r,o;if(1===a.rowCount)return void(null===(r=c.parent)||void 0===r||r.removeComponent(c));const s=vo(n);l.update((n=>{n.rowCount=a.rowCount-(t-e+1)}));for(let n=e;n<=t;n++)s[n].cellsPosition.forEach((r=>{const o=r.rowIndex-r.offsetRow;if(o<e)o+r.cell.state.rowspan>t?r.cell.updateState((n=>{n.rowspan=r.cell.state.rowspan-(t-e+1)})):r.cell.updateState((t=>{t.rowspan=e-r.rowIndex}));else if(o+r.cell.state.rowspan-1>t){r.cell.updateState((n=>{n.rowspan=r.cell.state.rowspan-(t-e+1)})),r.cell.cut();const o=s[n+1].cellsPosition.find((e=>e.cell===r.cell));o.row.splice(o.row.indexOf(o.cell),0,r.cell)}else u.remove(r.cell)}));0===u.length&&(null===(o=c.parent)||void 0===o||o.removeComponent(c))},insertRow(e){const t=vo(n),r=[];if(l.update((e=>{e.rowCount=a.rowCount+1})),0===e||e===t.length){for(let e=0;e<a.columnCount;e++)r.push(po());return void(0===e?u.insertByIndex(r,0):u.insertByIndex(r,u.length))}const o=t[e];o.cellsPosition.forEach((e=>{e.offsetRow>0?0===e.offsetColumn&&e.cell.updateState((t=>{t.rowspan=e.cell.state.rowspan+1})):r.push(po())})),n.splice(n.indexOf(o.cells),0,r),Array.from(new Set(n.flat())).forEach(((e,t)=>{u.get(t)!==e&&u.insertByIndex(e,t)}))},insertColumn(e){e<0&&(e=0),e>a.columnCount&&(e=a.columnCount);const t=vo(n),r=t.map((e=>e.cellsPosition.map((e=>e.cell)))),o=[];t.forEach(((t,n)=>{if(0===e)r[n].unshift(po());else if(e===a.columnCount)r[n].push(po());else{const s=t.cellsPosition[e];if(s.offsetColumn>0){if(o.includes(s.cell))return;s.cell.updateState((e=>{e.colspan=s.cell.state.colspan+1})),o.push(s.cell)}else r[n].splice(e,0,po())}}));const s=r.flat();Array.from(new Set(s)).forEach(((e,t)=>{u.get(t)!==e&&u.insertByIndex(e,t)})),l.update((e=>{e.columnCount=a.columnCount+1})),n=bo(u.toArray(),a.columnCount)},render(t,r){n=bo(u.toArray(),a.columnCount);const s=On.createElement("table",{class:"tb-table"+(e.state.useTextbusStyle?" tb-table-textbus":"")+(p?" td-table-multiple-select":"")},On.createElement("tbody",null,n.map((e=>On.createElement("tr",null,e.map((e=>t(e,(t=>{var n,r;return On.createElement("td",{colSpan:null===(n=e.state)||void 0===n?void 0:n.colspan,rowSpan:null===(r=e.state)||void 0===r?void 0:r.rowspan},t)})))))))));return On.createElement("div",{"data-component":gh.name},r===zn.Editing?On.createElement(m,null,On.createElement("button",{type:"button",title:o.get("components.tableComponent.addColumnToLeft"),class:"textbus-toolbar-button",onClick:()=>{f.addColumnToLeft()}},On.createElement("span",{class:"textbus-icon-table-add-column-left"})),On.createElement("button",{type:"button",title:o.get("components.tableComponent.addColumnToRight"),class:"textbus-toolbar-button",onClick:()=>{f.addColumnToRight()}},On.createElement("span",{class:"textbus-icon-table-add-column-right"})),On.createElement("button",{type:"button",title:o.get("components.tableComponent.insertRowBefore"),class:"textbus-toolbar-button",onClick:()=>{f.addRowToTop()}},On.createElement("span",{class:"textbus-icon-table-add-row-top"})),On.createElement("button",{type:"button",title:o.get("components.tableComponent.insertRowAfter"),class:"textbus-toolbar-button",onClick:()=>{f.addRowToBottom()}},On.createElement("span",{class:"textbus-icon-table-add-row-bottom"})),On.createElement("span",{class:"textbus-toolbar-split-line"}),On.createElement("button",{type:"button",title:o.get("components.tableComponent.deleteColumns"),class:"textbus-toolbar-button",onClick:()=>{f.deleteColumns()}},On.createElement("span",{class:"textbus-icon-table-delete-column-left"})),On.createElement("button",{type:"button",title:o.get("components.tableComponent.deleteRows"),class:"textbus-toolbar-button",onClick:()=>{f.deleteRows()}},On.createElement("span",{class:"textbus-icon-table-delete-row-top"})),On.createElement("span",{class:"textbus-toolbar-split-line"}),On.createElement("button",{type:"button",title:o.get("components.tableComponent.mergeCells"),class:"textbus-toolbar-button",onClick:()=>{f.mergeCells()}},On.createElement("span",{class:"textbus-icon-table-split-columns"})),On.createElement("button",{type:"button",title:o.get("components.tableComponent.splitCells"),class:"textbus-toolbar-button",onClick:()=>{f.splitCells()}},On.createElement("span",{class:"textbus-icon-table"})),On.createElement("span",{class:"textbus-toolbar-split-line"}),On.createElement("button",{type:"button",title:o.get("components.tableComponent.contextMenuRemoveTable"),class:"textbus-toolbar-button",onClick:()=>{i.removeComponent(c)}},On.createElement("span",{class:"textbus-icon-table-remove"}))):null,s)}};return f}}),bh={match(e){return"TABLE"===e.tagName||"DIV"===e.tagName&&e.dataset.component===gh.name},read(e,t,n){"DIV"===e.tagName&&(e=e.children[0]);const{tHead:r,tBodies:o,tFoot:s}=e,i=[],a=[];r&&Array.from(r.rows).forEach((e=>{const t=[];i.push(t),Array.from(e.cells).forEach((e=>{const r=po(e.colSpan,e.rowSpan);t.push(r),n(r,e)}))})),o&&Array.of(...Array.from(o),s||{rows:[]}).reduce(((e,t)=>e.concat(Array.from(t.rows))),[]).forEach((e=>{const t=[];a.push(t),Array.from(e.cells).forEach((e=>{const r=po(e.colSpan,e.rowSpan);t.push(r),n(r,e)}))})),a.unshift(...i);const l=go(a);return gh.createInstance(t,{slots:a.flat(),state:{useTextbusStyle:e.classList.contains("tb-table-textbus"),columnCount:l[0].map((e=>e.state.colspan)).reduce(((e,t)=>e+t),0),rowCount:l.length}})}},vh=["primary","info","success","warning","danger","dark","gray"];function yh(e,t="primary"){const n=new _n([Fn.BlockComponent,Fn.Text,Fn.InlineComponent],{type:t}),r=Mo.createInstance(e);r.slots.first.insert("时间主题",[[rh,"18px"],[Ou,!0]]),r.slots.first.insert(" 2020-02-02",[[rh,"15px"],[th,"#777"]]);const o=eo.createInstance(e);return o.slots.first.insert("描述信息..."),n.insert(r),n.insert(o),n}const xh=Ft({type:Fn.BlockComponent,name:"TimelineComponent",setup(e){const t=zt(),n=_t((null==e?void 0:e.slots)||[yh(t)]);return 0===n.length&&n.push(yh(t)),{render(e,r){return On.createElement("tb-timeline",null,n.toArray().map((o=>{const s=o.state.type,i=["tb-timeline-item"];return s&&i.push("tb-timeline-item-"+s),On.createElement("div",{class:i.join(" ")},On.createElement("div",{class:"tb-timeline-line"}),On.createElement("div",{class:"tb-timeline-icon",title:r===zn.Editing?null:"点击切换颜色",onClick:()=>{s?o.updateState((e=>{e.type=vh[vh.indexOf(s)+1]||null})):o.updateState((e=>{e.type=vh[0]}))}}),r===zn.Editing&&On.createElement("span",{class:"tb-timeline-add",onClick:()=>{const e=n.indexOf(o)+1;n.insertByIndex(yh(t,s),e)}}),e(o,(e=>On.createElement("div",{class:"tb-timeline-content"},e))))})))}}}}),wh={match(e){return"tb-timeline"===e.nodeName.toLowerCase()},read(e,t,n){return xh.createInstance(t,{slots:Array.from(e.children).map((e=>{let t="primary";for(const n of vh)if(e.classList.contains("tb-timeline-item-"+n)){t=n;break}const r=new _n([Fn.InlineComponent,Fn.Text,Fn.BlockComponent],{type:t});return n(r,e.querySelector("div.tb-timeline-content")||document.createElement("div"))}))})}},kh=Ft({type:Fn.BlockComponent,name:"TodolistComponent",separable:!0,zenCoding:{match:/^-\s\[(x|\s)?\\]$/,key:" ",generateInitData(e){const t="x"===e.charAt(3);return{slots:[new _n([Fn.Text,Fn.InlineComponent],{active:t,disabled:!1})]}}},setup(e){const{Text:t,InlineComponent:n}=Fn,r=_t(e.slots||[new _n([t,n])]);0===r.length&&r.push(new _n([t,n]));const o=zt(),s=Dt(),i=o.get(Vn),a=o.get(Zn);dn((e=>{const t=e.target,n=e.data.index;if(e.preventDefault(),t.isEmpty&&0===n&&r.length>1&&t===r.last){const e=eo.createInstance(o);a.insertAfter(e,s),r.remove(t);const n=e.slots.get(0);i.setPosition(n,0)}else{const e=t.cut(n);r.insertAfter(e,t),i.setPosition(e,0)}}));const l=[{active:!1,disabled:!1},{active:!0,disabled:!1},{active:!1,disabled:!0},{active:!0,disabled:!0}];return{render(e){return On.createElement("tb-todolist",null,r.toArray().map((t=>{const n=t.state,r=["tb-todolist-state"];return n.active&&r.push("tb-todolist-state-active"),n.disabled&&r.push("tb-todolist-state-disabled"),On.createElement("div",{class:"tb-todolist-item"},On.createElement("div",{class:"tb-todolist-btn"},On.createElement("div",{class:r.join(" "),onClick:()=>{const e=(function(e,t){for(let n=0;n<4;n++){const r=l[n];if(r.active===e&&r.disabled===t)return n}return-1}(n.active,n.disabled)+1)%4,r=l[e];t.updateState((e=>{e.active=r.active,e.disabled=r.disabled}))}})),e(t,(e=>On.createElement("div",{class:"tb-todolist-content"},e))))})))}}}}),Ch={match(e){return"tb-todolist"===e.nodeName.toLowerCase()},read(e,t,n){const r=Array.from(e.children).map((e=>{const t=e.querySelector(".tb-todolist-state");return{childSlot:e.querySelector(".tb-todolist-content"),slot:new _n([Fn.Text,Fn.InlineComponent],{active:!!(null==t?void 0:t.classList.contains("tb-todolist-state-active")),disabled:!!(null==t?void 0:t.classList.contains("tb-todolist-state-disabled"))})}}));return kh.createInstance(t,{slots:r.map((e=>n(e.slot,e.childSlot)))})}},Sh=Ft({name:"VideoComponent",type:Fn.InlineComponent,setup(e){let t=(null==e?void 0:e.state)||{src:"",autoplay:!1,controls:!0,width:"100%",height:""};const n=qt(t);n.onChange.subscribe((e=>{t=e}));const r=jt();return Zr(r,(e=>{t=n.update((t=>{Object.assign(t,e)}))})),{render(){return On.createElement("video",{src:t.src,ref:r,autoPlay:t.autoplay,controls:t.controls,style:{width:t.width,height:t.height}})},mergeProps(e){t=n.update((t=>{Object.assign(t,e)}))}}}}),Th={match(e){return"video"===e.nodeName.toLowerCase()},read(e,t){return Sh.createInstance(t,{state:{src:e.src,width:e.style.width||e.width+"",height:e.style.height||e.height+"",autoplay:e.autoplay,controls:e.controls}})}},Ah=Ft({type:Fn.BlockComponent,name:"WordExplainComponent",separable:!1,setup(e){const t=_t((null==e?void 0:e.slots)||[]);let n=(null==e?void 0:e.state)||{width:"140px"};for(;t.length<3;)t.push(new _n([Fn.Text,Fn.InlineComponent]));const r=qt(n),o=r.onChange.subscribe((e=>{n=e})),s=zt(),i=s.get(Zn),a=s.get(Co),l=s.get(Uo),c=Dt();fn((()=>{o.unsubscribe()})),ln((e=>{e.preventDefault()}));const u=a.getContext("components.wordExplainComponent.setter");return on((e=>{e.useMenus([{label:u.get("title"),onClick(){!function(){const e=new Po({title:u.get("title"),confirmBtnText:u.get("confirmBtnText"),cancelBtnText:u.get("cancelBtnText"),items:[new Ho({name:"width",value:n.width,placeholder:u.get("widthInputPlaceholder"),label:u.get("widthLabel")})]});l.show(e.elementRef);const t=e.onComplete.subscribe((e=>{r.update((t=>{t.width=e.width})),l.hide(),t.unsubscribe()}));t.add(e.onCancel.subscribe((()=>{l.hide(),t.unsubscribe()})))}()}}])})),{render(e,r){return On.createElement("tb-word-explain",null,On.createElement("div",{class:"tb-word-explain-title-group",style:{width:n.width}},e(t.get(0),(e=>On.createElement("div",{class:"tb-word-explain-title"},e))),e(t.get(1),(e=>On.createElement("div",{class:"tb-word-explain-subtitle"},e)))),e(t.get(2),(e=>On.createElement("div",{class:"tb-word-explain-detail"},e))),r===zn.Editing&&On.createElement("span",{class:"tb-word-explain-close",onClick:()=>{i.removeComponent(c)}}))}}}}),Eh={match(e){return"tb-word-explain"===e.nodeName.toLowerCase()},read(e,t,n){const r=e.querySelector(".tb-word-explain-title"),o=e.querySelector(".tb-word-explain-subtitle"),s=e.querySelector(".tb-word-explain-detail"),{Text:i,InlineComponent:a}=Fn,l=new _n([i,a]),c=new _n([i,a]),u=new _n([i,a]),h=e.querySelector(".tb-word-explain-title-group").style.width;return n(l,r),n(c,o),n(u,s),Ah.createInstance(t,{state:{width:h},slots:[l,c,u]})}},Mh={editor:{noSelection:"please select the location to insert the resource first!",copy:"copy",paste:"paste",cut:"cut",selectAll:"select all",insertParagraphAfter:"insert paragraph to after",insertParagraphBefore:"insert paragraph to before",input:{canNotAccessClipboard:"can not access to the clipboard!"},noUploader:"please add upload function to editor options!"},plugins:{toolbar:{audioTool:{tooltip:"audio",view:{title:"audio setting",addressLabel:"URL",addressPlaceholder:"audio url",uploadBtnText:"upload audio",errorMessage:"fields is required.",switchLabel:"autoplay",confirmBtnText:"ok",cancelBtnText:"cancel"}},blockBackgroundColorTool:{tooltip:"block background",view:{btnText:"ok",paletteText:"palette"}},blockMarginTool:{label:"block margin",tooltip:"block margin",view:{topLabel:"margin top",topPlaceholder:"margin top",rightLabel:"margin right",rightPlaceholder:"margin right",bottomLabel:"margin bottom",bottomPlaceholder:"margin bottom",leftLabel:"margin left",leftPlaceholder:"margin left",confirmBtnText:"ok",cancelBtnText:"cancel"}},blockPaddingTool:{label:"padding",tooltip:"padding",view:{topLabel:"padding top",topPlaceholder:"padding top",rightLabel:"padding right",rightPlaceholder:"padding right",bottomLabel:"padding bottom",bottomPlaceholder:"padding bottom",leftLabel:"padding left",leftPlaceholder:"padding left",confirmBtnText:"ok",cancelBtnText:"cancel"}},blockquoteTool:{tooltip:"blockquote"},formatPainterTool:{tooltip:"format painter"},boldTool:{tooltip:"bold"},cleanTool:{tooltip:"clean format"},codeTool:{tooltip:"Code"},colorTool:{tooltip:"text color",view:{btnText:"ok",recentText:"recent colors",backText:"back",paletteText:"palette"}},emojiTool:{tooltip:"emoji"},findTool:{tooltip:"find and replace",view:{findLabel:"find",findPlaceholder:"find content",nextBtnText:"next",replaceLabel:"replace",replacePlaceholder:"replace to",replaceBtnText:"replace",replaceAllBtnText:"replace all"}},fontFamilyTool:{tooltip:"font family",defaultFamilyText:"inherit"},fontSizeTool:{tooltip:"font size",defaultSizeText:"inherit"},headingTool:{tooltip:"paragraph and heading",h1:"heading 1",h2:"heading 2",h3:"heading 3",h4:"heading 4",h5:"heading 5",h6:"heading 6",div:"div",paragraph:"paragraph"},historyBackTool:{tooltip:"back"},historyForwardTool:{tooltip:"forward"},imageTool:{tooltip:"upload picture",view:{linkLabel:"URL",linkInputPlaceholder:"image url",uploadLabel:"upload",uploadBtnText:"upload image",confirmBtnText:"ok"}},inlineMarginTool:{label:"inline margin",tooltip:"inline margin",view:{topLabel:"margin top",topPlaceholder:"margin top",rightLabel:"margin right",rightPlaceholder:"margin right",bottomLabel:"margin bottom",bottomPlaceholder:"margin bottom",leftLabel:"margin left",leftPlaceholder:"margin left",confirmBtnText:"ok",cancelBtnText:"cancel"}},inlinePaddingTool:{label:"inline padding",tooltip:"inline padding",view:{topLabel:"padding top",topPlaceholder:"padding top",rightLabel:"padding right",rightPlaceholder:"padding right",bottomLabel:"padding bottom",bottomPlaceholder:"padding bottom",leftLabel:"padding left",leftPlaceholder:"padding left",confirmBtnText:"ok",cancelBtnText:"cancel"}},insertObjectTool:{sourceCode:"source code",lineHeight:"line height",letterSpacing:"letter spacing",blockBackgroundColor:"block background color",emoji:"emoji",audio:"audio...",video:"video...",subscript:"subscript",superscript:"superscript",code:"Code",blockquote:"blockquote",leftToRight:"ltr",rightToLeft:"rtl"},insertParagraphAfterTool:{tooltip:"insert paragraph to after"},insertParagraphBeforeTool:{tooltip:"insert paragraph to before"},italicTool:{tooltip:"italic"},leftToRightTool:{tooltip:"ltr"},letterSpacingTool:{tooltip:"letter spacing",defaultValueLabel:"inherit"},lineHeightTool:{tooltip:"line height",defaultValueLabel:"inherit"},linkTool:{tooltip:"link",view:{linkLabel:"link url",linkInputPlaceholder:"url address",jumpLabel:"target",jumpSelfLabel:"_self",jumpBlankLabel:"_blank",invalidMessage:"url is invalid"}},olTool:{tooltip:"ol"},preTool:{tooltip:"pre",defaultLang:"source code"},rightToLeftTool:{tooltip:"rtl"},strikeThrough:{tooltip:"strike"},subscript:{tooltip:"subscript"},superscript:{tooltip:"superscript"},tableTool:{tooltip:"table",createTable:"create table",editTable:"edit table",cellBorderColor:"table cell border color",deleteTable:"delete table"},tableAddTool:{tooltip:"insert table",view:{confirmBtnText:"ok",rowLabel:"row count",rowPlaceholder:"row count",columnLabel:"column count",columnPlaceholder:"column count",useTextbusStyleLabel:"use Textbus style"}},tableEditTool:{tooltip:"edit table",addColumnToLeft:"add column to left",addColumnToRight:"add column to right",insertRowBefore:"insert row to before",insertRowAfter:"insert row to after",deleteLeftColumn:"delete left column",deleteRightColumn:"delete right column",deletePrevRow:"delete previous row",deleteNextRow:"delete next row",mergeCells:"merge cells",splitCells:"split cells"},tableRemoveTool:{tooltip:"delete table"},tdBorderColorTool:{tooltip:"table cell border color",view:{confirmBtnText:"ok"}},textAlignTool:{tooltip:"text align",left:"align left",right:"align right",center:"align center",justify:"align justify"},textBackgroundColorTool:{tooltip:"text background color",view:{btnText:"ok",recentText:"recent colors",backText:"back",paletteText:"palette"}},textIndentTool:{tooltip:"text indent"},ulTool:{tooltip:"ul"},underlineTool:{tooltip:"underline"},unlinkTool:{tooltip:"remove link"},verticalAlignTool:{tooltip:"vertical align",baseline:"baseline",super:"super",sub:"sub",top:"top",middle:"middle",bottom:"bottom",textTop:"text-top",textBottom:"text-bottom"},videoTool:{tooltip:"video",view:{title:"video setting",confirmBtnText:"ok",cancelBtnText:"cancel",linkLabel:"URL",linkInputPlaceholder:"video url",uploadBtnText:"upload",validateErrorMessage:"fields is required.",videoWidthLabel:"width",videoWidthInputPlaceholder:"support CSS unit",videoHeightLabel:"height",videoHeightInputPlaceholder:"support CSS unit",autoplayLabel:"autoplay"}},componentsTool:{tooltip:"component library"}},linkJump:{accessLink:"open"},pasteHandle:{title:"source upload",confirmBtnText:"ok",cancelBtnText:"finish",uploadBtnText:"upload",imageLabel:"{0} picture",videoLabel:"{0} video",audioLabel:"{0} audio",imagePlaceholder:"please enter image URL",videoPlaceholder:"please enter video URL",audioPlaceholder:"please enter audio URL"}},components:{imageComponent:{contextMenu:{title:"picture setting",linkLabel:"URL",linkInputPlaceholder:"image url",uploadBtnText:"upload image",validateErrorMessage:"fields is required.",sizeSetter:{label:"size",widthPlaceholder:"width",heightPlaceholder:"height"},maxSizeSetter:{label:"max size",widthPlaceholder:"width",heightPlaceholder:"height"},float:{label:"float",noFloatLabel:"no",floatToLeftLabel:"to left",floatToRightLabel:"to right"},marginLabel:"margin",confirmBtnText:"ok",cancelBtnText:"cancel"}},tableComponent:{addColumnToLeft:"add column to left",addColumnToRight:"add column to right",insertRowBefore:"insert row to before",insertRowAfter:"insert row to after",deleteColumns:"delete columns",deleteRows:"delete rows",mergeCells:"merge cells",splitCells:"split cells",contextMenuLabel:"table",contextMenuRemoveTable:"remove table"},preComponent:{defaultLang:"other",contextMenuLabel:"switch language",changeTheme:"change theme",emphasize:"emphasize",cancelEmphasize:"cancel emphasize"},alertComponent:{creator:{name:"Alert"},contextMenu:{fill:"fill alert",noFill:"cancel fill alert",type:"select alert style"}},imageCardComponent:{creator:{name:"Card"},setting:{title:"card setting",srcLabel:"url",srcPlaceholder:"please enter the picture url",heightLabel:"image height",heightPlaceholder:"please enter the picture height",confirmBtnText:"ok",cancelBtnText:"cancel"}},jumbotronComponent:{settingBtn:"setting",creator:{name:"Jumbotron"},setting:{name:"Jumbotron",form:{title:"jumbotron setting",confirmBtnText:"ok",cancelBtnText:"cancel",minHeightLabel:"min height",minHeightInputPlaceholder:"min height",backgroundImageLabel:"background image",backgroundImageInputPlaceholder:"background image url",uploadBtnText:"upload",validateErrorMessage:"fields is required."}}},katexComponent:{creator:{name:"Mathematical formula"},setter:{title:"mathematical formula setting",label:"source code",placeholder:"please...",confirmBtnText:"ok",cancelBtnText:"cancel"}},stepsComponent:{creator:{name:"Steps"}},timelineComponent:{creator:{name:"Timeline"}},todoListComponent:{creator:{name:"Todolist"}},wordExplainComponent:{creator:{name:"Word explain"},setter:{title:"word explain setting",confirmBtnText:"ok",cancelBtnText:"cancel",widthInputPlaceholder:"title box width",widthLabel:"width"}}}},Bh={editor:{noSelection:"请先选择插入资源位置!",copy:"复制",paste:"粘贴",cut:"剪切",selectAll:"全选",insertParagraphAfter:"在后面插入段落",insertParagraphBefore:"在前面插入段落",input:{canNotAccessClipboard:"无法访问剪切板!"},noUploader:"你没有在编辑器的配置项中添加 uploader 方法!"},plugins:{toolbar:{audioTool:{tooltip:"音频",view:{title:"音频设置",addressLabel:"音频链接地址",addressPlaceholder:"请输入链接地址",uploadBtnText:"上传新音频",errorMessage:"必填项不能为空",switchLabel:"自动播放",confirmBtnText:"确定",cancelBtnText:"取消"}},blockBackgroundColorTool:{tooltip:"块背景颜色",view:{btnText:"确定"}},blockMarginTool:{label:"块外边距",tooltip:"块外边距",view:{topLabel:"上边距",topPlaceholder:"请输入上边距",rightLabel:"右边距",rightPlaceholder:"请输入右边距",bottomLabel:"下边距",bottomPlaceholder:"请输入下边距",leftLabel:"左边距",leftPlaceholder:"请输入左边距",confirmBtnText:"确定",cancelBtnText:"取消"}},blockPaddingTool:{label:"块内边距",tooltip:"块内边距",view:{topLabel:"上边距",topPlaceholder:"请输入上边距",rightLabel:"右边距",rightPlaceholder:"请输入右边距",bottomLabel:"下边距",bottomPlaceholder:"请输入下边距",leftLabel:"左边距",leftPlaceholder:"请输入左边距",confirmBtnText:"确定",cancelBtnText:"取消"}},blockquoteTool:{tooltip:"引用"},formatPainterTool:{tooltip:"格式刷"},boldTool:{tooltip:"加粗"},cleanTool:{tooltip:"清除格式"},codeTool:{tooltip:"代码"},colorTool:{tooltip:"文字颜色",view:{btnText:"确定",recentText:"最近使用",backText:"返回",paletteText:"调色盘"}},emojiTool:{tooltip:"表情"},findTool:{tooltip:"查找与替换",view:{findLabel:"查找",findPlaceholder:"请输入查找内容",nextBtnText:"下一个",replaceLabel:"替换",replacePlaceholder:"替换成",replaceBtnText:"替换",replaceAllBtnText:"全部替换"}},fontFamilyTool:{tooltip:"字体",defaultFamilyText:"默认字体"},fontSizeTool:{tooltip:"字体大小",defaultSizeText:"默认"},headingTool:{tooltip:"段落与标题",h1:"标题1",h2:"标题2",h3:"标题3",h4:"标题4",h5:"标题5",h6:"标题6",div:"div",paragraph:"正文"},historyBackTool:{tooltip:"撤销"},historyForwardTool:{tooltip:"重做"},imageTool:{tooltip:"图片",view:{linkLabel:"图片链接地址",linkInputPlaceholder:"请输入链接地址",uploadLabel:"上传图片",uploadBtnText:" 点击上传",confirmBtnText:"确定"}},inlineMarginTool:{label:"外边距",tooltip:"外边距",view:{topLabel:"上边距",topPlaceholder:"请输入上边距",rightLabel:"右边距",rightPlaceholder:"请输入右边距",bottomLabel:"下边距",bottomPlaceholder:"请输入下边距",leftLabel:"左边距",leftPlaceholder:"请输入左边距",confirmBtnText:"确定",cancelBtnText:"取消"}},inlinePaddingTool:{label:"内边距",tooltip:"内边距",view:{topLabel:"上边距",topPlaceholder:"请输入上边距",rightLabel:"右边距",rightPlaceholder:"请输入右边距",bottomLabel:"下边距",bottomPlaceholder:"请输入下边距",leftLabel:"左边距",leftPlaceholder:"请输入左边距",confirmBtnText:"确定",cancelBtnText:"取消"}},insertObjectTool:{sourceCode:"源代码",lineHeight:"行高",letterSpacing:"字间距",blockBackgroundColor:"区块背景颜色",emoji:"表情",audio:"音频...",video:"视频...",subscript:"下标",superscript:"上标",code:"Code",blockquote:"引用",leftToRight:"从左向右",rightToLeft:"从右向左"},insertParagraphAfterTool:{tooltip:"在后面插入段落"},insertParagraphBeforeTool:{tooltip:"在前面插入段落"},italicTool:{tooltip:"斜体"},leftToRightTool:{tooltip:"从左向右"},letterSpacingTool:{tooltip:"字间距",defaultValueLabel:"默认"},lineHeightTool:{tooltip:"行高",defaultValueLabel:"默认"},linkTool:{tooltip:"超链接",view:{linkLabel:"跳转链接地址",linkInputPlaceholder:"请输入链接地址",jumpLabel:"跳转方式",jumpSelfLabel:"当前窗口",jumpBlankLabel:"新窗口",invalidMessage:"请输入正确的链接地址"}},olTool:{tooltip:"有序列表"},preTool:{tooltip:"代码块",defaultLang:"其它"},rightToLeftTool:{tooltip:"从右向左"},strikeThrough:{tooltip:"删除线"},subscript:{tooltip:"下标"},superscript:{tooltip:"上标"},tableTool:{tooltip:"表格",createTable:"创建表格",editTable:"编辑表格",cellBorderColor:"设置单元格边框颜色",deleteTable:"删除表格"},tableAddTool:{tooltip:"插入表格",view:{confirmBtnText:"确定",rowLabel:"表格行数",rowPlaceholder:"请输入表格行数",columnLabel:"表格列数",columnPlaceholder:"请输入表格列数",useTextbusStyleLabel:"使用 Textbus 样式"}},tableEditTool:{tooltip:"编辑表格",addColumnToLeft:"在左边添加列",addColumnToRight:"在右边添加列",insertRowBefore:"在前面添加行",insertRowAfter:"在后面添加行",deleteLeftColumn:"删除左边列",deleteRightColumn:"删除右边列",deletePrevRow:"删除前一行",deleteNextRow:"删除后一行",mergeCells:"合并单元格",splitCells:"取消合并单元格"},tableRemoveTool:{tooltip:"删除表格"},tdBorderColorTool:{tooltip:"表格边框颜色",view:{confirmBtnText:"确定"}},textAlignTool:{tooltip:"对齐方式",left:"左对齐",right:"右对齐",center:"居中对齐",justify:"分散对齐"},textBackgroundColorTool:{tooltip:"文字背景颜色",view:{btnText:"确定",recentText:"最近使用",backText:"返回",paletteText:"调色盘"}},textIndentTool:{tooltip:"首行缩进"},ulTool:{tooltip:"无序列表"},underlineTool:{tooltip:"下划线"},unlinkTool:{tooltip:"取消超链接"},verticalAlignTool:{tooltip:"垂直对齐方式",baseline:"基线对齐",super:"文本上标",sub:"文本下标",top:"顶端对齐",middle:"居中",bottom:"底端对齐",textTop:"字体顶端对齐",textBottom:"字体底端对齐"},videoTool:{tooltip:"视频",view:{title:"视频设置",confirmBtnText:"确定",cancelBtnText:"取消",linkLabel:"视频链接地址",linkInputPlaceholder:"请输入链接地址",uploadBtnText:"上传新视频",validateErrorMessage:"必填项不能为空",videoWidthLabel:"视频宽度",videoWidthInputPlaceholder:"支持任意 CSS 单位",videoHeightLabel:"视频高度",videoHeightInputPlaceholder:"支持任意 CSS 单位",autoplayLabel:"自动播放"}},componentsTool:{tooltip:"组件库"}},linkJump:{accessLink:"跳转"},pasteHandle:{title:"资源上传",confirmBtnText:"确定",cancelBtnText:"完成",uploadBtnText:"上传",imageLabel:"第 {0} 张图片",videoLabel:"第 {0} 个视频",audioLabel:"第 {0} 个音频",imagePlaceholder:"请输入图片地址",videoPlaceholder:"请输入视频地址",audioPlaceholder:"请输入音频地址"}},components:{imageComponent:{contextMenu:{title:"图片设置",linkLabel:"图片链接地址",linkInputPlaceholder:"请输入链接地址",uploadBtnText:"上传",validateErrorMessage:"必填项不能为空",sizeSetter:{label:"宽高设置",widthPlaceholder:"宽度",heightPlaceholder:"高度"},maxSizeSetter:{label:"最大尺寸",widthPlaceholder:"宽度",heightPlaceholder:"高度"},float:{label:"浮动设置",noFloatLabel:"不浮动",floatToLeftLabel:"到左边",floatToRightLabel:"到右边"},marginLabel:"边距设置",confirmBtnText:"确定",cancelBtnText:"取消"}},tableComponent:{addColumnToLeft:"在左边添加列",addColumnToRight:"在右边添加列",insertRowBefore:"在前面添加行",insertRowAfter:"在后面添加行",deleteColumns:"删除列",deleteRows:"删除行",mergeCells:"合并单元格",splitCells:"拆分单元格",contextMenuLabel:"表格",contextMenuRemoveTable:"删除表格"},preComponent:{defaultLang:"其它",contextMenuLabel:"切换代码块语言",changeTheme:"切换代码块主题",emphasize:"强调",cancelEmphasize:"取消强调"},alertComponent:{creator:{name:"警告框"},contextMenu:{fill:"填充警告框",noFill:"取消填充警告框",type:"警告框风格"}},imageCardComponent:{creator:{name:"卡片"},setting:{title:"卡片设置",srcLabel:"图片地址",srcPlaceholder:"请输入图片地址",heightLabel:"图片高度",heightPlaceholder:"请输入图片高度",confirmBtnText:"确定",cancelBtnText:"取消"}},jumbotronComponent:{settingBtn:"设置",creator:{name:"巨幕"},setting:{name:"巨幕",form:{title:"巨幕设置",confirmBtnText:"确定",cancelBtnText:"取消",minHeightLabel:"巨幕最小高度",minHeightInputPlaceholder:"请输入巨幕最小高度",backgroundImageLabel:"背景图片地址",backgroundImageInputPlaceholder:"请输入背景图片地址",uploadBtnText:"上传新图片",validateErrorMessage:"必填项不能为空"}}},katexComponent:{creator:{name:"数学公式"},setter:{title:"数学公式设置",label:"源代码",placeholder:"请输入代码",confirmBtnText:"确定",cancelBtnText:"取消"}},stepsComponent:{creator:{name:"步骤条"}},timelineComponent:{creator:{name:"时间轴"}},todoListComponent:{creator:{name:"待办事项列表"}},wordExplainComponent:{creator:{name:"名词释义"},setter:{title:"名词释义设置",confirmBtnText:"确定",cancelBtnText:"取消",widthInputPlaceholder:"请输入标题宽度",widthLabel:"标题宽度"}}}};let Rh=class{get top(){return this.isAppendTop||(this.container.prepend(this._top),this.isAppendTop=!0),this._top}get bottom(){return this.isAppendBottom||(this.container.append(this._bottom),this.isAppendBottom=!0),this._bottom}constructor(e=!1){this._top=br("div",{classes:["textbus-ui-top"]}),this._bottom=br("div",{classes:["textbus-ui-bottom"]}),this.isAppendTop=!1,this.isAppendBottom=!1,this.sub=null,this.container=br("div",{classes:["textbus-container"],children:[this.middle=br("div",{classes:["textbus-ui-middle"],children:[this.workbench=br("div",{classes:["textbus-ui-workbench"],children:[this.scroller=br("div",{classes:["textbus-ui-scroller"]})]})]})]}),e&&(this.container.style.height="auto",this.scroller.style.overflow="visible",this.workbench.style.position="static")}setTheme(e){this.container.classList.add("textbus-theme-"+e)}destroy(){var e;null===(e=this.sub)||void 0===e||e.unsubscribe()}};Rh=function(e,t,n,r){var o,s=arguments.length,i=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,n,i):o(t,n))||i);return s>3&&i&&Object.defineProperty(t,n,i),i}([b(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Object])],Rh);let Oh=class{constructor(e){this.layout=e,this.messageBox=br("div",{classes:["textbus-message"]}),this.layout.workbench.append(this.messageBox)}message(e,t){this.createMessage("message",e,t)}info(e,t){this.createMessage("info",e,t)}success(e,t){this.createMessage("success",e,t)}warning(e,t){this.createMessage("warning",e,t)}danger(e,t){this.createMessage("danger",e,t)}createMessage(e,t,n=3e3){const r=br("div",{classes:["textbus-message-item","textbus-message-item-"+e],children:[vr(t)]});this.messageBox.append(r),setTimeout((()=>{r.remove()}),n)}};Oh=function(e,t,n,r){var o,s=arguments.length,i=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,n,i):o(t,n))||i);return s>3&&i&&Object.defineProperty(t,n,i),i}([b(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Rh])],Oh);class Nh{constructor(){this.eventFromSelf=!1,this.subs=[],this.menuSubscriptions=[],this.submenuSubscriptions=[]}setup(e){const t=e.get(Br),n=e.get(Co),r=e.get(Vn),o=e.get(Zn),s=e.get(bt),i=e.get(Oh),a=e.get(_r),l=e.get(or);this.subs.push(K(document,"mousedown").subscribe((()=>{this.hide()})),K(t,"contextmenu").subscribe((t=>{const c=document.getSelection(),u=c.focusNode,h=c.focusOffset,d=c.isCollapsed;setTimeout((()=>{d&&(c.isCollapsed||c.collapse(u,h))}));const p=Nh.makeContextmenu(t.target,r,l),m=[{iconClasses:["textbus-icon-copy"],label:n.get("editor.copy"),disabled:r.isCollapsed,onClick:()=>{o.copy()}},{iconClasses:["textbus-icon-paste"],label:n.get("editor.paste"),onClick:()=>{navigator.permissions.query({name:"clipboard-write"}).then((e=>{"granted"===e.state?navigator.clipboard.read().then((e=>{const t=e[0];t.types.filter((e=>"text/html"===e)).forEach((e=>{t.getType(e).then((e=>e.text())).then((e=>{const t=document.createElement("div");t.innerHTML=e,o.paste(a.parse(e,new _n([Fn.BlockComponent,Fn.Text,Fn.InlineComponent])),t.innerText)}))}))})):i.danger(n.get("editor.input.canNotAccessClipboard"))}))}},{iconClasses:["textbus-icon-cut"],label:n.get("editor.cut"),disabled:r.isCollapsed,onClick:()=>{o.cut()}},{iconClasses:["textbus-icon-select"],label:n.get("editor.selectAll"),onClick:()=>{r.selectAll()}}];this.menu=this.show([...p,m,[{label:n.get("editor.insertParagraphBefore"),iconClasses:["textbus-icon-insert-paragraph-before"],disabled:r.commonAncestorComponent===s.component,onClick:()=>{const t=eo.createInstance(e),n=r.commonAncestorComponent;n&&(o.insertBefore(t,n),r.selectFirstPosition(t))}},{label:n.get("editor.insertParagraphAfter"),iconClasses:["textbus-icon-insert-paragraph-after"],disabled:r.commonAncestorComponent===s.component,onClick:()=>{const t=eo.createInstance(e),n=r.commonAncestorComponent;n&&(o.insertAfter(t,n),r.selectFirstPosition(t))}}]],t.clientX,t.clientY,this.menuSubscriptions),t.preventDefault()})))}destroy(){this.hide(),this.subs.forEach((e=>e.unsubscribe())),this.subs=[]}static makeContextmenu(e,t,n){if(!t.startSlot)return[];let r=null;do{const t=n.getLocationByNativeNode(e);if(t){const e=t.slot.getContentAtIndex(t.startIndex);r=t.endIndex-t.startIndex==1&&"object"==typeof e?e:t.slot.parent;break}e=e.parentNode}while(e);return r||(r=t.commonAncestorComponent),r?Kt(r):[]}hide(){var e,t,n,r;this.menuSubscriptions.forEach((e=>e.unsubscribe())),this.menuSubscriptions=[],null===(t=null===(e=this.menu)||void 0===e?void 0:e.parentNode)||void 0===t||t.removeChild(this.menu),null===(r=null===(n=this.submenu)||void 0===n?void 0:n.parentNode)||void 0===r||r.removeChild(this.submenu)}show(e,t,n,r){let o;const s=br("div",{classes:["textbus-contextmenu"],children:[br("div",{classes:["textbus-contextmenu-container"],children:[o=br("div",{classes:["textbus-contextmenu-groups"]})]})]});r.push(K(s,"contextmenu").subscribe((e=>{e.preventDefault()})),K(document,"mousedown").subscribe((()=>{this.eventFromSelf||this.hide()})),K(window,"resize").subscribe((()=>{i()})));const i=()=>{const e=document.documentElement.clientWidth,r=document.documentElement.clientHeight;t+c>=e&&(t-=c),n+u>=r-20&&(n=r-u-20),n<20&&(n=20),Object.assign(s.style,{left:t+"px",top:n+"px"}),s.style.maxHeight=r-n-20+"px"};let a=0;const l=[];e.forEach((e=>{a+=e.length,0!==e.length&&o.appendChild(br("div",{classes:["textbus-contextmenu-group"],children:e.map((e=>Array.isArray(e.submenu)?Object.assign(Object.assign({},Nh.createMenuView(e,!0)),{item:e}):Object.assign(Object.assign({},Nh.createMenuView(e)),{item:e}))).map((e=>{const{wrapper:t,btn:n,item:o}=e;return l.push(t),r.push(K(n,"mouseenter").subscribe((()=>{var e;if(!o.disabled&&r===this.menuSubscriptions&&(this.submenu&&(null===(e=this.submenu.parentNode)||void 0===e||e.removeChild(this.submenu),this.submenuSubscriptions.forEach((e=>e.unsubscribe())),this.submenuSubscriptions=[]),l.forEach((e=>e.classList.remove("textbus-contextmenu-item-active"))),Array.isArray(o.submenu))){const e=t.getBoundingClientRect(),n=this.show([o.submenu],e.left+e.width,e.top,this.submenuSubscriptions);t.classList.add("textbus-contextmenu-item-active"),this.submenu=n}}))),o.disabled||"function"!=typeof o.onClick||(n.addEventListener("mousedown",(e=>{this.eventFromSelf=!0,e.stopPropagation()})),n.addEventListener("click",(()=>{this.hide(),o.onClick(),this.eventFromSelf=!1}))),e.wrapper}))}))}));const c=190,u=26*a+10*e.length+e.length+10;return i(),document.body.appendChild(s),s}static createMenuView(e,t=!1){const n=br("button",{attrs:{type:"button"},classes:["textbus-contextmenu-item-btn"],props:{disabled:e.disabled},children:[br("span",{classes:["textbus-contextmenu-item-icon"],children:[br("span",{classes:e.iconClasses||[]})]}),br("span",{classes:["textbus-contextmenu-item-label"],children:[vr(e.label)]}),t?br("span",{classes:["textbus-contextmenu-item-arrow"]}):null]});return{wrapper:br("div",{classes:e.disabled?["textbus-contextmenu-item","textbus-contextmenu-item-disabled"]:["textbus-contextmenu-item"],children:[n]}),btn:n}}}class Ih{constructor(){this.link=document.createElement("a"),this.subs=[]}setup(e){const t=e.get(Vn),n=e.get(Ir),r=e.get(Br),o=e.get(Co);this.link.innerText=o.get("plugins.linkJump.accessLink")||"跳转",this.link.target="_blank",this.link.className="textbus-link-jump-plugin",this.subs.push(t.onChange.pipe(ie()).subscribe((()=>{this.onSelectionChange(document,t,n,r)})))}onDestroy(){this.subs.forEach((e=>e.unsubscribe()))}onSelectionChange(e,t,n,r){var o;const s=e.getSelection(),i=s.rangeCount?s.getRangeAt(0):null;if(i){const e=i.commonAncestorContainer;if(e){const o=e.nodeType===Node.TEXT_NODE?e.parentNode:e,i=this.getLinkByDOMTree(o);if(i&&(i.href||i.dataset.href)){this.link.href=i.href||i.dataset.href||"";const e=n.getRect({slot:t.startSlot,offset:t.startOffset}),o=r.getBoundingClientRect();if(s.isCollapsed)Object.assign(this.link.style,{left:e.left-o.left+"px",top:e.top-o.top+"px"});else{const r=n.getRect({slot:t.endSlot,offset:t.endOffset});Object.assign(this.link.style,{left:(e.left+r.left)/2-o.left+"px",top:e.top-o.top+"px"})}return void(this.link.parentNode||r.appendChild(this.link))}}}null===(o=this.link.parentNode)||void 0===o||o.removeChild(this.link)}getLinkByDOMTree(e){if(e.nodeType===Node.ELEMENT_NODE){if("a"===e.tagName.toLowerCase())return e;if(e.parentNode)return this.getLinkByDOMTree(e.parentNode)}return null}}function Ph(e){const t=br("button",{classes:["textbus-toolbar-button"],attrs:{title:e.tooltip||"",type:"button","data-keymap":JSON.stringify(e.keymap)},children:[br("span",{classes:e.iconClasses?[...e.iconClasses,"textbus-toolbar-button-icon"]:["textbus-toolbar-button-icon"]}),br("span",{classes:["textbus-toolbar-label"],children:[e.label?vr(e.label):null]})],on:{click(){e.onClick()}}}),n=br("span",{classes:["textbus-toolbar-item"],children:[t]});let r=!1,o=!1;return{elementRef:n,get highlight(){return r},set highlight(e){r=e,e?t.classList.add("textbus-toolbar-button-active"):t.classList.remove("textbus-toolbar-button-active")},get disabled(){return o},set disabled(e){o=e,t.disabled=e}}}function Lh(e,t,n){const r=br("div",{classes:["textbus-toolbar-dropdown-menu"],children:[t],on:{mousedown(e){e.stopPropagation()}}}),o=br("div",{classes:["textbus-toolbar-dropdown"],children:[br("div",{classes:["textbus-toolbar-dropdown-button"],children:[e]}),r]});function s(){o.classList.contains("textbus-toolbar-dropdown-open")||function(e,t,n){const r=n.getBoundingClientRect(),o=r.left+r.width-(e.getBoundingClientRect().left+t.offsetWidth);t.style.left=`${Math.min(0,o)}px`}(o,r,n)}const i=K(window,"resize").subscribe((()=>{s()})),a={elementRef:o,toggle(){o.classList.contains("textbus-toolbar-dropdown-open")?a.hide():a.open()},open(){s(),o.classList.add("textbus-toolbar-dropdown-open")},hide(){o.classList.remove("textbus-toolbar-dropdown-open")},destroy(){i.unsubscribe()}};return a}function Fh(e){const t=br("span",{classes:["textbus-toolbar-dropdown-label"],children:[e.label?vr(e.label):null]});let n=!1;const r=br("button",{classes:["textbus-toolbar-button"],attrs:{title:e.tooltip||"",type:"button"},children:[e.iconClasses?br("span",{classes:[...e.iconClasses]}):null,t,br("span",{classes:["textbus-dropdown-caret"]})],on:{mousedown(){n=!0,s.toggle()}}}),o=K(document,"mousedown").subscribe((()=>{n||s.hide(),n=!1})),s=Lh(br("span",{classes:["textbus-toolbar-item","textbus-toolbar-dropdown"],children:[r]}),e.menuView,e.stickyElement);let i=!1,a=!1;return{elementRef:s.elementRef,hide(){s.hide()},destroy(){s.destroy(),o.unsubscribe()},get highlight(){return i},set highlight(e){i=e,e?r.classList.add("textbus-toolbar-button-active"):r.classList.remove("textbus-toolbar-button-active")},get disabled(){return a},set disabled(e){a=e,r.disabled=e}}}function zh(e){const t=wr(),n=[];e.ctrlKey&&n.push(t?"textbus-icon-command":"Ctrl"),e.shiftKey&&n.push(t?"textbus-icon-shift":"Shift"),e.altKey&&n.push(t?"textbus-icon-opt":"Alt");const r=Array.isArray(e.key)?e.key.map((e=>e.toUpperCase())).join("/"):"string"==typeof e.key?e.key.toUpperCase():Array.isArray(e.key.name)?e.key.name.map((e=>e.toUpperCase())).join("/"):e.key.name.toLowerCase(),o=[];return t?o.push(...n.map((e=>br("span",{classes:[e]}))),vr(r)):(n.push(r),n.forEach(((e,t)=>{t-1>-1&&o.push(br("span",{classes:["textbus-toolbar-keymap-join"],children:[vr("+")]})),o.push(vr(e))}))),o}function Dh(e){return br("button",{attrs:{type:"button"},classes:["textbus-toolbar-option",...e.disabled?["textbus-toolbar-option-disabled"]:[]],children:[e.iconClasses?br("span",{classes:["textbus-toolbar-option-icon",...e.iconClasses||[]]}):null,br("span",{classes:["textbus-toolbar-option-label",...e.classes||[]],children:e.label?[vr(e.label)]:[]}),e.keymap?br("span",{classes:["textbus-toolbar-option-keymap"],children:zh(e.keymap)}):null],on:e.disabled?{}:{click(){e.onClick()}}})}class _h{constructor(e){this.factory=e}setup(e){this.config=this.factory(e),this.controller=e.get(qn);const t=e.get(hr),n=Ph(Object.assign(Object.assign({},this.config),{onClick:()=>{this.config.onClick()}}));return this.config.keymap&&t.addShortcut({keymap:this.config.keymap,action:()=>{this.config.onClick()}}),this.viewer=n,n.elementRef}refreshState(){if(!this.config.queryState)return;const e=this.viewer;if(this.controller.readonly)return e.disabled=!0,void(e.highlight=!1);switch(this.config.queryState().state){case pr.Disabled:e.disabled=!0,e.highlight=!1;break;case pr.Enabled:e.disabled=!1,e.highlight=!0;break;case pr.Normal:e.disabled=!1,e.highlight=!1}}disabled(e){e&&(this.viewer.disabled=!0,this.viewer.highlight=!1)}onDestroy(){var e,t;null===(t=(e=this.config).onDestroy)||void 0===t||t.call(e)}}class qh{constructor(e){this.factory=e,this.subs=[]}setup(e){const t=this.factory(e);this.controller=e.get(qn),this.config=t;const n=e.get(hr),r=e.get(Uo),o={};let s=o;const i=Ph(Object.assign(Object.assign({},this.config),{onClick:()=>{r.show(t.viewController.elementRef)}}));return this.subs.push(t.viewController.onComplete.subscribe((e=>{s=e,r.hide(),t.useValue(s)})),t.viewController.onCancel.subscribe((()=>{r.hide()}))),t.keymap&&n.addShortcut({keymap:t.keymap,action(){i.disabled||s===o||t.useValue(s)}}),this.viewer=i,i.elementRef}refreshState(){const e=this.viewer;if(this.controller.readonly)return e.disabled=!0,void(e.highlight=!1);const t=this.config.queryState();switch(t.value?this.config.viewController.update(t.value):this.config.viewController.reset(),t.state){case pr.Enabled:e.disabled=!1,e.highlight=!0;break;case pr.Normal:e.disabled=!1,e.highlight=!1;break;case pr.Disabled:e.disabled=!0,e.highlight=!1}}disabled(e){e&&(this.viewer.disabled=!0,this.viewer.highlight=!1)}onDestroy(){var e,t;this.subs.forEach((e=>e.unsubscribe())),null===(t=(e=this.config).onDestroy)||void 0===t||t.call(e)}}class jh{constructor(e){this.factory=e,this.subs=[]}setup(e,t){const n=this.factory(e);this.config=n,this.controller=e.get(qn);const r=e.get(hr),o={};let s=o;this.subs.push(n.viewController.onComplete.subscribe((e=>{s=e,i.hide(),n.useValue(s)})));const i=Fh(Object.assign(Object.assign({},n),{stickyElement:t,menuView:n.viewController.elementRef}));return n.keymap&&r.addShortcut({keymap:n.keymap,action(){i.disabled||s===o||n.useValue(s)}}),this.viewer=i,i.elementRef}refreshState(){const e=this.viewer;if(this.controller.readonly)return e.disabled=!0,void(e.highlight=!1);const t=this.config.queryState();switch(t.value?this.config.viewController.update(t.value):this.config.viewController.reset(),t.state){case pr.Enabled:e.disabled=!1,e.highlight=!0;break;case pr.Normal:e.disabled=!1,e.highlight=!1;break;case pr.Disabled:e.disabled=!0,e.highlight=!1}}disabled(e){e&&(this.viewer.disabled=!0,this.viewer.highlight=!1)}onDestroy(){var e,t;this.subs.forEach((e=>e.unsubscribe())),null===(t=(e=this.config).onDestroy)||void 0===t||t.call(e)}}var Hh;!function(e){e[e.Select=0]="Select",e[e.Button=1]="Button",e[e.Dropdown=2]="Dropdown",e[e.Dialog=3]="Dialog"}(Hh||(Hh={}));class Vh{constructor(e){this.factory=e,this.menus=[]}setup(e,t){const n=this.factory(e),r=e.get(hr),o=e.get(Uo);this.controller=e.get(qn),this.config=n;const s=n.items.map((e=>{switch(e.type){case Hh.Button:return this.createButton(e,r);case Hh.Select:return this.createSelect(e,r);case Hh.Dropdown:return this.createDropdown(e,r);case Hh.Dialog:return this.createDialog(e,r,o)}}));this.menus=s;const i=br("div",{classes:["textbus-toolbar-group-menu"],children:s.map((e=>e.elementRef))}),a=Fh(Object.assign(Object.assign({},n),{menuView:i,stickyElement:t}));return this.controller.onReadonlyStateChange.subscribe((e=>{a.disabled=e,s.forEach((t=>{t.disabled(e)}))})),this.uiDropdown=a,a.elementRef}refreshState(){this.menus.forEach((e=>e.refreshState()))}disabled(){}createDialog(e,t,n){const r=this._createItem(Object.assign(Object.assign({},e),{label:e.label||"",isDropdown:!1}));K(r.elementRef,"click").subscribe((()=>{n.show(e.viewController.elementRef),this.uiDropdown.hide()}));const o={};let s=o;e.viewController.onComplete.subscribe((t=>{s=t,e.useValue(t),n.hide()})),e.viewController.onCancel.subscribe((()=>{n.hide()})),e.keymap&&t.addShortcut({keymap:e.keymap,action(){r.disabled||s===o||e.useValue(s)}});const i=this.controller;return{elementRef:r.elementRef,disabled(e){r.disabled=e},refreshState(){if(!e.queryState)return;const t=r;if(i.readonly)return t.disabled=!0,void(t.highlight=!1);const n=e.queryState();switch(n.state){case pr.Disabled:t.disabled=!0,t.highlight=!1,e.viewController.reset();break;case pr.Enabled:t.disabled=!1,t.highlight=!0,e.viewController.update(n.value);break;case pr.Normal:t.disabled=!1,t.highlight=!1,e.viewController.reset()}}}}createDropdown(e,t){const n=this._createItem(Object.assign(Object.assign({},e),{label:e.label||"",isDropdown:!0})),r=br("div",{classes:["textbus-toolbar-submenu"],children:[e.viewController.elementRef]}),o={};let s=o;e.viewController.onComplete.subscribe((t=>{s=t,e.useValue(t),this.uiDropdown.hide()})),e.keymap&&t.addShortcut({keymap:e.keymap,action(){n.disabled||s===o||e.useValue(s)}}),n.elementRef.appendChild(r);const i=this.controller;return{elementRef:n.elementRef,disabled(e){n.disabled=e},refreshState(){if(!e.queryState)return;const t=n;if(i.readonly)return t.disabled=!0,void(t.highlight=!1);const r=e.queryState();switch(r.state){case pr.Disabled:t.disabled=!0,t.highlight=!1,e.viewController.reset();break;case pr.Enabled:t.disabled=!1,t.highlight=!0,e.viewController.update(r.value);break;case pr.Normal:t.disabled=!1,t.highlight=!1,e.viewController.reset()}}}}createSelect(e,t){const n=this._createItem(Object.assign(Object.assign({},e),{isDropdown:!0})),r=new Map,o=br("div",{classes:["textbus-toolbar-submenu"],children:[br("div",{classes:["textbus-toolbar-select-options"],children:e.options.map((o=>{const s=Dh(Object.assign(Object.assign({},o),{onClick:()=>{e.onChecked(o.value),this.uiDropdown.hide()}}));return r.set(o,s),o.keymap&&t.addShortcut({keymap:o.keymap,action(){n.disabled||e.onChecked(o.value)}}),s}))})]});n.elementRef.appendChild(o);const s=this.controller;return{elementRef:n.elementRef,disabled(e){n.disabled=e},refreshState(){if(!e.queryState)return;const t=n;if(s.readonly)return t.disabled=!0,void(t.highlight=!1);const o=e.queryState();switch(o.state){case pr.Disabled:t.disabled=!0,t.highlight=!1;break;case pr.Enabled:t.disabled=!1,t.highlight=!0,r.forEach(((e,t)=>{t.value===o.value?e.classList.add("textbus-toolbar-option-active"):e.classList.remove("textbus-toolbar-option-active")}));break;case pr.Normal:t.disabled=!1,t.highlight=!1,r.forEach((e=>{e.classList.remove("textbus-toolbar-option-active")}))}}}}createButton(e,t){const n=this._createItem(Object.assign(Object.assign({},e),{label:e.label||"",isDropdown:!1}));K(n.elementRef,"click").subscribe((()=>{e.onClick(),this.uiDropdown.hide()})),e.keymap&&t.addShortcut({keymap:e.keymap,action(){n.disabled||e.onClick()}});const r=this.controller;return{elementRef:n.elementRef,disabled(e){n.disabled=e},refreshState(){if(!e.queryState)return;const t=n;if(r.readonly)return t.disabled=!0,void(t.highlight=!1);switch(e.queryState().state){case pr.Disabled:t.disabled=!0,t.highlight=!1;break;case pr.Enabled:t.disabled=!1,t.highlight=!0;break;case pr.Normal:t.disabled=!1,t.highlight=!1}}}}_createItem(e){const t=br("button",{attrs:{type:"button"},classes:["textbus-toolbar-group-button"],children:[e.iconClasses?br("span",{classes:[...e.iconClasses,"textbus-toolbar-group-button-icon"]}):null,br("span",{classes:["textbus-toolbar-group-button-label"],children:[vr(e.label)]}),e.keymap?br("span",{classes:["textbus-toolbar-group-button-keymap"],children:zh(e.keymap)}):null,e.isDropdown?br("span",{classes:["textbus-toolbar-group-button-caret"]}):null]}),n=br("div",{classes:["textbus-toolbar-group-item"],children:[t]});let r=!1,o=!1;return{elementRef:n,get highlight(){return r},set highlight(e){r=e,e?t.classList.add("textbus-toolbar-group-button-active"):t.classList.remove("textbus-toolbar-group-button-active")},get disabled(){return o},set disabled(e){o=e,t.disabled=e}}}}class $h{constructor(e){this.factory=e,this.subs=[]}setup(e,t){var n;const r=this.factory(e);this.controller=e.get(qn),this.config=r;const o=e.get(hr),s=r.viewController.elementRef,i=function(e){const t=e.iconClasses?br("span",{classes:e.iconClasses}):null,n=e.label?br("span",{classes:["textbus-dropdown-label"],children:[vr(e.label)]}):null,r=br("button",{classes:["textbus-toolbar-button","textbus-toolbar-dropdown-left-button"],attrs:{type:"button"},children:[t,n],on:{click(){i=!0,s.hide(),e.onLeftButtonClick()}}}),o=br("button",{classes:["textbus-toolbar-button","textbus-toolbar-dropdown-right-button"],attrs:{type:"button"},children:[br("span",{classes:["textbus-dropdown-caret"]})],on:{mousedown(){i=!0,s.toggle()}}}),s=Lh(br("span",{classes:["textbus-toolbar-item","textbus-toolbar-dropdown-button-wrap"],attrs:{title:e.tooltip||""},children:[r,o]}),e.menuView,e.stickyElement);let i=!1;const a=K(document,"mousedown").subscribe((()=>{i||s.hide(),i=!1}));let l=!1,c=!1;return{elementRef:s.elementRef,leftButton:r,destroy(){a.unsubscribe(),s.destroy()},hide(){s.hide()},get highlight(){return l},set highlight(e){l=e,e?r.classList.add("textbus-toolbar-button-active"):r.classList.remove("textbus-toolbar-button-active")},get disabled(){return c},set disabled(e){c=e,r.disabled=e,o.disabled=e}}}(Object.assign(Object.assign({},r),{menuView:s,stickyElement:t,onLeftButtonClick(){var e;i.disabled||l===a||null===(e=r.useValue)||void 0===e||e.call(r,l)}})),a={};let l=a;return this.subs.push(r.viewController.onComplete.subscribe((e=>{var t;l=e,null===(t=r.useValue)||void 0===t||t.call(r,e),i.hide()}))),r.keymap&&o.addShortcut({keymap:r.keymap,action(){var e;i.disabled||l===a||null===(e=r.useValue)||void 0===e||e.call(r,l)}}),this.viewer=i,null===(n=r.onInit)||void 0===n||n.call(r,i),i.elementRef}disabled(e){e&&(this.viewer.disabled=!0,this.viewer.highlight=!1)}refreshState(){if(!this.config.queryState)return;const e=this.viewer;if(this.controller.readonly)return e.disabled=!0,void(e.highlight=!1);const t=this.config.queryState();switch(this.config.viewController.update(t.value),t.state){case pr.Enabled:e.disabled=!1,e.highlight=!0;break;case pr.Normal:e.disabled=!1,e.highlight=!1;break;case pr.Disabled:e.disabled=!0,e.highlight=!1}}onDestroy(){var e,t;this.subs.forEach((e=>e.unsubscribe())),null===(t=(e=this.config).onDestroy)||void 0===t||t.call(e)}}class Uh{constructor(e){this.factory=e}setup(e,t){const n=this.factory(e);this.controller=e.get(qn),this.config=n;const r=e.get(hr),o=function(e){const t=br("span",{classes:["textbus-toolbar-select-label"].concat(e.mini?["textbus-toolbar-select-label-mini"]:[])});let n=!1;const r=br("button",{classes:["textbus-toolbar-button"],attrs:{title:e.tooltip||"",type:"button"},children:[e.iconClasses?br("span",{classes:[...e.iconClasses,"textbus-toolbar-select-icon"]}):null,t,br("span",{classes:["textbus-dropdown-caret"]})],on:{click(){n=!0,s.toggle()}}}),o=K(document,"click").subscribe((()=>{n||s.hide(),n=!1})),s=Lh(br("span",{classes:["textbus-toolbar-item","textbus-toolbar-dropdown"],children:[r]}),br("div",{classes:["textbus-toolbar-select-options"],children:e.options.map((n=>(n.default&&(t.innerText=n.label),Dh(Object.assign(Object.assign({},n),{onClick(){s.hide(),e.onSelected(n.value)}})))))}),e.stickyElement);let i=!1,a=!1;return{elementRef:s.elementRef,destroy(){s.destroy(),o.unsubscribe()},setLabel(e){t.innerText=e},get highlight(){return i},set highlight(e){i=e,e?r.classList.add("textbus-toolbar-button-active"):r.classList.remove("textbus-toolbar-button-active")},get disabled(){return a},set disabled(e){a=e,r.disabled=e}}}(Object.assign(Object.assign({},n),{stickyElement:t,onSelected:e=>{n.onChecked(e)}}));return n.options.filter((e=>e.keymap)).forEach((e=>{r.addShortcut({keymap:e.keymap,action:()=>{o.disabled||this.config.onChecked(e.value)}})})),this.viewer=o,o.elementRef}refreshState(){if(!this.config.queryState)return;const e=this.viewer;if(this.controller.readonly)return e.disabled=!0,void(e.highlight=!1);const t=this.config.queryState();if(t.value){const n=this.config.options.find((e=>e.value===t.value));if(n)return e.setLabel(n.label),e.disabled=!1,void(e.highlight=!0)}let n;e.highlight=!1,e.disabled=t.state===pr.Disabled;for(const e of this.config.options)if(e.default){n=e;break}n&&e.setLabel(n.label)}disabled(e){e&&(this.viewer.disabled=!0,this.viewer.highlight=!1)}onDestroy(){var e,t;null===(t=(e=this.config).onDestroy)||void 0===t||t.call(e)}}function Gh(e){const t=e.get(Co),n=e.get(mr),r=e.get(Zn),o=e.get($o),s=t.getContext("plugins.toolbar.audioTool.view"),i=new Po({title:s.get("title"),cancelBtnText:s.get("cancelBtnText"),confirmBtnText:s.get("confirmBtnText"),items:[new Ho({label:s.get("addressLabel"),name:"src",placeholder:s.get("addressPlaceholder"),canUpload:!0,uploadType:"audio",uploadBtnText:s.get("uploadBtnText"),fileUploader:o,validateFn(e){return!e&&s.get("errorMessage")}}),new jo({label:s.get("switchLabel"),checked:!1,name:"autoplay"}),new Fo({name:"controls",value:"controls"})]});return{iconClasses:["textbus-icon-music"],tooltip:t.get("plugins.toolbar.audioTool.tooltip"),viewController:i,queryState(){const e=n.queryComponent(Ao);return e.state===pr.Enabled?{state:pr.Enabled,value:e.value.extends.toJSON()}:{state:e.state,value:null}},useValue(t){if(t){const o=n.queryComponent(Ao);o.state===pr.Enabled?o.value.extends.mergeProps(t):r.insert(Ao.createInstance(e,{state:t}))}}}}function Wh(){return new qh(Gh)}function Kh(e){const t=e.get(Co),n=e.get(mr),r=e.get(Zn),o=e.get(Vn);return{iconClasses:["textbus-icon-quotes-right"],tooltip:t.get("plugins.toolbar.blockquoteTool.tooltip"),keymap:/win(dows|32|64)/i.test(navigator.userAgent)?{altKey:!0,key:"'"}:{ctrlKey:!0,key:"'"},queryState(){return n.queryComponent(Ro)},onClick(){const t=n.queryComponent(Ro);if(t.state===pr.Enabled){const e=t.value,n=e.parent,o=n.indexOf(e);n.retain(o),r.removeComponent(e),e.slots.get(0).sliceContent().forEach((e=>{n.insert(e)}))}else{const t=Ro.createInstance(e),n=t.slots.get(0);if(o.startSlot===o.endSlot){const e=o.startSlot.parent,r=e.parent,s=r.indexOf(e);n.insert(e),r.retain(s),r.insert(t)}else{const e=o.commonAncestorSlot,r=o.getCommonAncestorSlotScope();e.cut(r.startOffset,r.endOffset).sliceContent().forEach((e=>{n.insert(e)})),e.retain(r.startOffset),e.insert(t)}}}}}function Yh(){return new _h(Kh)}function Xh(e){const t=e.get(mr),n=e.get(Zn);return{iconClasses:["textbus-icon-bold"],tooltip:e.get(Co).get("plugins.toolbar.boldTool.tooltip"),keymap:{ctrlKey:!0,key:"b"},queryState(){return t.queryFormat(Ou)},onClick(){t.queryFormat(Ou).state===pr.Enabled?n.unApplyFormat(Ou):n.applyFormat(Ou,!0)}}}function Jh(){return new _h(Xh)}function Zh(e){const t=e.get(Vn),n=e.get(Zn);return{iconClasses:["textbus-icon-clear-formatting"],tooltip:e.get(Co).get("plugins.toolbar.cleanTool.tooltip"),keymap:{ctrlKey:!0,shiftKey:!0,altKey:!0,key:"c"},queryState(){return{state:t.isCollapsed?pr.Disabled:pr.Normal,value:null}},onClick(){n.cleanFormats([so]),n.cleanAttributes()}}}function Qh(){return new _h(Zh)}function ed(e){const t=e.get(Co),n=e.get(mr),r=e.get(Zn);return{iconClasses:["textbus-icon-code"],tooltip:t.get("plugins.toolbar.codeTool.tooltip"),keymap:{key:";",ctrlKey:!0},queryState(){return n.queryFormat(zu)},onClick(){n.queryFormat(zu).state===pr.Enabled?r.unApplyFormat(zu):r.applyFormat(zu,!0)}}}function td(){return new _h(ed)}function nd(e){return(e%360+360)%360}function rd(e){return/^#/.test(e)&&(e=e.substring(1)),3===e.length?"#"+e.split("").map((function(e){return e+e})).join(""):"#"+e}var od=255,sd=360,id=100;function ad(e){var t=e.r,n=e.g,r=e.b;t=t===od?1:t%od/od,n=n===od?1:n%od/od,r=r===od?1:r%od/od;var o,s,i=Math.max(t,n,r),a=Math.min(t,n,r),l=(i+a)/2;if(i===a)o=s=0;else{var c=i-a;switch(s=l>.5?c/(2-i-a):c/(i+a),i){case t:o=(n-r)/c+(n<r?6:0);break;case n:o=(r-t)/c+2;break;case r:o=(t-n)/c+4}o/=6}return{h:Math.round(o*sd),s:Math.round(s*id),l:Math.round(l*id)}}function ld(e){var t=e.r,n=e.g,r=e.b;t=t===od?1:t%od/od,n=n===od?1:n%od/od,r=r===od?1:r%od/od;var o,s,i=Math.max(t,n,r),a=Math.min(t,n,r),l=i,c=i-a;if(s=0===i?0:c/i,i===a)o=0;else{switch(i){case t:o=(n-r)/c+(n<r?6:0);break;case n:o=(r-t)/c+2;break;case r:o=(t-n)/c+4}o/=6}return{h:Math.round(o*sd),s:Math.round(s*id),v:Math.round(l*id)}}function cd(e){var t,n,r,o=e.h,s=e.s,i=e.l;function a(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(o=(o=nd(o))===sd?1:o%sd/sd,i=i===id?1:i%id/id,0==(s=s===id?1:s%id/id))t=n=r=i;else{var l=i<.5?i*(1+s):i+s-i*s,c=2*i-l;t=a(c,l,o+1/3),n=a(c,l,o),r=a(c,l,o-1/3)}return{r:Math.round(t*od),g:Math.round(n*od),b:Math.round(r*od)}}function ud(e){var t=e.h,n=e.s,r=e.v;t=(t=nd(t))===sd?1:t%sd/sd*6,n=n===id?1:n%id/id,r=r===id?1:r%id/id;var o=Math.floor(t),s=t-o,i=r*(1-n),a=r*(1-s*n),l=r*(1-(1-s)*n),c=o%6,u=[r,a,i,i,l,r][c],h=[l,r,r,a,i,i][c],d=[i,i,l,r,r,a][c];return{r:Math.floor(u*od),g:Math.floor(h*od),b:Math.floor(d*od)}}function hd(e){var t=e.r,n=e.g,r=e.b,o=Math.round(t).toString(16),s=Math.round(n).toString(16),i=Math.round(r).toString(16);return"#"+(o=1===o.length?"0"+o:o)+(s=1===s.length?"0"+s:s)+(1===i.length?"0"+i:i)}function dd(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(rd(e));return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function pd(e){return hd(cd(e))}function md(e){return ad(dd(rd(e)))}function fd(e){return ad(ud(e))}function gd(e){if(e.indexOf("#")>-1)return dd(e);var t=e.split("(")[0],n=e.split("(")[1].split(")")[0].split(",");return t.split("").reduce((function(e,t,r){var o=e;return o[t]=parseFloat(n[r]),o}),{})}var bd=function(){return bd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},bd.apply(this,arguments)},vd=function(){function e(e,t){void 0===t&&(t={});var n,r,o,s,i=this;this.onChange=new j,this.onSelected=new j,this.host=document.createElement("div"),this.empty=!1,this.resetAlpha=!0,this.recentColorOptions=[],this.writing=!1,this.colorElements=[],this.container="string"==typeof e?document.querySelector(e):e,this.host.classList.add("tanbo-color-picker"),this.host.innerHTML=(n=t.btnText||"确定",r=t.paletteText||"调色盘",o=t.recentText||"最近使用",s=t.backText||"返回",'\n<div class="tanbo-color-picker-preset">\n <div class="tanbo-color-picker-swatches" style="height: 50px"></div>\n <div class="tanbo-color-picker-swatches" style="height: 118px;"></div>\n <div class="tanbo-color-picker-recent-text">'.concat(o,'</div>\n <div class="tanbo-color-picker-swatches" style="height: 25px;">\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n </div>\n <div class="tanbo-color-picker-flex">\n <div class="tanbo-color-picker-swatches">\n <div data-color=""></div>\n </div>\n <button type="button" class="tanbo-color-picker-to-palette">').concat(r,'<svg style="vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path transform="rotate(180, 512, 512)" d="M497.92 165.12L422.4 89.6 0 512l422.4 422.4 75.52-75.52L151.04 512z"></path></svg>\n </button>\n </div>\n</div>\n<div class="tanbo-color-picker-menu">\n <div class="tanbo-color-picker-back-btn-wrap">\n <button type="button" class="tanbo-color-picker-back-btn">\n <svg style="vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M497.92 165.12L422.4 89.6 0 512l422.4 422.4 75.52-75.52L151.04 512z"></path></svg>').concat(s,'\n </button>\n </div>\n <div class="tanbo-color-picker-viewer">\n <div class="tanbo-color-picker-viewer-left">\n <div class="tanbo-color-picker-palette">\n <div class="tanbo-color-picker-palette-point"></div>\n </div>\n <div class="tanbo-color-picker-viewer-alpha">\n <div class="tanbo-color-picker-viewer-alpha-pointer"></div>\n <div class="tanbo-color-picker-viewer-alpha-bar"></div>\n </div>\n </div>\n <div class="tanbo-color-picker-viewer-right">\n <div class="tanbo-color-picker-tools">\n <div class="tanbo-color-picker-value">\n <div class="tanbo-color-picker-value-color"></div>\n </div>\n <div class="tanbo-color-picker-hue-bar">\n <div class="tanbo-color-picker-hue-pointer"></div>\n </div>\n </div>\n <div class="tanbo-color-picker-viewer-alpha-value">\n 1\n </div>\n </div>\n </div>\n <div class="tanbo-color-picker-inputs">\n <div class="tanbo-color-picker-hsl">\n <div>H <input data-model="H" min="0" max="360" type="number"></div>\n <div>S <input data-model="S" min="0" max="100" type="number"></div>\n <div>L <input data-model="L" min="0" max="100" type="number"></div>\n </div>\n <div class="tanbo-color-picker-rgb">\n <div>R <input data-model="R" min="0" max="255" type="number"></div>\n <div>G <input data-model="G" min="0" max="255" type="number"></div>\n <div>B <input data-model="B" min="0" max="255" type="number"></div>\n </div>\n <div class="tanbo-color-picker-hex">\n <div>HEX <input data-model="HEX" type="text"></div>\n </div>\n </div>\n <div class="tanbo-color-picker-btn-wrap">\n <button type="button" class="tanbo-color-picker-btn">').concat(n,"</button>\n </div>\n</div>\n")),this.container.appendChild(this.host),this.valueViewer=this.host.querySelector(".tanbo-color-picker-value-color"),this.palette=this.host.querySelector(".tanbo-color-picker-palette"),this.palettePoint=this.host.querySelector(".tanbo-color-picker-palette-point"),this.hueBar=this.host.querySelector(".tanbo-color-picker-hue-bar"),this.huePoint=this.host.querySelector(".tanbo-color-picker-hue-pointer"),this.checkBtn=this.host.querySelector(".tanbo-color-picker-btn"),this.alphaBar=this.host.querySelector(".tanbo-color-picker-viewer-alpha-bar"),this.alphaValue=this.host.querySelector(".tanbo-color-picker-viewer-alpha-value"),this.alphaPoint=this.host.querySelector(".tanbo-color-picker-viewer-alpha-pointer"),this.inputsWrap=this.host.querySelector(".tanbo-color-picker-inputs"),this.hslInputs=Array.from(this.host.querySelectorAll(".tanbo-color-picker-hsl input")),this.rgbInputs=Array.from(this.host.querySelectorAll(".tanbo-color-picker-rgb input")),this.hexInput=this.host.querySelector(".tanbo-color-picker-hex input"),this.colorWrapper=this.host.querySelector(".tanbo-color-picker-preset"),this.switchBtn=this.host.querySelector(".tanbo-color-picker-to-palette"),this.menu=this.host.querySelector(".tanbo-color-picker-menu"),this.backBtn=this.host.querySelector(".tanbo-color-picker-back-btn"),this.mainColors=this.colorWrapper.children[0],this.colors=this.colorWrapper.children[1],this.recentElement=this.colorWrapper.children[3],Array.isArray(t.mainColors)&&this.addColor(t.mainColors,this.mainColors),Array.isArray(t.colors)&&this.addColor(t.colors,this.colors),this.hex=t.value||"#f00",this.bindingEvents(),this.onSelected.subscribe((function(){i.addRecentColor(i.hex)}))}return Object.defineProperty(e.prototype,"hex",{get:function(){return this.empty?null:this._hex},set:function(e){var t=e?rd(e):null;t?(this.empty=!1,this._hex=t,this._hsl=md(t),this._rgb=dd(t),this._hsv=function(e){return ld(dd(rd(e)))}(t),this._rgba=bd(bd({},this._rgb),{a:this.resetAlpha?1:this._rgba.a})):this.empty=!0,this.resetAlpha=!0,this.render()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hsl",{get:function(){return this.empty?null:this._hsl},set:function(e){e&&"number"==typeof e.h&&"number"==typeof e.s&&"number"==typeof e.l?(this.empty=!1,this._hsl=e,this._hex=pd(e),this._hsv=function(e){return ld(cd(e))}(e),this._rgb=cd(e),this._rgba=bd(bd({},this._rgb),{a:this.resetAlpha?1:this._rgba.a})):this.empty=!0,this.resetAlpha=!0,this.render()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rgb",{get:function(){return this.empty?null:this._rgb},set:function(e){e&&"number"==typeof e.r&&"number"==typeof e.g&&"number"==typeof e.b?(this.empty=!1,this._rgb=e,this._rgba=bd(bd({},e),{a:this.resetAlpha?1:this._rgba.a}),this._hsl=ad(e),this._hex=hd(e),this._hsv=ld(e)):this.empty=!0,this.resetAlpha=!0,this.render()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rgba",{get:function(){return this.empty?null:this._rgba},set:function(e){e&&"number"==typeof e.r&&"number"==typeof e.g&&"number"==typeof e.b&&"number"==typeof e.a?(this.empty=!1,this._rgba=e,this._hsl=ad(e),this._hex=hd(e),this._hsv=ld(e)):this.empty=!0,this.render()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hsv",{get:function(){return this.empty?null:this._hsv},set:function(e){e&&"number"==typeof e.h&&"number"==typeof e.s&&"number"==typeof e.v?(this.empty=!1,this._hsv=e,this._hex=function(e){return hd(ud(e))}(e),this._hsl=fd(e),this._rgb=ud(e),this._rgba=bd(bd({},this._rgb),{a:this.resetAlpha?1:this._rgba.a})):this.empty=!0,this.resetAlpha=!0,this.render()},enumerable:!1,configurable:!0}),e.prototype.addRecentColor=function(e){e&&(this.recentColorOptions=this.recentColorOptions.filter((function(t){return t!==e})),this.recentColorOptions.unshift(e),this.recentColorOptions.length>=7&&(this.recentColorOptions.length=7),this.renderRecentColors())},e.prototype.renderRecentColors=function(){for(var e=0;e<7;){var t=this.recentColorOptions[e],n=this.recentElement.children[e];e++,t?(n.style.background=t,n.setAttribute("data-color",t)):(n.style.background="",n.removeAttribute("data-color"))}},e.prototype.addColor=function(e,t){var n=this;e.forEach((function(e){var r=document.createElement("div");r.style.background=e,r.setAttribute("data-color",e),n.colorElements.push(r),t.append(r)}))},e.prototype.render=function(){var e=this;this.writing||(this.empty?(this.hslInputs[0].value="",this.hslInputs[1].value="",this.hslInputs[2].value="",this.rgbInputs[0].value="",this.rgbInputs[1].value="",this.rgbInputs[2].value="",this.hexInput.value="",this.alphaValue.innerText="1"):(this.hslInputs[0].value=this.hsl.h+"",this.hslInputs[1].value=this.hsl.s+"",this.hslInputs[2].value=this.hsl.l+"",this.rgbInputs[0].value=this.rgb.r+"",this.rgbInputs[1].value=this.rgb.g+"",this.rgbInputs[2].value=this.rgb.b+"",this.hexInput.value=this.hex,this.alphaValue.innerText=Number(this.rgba.a.toFixed(2))+"")),this.palette.classList.remove("tanbo-color-picker-palette-empty"),this.palette.style.background="linear-gradient(to right, #fff, hsl(".concat(this._hsv.h,", 100%, 50%))"),this.palettePoint.style.left="calc(".concat(this._hsv.s,"% - 6px)"),this.palettePoint.style.top="calc(".concat(100-this._hsv.v,"% - 6px)"),this.huePoint.style.top="calc(".concat(this._hsv.h/360*100,"% - 4px)"),this.empty?(this.palette.classList.add("tanbo-color-picker-palette-empty"),this.palette.style.background="",this.valueViewer.style.background="",this.alphaBar.style.background="",this.alphaPoint.style.left="100%"):(this.valueViewer.style.background="rgba(".concat(this.rgba.r,", ").concat(this.rgba.g,", ").concat(this.rgba.b,", ").concat(this.rgba.a,")"),this.palette.classList.remove("tanbo-color-picker-palette-empty"),this.palette.style.background="linear-gradient(to right, #fff, hsl(".concat(this._hsv.h,", 100%, 50%))"),this.alphaBar.style.background="linear-gradient(to right, transparent, ".concat(this.hex,")"),this.alphaPoint.style.left=100*(this.rgba.a||0)+"%"),this.colorElements.forEach((function(t){var n=function(e){var t=function(e){if("string"==typeof e)try{return dd(e),"hex"}catch(e){}if("object"!=typeof e)return"unknown";var t=e;return t.r+t.g+t.b&&"number"==typeof(t.r+t.g+t.b)?"rgb":t.h+t.s+t.v&&"number"==typeof(t.h+t.s+t.v)?"hsv":t.h+t.s+t.l&&"number"==typeof(t.h+t.s+t.l)?"hsl":t.c+t.m+t.y+t.k&&"number"==typeof(t.c+t.m+t.y+t.k)?"cmyk":"unknown"}(e);switch(t){case"hsl":return e;case"rgb":return ad(e);case"hex":return md(e);case"hsv":return fd(e);case"cmyk":return ad(function(e){var t=e.c,n=e.m,r=e.y,o=e.k,s=255*(1-t)*(1-o),i=255*(1-n)*(1-o),a=255*(1-r)*(1-o);return{r:Math.floor(s),g:Math.floor(i),b:Math.floor(a)}}(e));default:return"unknown"}}(t.getAttribute("data-color")||"");"unknown"!==n&&e.hsl&&n.l===e.hsl.l&&n.s===e.hsl.s&&n.h===e.hsl.h?t.classList.add("tanbo-color-picker-current"):t.classList.remove("tanbo-color-picker-current")}))},e.prototype.bindingEvents=function(){this.bindPaletteEvent(),this.bindHueBarEvent(),this.bindAlphaEvent(),this.bindInputsEvent(),this.bindSelectedEvent(),this.bindColorOptionsEvent(),this.bindSwitchEvent()},e.prototype.bindSwitchEvent=function(){var e=this;this.switchBtn.addEventListener("click",(function(){e.host.classList.add("tanbo-color-picker-show-palette")})),this.backBtn.addEventListener("click",(function(){e.host.classList.remove("tanbo-color-picker-show-palette")}))},e.prototype.bindAlphaEvent=function(){var e=this,t=function(t){var n=e.alphaBar.getBoundingClientRect(),r=t.clientX-n.left;r=Math.max(0,r),r=Math.min(n.width,r),e.rgba=bd(bd({},e._rgba),{a:r/n.width}),e.onChange.next(e)},n=function(e){t(e)},r=function(){document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",r)};this.alphaBar.addEventListener("mousedown",(function(e){t(e),document.addEventListener("mousemove",n),document.addEventListener("mouseup",r)}))},e.prototype.bindPaletteEvent=function(){var e=this,t=function(t){var n=e.palette.getBoundingClientRect(),r=(t.clientX-n.left)/130*100,o=100-(t.clientY-n.top)/130*100;r=Math.max(0,r),r=Math.min(100,r),o=Math.max(0,o),o=Math.min(100,o),e.resetAlpha=!1,e.hsv={h:e._hsv.h,s:r,v:o},e.onChange.next(e)},n=function(e){t(e)},r=function(){document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",r)};this.palette.addEventListener("mousedown",(function(e){t(e),document.addEventListener("mousemove",n),document.addEventListener("mouseup",r)}))},e.prototype.bindHueBarEvent=function(){var e=this,t=function(t){var n=e.hueBar.getBoundingClientRect(),r=t.clientY-n.top;r=Math.max(0,r);var o=3.6*(r=Math.min(100,r));e.resetAlpha=!1,e.hsv={h:o,s:e._hsv.s,v:e._hsv.v},e.onChange.next(e)},n=function(e){t(e)},r=function(){document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",r)};this.hueBar.addEventListener("mousedown",(function(e){t(e),document.addEventListener("mousemove",n),document.addEventListener("mouseup",r)}))},e.prototype.bindInputsEvent=function(){var e=this,t=function(t,n,r){e.hex=pd({h:t,s:n,l:r}),e.onChange.next(e)},n=function(t,n,r){e.hex=hd({r:t,g:n,b:r}),e.onChange.next(e)};this.inputsWrap.addEventListener("input",(function(r){e.writing=!0;var o=r.target,s=o.getAttribute("data-model");if("number"===o.type){var i=+o.min,a=+o.max;o.value=Math.max(o.value,i),o.value=Math.min(o.value,a)}var l=e.hsl,c=l.h,u=l.s,h=l.l,d=e.rgb,p=d.r,m=d.g,f=d.b;switch(s){case"H":t(o.value,u,h);break;case"S":t(c,o.value,h);break;case"L":t(c,u,o.value);break;case"R":n(o.value,m,f);break;case"G":n(p,o.value,f);break;case"B":n(p,m,o.value);break;case"HEX":/^#(([0-9a-f]){3}){1,2}$/i.test(o.value)&&(e.hex=o.value,e.onChange.next(e))}e.writing=!1}))},e.prototype.bindSelectedEvent=function(){var e=this;this.checkBtn.addEventListener("click",(function(){e.host.classList.remove("tanbo-color-picker-show-palette"),e.onSelected.next(e)}))},e.prototype.bindColorOptionsEvent=function(){var e=this;this.colorWrapper.addEventListener("click",(function(t){var n=t.target;if(n.hasAttribute("data-color")){var r=n.getAttribute("data-color");/^rgba/.test(r)?e.rgba=gd(r):e.hex=r,e.onSelected.next(e)}}))},e}();class yd{constructor(e,t,n,r,o){var s,i;this.styleName=e,this.elementRef=document.createElement("div"),this.completeEvent=new j,this.elementRef.classList.add("textbus-toolbar-palette"),this.onComplete=this.completeEvent.asObservable(),this.picker=(s=this.elementRef,void 0===(i={recentText:n,btnText:t,backText:r,paletteText:o})&&(i={}),new vd(s,bd({mainColors:["#000","#333","#444","#555","#666","#777","#888","#999","#aaa","#bbb","#ccc","#ddd","#eee","#fff"],colors:["#fec6c2","#fee5c3","#fefcc3","#baf6c4","#c3ebfe","#c3cbfe","#e1caff","#fc8e88","#fccc88","#fcf888","#76ec8a","#88d8fc","#97a4fb","#c098f4","#ff6666","#ffb151","#fada3a","#18c937","#3aaafa","#6373e2","#a669f7","#f63030","#f88933","#deb12a","#038e23","#1276cc","#3f52ce","#8838ed","#c60000","#d86912","#b88811","#086508","#144c93","#1b2eaa","#6117bf"]},i))),this.picker.onSelected.subscribe((e=>{if(e.rgba)if(1===e.rgba.a)this.completeEvent.next(e.hex);else{const{r:t,g:n,b:r,a:o}=e.rgba;this.completeEvent.next(`rgba(${t},${n},${r},${o})`)}else this.completeEvent.next(null)}))}update(e){const t=e||"#f00";/^#/.test(t)?this.picker.hex=t:/^rgba/.test(t)?this.picker.rgba=gd(t):/^rgb/.test(t)?this.picker.hex=hd(gd(t)):/^hsl/.test(t)&&(this.picker.hex=pd(gd(t)))}}function xd(e,t,n){const r=e.get(mr),o=e.get(Zn);let s;return{viewController:{elementRef:t.elementRef,onComplete:t.onComplete,onCancel:new q,reset(){t.update()},update(e){t.update(e)}},onInit(e){s=e},useValue(e){s.leftButton.style.color=e,o.applyFormat(n,e)},queryState(){return r.queryFormat(n)}}}function wd(e){const t=e.get(Co).getContext("plugins.toolbar.colorTool"),n=new yd("color",t.get("view.btnText"),t.get("view.recentText"),t.get("view.backText"),t.get("view.paletteText"));return Object.assign({iconClasses:["textbus-icon-color"],tooltip:t.get("tooltip"),keymap:{ctrlKey:!0,shiftKey:!0,key:"c"}},xd(e,n,th))}function kd(){return new $h(wd)}function Cd(e){const t=e.get(Co),n=br("div",{classes:["textbus-component-stage-list"]}),r=[{name:t.get("components.imageCardComponent.creator.name"),example:`<img src="data:image/svg+xml;charset=UTF-8,${encodeURIComponent('<svg width="100" height="70" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="bg" x1="0%" y1="0%" x2="0%" y2="100%"><stop offset="0%" stop-color="#f90"/><stop offset="100%" stop-color="#fff"/></linearGradient></defs><g><rect fill="url(#bg)" height="50" width="100%"/></g><g><path fill="#f00" opacity="0.2" d="M81.25 28.125c0 5.178-4.197 9.375-9.375 9.375s-9.375-4.197-9.375-9.375 4.197-9.375 9.375-9.375 9.375 4.197 9.375 9.375z"></path><path fill="#0e0" opacity="0.3" d="M87.5 81.25h-75v-12.5l21.875-37.5 25 31.25h6.25l21.875-18.75z"></path></g><g><rect fill="#fff" height="20" width="100%" y="50"></rect></g><g><text font-family="Helvetica, Arial, sans-serif" font-size="12" y="63" x="50%" text-anchor="middle" stroke-width="0" stroke="#000" fill="#000000">描述文字</text></g></svg>')}" alt="">`,factory(){return Jo.createInstance(e)}},{name:t.get("components.todoListComponent.creator.name"),example:`<img alt="默认图片" src="data:image/svg+xml;charset=UTF-8,${encodeURIComponent('<svg width="100" height="70" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" ><g><rect fill="#fff" height="100%" width="100%"/></g><defs><g id="item"><rect fill="#fff" stroke="#1296db" height="8" width="8" rx="2" x="15" y="12"/><text font-family="Helvetica, Arial, sans-serif" font-size="8" x="28" y="19" stroke-width="0" stroke="#000" fill="#000000">待办事项...</text></g></defs><use xlink:href="#item"></use><use xlink:href="#item" transform="translate(0, 12)"></use><use xlink:href="#item" transform="translate(0, 24)"></use><use xlink:href="#item" transform="translate(0, 36)"></use></svg>')}">`,factory(){return kh.createInstance(e,{slots:[new _n([Fn.Text,Fn.InlineComponent],{active:!1,disabled:!1})]})}},{name:t.get("components.jumbotronComponent.creator.name"),example:`<img src="data:image/svg+xml;charset=UTF-8,${encodeURIComponent('<svg width="100" height="70" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><linearGradient id="bg" x1="0%" y1="0%" x2="0%" y2="100%"><stop offset="0%" stop-color="#6ad1ec"/><stop offset="100%" stop-color="#fff"/></linearGradient></defs><g><rect fill="url(#bg)" height="100%" width="100%"/></g><path fill="#fff" opacity="0.3" d="M81.25 28.125c0 5.178-4.197 9.375-9.375 9.375s-9.375-4.197-9.375-9.375 4.197-9.375 9.375-9.375 9.375 4.197 9.375 9.375z"></path><path fill="#fff" opacity="0.3" d="M87.5 81.25h-75v-12.5l21.875-37.5 25 31.25h6.25l21.875-18.75z"></path><text font-family="Helvetica, Arial, sans-serif" font-size="12" x="10" y="25" stroke-width="0.3" stroke="#000" fill="#000000">Hello, world!</text><text font-family="Helvetica, Arial, sans-serif" font-size="6" x="10" y="40" stroke-width="0" stroke="#000" fill="#000000">你好,我是 Textbus一个给你带来全新体验的富文本开发框架。</text><text font-family="Helvetica, Arial, sans-serif" font-size="6" x="10" y="50" stroke-width="0" stroke="#000" fill="#000000">现在我们开始吧!</text></svg>')}">`,factory(){return es.createInstance(e)}},{name:t.get("components.katexComponent.creator.name"),example:`<img src="data:image/svg+xml;charset=UTF-8,${encodeURIComponent('<svg width="100" height="70" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 40.541"><path d="M4.618 27.925c-.299.299-.591.478-.874.538-.284.06-1.039.105-2.264.135H0v2.062h.493c.508-.09 2.66-.135 6.456-.135 3.796 0 5.948.045 6.456.135h.493v-2.062h-1.48c-1.764-.029-2.765-.209-3.004-.538-.09-.119-.135-1.584-.135-4.394v-4.259l2.062-2.018a83.544 83.544 0 002.063-1.972c.209-.209.388-.373.538-.493l3.901 5.873c2.331 3.587 3.661 5.62 3.99 6.098.09.179.135.359.135.538 0 .778-.688 1.166-2.062 1.166h-.359v2.062h.493c.628-.09 2.764-.135 6.412-.135.269 0 .673.008 1.211.022.538.015.956.022 1.255.022.298 0 .68.008 1.143.022.463.015.807.03 1.031.045.224.015.366.022.426.022h.359v-2.062h-.942c-1.255-.029-2.152-.194-2.69-.493a3.197 3.197 0 01-1.076-1.031l-5.179-7.779c-3.273-4.917-4.91-7.39-4.91-7.42 0-.029 1.33-1.33 3.99-3.901 2.66-2.57 4.065-3.93 4.215-4.08C26.6 2.817 28.379 2.219 30.62 2.1h.628V.037h-.269c-.03 0-.135.008-.314.022-.179.015-.434.03-.762.045a18.99 18.99 0 01-.852.022c-.209 0-.523.008-.942.022-.419.015-.747.022-.986.022-3.408 0-5.366-.045-5.873-.135h-.448v2.062h.179l.202.022.247.022c.836.209 1.255.643 1.255 1.3-.06.24-.12.404-.179.493-.06.12-2.272 2.317-6.636 6.591l-6.546 6.367-.045-6.95c0-4.663.015-7.024.045-7.084.06-.508.897-.762 2.511-.762h2.062V.037h-.493c-.509.09-2.661.135-6.456.135C3.152.172 1 .127.492.037H0v2.062h1.48c1.225.03 1.98.075 2.264.135.284.06.575.24.874.538v25.153zm34.924-16.858h1.793v-.269c.029-.119.074-.478.135-1.076.239-3.198.836-5.201 1.793-6.008.747-.628 1.763-1.046 3.049-1.255.298-.029 1.15-.045 2.556-.045h1.211c.687 0 1.113.022 1.278.067.164.045.291.202.381.471.029.06.045 4.23.045 12.509v12.375c-.24.329-.613.538-1.121.628-1.076.09-2.421.135-4.035.135h-1.345v2.062h.583c.628-.09 3.377-.135 8.25-.135 4.872 0 7.622.045 8.25.135h.583v-2.062h-1.345c-1.614 0-2.959-.045-4.035-.135-.509-.09-.882-.298-1.121-.628V15.461c0-8.279.015-12.449.045-12.509.09-.269.216-.426.381-.471.164-.045.59-.067 1.278-.067h1.211c1.674 0 2.825.075 3.452.224 1.136.329 1.957.807 2.466 1.435.747.867 1.225 2.75 1.435 5.649.06.598.104.957.135 1.076v.269h1.793v-.269c0-.06-.134-1.763-.404-5.111C67.97 2.34 67.82.636 67.791.576v-.27H40.394v.269c0 .06-.135 1.764-.404 5.111-.269 3.348-.419 5.052-.448 5.111v.27zm60.461 19.593v-2.062h-.359c-.658-.06-1.226-.254-1.704-.583-.478-.329-.717-.702-.717-1.121 0-.209.015-.329.045-.359.029-.09 1.031-1.629 3.004-4.618.448-.687.836-1.293 1.166-1.816.329-.523.605-.956.829-1.3.224-.343.411-.62.56-.829.149-.209.254-.343.314-.404l.135-.135 1.659 2.556a514.118 514.118 0 013.273 5.111c1.076 1.704 1.614 2.6 1.614 2.69 0 .209-.314.397-.942.56-.628.165-1.196.247-1.704.247h-.269v2.062h.493c.687-.09 2.869-.135 6.546-.135 3.318 0 5.201.045 5.649.135H120v-2.062h-1.39c-1.166-.029-1.958-.09-2.376-.179-.419-.09-.747-.269-.986-.538-.09-.09-1.667-2.526-4.73-7.308-3.064-4.782-4.596-7.203-4.596-7.263 0-.029.986-1.584 2.959-4.663 2.092-3.139 3.183-4.753 3.273-4.842 1.016-1.046 2.75-1.614 5.201-1.704h.762V.037h-.359c-.359.09-2.003.135-4.932.135-3.468 0-5.396-.045-5.784-.135h-.404v2.062h.359c.926.09 1.614.389 2.062.897.388.389.493.747.314 1.076 0 .03-.778 1.248-2.331 3.654-1.555 2.406-2.347 3.609-2.376 3.609-.06 0-.979-1.397-2.757-4.192-1.779-2.795-2.668-4.237-2.668-4.327.06-.149.404-.306 1.031-.471.628-.164 1.195-.247 1.704-.247h.224V.037h-.493c-.658.09-2.84.135-6.546.135-3.318 0-5.201-.045-5.649-.135h-.404v2.062h1.525c1.614 0 2.69.224 3.228.673.09.09 1.464 2.212 4.125 6.367 2.66 4.155 3.99 6.262 3.99 6.322 0 .03-1.188 1.868-3.564 5.515a2726.32 2726.32 0 01-3.744 5.739c-.957 1.166-2.765 1.793-5.425 1.883h-.763v2.062h.359c.359-.09 2.002-.135 4.932-.135 3.467 0 5.395.045 5.784.135h.448z"/><path d="M37.736 15.499h-3.429c-2.264 0-3.396-.011-3.396-.034l1.715-5.077 1.681-5.043.672 1.984a629.242 629.242 0 011.715 5.077l1.042 3.093zm-6.153 8.573v-1.547h-.168c-.493 0-.958-.095-1.395-.286-.437-.19-.723-.431-.857-.723a.491.491 0 01-.101-.303c0-.134.224-.863.672-2.185l.672-1.984h7.834l.807 2.387c.538 1.614.807 2.443.807 2.488 0 .403-.785.605-2.353.605h-.437v1.547h.336c.336-.067 1.95-.101 4.841-.101 2.51 0 3.934.034 4.27.101h.303v-1.547h-1.009c-1.166-.022-1.872-.146-2.118-.37a1.261 1.261 0 01-.235-.336c-.516-1.591-1.855-5.581-4.018-11.969C37.271 3.461 36.178.256 36.156.233c-.09-.132-.359-.21-.808-.233h-.303c-.359 0-.572.09-.639.269-.023.023-.611 1.754-1.765 5.194a16100.31 16100.31 0 01-5.262 15.65c-.449.874-1.479 1.345-3.093 1.412h-.504v1.547h.235c.269-.067 1.401-.101 3.396-.101 2.174 0 3.463.034 3.866.101h.304zm36.735 13.734c-.299.299-.591.478-.874.538-.284.06-1.039.105-2.264.135H63.7v2.062h26.229v-.135c.06-.09.381-2.085.964-5.986s.889-5.896.919-5.986v-.135h-1.793v.135c-.03.06-.105.464-.224 1.211-.269 1.793-.613 3.244-1.031 4.349-.509 1.375-1.248 2.399-2.219 3.071-.972.673-2.324 1.114-4.058 1.323-.419.03-1.973.045-4.663.045h-2.287c-1.375 0-2.152-.074-2.331-.224-.09-.06-.15-.164-.179-.314-.03-.06-.045-2.107-.045-6.142v-6.008h2.421c1.943.03 3.139.12 3.587.269.836.24 1.405.666 1.704 1.278.298.613.478 1.547.538 2.802v.897h1.793V18.437h-1.793v.897c-.06 1.255-.24 2.19-.538 2.802-.299.613-.867 1.039-1.704 1.278-.448.15-1.644.24-3.587.269h-2.421v-5.425c0-3.646.015-5.499.045-5.56.09-.298.269-.463.538-.493.239-.06 1.853-.09 4.842-.09 1.733 0 2.75.015 3.049.045 2.451.15 4.177.74 5.179 1.771 1.001 1.031 1.681 2.952 2.04 5.761.06.538.104.852.135.942v.179h1.793v-.179c0-.029-.209-1.763-.628-5.201l-.628-5.201v-.179H63.7v2.062h1.48c1.225.03 1.98.075 2.264.135.284.06.575.24.874.538v25.018z"/></svg>')}">`,factory(){return Kc.createInstance(e,{state:{source:""}})}},{name:t.get("components.wordExplainComponent.creator.name"),example:`<img alt="示例" src="data:image/svg+xml;charset=UTF-8,${encodeURIComponent('<svg width="100" height="70" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g><rect fill="#fff" height="100%" width="100%"/></g><defs><g id="item"><rect fill="#eee" height="18" width="90" rx="2" x="5" y="6"/><line x1="26" y1="9" x2="26" y2="20.5" stroke="#000" stroke-dasharray="0.8 0.8" stroke-width="0.1"></line><text font-family="Helvetica, Arial, sans-serif" font-size="6" x="10" y="14" stroke-width="0" stroke="#000" fill="#000000">名词</text><text font-family="Helvetica, Arial, sans-serif" font-size="5" x="12" y="20" stroke-width="0" stroke="#000" fill="#000000">说明</text><text font-family="Helvetica, Arial, sans-serif" font-size="6" x="30" y="14" stroke-width="0" stroke="#000" fill="#000000">详细解释...</text></g></defs><use xlink:href="#item"></use><use xlink:href="#item" transform="translate(0, 20)"></use><use xlink:href="#item" transform="translate(0, 40)"></use></svg>')}">`,factory(){const{Text:t,InlineComponent:n}=Fn,r=new _n([t,n]),o=new _n([t,n]),s=new _n([t,n]);return r.insert("标题",Ou,!0),o.insert("副标题"),r.setAttribute(Su,"right"),o.setAttribute(Su,"right"),s.insert("正文..."),Ah.createInstance(e,{slots:[r,o,s]})}},{name:t.get("components.timelineComponent.creator.name"),example:`<img alt="示例" src="data:image/svg+xml;charset=UTF-8,${encodeURIComponent('<svg width="100" height="70" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g><rect fill="#fff" height="100%" width="100%"/></g><defs><g id="item"><circle r="2" cx="10" cy="12"></circle><line x1="10" y1="12" x2="10" y2="24" stroke-width="0.5"></line><text font-family="Helvetica, Arial, sans-serif" font-size="5" x="16" y="14" stroke-width="0" stroke="#000" fill="#000000">事件主题</text><text font-family="Helvetica, Arial, sans-serif" font-size="4.5" x="38" y="13.5" stroke-width="0" stroke="#000" fill="#888">2020-08-08</text><text font-family="Helvetica, Arial, sans-serif" font-size="4.5" x="16" y="20" stroke-width="0" stroke="#000" fill="#000000">详细说明...</text></g></defs><use xlink:href="#item" fill="#1296db" stroke="#1296db"></use><use xlink:href="#item" transform="translate(0, 14)" fill="#15bd9a" stroke="#15bd9a"></use><use xlink:href="#item" transform="translate(0, 28)" fill="#495060" stroke="#495060"></use><use xlink:href="#item" transform="translate(0, 42)" fill="#E74F5E" stroke="#E74F5E"></use></svg>')}">`,factory(){return xh.createInstance(e)}},{name:t.get("components.stepsComponent.creator.name"),example:`<img alt="示例" src="data:image/svg+xml;charset=UTF-8,${encodeURIComponent('<svg width="100" height="70" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g><rect fill="#fff" height="100%" width="100%"/></g><defs><g id="item"><circle r="2" cx="10" cy="12"></circle><line x1="12" y1="12" x2="38" y2="12" stroke-width="0.5"></line><text font-family="Helvetica, Arial, sans-serif" font-size="5" x="8" y="22" stroke-width="0" stroke="#000" fill="#000000">标题</text><text font-family="Helvetica, Arial, sans-serif" font-size="4.5" x="8" y="27" stroke-width="0" stroke="#000" fill="#000">描述信息...</text></g></defs><use xlink:href="#item" transform="translate(0, 20)" fill="#15bd9a" stroke="#15bd9a"></use><use xlink:href="#item" transform="translate(30, 20)" fill="#1296db" stroke="#1296db"></use><use xlink:href="#item" transform="translate(60, 20)" fill="#aaa" stroke="#aaa"></use></svg>')}">`,factory(){return ph.createInstance(e)}},{name:t.get("components.alertComponent.creator.name"),example:`<img src="data:image/svg+xml;charset=UTF-8,${encodeURIComponent('<svg width="100" height="70" xmlns="http://www.w3.org/2000/svg"><g><rect fill="#fff" height="100%" width="100%"/></g><rect width="90%" height="20" fill="#eee" stroke="#dedede" rx="5" ry="5" x="5" y="25"></rect><text font-family="Helvetica, Arial, sans-serif" font-size="10" x="10" y="35" stroke-width="0" stroke="#000" fill="#000000">文本内容</text></svg>')}">`,factory(){return So.createInstance(e)}}],o=new j;return r.forEach((t=>{n.append(function(e,t,n){const{wrapper:r,card:o}=function(e,t){const n=document.createElement("div");n.classList.add("textbus-component-example-item");const r=document.createElement("div");r.classList.add("textbus-component-example");const o=document.createElement("div");o.classList.add("textbus-component-example-content"),"string"==typeof e?o.innerHTML=e:e instanceof HTMLElement&&o.appendChild(e),r.appendChild(o);const s=document.createElement("div");s.classList.add("textbus-component-example-mask"),r.appendChild(s),n.appendChild(r);const i=document.createElement("div");return i.classList.add("textbus-component-example-name"),i.innerText=t||"",n.appendChild(i),{wrapper:n,card:r}}(t.example,t.name),s=e.get(Zn),i=e.get(Vn);return o.addEventListener("click",(()=>{const r=t.factory(e);r instanceof Promise?r.then((e=>{s.insert(e),i.selectFirstPosition(e),n.next()})):(s.insert(r),i.selectFirstPosition(r),n.next())})),r}(e,t,o))})),{iconClasses:["textbus-icon-components"],tooltip:t.get("plugins.toolbar.componentsTool.tooltip"),viewController:{elementRef:n,onComplete:o,onCancel:new q,reset(){},update(){}},queryState(){return{state:pr.Normal,value:null}},useValue(){}}}function Sd(){return new jh(Cd)}function Td(e){const t=e.get(Co),n=e.get(mr),r=e.get(Zn);return{iconClasses:["textbus-icon-superscript"],tooltip:t.get("plugins.toolbar.superscript.tooltip"),queryState(){return n.queryFormat(Fu)},onClick(){n.queryFormat(Fu).state===pr.Enabled?r.unApplyFormat(Fu):r.applyFormat(Fu,!0)}}}function Ad(){return new _h(Td)}function Ed(e){const t=e.get(Co),n=e.get(mr),r=e.get(Zn);return{iconClasses:["textbus-icon-subscript"],tooltip:t.get("plugins.tooltip.subscript.tooltip"),queryState(){return n.queryFormat(Lu)},onClick(){n.queryFormat(Lu).state===pr.Enabled?r.unApplyFormat(Lu):r.applyFormat(Lu,!0)}}}function Md(){return new _h(Ed)}function Bd(e){const t=e.get(Co),n=e.get(mr),r=e.get(Zn),o=e.get(Vn);return{iconClasses:["textbus-icon-source-code"],tooltip:t.get("plugins.toolbar.preTool.tooltip"),mini:!0,options:[{label:"JavaScript",value:"JavaScript"},{label:"HTML",value:"HTML"},{label:"CSS",value:"CSS"},{label:"TypeScript",value:"TypeScript"},{label:"Java",value:"Java"},{label:"C",value:"C"},{label:"C++",value:"CPP"},{label:"C#",value:"CSharp"},{label:"Swift",value:"Swift"},{label:"Go",value:"Go"},{label:"JSON",value:"JSON"},{label:"Less",value:"Less"},{label:"SCSS",value:"SCSS"},{label:"Stylus",value:"Stylus"},{label:"Jsx",value:"Jsx"},{label:"Tsx",value:"Tsx"},{label:t.get("plugins.toolbar.preTool.defaultLang"),value:"",default:!0}],queryState(){const e=n.queryComponent(pu);return{state:e.state,value:e.value?e.value.toJSON().state.lang:null}},onChecked(t){const s=n.queryComponent(pu);if(s.state===pr.Enabled)s.value.updateState((e=>{e.lang=t}));else{const n=pu.createInstance(e,{state:{lang:t,theme:"light"},slots:[du()]});r.insert(n),o.setPosition(n.slots.get(0),0)}}}}function Rd(){return new Uh(Bd)}function Od(e){const t=e.get(Co),n=e.get(mr),r=e.get(Zn);return{tooltip:t.get("plugins.toolbar.lineHeightTool.tooltip"),iconClasses:["textbus-icon-line-height"],mini:!0,options:[{label:t.get("plugins.toolbar.lineHeightTool.defaultValueLabel"),classes:["textbus-toolbar-line-height-inherit"],value:"",default:!0},{label:"1x",classes:["textbus-toolbar-line-height-1"],value:"1em"},{label:"1.2x",classes:["textbus-toolbar-line-height-1_2"],value:"1.2em"},{label:"1.4x",classes:["textbus-toolbar-line-height-1_4"],value:"1.4em"},{label:"1.6x",classes:["textbus-toolbar-line-height-1_6"],value:"1.6em"},{label:"1.8x",classes:["textbus-toolbar-line-height-1_8"],value:"1.8em"},{label:"2x",classes:["textbus-toolbar-line-height-2"],value:"2em"},{label:"3x",classes:["textbus-toolbar-line-height-3"],value:"3em"},{label:"4x",classes:["textbus-toolbar-line-height-4"],value:"4em"}],queryState(){return n.queryFormat(Yu)},onChecked(e){e?r.applyFormat(Yu,e):r.unApplyFormat(Yu)}}}function Nd(){return new Uh(Od)}function Id(e){const t=e.get(Co),n=e.get(mr),r=e.get(Zn);return{tooltip:t.get("plugins.toolbar.letterSpacingTool.tooltip"),iconClasses:["textbus-icon-letter-spacing"],mini:!0,options:[{label:t.get("plugins.toolbar.letterSpacingTool.defaultValueLabel"),value:"",classes:["textbus-toolbar-letter-spacing-inherit"],default:!0},{label:"0px",value:"0px",classes:["textbus-toolbar-letter-spacing-0"]},{label:"1px",classes:["textbus-toolbar-letter-spacing-1"],value:"1px"},{label:"2px",classes:["textbus-toolbar-letter-spacing-2"],value:"2px"},{label:"3px",classes:["textbus-toolbar-letter-spacing-3"],value:"3px"},{label:"4px",classes:["textbus-toolbar-letter-spacing-4"],value:"4px"},{label:"5px",classes:["textbus-toolbar-letter-spacing-5"],value:"5px"}],queryState(){return n.queryFormat(Wu)},onChecked(e){e?r.applyFormat(Wu,e):r.unApplyFormat(Wu)}}}function Pd(){return new Uh(Id)}yd.defaultColors=["#f8f8f9","#e9eaec","#dddee1","#bbbec4","#80848f","#495060","#1c2838","#e74f5e","#ff9900","#15bd9a","#6ad1ec","#1296db"];class Ld{constructor(){this.elementRef=document.createElement("div"),this.onCancel=new q,this.checkEvent=new j,this.onComplete=this.checkEvent.asObservable(),this.elementRef.classList.add("textbus-toolbar-emoji-menu");const e=[];for(let t=128512;t<=128591;t++)e.push(t.toString(16).toUpperCase());const t=document.createDocumentFragment(),n=e.map((e=>{const n=document.createElement("button");return n.type="button",n.classList.add("textbus-toolbar-emoji-menu-item"),n.innerHTML=`&#x${e};`,t.appendChild(n),n}));this.elementRef.addEventListener("click",(e=>{const t=e.target;for(const e of n)if(t===e){this.checkEvent.next(e.innerHTML);break}})),this.elementRef.appendChild(t)}update(){}reset(){}}function Fd(e){const t=e.get(Co),n=e.get(Zn);return{iconClasses:["textbus-icon-emoji"],tooltip:t.get("plugins.toolbar.emojiTool.tooltip"),viewController:new Ld,queryState(){return{state:pr.Normal,value:null}},useValue(e){n.insert(e)}}}function zd(){return new jh(Fd)}function Dd(e){const t=e.get(Co),n=e.get(mr),r=e.get(Zn);return{iconClasses:["textbus-icon-ltr"],tooltip:t.get("plugins.toolbar.leftToRightTool.tooltip"),queryState(){const e=n.queryAttribute(yu);return{state:"ltr"===e.value?pr.Enabled:pr.Normal,value:e.value}},onClick(){"ltr"===n.queryAttribute(yu).value?r.unApplyAttribute(yu):r.applyAttribute(yu,"ltr")}}}function _d(){return new _h(Dd)}function qd(e){const t=e.get(Co),n=e.get(mr),r=e.get(Zn);return{iconClasses:["textbus-icon-rtl"],tooltip:t.get("plugins.toolbar.rightToLeftTool.tooltip"),queryState(){const e=n.queryAttribute(yu);return{state:"rtl"===e.value?pr.Enabled:pr.Normal,value:e.value}},onClick(){"rtl"===n.queryAttribute(yu).value?r.unApplyAttribute(yu):r.applyAttribute(yu,"rtl")}}}function jd(){return new _h(qd)}function Hd(e){const t=e.get(Co),n=e.get(mr),r=e.get(Zn),o=e.get($o),s=t.getContext("plugins.toolbar.videoTool.view"),i=new Po({title:s.get("title"),confirmBtnText:s.get("confirmBtnText"),cancelBtnText:s.get("cancelBtnText"),items:[new Ho({label:s.get("linkLabel"),name:"src",placeholder:s.get("linkInputPlaceholder"),canUpload:!0,uploadType:"video",fileUploader:o,uploadBtnText:s.get("uploadBtnText"),validateFn(e){return!e&&s.get("validateErrorMessage")}}),new Fo({name:"controls",value:"controls"}),new Ho({label:s.get("videoWidthLabel"),name:"width",placeholder:s.get("videoWidthInputPlaceholder"),value:"100%"}),new Ho({label:s.get("videoHeightLabel"),name:"height",placeholder:s.get("videoHeightInputPlaceholder"),value:"auto"}),new jo({label:s.get("autoplayLabel"),checked:!1,name:"autoplay"})]});return{iconClasses:["textbus-icon-video"],tooltip:t.get("plugins.toolbar.videoTool.tooltip"),viewController:i,queryState(){const e=n.queryComponent(Sh);return e.state===pr.Enabled?{state:pr.Enabled,value:e.value.toJSON().state}:{state:e.state,value:null}},useValue(t){if(t){const o=n.queryComponent(Sh);o.state===pr.Enabled?o.value.extends.mergeProps(t):r.insert(Sh.createInstance(e,{state:t}))}}}}function Vd(){return new qh(Hd)}function $d(e){const t=e.get(Co);return{iconClasses:["textbus-icon-plus"],items:[Object.assign(Object.assign({},Bd(e)),{type:Hh.Select,label:t.get("plugins.toolbar.insertObjectTool.sourceCode")}),Object.assign(Object.assign({},Od(e)),{type:Hh.Select,label:t.get("plugins.toolbar.insertObjectTool.lineHeight")}),Object.assign(Object.assign({},Id(e)),{type:Hh.Select,label:t.get("plugins.toolbar.insertObjectTool.letterSpacing")}),Object.assign(Object.assign({},Fd(e)),{type:Hh.Dropdown,label:t.get("plugins.toolbar.insertObjectTool.emoji")}),Object.assign(Object.assign({},Gh(e)),{type:Hh.Dialog,label:t.get("plugins.toolbar.insertObjectTool.audio")}),Object.assign(Object.assign({},Hd(e)),{type:Hh.Dialog,label:t.get("plugins.toolbar.insertObjectTool.video")}),Object.assign(Object.assign({},Td(e)),{type:Hh.Button,label:t.get("plugins.toolbar.insertObjectTool.superscript")}),Object.assign(Object.assign({},Ed(e)),{type:Hh.Button,label:t.get("plugins.toolbar.insertObjectTool.subscript")}),Object.assign(Object.assign({},ed(e)),{type:Hh.Button,label:t.get("plugins.toolbar.insertObjectTool.code")}),Object.assign(Object.assign({},Kh(e)),{type:Hh.Button,label:t.get("plugins.toolbar.insertObjectTool.blockquote")}),Object.assign(Object.assign({},Dd(e)),{type:Hh.Button,label:t.get("plugins.toolbar.insertObjectTool.leftToRight")}),Object.assign(Object.assign({},qd(e)),{type:Hh.Button,label:t.get("plugins.toolbar.insertObjectTool.rightToLeft")})]}}function Ud(){return new Vh($d)}const Gd=function(){const e="Arial",t=document.createElement("canvas"),n=t.getContext("2d");function r(t){n.clearRect(0,0,200,50),n.font="20px "+t+", "+e,n.fillText("HeRe-is*SoMe%tEst +99.? !@ #~ &^teXtWw L$VEY$U0",100,25);const r=n.getImageData(0,0,200,50).data;return Array.from(r).filter((e=>0!==e))}return t.width=200,t.height=50,n.textAlign="center",n.fillStyle="black",n.textBaseline="middle",function(t){return t.toLowerCase()===e.toLowerCase()||r(e).join("")!==r(t).join("")}}();function Wd(e){const t=e.get(Co),n=e.get(mr),r=e.get(Zn);return{tooltip:t.get("plugins.toolbar.fontFamilyTool.tooltip"),options:[{label:t.get("plugins.toolbar.fontFamilyTool.defaultFamilyText"),classes:["textbus-toolbar-font-family-inherit"],value:"",default:!0},{label:"宋体",classes:["textbus-toolbar-font-family-SimSun"],value:"SimSun, STSong"},{label:"黑体",classes:["textbus-toolbar-font-family-SimHei"],value:"SimHei, STHeiti"},{label:"微软雅黑",classes:["textbus-toolbar-font-family-Microsoft-YaHei"],value:"Microsoft YaHei"},{label:"楷体",classes:["textbus-toolbar-font-family-KaiTi"],value:"KaiTi, STKaiti"},{label:"仿宋",classes:["textbus-toolbar-font-family-FangSong"],value:"FangSong, STFangsong"},{label:"冬青黑简体中文",classes:["textbus-toolbar-font-family-DongQingHei"],value:'"Hiragino Sans GB", 冬青黑简体中文'},{label:"苹方",classes:["textbus-toolbar-font-family-PingFang"],value:'"PingFang SC", 苹方'},{label:"隶书",classes:["textbus-toolbar-font-family-SimLi"],value:"SimLi"},{label:"Andale Mono",classes:["textbus-toolbar-font-family-andale-mono"],value:"Andale Mono"},{label:"Arial",classes:["textbus-toolbar-font-family-Arial"],value:"Arial"},{label:"Helvetica",classes:["textbus-toolbar-font-family-Helvetica"],value:"Helvetica"},{label:"Impact",classes:["textbus-toolbar-font-family-Impact"],value:"Impact"},{label:"Times New Roman",classes:["textbus-toolbar-font-family-Times-New-Roman"],value:"Times New Roman"}].map((e=>(e.value&&(e.value.split(",").map((e=>Gd(e.trim()))).some((e=>e))||(e.disabled=!0)),e))),queryState(){return n.queryFormat(Ku)},onChecked(e){e?r.applyFormat(Ku,e):r.unApplyFormat(Ku)}}}function Kd(){return new Uh(Wd)}function Yd(e){const t=e.get(Co),n=e.get(mr),r=e.get(Zn);return{tooltip:t.get("plugins.toolbar.fontSizeTool.tooltip"),iconClasses:["textbus-icon-font-size"],mini:!0,options:[{label:t.get("plugins.toolbar.fontSizeTool.defaultSizeText"),classes:["textbus-toolbar-font-size-inherit"],value:"",default:!0},{label:"12px",classes:["textbus-toolbar-font-size-12"],value:"12px"},{label:"13px",classes:["textbus-toolbar-font-size-13"],value:"13px"},{label:"14px",classes:["textbus-toolbar-font-size-14"],value:"14px"},{label:"15px",classes:["textbus-toolbar-font-size-15"],value:"15px"},{label:"16px",classes:["textbus-toolbar-font-size-16"],value:"16px"},{label:"18px",classes:["textbus-toolbar-font-size-18"],value:"18px"},{label:"20px",classes:["textbus-toolbar-font-size-20"],value:"20px"},{label:"24px",classes:["textbus-toolbar-font-size-24"],value:"24px"},{label:"36px",classes:["textbus-toolbar-font-size-36"],value:"36px"},{label:"48px",classes:["textbus-toolbar-font-size-48"],value:"48px"}],queryState(){return n.queryFormat(rh)},onChecked(e){e?r.applyFormat(rh,e):r.unApplyFormat(rh)}}}function Xd(){return new Uh(Yd)}function Jd(e){const t=e.get(Vn),n=e.get(Zn),r=e.get(Rr),o=e.get(Co),s=e.get($n);let i=!1;return{iconClasses:["textbus-icon-brush"],tooltip:o.get("plugins.toolbar.formatPainterTool.tooltip"),queryState(){return i?{state:pr.Enabled,value:null}:{state:t.isSelected?pr.Normal:pr.Disabled,value:null}},onClick(){if(!t.isSelected)return;i=!0;const e=t.startSlot,o=e.extractFormatsByIndex(t.startOffset),a=e.parent,l=[Xc,kh],c=[eo,Mo,Xc,kh,No].map((e=>e.name));let u=eo.name,h=null;c.includes(a.name)&&(u=a.name,h="object"==typeof a.state&&null!==a.state?JSON.parse(JSON.stringify(a.state)):a.state),e.changeMarker.forceMarkChanged();const{Text:d,InlineComponent:p,BlockComponent:m}=Fn;K(r,"mouseup").pipe(me(1),ie(10)).subscribe((()=>{i=!1,n.cleanFormats([so]),o.forEach((e=>{n.applyFormat(e[0],e[1])})),n.transform({multipleSlot:l.map((e=>e.name)).includes(u),target:s.getComponent(u),slotFactory(){return new _n(u===Mo.name?[d,p,m]:[d,p],e.state)},stateFactory(){return h}})}))}}}function Zd(){return new _h(Jd)}function Qd(e){const t=e.get(Co),n=e.get(mr),r=e.get(Zn);return{tooltip:t.get("plugins.toolbar.headingTool.tooltip"),options:[{label:t.get("plugins.toolbar.headingTool.h1"),classes:["textbus-toolbar-h1"],value:"h1",keymap:{ctrlKey:!0,key:"1"}},{label:t.get("plugins.toolbar.headingTool.h2"),classes:["textbus-toolbar-h2"],value:"h2",keymap:{ctrlKey:!0,key:"2"}},{label:t.get("plugins.toolbar.headingTool.h3"),classes:["textbus-toolbar-h3"],value:"h3",keymap:{ctrlKey:!0,key:"3"}},{label:t.get("plugins.toolbar.headingTool.h4"),classes:["textbus-toolbar-h4"],value:"h4",keymap:{ctrlKey:!0,key:"4"}},{label:t.get("plugins.toolbar.headingTool.h5"),classes:["textbus-toolbar-h5"],value:"h5",keymap:{ctrlKey:!0,key:"5"}},{label:t.get("plugins.toolbar.headingTool.h6"),classes:["textbus-toolbar-h6"],value:"h6",keymap:{ctrlKey:!0,key:"6"}},{label:t.get("plugins.toolbar.headingTool.paragraph"),value:"p",default:!0,keymap:{ctrlKey:!0,key:"0"}}],queryState(){const e=n.queryComponent(No);if(e.state===pr.Enabled)return{state:pr.Enabled,value:e.value.extends.type};const t=n.queryComponent(eo);return{state:t.state,value:t.state===pr.Enabled?"p":null}},onChecked(e){const t=/h[1-6]/.test(e);r.transform({target:t?No:eo,multipleSlot:!1,slotFactory(){return new _n([Fn.Text,Fn.InlineComponent])},stateFactory(){if(t)return e}})}}}function ep(){return new Uh(Qd)}function tp(e){const t=e.get(Co),n=e.get(lr);return{iconClasses:["textbus-icon-history-back"],tooltip:t.get("plugins.toolbar.historyBackTool.tooltip"),keymap:{ctrlKey:!0,key:"z"},queryState(){return{state:n.canBack?pr.Normal:pr.Disabled,value:null}},onClick(){n.back()}}}function np(){return new _h(tp)}function rp(e){const t=e.get(Co),n=e.get(lr);return{iconClasses:["textbus-icon-history-forward"],tooltip:t.get("plugins.toolbar.historyForwardTool.tooltip"),keymap:{ctrlKey:!0,shiftKey:!0,key:"z"},queryState(){return{state:n.canForward?pr.Normal:pr.Disabled,value:null}},onClick(){n.forward()}}}function op(){return new _h(rp)}function sp(e){const t=e.get(Co),n=e.get(Zn),r=e.get($o),o=t.getContext("plugins.toolbar.imageTool.view"),s=new Po({mini:!0,confirmBtnText:o.get("confirmBtnText"),items:[new Ho({label:o.get("linkLabel"),name:"src",placeholder:o.get("linkInputPlaceholder")}),new Lo({name:"",value:"",label:o.get("uploadLabel"),btnText:o.get("uploadBtnText"),iconClasses:["textbus-icon-upload"],onClick(){r.upload({multiple:!0,uploadType:"image",currentValue:""}).subscribe((t=>{"string"==typeof t&&(t=[t]),t.forEach((t=>{n.insert(Ko.createInstance(e,{state:{src:t}}))}))}))}})]});return{iconClasses:["textbus-icon-image"],tooltip:t.get("plugins.toolbar.imageTool.tooltip"),queryState(){return{state:pr.Normal,value:null}},viewController:s,useValue(t){t&&n.insert(Ko.createInstance(e,{state:{src:t.src}}))}}}function ip(){return new jh(sp)}function ap(e){const t=e.get(Co),n=e.get(Zn),r=e.get(Vn);return{iconClasses:["textbus-icon-insert-paragraph-after"],tooltip:t.get("plugins.toolbar.insertParagraphAfterTool.tooltip"),keymap:{ctrlKey:!0,key:"p"},queryState(){var e;return r.isSelected&&(null===(e=r.commonAncestorComponent)||void 0===e?void 0:e.parent)?{state:pr.Normal,value:null}:{state:pr.Disabled,value:null}},onClick(){const t=eo.createInstance(e);n.insertAfter(t,r.commonAncestorComponent),r.setPosition(t.slots.get(0),0)}}}function lp(){return new _h(ap)}function cp(e){const t=e.get(Co),n=e.get(Zn),r=e.get(Vn);return{iconClasses:["textbus-icon-insert-paragraph-before"],tooltip:t.get("plugins.toolbar.insertParagraphBeforeTool.tooltip"),keymap:{ctrlKey:!0,shiftKey:!0,key:"p"},queryState(){var e;return r.isSelected&&(null===(e=r.commonAncestorComponent)||void 0===e?void 0:e.parent)?{state:pr.Normal,value:null}:{state:pr.Disabled,value:null}},onClick(){const t=eo.createInstance(e);n.insertBefore(t,r.commonAncestorComponent),r.setPosition(t.slots.get(0),0)}}}function up(){return new _h(cp)}function hp(e){const t=e.get(Co),n=e.get(mr),r=e.get(Zn);return{iconClasses:["textbus-icon-italic"],tooltip:t.get("plugins.toolbar.italicTool.tooltip"),keymap:{ctrlKey:!0,key:"i"},queryState(){return n.queryFormat(Nu)},onClick(){n.queryFormat(Nu).state===pr.Enabled?r.unApplyFormat(Nu):r.applyFormat(Nu,!0)}}}function dp(){return new _h(hp)}function pp(e){const t=e.get(Co),n=e.get(mr),r=e.get(Zn),o=e.get(Vn),s=t.getContext("plugins.toolbar.linkTool.view"),i=new Po({mini:!0,items:[new Ho({label:s.get("linkLabel"),name:"href",placeholder:s.get("linkInputPlaceholder"),validateFn(e){const t=document.createElement("a");return t.href=e,!t.hostname&&s.get("invalidMessage")}}),new Do({label:s.get("jumpLabel"),name:"target",values:[{label:s.get("jumpSelfLabel"),value:"_self",default:!0},{label:s.get("jumpBlankLabel"),value:"_blank"}]})]});return{iconClasses:["textbus-icon-link"],tooltip:t.get("plugins.toolbar.linkTool.tooltip"),viewController:i,queryState(){return n.queryFormat(so)},useValue(e){if(o.isCollapsed){const t=o.startSlot;t.getFormatRangesByFormatter(so,0,t.length).filter((e=>e.startIndex<o.startOffset&&e.endIndex>=o.endOffset)).forEach((n=>{t.retain(n.startIndex),t.retain(n.endIndex-n.startIndex,so,e)}))}r.applyFormat(so,e)}}}function mp(){return new jh(pp)}function fp(e,t){const n=e.get(Vn),r=e.get(Zn),o={queryState(){const e=n.commonAncestorComponent;return(null==e?void 0:e.name)===Xc.name&&e.extends.type===t?{state:pr.Enabled,value:e}:{state:pr.Normal,value:null}},onClick(){o.queryState().state===pr.Normal?o.toList():o.toParagraph()},toParagraph(){r.transform({target:eo,multipleSlot:!1,slotFactory(){return new _n([Fn.Text,Fn.InlineComponent])}})},toList(){r.transform({target:Xc,multipleSlot:!0,slotFactory(){return new _n([Fn.Text,Fn.InlineComponent])},stateFactory(){return t}})}};return o}function gp(e){const t=e.get(Co);return Object.assign({iconClasses:["textbus-icon-list-numbered"],tooltip:t.get("plugins.toolbar.olTool.tooltip"),keymap:{shiftKey:!0,ctrlKey:!0,key:"o"}},fp(e,"ol"))}function bp(){return new _h(gp)}function vp(e){const t=e.get(Co),n=e.get(mr),r=e.get(Zn);return{iconClasses:["textbus-icon-strikethrough"],tooltip:t.get("plugins.toolbar.strikeThrough.tooltip"),keymap:{ctrlKey:!0,key:"d"},queryState(){return n.queryFormat(Iu)},onClick(){n.queryFormat(Iu).state===pr.Enabled?r.unApplyFormat(Iu):r.applyFormat(Iu,!0)}}}function yp(){return new _h(vp)}function xp(e){const t=e.get(Co),n=e.get(Zn),r=e.get(Vn),o=t.getContext("plugins.toolbar.tableAddTool.view"),s=new Po({mini:!0,confirmBtnText:o.get("confirmBtnText"),items:[new zo({name:"rows",label:o.get("rowLabel"),placeholder:o.get("rowPlaceholder")}),new zo({name:"cols",label:o.get("columnLabel"),placeholder:o.get("columnPlaceholder")}),new jo({label:o.get("useTextbusStyleLabel"),name:"useTextbusStyle",checked:!0})]}),i=document.createElement("div");i.classList.add("textbus-toolbar-table-quick-selector");const a=new Map;for(let e=0;e<10;e++)for(let t=0;t<10;t++)((e,t)=>{const n=document.createElement("div");i.appendChild(n),a.set(n,{row:e,col:t})})(e,t);let l=!1;return i.addEventListener("mouseover",(e=>{if(l)return;const t=e.target,n=a.get(t);n&&(a.forEach(((e,t)=>{e.row<=n.row&&e.col<=n.col?t.classList.add("textbus-toolbar-table-quick-selector-selected"):t.classList.remove("textbus-toolbar-table-quick-selector-selected")})),s.update({cols:n.col+1,rows:n.row+1}))})),i.addEventListener("mouseleave",(()=>{l||(Array.from(a.keys()).forEach((e=>e.classList.remove("textbus-toolbar-table-quick-selector-selected"))),s.update({})),l=!1})),i.addEventListener("click",(()=>{l=!0})),s.elementRef.insertBefore(i,s.elementRef.childNodes[0]),{iconClasses:["textbus-icon-table"],tooltip:t.get("plugins.toolbar.tableAddTool.tooltip"),viewController:s,queryState(){return{state:pr.Normal,value:null}},useValue(t){const o=gh.createInstance(e,{slots:function(e,t){const n=[],r=e*t;for(let e=0;e<r;e++)n.push(po());return n}(t.rows||4,t.cols||6),state:{useTextbusStyle:t.useTextbusStyle,columnCount:t.cols||6,rowCount:t.rows||4}});n.insert(o),r.setPosition(o.slots.get(0),0)}}}function wp(){return new jh(xp)}function kp(e){const t=e.get(Co),n=e.get(mr),r=e.get(Zn);return{iconClasses:["textbus-icon-table-remove"],tooltip:t.get("plugins.toolbar.tableRemoveTool.tooltip"),queryState(){const e=n.queryComponent(gh);return e.state!==pr.Enabled?e.state=pr.Disabled:e.state===pr.Enabled&&(e.state=pr.Normal),e},onClick(){const e=n.queryComponent(gh);e.state===pr.Enabled&&r.removeComponent(e.value)}}}function Cp(){return new _h(kp)}function Sp(e){const t=e.get(Co),n=e.get(mr),r=e.get(Zn);return{tooltip:t.get("plugins.toolbar.textAlignTool.tooltip"),options:[{label:t.get("plugins.toolbar.textAlignTool.left"),iconClasses:["textbus-icon-paragraph-left"],value:"left",keymap:{ctrlKey:!0,key:"l"},default:!0},{label:t.get("plugins.toolbar.textAlignTool.right"),iconClasses:["textbus-icon-paragraph-right"],value:"right",keymap:{ctrlKey:!0,key:"r"}},{label:t.get("plugins.toolbar.textAlignTool.center"),iconClasses:["textbus-icon-paragraph-center"],value:"center",keymap:{ctrlKey:!0,key:"e"}},{label:t.get("plugins.toolbar.textAlignTool.justify"),iconClasses:["textbus-icon-paragraph-justify"],value:"justify",keymap:{ctrlKey:!0,key:"j"}}],queryState(){return n.queryAttribute(Su)},onChecked(e){r.applyAttribute(Su,e)}}}function Tp(){return new Uh(Sp)}function Ap(e){const t=e.get(Co).getContext("plugins.toolbar.textBackgroundColorTool"),n=new yd("color",t.get("view.btnText"),t.get("view.recentText"),t.get("view.backText"),t.get("view.paletteText"));return Object.assign({iconClasses:["textbus-icon-background-color"],tooltip:t.get("tooltip")},xd(e,n,ch))}function Ep(){return new $h(Ap)}function Mp(e){const t=e.get(Co),n=e.get(mr),r=e.get(Zn);return{tooltip:t.get("plugins.toolbar.textIndentTool.tooltip"),iconClasses:["textbus-icon-text-indent"],mini:!0,options:[{label:"0x",value:"0",classes:["textbus-toolbar-text-indent-0"],default:!0},{label:"1x",value:"1em",classes:["textbus-toolbar-text-indent-1"]},{label:"2x",classes:["textbus-toolbar-text-indent-2"],value:"2em"},{label:"4x",classes:["textbus-toolbar-text-indent-4"],value:"4em"}],queryState(){return n.queryAttribute(Cu)},onChecked(e){"0"===e?r.unApplyAttribute(Cu):r.applyAttribute(Cu,e)}}}function Bp(){return new Uh(Mp)}function Rp(e){const t=e.get(Co);return Object.assign({iconClasses:["textbus-icon-list"],tooltip:t.get("plugins.toolbar.ulTool.tooltip"),keymap:{shiftKey:!0,ctrlKey:!0,key:"u"}},fp(e,"ul"))}function Op(){return new _h(Rp)}function Np(e){const t=e.get(Co),n=e.get(mr),r=e.get(Zn);return{iconClasses:["textbus-icon-underline"],tooltip:t.get("plugins.toolbar.underlineTool.tooltip"),keymap:{ctrlKey:!0,key:"u"},queryState(){return n.queryFormat(Pu)},onClick(){n.queryFormat(Pu).state===pr.Enabled?r.unApplyFormat(Pu):r.applyFormat(Pu,!0)}}}function Ip(){return new _h(Np)}function Pp(e){const t=e.get(Co),n=e.get(Vn),r=e.get(mr),o=e.get(Zn);return{tooltip:t.get("plugins.toolbar.unlinkTool.tooltip"),iconClasses:["textbus-icon-unlink"],queryState(){const e=r.queryFormat(so);return e.state===pr.Normal&&(e.state=pr.Disabled),e},onClick(){if(n.isCollapsed){const e=n.startSlot;e.getFormatRangesByFormatter(so,0,e.length).filter((e=>e.startIndex<n.startOffset&&e.endIndex>=n.endOffset)).forEach((t=>{e.retain(t.startIndex),e.retain(t.endIndex-t.startIndex,so,null)}))}else o.unApplyFormat(so)}}}function Lp(){return new _h(Pp)}function Fp(e){const t=e.get(Co),n=e.get(mr),r=e.get(Zn),o=t.getContext("plugins.toolbar.verticalAlignTool");return{tooltip:o.get("tooltip"),mini:!0,options:[{label:o.get("baseline"),value:"baseline",default:!0},{label:o.get("super"),value:"super"},{label:o.get("sub"),value:"sub"},{label:o.get("top"),value:"top"},{label:o.get("middle"),value:"middle"},{label:o.get("bottom"),value:"bottom"},{label:o.get("textTop"),value:"text-top"},{label:o.get("textBottom"),value:"text-bottom"}],queryState(){return n.queryAttribute(Su)},onChecked(e){r.applyFormat(rh,e)}}}function zp(){return new Uh(Fp)}const Dp=ft("Toolbar");class _p{constructor(e=[],t){this.toolFactories=e,this.host=t,this.subs=[],this.tools=e.map((e=>Array.isArray(e)?e.map((e=>e())):e()))}setup(e){const t=e.get(Rh),n=e.get(Vn),r=e.get(or),o=e.get(Mr);this.elementRef=br("div",{classes:["textbus-toolbar"],children:[this.toolWrapper=br("div",{classes:["textbus-toolbar-wrapper"]}),this.keymapPrompt=br("div",{classes:["textbus-toolbar-keymap-prompt"]})]}),o.theme&&this.elementRef.classList.add("textbus-toolbar-"+o.theme);const s=this.host;if(s){let e;if(e="string"==typeof s?document.querySelector(s):s,!(e&&e instanceof HTMLElement))throw Dp("selector is not an HTMLElement, or the CSS selector cannot find a DOM element in the document.");e.append(this.elementRef)}else t.top.append(this.elementRef);this.tools.forEach((t=>{const n=document.createElement("div");n.classList.add("textbus-toolbar-group"),this.toolWrapper.appendChild(n),Array.isArray(t)?t.forEach((t=>{n.appendChild(t.setup(e,this.toolWrapper))})):n.appendChild(t.setup(e,this.toolWrapper))}));const i=this.tools.flat();this.subs.push(J(n.onChange,r.onViewUpdated).pipe(re(100)).subscribe((()=>{i.forEach((e=>{e.refreshState()}))})),K(this.elementRef,"mouseover").subscribe((e=>{const t=this.findNeedShowKeymapHandler(e.target);if(t)try{const e=JSON.parse(t);return this.keymapPrompt.innerHTML="",this.keymapPrompt.append(...zh(e)),void this.keymapPrompt.classList.add("textbus-toolbar-keymap-prompt-show")}catch(e){}this.keymapPrompt.classList.remove("textbus-toolbar-keymap-prompt-show")})))}onDestroy(){this.subs.forEach((e=>e.unsubscribe()))}findNeedShowKeymapHandler(e){return e===this.elementRef?"":e.dataset.keymap?e.dataset.keymap:this.findNeedShowKeymapHandler(e.parentNode)}}const qp=Ft({type:Fn.BlockComponent,name:"RootComponent",setup(e){const t=zt(),n=t.get(Vn),r=t.get(Mr),o=t.get(Rr),s=Dt(),i=_t((null==e?void 0:e.slots)||[new _n([Fn.Text,Fn.BlockComponent,Fn.InlineComponent])]);pn((e=>{if("string"==typeof e.data.content||e.data.content.type!==Fn.BlockComponent){const r=eo.createInstance(t),o=r.slots.get(0);o.insert(e.data.content),e.target.insert(r),n.setPosition(o,o.index),e.preventDefault()}})),dn((e=>{const r=eo.createInstance(t);i.get(0).insert(r),n.setPosition(r.slots.get(0),0),e.preventDefault()})),ln((e=>{e.preventDefault()}));const a=jt(),l=new _;return an((()=>{l.add(K(o,"click").subscribe((e=>{const r=a.current.getBoundingClientRect(),o=i.first;if(e.clientY>r.top+r.height-30){const e=o.getContentAtIndex(o.length-1);if(!o.isEmpty&&"string"!=typeof e&&e.name!==eo.name){const e=o.index;o.retain(o.length);const r=eo.createInstance(t);o.insert(r),o.retain(e),n.setPosition(r.slots.get(0),0)}}else if(e.target===a.current){let t=n.focusSlot.parent;for(;t&&t.parentComponent!==s;)t=t.parentComponent;if(!t)return;const i=o.indexOf(t);i>-1&&(e.clientX-r.left<4?(n.setPosition(o,i),n.restore()):r.left+r.width-e.clientX<4&&(n.setPosition(o,i+1),n.restore()))}})))})),fn((()=>{l.unsubscribe()})),vn((()=>{var e;null===(e=a.current)||void 0===e||e.setAttribute("data-placeholder","")})),{render(e){return e(i.get(0),(e=>{var t;return new On("div",{"textbus-document":"true",ref:a,style:{padding:"8px 8px 30px"},"data-placeholder":(null===(t=i.get(0))||void 0===t?void 0:t.isEmpty)&&r.placeholder||""},e)}))}}}}),jp={match(){return!0},read(e,t,n){const r=new _n([Fn.Text,Fn.BlockComponent,Fn.InlineComponent]);return n(r,e),qp.createInstance(t,{state:null,slots:[r]})}},Hp=ft("Editor");class Vp extends Wr{constructor(e={}){super(e.rootComponent||qp,e.rootComponentLoader||jp,(()=>{const t=[{provide:Rh,useFactory:()=>this.layout},{provide:Co,useValue:new Co(Bh,e.i18n)},{provide:Vp,useFactory:()=>this},{provide:$o,useFactory(t,n,r){return{upload:o=>{if(t.isSelected||(t.usePaths({anchor:[0,0],focus:[0,0]}),t.restore()),"function"==typeof e.uploader){const t=e.uploader(o);if(t instanceof q)return t;if(t instanceof Promise)return Y(t);if("string"==typeof t)return Z(t);if(Array.isArray(t))return Z(t)}return n.message(r.get("editor.noUploader")),o.multiple?Z([]):Z("")}}},deps:[Vn,Oh,Co]},Uo,Oh];return e.providers=e.providers||[],e.providers.push(...t),e.editingStyleSheets=e.editingStyleSheets||[],e.editingStyleSheets.push("[textbus-document=true]::before {content: attr(data-placeholder); position: absolute; opacity: 0.6;}"),e})()),this.host=null,this.readyEvent=new j,this.onReady=this.readyEvent.asObservable(),this.layout=new Rh(e.autoHeight),e.theme&&this.layout.setTheme(e.theme),e.autoHeight&&(this.layout.scroller.style.overflow="visible")}mount(e){if(this.host="string"==typeof e?document.querySelector(e):e,!(this.host&&this.host instanceof HTMLElement))throw Hp("selector is not an HTMLElement, or the CSS selector cannot find a DOM element in the document.");return this.host.append(this.layout.container),super.mount(this.layout.scroller).then((e=>{if(this.destroyed)return e;if(!this.options.autoHeight){const t=this.layout.scroller;e.get(Nr).caret.correctScrollTop({onScroll:K(t,"scroll"),getLimit(){const e=t.getBoundingClientRect();return{top:e.top,bottom:e.top+e.height}},setOffset(e){t.scrollTop+=e}})}return this.readyEvent.next(e),e}))}destroy(){var e;this.destroyed||([Uo].forEach((e=>{this.get(e).destroy()})),this.layout.destroy(),null===(e=this.layout.container.parentNode)||void 0===e||e.removeChild(this.layout.container),super.destroy())}}var $p=n(742),Up=n.n($p),Gp=n(737),Wp=n.n(Gp);const Kp=[Zo,Ch,Yc,Eh,wh,mh,To,ts,Eo,Bo,Oo,Io,Yo,Jc,to,mu,bh,Th],Yp=[Du,_u,nh,Ju,oh,Xu,Zu,qu,Hu,Vu,ju,$u,io,hh,uh],Xp=[Mu,Eu,Au,xu],Jp=[Ao,Mo,Ro,No,Ko,Xc,eo,pu,gh,Sh,Jo,kh,Kc,Ah,xh,ph,So,es],Zp=[Ou,Nu,th,Ku,rh,Wu,Yu,Iu,Lu,Fu,Pu,zu,so,ch,lh],Qp=[Tu,Su,Cu,yu],em={editingStyleSheets:["[textbus-document=true] [style*=color]:not([style*=background-color])\n [textbus-document=true] a {color: inherit;}\n [textbus-document=true] a {text-decoration: underline; color: #449fdb; cursor: text;}\n [textbus-document=true] {line-height: 1.5}",Up()],styleSheets:[Wp()],components:Jp,formatters:Zp,componentLoaders:Kp,formatLoaders:Yp,attributes:Qp,attributeLoaders:Xp},tm=[[np,op],[Ud],[Sd],[ep],[Jh,dp,yp,Ip],[bp,Op],[Xd,Bp],[kd,Ep],[up,lp],[Kd],[mp,Lp],[ip],[Tp],[wp,Cp],[Zd],[Qh]];function nm(e={}){return new Vp(Object.assign(Object.assign({plugins:[()=>new _p(tm),()=>new Ih,()=>new Nh]},em),e))}}(),r}()}));