Version 5.0.0 release
This commit is contained in:
1 parent
90e8c7e903
commit
a3a4a9ccbd
651 files changed
+7275
-9481
No files matched your search
@@ -1 +1 @@
|
||||
(()=>{var e,s,t={4333:(e,s,t)=>{var a={"./1c":[4570,6319,4570],"./1c.js":[4570,6319,4570],"./abnf":[4414,4414],"./abnf.js":[4414,4414],"./accesslog":[7490,7490],"./accesslog.js":[7490,7490],"./actionscript":[227,227],"./actionscript.js":[227,227],"./ada":[4968,4968],"./ada.js":[4968,4968],"./angelscript":[2725,2725],"./angelscript.js":[2725,2725],"./apache":[8430,8430],"./apache.js":[8430,8430],"./applescript":[7485,7485],"./applescript.js":[7485,7485],"./arcade":[1573,1573],"./arcade.js":[1573,1573],"./arduino":[319,319],"./arduino.js":[319,319],"./armasm":[358,358],"./armasm.js":[358,358],"./asciidoc":[2548,2548],"./asciidoc.js":[2548,2548],"./aspectj":[1016,1016],"./aspectj.js":[1016,1016],"./autohotkey":[3182,3182],"./autohotkey.js":[3182,3182],"./autoit":[661,661],"./autoit.js":[661,661],"./avrasm":[6286,6286],"./avrasm.js":[6286,6286],"./awk":[2715,2715],"./awk.js":[2715,2715],"./axapta":[3408,3408],"./axapta.js":[3408,3408],"./bash":[1755,1755],"./bash.js":[1755,1755],"./basic":[7535,7535],"./basic.js":[7535,7535],"./bnf":[9841,9841],"./bnf.js":[9841,9841],"./brainfuck":[3857,3857],"./brainfuck.js":[3857,3857],"./c":[3179,3179],"./c.js":[3179,3179],"./cal":[8123,8123],"./cal.js":[8123,8123],"./capnproto":[775,775],"./capnproto.js":[775,775],"./ceylon":[6740,6740],"./ceylon.js":[6740,6740],"./clean":[1675,1675],"./clean.js":[1675,1675],"./clojure":[894,894],"./clojure-repl":[4796,4796],"./clojure-repl.js":[4796,4796],"./clojure.js":[894,894],"./cmake":[7297,7297],"./cmake.js":[7297,7297],"./coffeescript":[2478,2478],"./coffeescript.js":[2478,2478],"./coq":[1434,1434],"./coq.js":[1434,1434],"./cos":[5875,5875],"./cos.js":[5875,5875],"./cpp":[863,863],"./cpp.js":[863,863],"./crmsh":[3582,3582],"./crmsh.js":[3582,3582],"./crystal":[8826,8826],"./crystal.js":[8826,8826],"./csharp":[5528,5528],"./csharp.js":[5528,5528],"./csp":[5248,5248],"./csp.js":[5248,5248],"./css":[1931,1931],"./css.js":[1931,1931],"./d":[552,552],"./d.js":[552,552],"./dart":[309,309],"./dart.js":[309,309],"./delphi":[713,713],"./delphi.js":[713,713],"./diff":[1730,1730],"./diff.js":[1730,1730],"./django":[2669,2669],"./django.js":[2669,2669],"./dns":[3485,3485],"./dns.js":[3485,3485],"./dockerfile":[1955,1955],"./dockerfile.js":[1955,1955],"./dos":[5763,5763],"./dos.js":[5763,5763],"./dsconfig":[5434,5434],"./dsconfig.js":[5434,5434],"./dts":[2908,2908],"./dts.js":[2908,2908],"./dust":[7565,7565],"./dust.js":[7565,7565],"./ebnf":[3152,3152],"./ebnf.js":[3152,3152],"./elixir":[1066,1066],"./elixir.js":[1066,1066],"./elm":[3435,3435],"./elm.js":[3435,3435],"./erb":[7005,7005],"./erb.js":[7005,7005],"./erlang":[8771,8771],"./erlang-repl":[8163,8163],"./erlang-repl.js":[8163,8163],"./erlang.js":[8771,8771],"./excel":[1007,1007],"./excel.js":[1007,1007],"./fix":[3596,3596],"./fix.js":[3596,3596],"./flix":[6634,6634],"./flix.js":[6634,6634],"./fortran":[8315,8315],"./fortran.js":[8315,8315],"./fsharp":[3078,3078],"./fsharp.js":[3078,3078],"./gams":[6929,6929],"./gams.js":[6929,6929],"./gauss":[1715,1715],"./gauss.js":[1715,1715],"./gcode":[7952,7952],"./gcode.js":[7952,7952],"./gherkin":[4935,4935],"./gherkin.js":[4935,4935],"./glsl":[1040,1040],"./glsl.js":[1040,1040],"./gml":[5726,7413,5726],"./gml.js":[5726,7413,5726],"./go":[3191,3191],"./go.js":[3191,3191],"./golo":[6643,6643],"./golo.js":[6643,6643],"./gradle":[7578,7578],"./gradle.js":[7578,7578],"./graphql":[6429,6429],"./graphql.js":[6429,6429],"./groovy":[371,371],"./groovy.js":[371,371],"./haml":[1690,1690],"./haml.js":[1690,1690],"./handlebars":[9079,9079],"./handlebars.js":[9079,9079],"./haskell":[7300,7469],"./haskell.js":[7300,7469],"./haxe":[3376,3376],"./haxe.js":[3376,3376],"./hsp":[8678,8678],"./hsp.js":[8678,8678],"./http":[3323,3323],"./http.js":[3323,3323],"./hy":[4010,4010],"./hy.js":[4010,4010],"./inform7":[3916,3916],"./inform7.js":[3916,3916],"./ini":[5544,5544],"./ini.js":[5544,5544],"./irpf90":[1642,1642],"./irpf90.js":[1642,1642],"./isbl":[3018,7930,3018],"./isbl.js":[3018,7930,3018],"./java":[1489,1489],"./java.js":[1489,1489],"./javascript":[6191,6191],"./javascript.js":[6191,6191],"./jboss-cli":[6812,6812],"./jboss-cli.js":[6812,6812],"./json":[8772,8772],"./json.js":[8772,8772],"./julia":[1122,1122],"./julia-repl":[1799,1799],"./julia-repl.js":[1799,1799],"./julia.js":[1122,1122],"./kotlin":[5872,5872],"./kotlin.js":[5872,5872],"./lasso":[7074,7074],"./lasso.js":[7074,7074],"./latex":[7649,7649],"./latex.js":[7649,7649],"./ldif":[8881,8881],"./ldif.js":[8881,8881],"./leaf":[150,150],"./leaf.js":[150,150],"./less":[7015,7015],"./less.js":[7015,7015],"./lisp":[8093,8093],"./lisp.js":[8093,8093],"./livecodeserver":[9924,9924],"./livecodeserver.js":[9924,9924],"./livescript":[6252,6252],"./livescript.js":[6252,6252],"./llvm":[3660,3660],"./llvm.js":[3660,3660],"./lsl":[6561,6561],"./lsl.js":[6561,6561],"./lua":[3324,3324],"./lua.js":[3324,3324],"./makefile":[6503,6503],"./makefile.js":[6503,6503],"./markdown":[7274,7274],"./markdown.js":[7274,7274],"./mathematLine truncated
|
||||
(()=>{var e,s,t={4333:(e,s,t)=>{var a={"./1c":[4570,6319,4570],"./1c.js":[4570,6319,4570],"./abnf":[4414,4414],"./abnf.js":[4414,4414],"./accesslog":[7490,7490],"./accesslog.js":[7490,7490],"./actionscript":[227,227],"./actionscript.js":[227,227],"./ada":[4968,4968],"./ada.js":[4968,4968],"./angelscript":[2725,2725],"./angelscript.js":[2725,2725],"./apache":[8430,8430],"./apache.js":[8430,8430],"./applescript":[7485,7485],"./applescript.js":[7485,7485],"./arcade":[1573,1573],"./arcade.js":[1573,1573],"./arduino":[319,319],"./arduino.js":[319,319],"./armasm":[358,358],"./armasm.js":[358,358],"./asciidoc":[2548,2548],"./asciidoc.js":[2548,2548],"./aspectj":[1016,1016],"./aspectj.js":[1016,1016],"./autohotkey":[3182,3182],"./autohotkey.js":[3182,3182],"./autoit":[661,661],"./autoit.js":[661,661],"./avrasm":[6286,6286],"./avrasm.js":[6286,6286],"./awk":[2715,2715],"./awk.js":[2715,2715],"./axapta":[3408,3408],"./axapta.js":[3408,3408],"./bash":[1755,1755],"./bash.js":[1755,1755],"./basic":[7535,7535],"./basic.js":[7535,7535],"./bnf":[9841,9841],"./bnf.js":[9841,9841],"./brainfuck":[3857,3857],"./brainfuck.js":[3857,3857],"./c":[3179,3179],"./c.js":[3179,3179],"./cal":[8123,8123],"./cal.js":[8123,8123],"./capnproto":[775,775],"./capnproto.js":[775,775],"./ceylon":[6740,6740],"./ceylon.js":[6740,6740],"./clean":[1675,1675],"./clean.js":[1675,1675],"./clojure":[894,894],"./clojure-repl":[4796,4796],"./clojure-repl.js":[4796,4796],"./clojure.js":[894,894],"./cmake":[7297,7297],"./cmake.js":[7297,7297],"./coffeescript":[2478,2478],"./coffeescript.js":[2478,2478],"./coq":[1434,1434],"./coq.js":[1434,1434],"./cos":[5875,5875],"./cos.js":[5875,5875],"./cpp":[863,863],"./cpp.js":[863,863],"./crmsh":[3582,3582],"./crmsh.js":[3582,3582],"./crystal":[8826,8826],"./crystal.js":[8826,8826],"./csharp":[5528,5528],"./csharp.js":[5528,5528],"./csp":[5248,5248],"./csp.js":[5248,5248],"./css":[1931,1931],"./css.js":[1931,1931],"./d":[552,552],"./d.js":[552,552],"./dart":[309,309],"./dart.js":[309,309],"./delphi":[713,713],"./delphi.js":[713,713],"./diff":[1730,1730],"./diff.js":[1730,1730],"./django":[2669,2669],"./django.js":[2669,2669],"./dns":[3485,3485],"./dns.js":[3485,3485],"./dockerfile":[1955,1955],"./dockerfile.js":[1955,1955],"./dos":[5763,5763],"./dos.js":[5763,5763],"./dsconfig":[5434,5434],"./dsconfig.js":[5434,5434],"./dts":[2908,2908],"./dts.js":[2908,2908],"./dust":[7565,7565],"./dust.js":[7565,7565],"./ebnf":[3152,3152],"./ebnf.js":[3152,3152],"./elixir":[1066,1066],"./elixir.js":[1066,1066],"./elm":[3435,3435],"./elm.js":[3435,3435],"./erb":[7005,7005],"./erb.js":[7005,7005],"./erlang":[8771,8771],"./erlang-repl":[8163,8163],"./erlang-repl.js":[8163,8163],"./erlang.js":[8771,8771],"./excel":[1007,1007],"./excel.js":[1007,1007],"./fix":[3596,3596],"./fix.js":[3596,3596],"./flix":[6634,6634],"./flix.js":[6634,6634],"./fortran":[8315,8315],"./fortran.js":[8315,8315],"./fsharp":[3078,3078],"./fsharp.js":[3078,3078],"./gams":[6929,6929],"./gams.js":[6929,6929],"./gauss":[1715,1715],"./gauss.js":[1715,1715],"./gcode":[7952,7952],"./gcode.js":[7952,7952],"./gherkin":[4935,4935],"./gherkin.js":[4935,4935],"./glsl":[1040,1040],"./glsl.js":[1040,1040],"./gml":[5726,7413,5726],"./gml.js":[5726,7413,5726],"./go":[3191,3191],"./go.js":[3191,3191],"./golo":[6643,6643],"./golo.js":[6643,6643],"./gradle":[7578,7578],"./gradle.js":[7578,7578],"./graphql":[6429,6429],"./graphql.js":[6429,6429],"./groovy":[371,371],"./groovy.js":[371,371],"./haml":[1690,1690],"./haml.js":[1690,1690],"./handlebars":[9079,9079],"./handlebars.js":[9079,9079],"./haskell":[7300,7469],"./haskell.js":[7300,7469],"./haxe":[3376,3376],"./haxe.js":[3376,3376],"./hsp":[8678,8678],"./hsp.js":[8678,8678],"./http":[3323,3323],"./http.js":[3323,3323],"./hy":[4010,4010],"./hy.js":[4010,4010],"./inform7":[3916,3916],"./inform7.js":[3916,3916],"./ini":[5544,5544],"./ini.js":[5544,5544],"./irpf90":[1642,1642],"./irpf90.js":[1642,1642],"./isbl":[3018,7930,3018],"./isbl.js":[3018,7930,3018],"./java":[1489,1489],"./java.js":[1489,1489],"./javascript":[6191,6191],"./javascript.js":[6191,6191],"./jboss-cli":[6812,6812],"./jboss-cli.js":[6812,6812],"./json":[8772,8772],"./json.js":[8772,8772],"./julia":[1122,1122],"./julia-repl":[1799,1799],"./julia-repl.js":[1799,1799],"./julia.js":[1122,1122],"./kotlin":[5872,5872],"./kotlin.js":[5872,5872],"./lasso":[7074,7074],"./lasso.js":[7074,7074],"./latex":[7649,7649],"./latex.js":[7649,7649],"./ldif":[8881,8881],"./ldif.js":[8881,8881],"./leaf":[150,150],"./leaf.js":[150,150],"./less":[7015,7015],"./less.js":[7015,7015],"./lisp":[8093,8093],"./lisp.js":[8093,8093],"./livecodeserver":[9924,9924],"./livecodeserver.js":[9924,9924],"./livescript":[6252,6252],"./livescript.js":[6252,6252],"./llvm":[3660,3660],"./llvm.js":[3660,3660],"./lsl":[6561,6561],"./lsl.js":[6561,6561],"./lua":[3324,3324],"./lua.js":[3324,3324],"./makefile":[6503,6503],"./makefile.js":[6503,6503],"./markdown":[7274,7274],"./markdown.js":[7274,7274],"./mathematLine truncated
|
||||
File diff suppressed because it is too large.
Load diff
+47
-47
@@ -6,7 +6,7 @@ var uc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Vu=Symbol.for("react.element"),$B=Symbol.for("react.portal"),zB=Symbol.for("react.fragment"),VB=Symbol.for("react.strict_mode"),WB=Symbol.for("react.profiler"),qB=Symbol.for("react.provider"),KB=Symbol.for("react.context"),QB=Symbol.for("react.forward_ref"),jB=Symbol.for("react.suspense"),XB=Symbol.for("react.memo"),ZB=Symbol.for("react.lazy"),jR=Symbol.iterator;function JB(e){return e===null||typeof e!="object"?null:(e=jR&&e[jR]||e["@@iterator"],typeof e=="function"?e:null)}var KA={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},QA=Object.assign,jA={};function Ol(e,t,n){this.props=e,this.context=t,this.refs=jA,this.updater=n||KA}Ol.prototype.isReactComponent={};Ol.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ol.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function XA(){}XA.prototype=Ol.prototype;function uT(e,t,n){this.props=e,this.context=t,this.refs=jA,this.updater=n||KA}var dT=uT.prototype=new XA;dT.constructor=uT;QA(dT,Ol.prototype);dT.isPureReactComponent=!0;var XR=Array.isArray,ZA=Object.prototype.hasOwnProperty,pT={current:null},JA={key:!0,ref:!0,__self:!0,__source:!0};function eI(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)ZA.call(t,r)&&!JA.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];i.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:Vu,type:e,key:o,ref:s,props:i,_owner:pT.current}}function eG(e,t){return{$$typeof:Vu,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function _T(e){return typeof e=="object"&&e!==null&&e.$$typeof===Vu}function tG(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ZR=/\/+/g;function Kg(e,t){return typeof e=="object"&&e!==null&&e.key!=null?tG(""+e.key):t.toString(36)}function Jp(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Vu:case $B:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+Kg(s,0):r,XR(i)?(n="",e!=null&&(n=e.replace(ZR,"$&/")+"/"),Jp(i,t,n,"",function(u){return u})):i!=null&&(_T(i)&&(i=eG(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(ZR,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",XR(e))for(var a=0;a<e.length;a++){o=e[a];var l=r+Kg(o,a);s+=Jp(o,t,n,l,i)}else if(l=JB(e),typeof l=="function")for(e=l.call(e),a=0;!(o=e.next()).done;)o=o.value,l=r+Kg(o,a++),s+=Jp(o,t,n,l,i);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function ip(e,t,n){if(e==null)return e;var r=[],i=0;return Jp(e,r,"","",function(o){return t.call(n,o,i++)}),r}function nG(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Gn={current:null},e_={transition:null},rG={ReactCurrentDispatcher:Gn,ReactCurrentBatchConfig:e_,ReactCurrentOwner:pT};function tI(){throw Error("act(...) is not supported in production builds of React.")}He.Children={map:ip,forEach:function(e,t,n){ip(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ip(e,function(){t++}),t},toArray:function(e){return ip(e,function(t){return t})||[]},only:function(e){if(!_T(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};He.Component=Ol;He.Fragment=zB;He.Profiler=WB;He.PureComponent=uT;He.StrictMode=VB;He.Suspense=jB;He.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=rG;He.act=tI;He.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=QA({},e.props),i=e.key,o=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,s=pT.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)ZA.call(t,l)&&!JA.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:Vu,type:e.type,key:i,ref:o,props:r,_owner:s}};He.createContext=function(e){return e={$$typeof:KB,_currentValue:e,_currentValue2:e,_threadCountLine truncated
|
||||
*/var Vu=Symbol.for("react.element"),$B=Symbol.for("react.portal"),zB=Symbol.for("react.fragment"),VB=Symbol.for("react.strict_mode"),WB=Symbol.for("react.profiler"),qB=Symbol.for("react.provider"),KB=Symbol.for("react.context"),QB=Symbol.for("react.forward_ref"),jB=Symbol.for("react.suspense"),XB=Symbol.for("react.memo"),ZB=Symbol.for("react.lazy"),jR=Symbol.iterator;function JB(e){return e===null||typeof e!="object"?null:(e=jR&&e[jR]||e["@@iterator"],typeof e=="function"?e:null)}var KA={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},QA=Object.assign,jA={};function Ol(e,t,n){this.props=e,this.context=t,this.refs=jA,this.updater=n||KA}Ol.prototype.isReactComponent={};Ol.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ol.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function XA(){}XA.prototype=Ol.prototype;function uT(e,t,n){this.props=e,this.context=t,this.refs=jA,this.updater=n||KA}var dT=uT.prototype=new XA;dT.constructor=uT;QA(dT,Ol.prototype);dT.isPureReactComponent=!0;var XR=Array.isArray,ZA=Object.prototype.hasOwnProperty,pT={current:null},JA={key:!0,ref:!0,__self:!0,__source:!0};function eI(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)ZA.call(t,r)&&!JA.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];i.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:Vu,type:e,key:o,ref:s,props:i,_owner:pT.current}}function eG(e,t){return{$$typeof:Vu,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function _T(e){return typeof e=="object"&&e!==null&&e.$$typeof===Vu}function tG(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ZR=/\/+/g;function Kg(e,t){return typeof e=="object"&&e!==null&&e.key!=null?tG(""+e.key):t.toString(36)}function Jp(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Vu:case $B:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+Kg(s,0):r,XR(i)?(n="",e!=null&&(n=e.replace(ZR,"$&/")+"/"),Jp(i,t,n,"",function(u){return u})):i!=null&&(_T(i)&&(i=eG(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(ZR,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",XR(e))for(var a=0;a<e.length;a++){o=e[a];var l=r+Kg(o,a);s+=Jp(o,t,n,l,i)}else if(l=JB(e),typeof l=="function")for(e=l.call(e),a=0;!(o=e.next()).done;)o=o.value,l=r+Kg(o,a++),s+=Jp(o,t,n,l,i);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function ip(e,t,n){if(e==null)return e;var r=[],i=0;return Jp(e,r,"","",function(o){return t.call(n,o,i++)}),r}function nG(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Yn={current:null},e_={transition:null},rG={ReactCurrentDispatcher:Yn,ReactCurrentBatchConfig:e_,ReactCurrentOwner:pT};function tI(){throw Error("act(...) is not supported in production builds of React.")}He.Children={map:ip,forEach:function(e,t,n){ip(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ip(e,function(){t++}),t},toArray:function(e){return ip(e,function(t){return t})||[]},only:function(e){if(!_T(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};He.Component=Ol;He.Fragment=zB;He.Profiler=WB;He.PureComponent=uT;He.StrictMode=VB;He.Suspense=jB;He.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=rG;He.act=tI;He.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=QA({},e.props),i=e.key,o=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,s=pT.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)ZA.call(t,l)&&!JA.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:Vu,type:e.type,key:i,ref:o,props:r,_owner:s}};He.createContext=function(e){return e={$$typeof:KB,_currentValue:e,_currentValue2:e,_threadCountLine truncated
|
||||
* @license React
|
||||
* react-jsx-runtime.production.min.js
|
||||
*
|
||||
@@ -14,7 +14,7 @@ var uc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var iG=P,oG=Symbol.for("react.element"),sG=Symbol.for("react.fragment"),aG=Object.prototype.hasOwnProperty,lG=iG.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,cG={key:!0,ref:!0,__self:!0,__source:!0};function nI(e,t,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)aG.call(t,r)&&!cG.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:oG,type:e,key:o,ref:s,props:i,_owner:lG.current}}$f.Fragment=sG;$f.jsx=nI;$f.jsxs=nI;WA.exports=$f;var N=WA.exports,TE={},rI={exports:{}},Er={},iI={exports:{}},oI={};/**
|
||||
*/var iG=k,oG=Symbol.for("react.element"),sG=Symbol.for("react.fragment"),aG=Object.prototype.hasOwnProperty,lG=iG.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,cG={key:!0,ref:!0,__self:!0,__source:!0};function nI(e,t,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)aG.call(t,r)&&!cG.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:oG,type:e,key:o,ref:s,props:i,_owner:lG.current}}$f.Fragment=sG;$f.jsx=nI;$f.jsxs=nI;WA.exports=$f;var N=WA.exports,TE={},rI={exports:{}},Er={},iI={exports:{}},oI={};/**
|
||||
* @license React
|
||||
* scheduler.production.min.js
|
||||
*
|
||||
@@ -22,7 +22,7 @@ var uc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/(function(e){function t(w,G){var q=w.length;w.push(G);e:for(;0<q;){var V=q-1>>>1,te=w[V];if(0<i(te,G))w[V]=G,w[q]=te,q=V;else break e}}function n(w){return w.length===0?null:w[0]}function r(w){if(w.length===0)return null;var G=w[0],q=w.pop();if(q!==G){w[0]=q;e:for(var V=0,te=w.length,Ee=te>>>1;V<Ee;){var be=2*(V+1)-1,ye=w[be],Ie=be+1,tt=w[Ie];if(0>i(ye,q))Ie<te&&0>i(tt,ye)?(w[V]=tt,w[Ie]=q,V=Ie):(w[V]=ye,w[be]=q,V=be);else if(Ie<te&&0>i(tt,q))w[V]=tt,w[Ie]=q,V=Ie;else break e}}return G}function i(w,G){var q=w.sortIndex-G.sortIndex;return q!==0?q:w.id-G.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],p=1,_=null,f=3,g=!1,h=!1,E=!1,b=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function R(w){for(var G=n(u);G!==null;){if(G.callback===null)r(u);else if(G.startTime<=w)r(u),G.sortIndex=G.expirationTime,t(l,G);else break;G=n(u)}}function A(w){if(E=!1,R(w),!h)if(n(l)!==null)h=!0,ue(I);else{var G=n(u);G!==null&&L(A,G.startTime-w)}}function I(w,G){h=!1,E&&(E=!1,T($),$=-1),g=!0;var q=f;try{for(R(G),_=n(l);_!==null&&(!(_.expirationTime>G)||w&&!se());){var V=_.callback;if(typeof V=="function"){_.callback=null,f=_.priorityLevel;var te=V(_.expirationTime<=G);G=e.unstable_now(),typeof te=="function"?_.callback=te:_===n(l)&&r(l),R(G)}else r(l);_=n(l)}if(_!==null)var Ee=!0;else{var be=n(u);be!==null&&L(A,be.startTime-G),Ee=!1}return Ee}finally{_=null,f=q,g=!1}}var D=!1,M=null,$=-1,H=5,B=-1;function se(){return!(e.unstable_now()-B<H)}function de(){if(M!==null){var w=e.unstable_now();B=w;var G=!0;try{G=M(!0,w)}finally{G?pe():(D=!1,M=null)}}else D=!1}var pe;if(typeof y=="function")pe=function(){y(de)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,ee=ce.port2;ce.port1.onmessage=de,pe=function(){ee.postMessage(null)}}else pe=function(){b(de,0)};function ue(w){M=w,D||(D=!0,pe())}function L(w,G){$=b(function(){w(e.unstable_now())},G)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(w){w.callback=null},e.unstable_continueExecution=function(){h||g||(h=!0,ue(I))},e.unstable_forceFrameRate=function(w){0>w||125<w?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<w?Math.floor(1e3/w):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(w){switch(f){case 1:case 2:case 3:var G=3;break;default:G=f}var q=f;f=G;try{return w()}finally{f=q}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(w,G){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var q=f;f=w;try{return G()}finally{f=q}},e.unstable_scheduleCallback=function(w,G,q){var V=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?V+q:V):q=V,w){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=q+te,w={id:p++,callback:G,priorityLevel:w,startTime:q,expirationTime:te,sortIndex:-1},q>V?(w.sortIndex=q,t(u,w),n(l)===null&&w===n(u)&&(E?(T($),$=-1):E=!0,L(A,q-V))):(w.sortIndex=te,t(l,w),h||g||(h=!0,ue(I))),w},e.unstable_shouldYield=se,e.unstable_wrapCallback=function(w){var G=f;return function(){var q=f;f=G;try{return w.apply(this,arguments)}finally{f=q}}}})(oI);iI.exports=oI;var uG=iI.exports;/**
|
||||
*/(function(e){function t(w,G){var q=w.length;w.push(G);e:for(;0<q;){var V=q-1>>>1,te=w[V];if(0<i(te,G))w[V]=G,w[q]=te,q=V;else break e}}function n(w){return w.length===0?null:w[0]}function r(w){if(w.length===0)return null;var G=w[0],q=w.pop();if(q!==G){w[0]=q;e:for(var V=0,te=w.length,Ee=te>>>1;V<Ee;){var be=2*(V+1)-1,ye=w[be],Ie=be+1,et=w[Ie];if(0>i(ye,q))Ie<te&&0>i(et,ye)?(w[V]=et,w[Ie]=q,V=Ie):(w[V]=ye,w[be]=q,V=be);else if(Ie<te&&0>i(et,q))w[V]=et,w[Ie]=q,V=Ie;else break e}}return G}function i(w,G){var q=w.sortIndex-G.sortIndex;return q!==0?q:w.id-G.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],p=1,_=null,f=3,g=!1,h=!1,E=!1,b=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function R(w){for(var G=n(u);G!==null;){if(G.callback===null)r(u);else if(G.startTime<=w)r(u),G.sortIndex=G.expirationTime,t(l,G);else break;G=n(u)}}function O(w){if(E=!1,R(w),!h)if(n(l)!==null)h=!0,ue(I);else{var G=n(u);G!==null&&L(O,G.startTime-w)}}function I(w,G){h=!1,E&&(E=!1,T($),$=-1),g=!0;var q=f;try{for(R(G),_=n(l);_!==null&&(!(_.expirationTime>G)||w&&!se());){var V=_.callback;if(typeof V=="function"){_.callback=null,f=_.priorityLevel;var te=V(_.expirationTime<=G);G=e.unstable_now(),typeof te=="function"?_.callback=te:_===n(l)&&r(l),R(G)}else r(l);_=n(l)}if(_!==null)var Ee=!0;else{var be=n(u);be!==null&&L(O,be.startTime-G),Ee=!1}return Ee}finally{_=null,f=q,g=!1}}var D=!1,M=null,$=-1,H=5,B=-1;function se(){return!(e.unstable_now()-B<H)}function de(){if(M!==null){var w=e.unstable_now();B=w;var G=!0;try{G=M(!0,w)}finally{G?pe():(D=!1,M=null)}}else D=!1}var pe;if(typeof y=="function")pe=function(){y(de)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,ee=ce.port2;ce.port1.onmessage=de,pe=function(){ee.postMessage(null)}}else pe=function(){b(de,0)};function ue(w){M=w,D||(D=!0,pe())}function L(w,G){$=b(function(){w(e.unstable_now())},G)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(w){w.callback=null},e.unstable_continueExecution=function(){h||g||(h=!0,ue(I))},e.unstable_forceFrameRate=function(w){0>w||125<w?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<w?Math.floor(1e3/w):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(w){switch(f){case 1:case 2:case 3:var G=3;break;default:G=f}var q=f;f=G;try{return w()}finally{f=q}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(w,G){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var q=f;f=w;try{return G()}finally{f=q}},e.unstable_scheduleCallback=function(w,G,q){var V=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?V+q:V):q=V,w){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=q+te,w={id:p++,callback:G,priorityLevel:w,startTime:q,expirationTime:te,sortIndex:-1},q>V?(w.sortIndex=q,t(u,w),n(l)===null&&w===n(u)&&(E?(T($),$=-1):E=!0,L(O,q-V))):(w.sortIndex=te,t(l,w),h||g||(h=!0,ue(I))),w},e.unstable_shouldYield=se,e.unstable_wrapCallback=function(w){var G=f;return function(){var q=f;f=G;try{return w.apply(this,arguments)}finally{f=q}}}})(oI);iI.exports=oI;var uG=iI.exports;/**
|
||||
* @license React
|
||||
* react-dom.production.min.js
|
||||
*
|
||||
@@ -30,26 +30,26 @@ var uc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var dG=P,hr=uG;function ie(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var sI=new Set,ou={};function sa(e,t){dl(e,t),dl(e+"Capture",t)}function dl(e,t){for(ou[e]=t,e=0;e<t.length;e++)sI.add(t[e])}var ji=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),bE=Object.prototype.hasOwnProperty,pG=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,JR={},eN={};function _G(e){return bE.call(eN,e)?!0:bE.call(JR,e)?!1:pG.test(e)?eN[e]=!0:(JR[e]=!0,!1)}function fG(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function mG(e,t,n,r){if(t===null||typeof t>"u"||fG(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Yn(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var cn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){cn[e]=new Yn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];cn[t]=new Yn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){cn[e]=new Yn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){cn[e]=new Yn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){cn[e]=new Yn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){cn[e]=new Yn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){cn[e]=new Yn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){cn[e]=new Yn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){cn[e]=new Yn(e,5,!1,e.toLowerCase(),null,!1,!1)});var fT=/[\-:]([a-z])/g;function mT(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(fT,mT);cn[t]=new Yn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(fT,mT);cn[t]=new Yn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(fT,mT);cn[t]=new Yn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){cn[e]=new Yn(e,1,!1,e.toLowerCase(),null,!1,!1)});cn.xlinkHref=new Yn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){cn[e]=new Yn(e,1,!1,e.toLowerCase(),null,!0,!0)});function gT(e,t,n,r){var i=cn.hasOwnProperty(t)?cn[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!==
Line truncated
|
||||
*/var dG=k,hr=uG;function ie(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var sI=new Set,ou={};function sa(e,t){dl(e,t),dl(e+"Capture",t)}function dl(e,t){for(ou[e]=t,e=0;e<t.length;e++)sI.add(t[e])}var ji=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),bE=Object.prototype.hasOwnProperty,pG=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,JR={},eN={};function _G(e){return bE.call(eN,e)?!0:bE.call(JR,e)?!1:pG.test(e)?eN[e]=!0:(JR[e]=!0,!1)}function fG(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function mG(e,t,n,r){if(t===null||typeof t>"u"||fG(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Hn(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var cn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){cn[e]=new Hn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];cn[t]=new Hn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){cn[e]=new Hn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){cn[e]=new Hn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){cn[e]=new Hn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){cn[e]=new Hn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){cn[e]=new Hn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){cn[e]=new Hn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){cn[e]=new Hn(e,5,!1,e.toLowerCase(),null,!1,!1)});var fT=/[\-:]([a-z])/g;function mT(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(fT,mT);cn[t]=new Hn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(fT,mT);cn[t]=new Hn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(fT,mT);cn[t]=new Hn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){cn[e]=new Hn(e,1,!1,e.toLowerCase(),null,!1,!1)});cn.xlinkHref=new Hn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){cn[e]=new Hn(e,1,!1,e.toLowerCase(),null,!0,!0)});function gT(e,t,n,r){var i=cn.hasOwnProperty(t)?cn[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!==
Line truncated
|
||||
`+Qg+e}var jg=!1;function Xg(e,t){if(!e||jg)return"";jg=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
|
||||
`),o=r.stack.split(`
|
||||
`),s=i.length-1,a=o.length-1;1<=s&&0<=a&&i[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(i[s]!==o[a]){if(s!==1||a!==1)do if(s--,a--,0>a||i[s]!==o[a]){var l=`
|
||||
`+i[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{jg=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Oc(e):""}function gG(e){switch(e.tag){case 5:return Oc(e.type);case 16:return Oc("Lazy");case 13:return Oc("Suspense");case 19:return Oc("SuspenseList");case 0:case 2:case 15:return e=Xg(e.type,!1),e;case 11:return e=Xg(e.type.render,!1),e;case 1:return e=Xg(e.type,!0),e;default:return""}}function NE(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ua:return"Fragment";case Pa:return"Portal";case yE:return"Profiler";case hT:return"StrictMode";case CE:return"Suspense";case RE:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case lI:return(e.displayName||"Context")+".Consumer";case aI:return(e._context.displayName||"Context")+".Provider";case ET:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ST:return t=e.displayName||null,t!==null?t:NE(e.type)||"Memo";case bo:t=e._payload,e=e._init;try{return NE(e(t))}catch{}}return null}function hG(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return NE(t);case 8:return t===hT?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Jo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function uI(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function EG(e){var t=uI(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function sp(e){e._valueTracker||(e._valueTracker=EG(e))}function dI(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=uI(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function b_(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function vE(e,t){var n=t.checked;return Nt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function nN(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Jo(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function pI(e,t){t=t.checked,t!=null&&gT(e,"checked",t,!1)}function OE(e,t){pI(e,t);var n=Jo(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?AE(e,t.type,n):t.hasOwnProperty("defaultValue")&&AE(e,t.type,Jo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function rN(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function AE(e,t,n){(t!=="number"||b_(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ac=Array.isArray;function Xa(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Jo(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function IE(e,t){if(t.dan
Line truncated
|
||||
`).replace(AY,"")}function fp(e,t,n){if(t=vN(t),vN(e)!==t&&n)throw Error(ie(425))}function I_(){}var HE=null,$E=null;function zE(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var VE=typeof setTimeout=="function"?setTimeout:void 0,IY=typeof clearTimeout=="function"?clearTimeout:void 0,ON=typeof Promise=="function"?Promise:void 0,wY=typeof queueMicrotask=="function"?queueMicrotask:typeof ON<"u"?function(e){return ON.resolve(null).then(e).catch(DY)}:VE;function DY(e){setTimeout(function(){throw e})}function uh(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),uu(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);uu(t)}function $o(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function AN(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Il=Math.random().toString(36).slice(2),hi="__reactFiber$"+Il,mu="__reactProps$"+Il,Xi="__reactContainer$"+Il,WE="__reactEvents$"+Il,xY="__reactListeners$"+Il,MY="__reactHandles$"+Il;function Ms(e){var t=e[hi];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Xi]||n[hi]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=AN(e);e!==null;){if(n=e[hi])return n;e=AN(e)}return t}e=n,n=e.parentNode}return null}function Ku(e){return e=e[hi]||e[Xi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ya(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ie(33))}function Kf(e){return e[mu]||null}var qE=[],Ha=-1;function ls(e){return{current:e}}function gt(e){0>Ha||(e.current=qE[Ha],qE[Ha]=null,Ha--)}function ct(e,t){Ha++,qE[Ha]=e.current,e.current=t}var es={},Tn=ls(es),Zn=ls(!1),Qs=es;function pl(e,t){var n=e.type.contextTypes;if(!n)return es;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Jn(e){return e=e.childContextTypes,e!=null}function w_(){gt(Zn),gt(Tn)}function IN(e,t,n){if(Tn.current!==es)throw Error(ie(168));ct(Tn,t),ct(Zn,n)}function ew(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(ie(108,hG(e)||"Unknown",i));return Nt({},n,r)}function D_(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||es,Qs=Tn.current,ct(Tn,e),ct(Zn,Zn.current),!0}function wN(e,t,n){var r=e.stateNode;if(!r)throw Error(ie(169));n?(e=ew(e,t,Qs),r.__reactInternalMemoizedMergedChildContext=e,gt(Zn),gt(Tn),ct(Tn,e)):gt(Zn),ct(Zn,n)}var Hi=null,Qf=!1,dh=!1;function tw(e){Hi===null?Hi=[e]:Hi.push(e)}function LY(e){Qf=!0,tw(e)}function cs(){if(!dh&&Hi!==null){dh=!0;var e=0,t=et;try{var n=Hi;for(et=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Hi=null,Qf=!1}catch(i){throw Hi!==null&&(Hi=Hi.slice(e+1)),vI(bT,cs),i}finally{et=t,dh=!1}}return null}var $a=[],za=0,x_=null,M_=0,xr=[],Mr=0,js=null,zi=1,Vi="";function Os(e,t){$a[za++]=M_,$a[za++]=x_,x_=e,M_=t}function nw(e,t,n){xr[Mr++]=zi,xr[Mr++]=Vi,xr[Mr++]=js,js=e;var r=zi;e=Vi;var i=32-Jr(r)-1;r&=~(1<<i),n+=1;var o=32-Jr(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,zi=1<<32-Jr(t)+i|n<<i|r,Vi=o+e}else zi=1<<o|n<<i|r,Vi=e}function wT(e){e.return!==null&&(Os(e,1),nw(e,1,0))}function DT(e){for(;e===x_;)x_=$a[--za],$a[za]=null,M_=$a[--za],$a[za]=null;for(;e===js;)js=xr[--Mr],xr[Mr]=null,Vi=xr[--Mr],xr[Mr]=null,zi=xr[--Mr],xr[Mr]=null}var gr=null,fr=null,St=!1,jr=null;function rw(e,t){var n=kr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function DN(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,gr=e,fr=$o(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,gr=e,fr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=js!==null?{id:zi,overflow:Vi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=kr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,gr=e,fr=null,!0):!1;default:return!1}}function KE(e){return(e.mode&1)!==0&&(e.flags&128)===0}function QE(e){if(St){var t=fr;if(t){var n=t;if(!DN(e,t)){if(KE(e))throw Error(ie(418));t=$o(n.nextSibling);var r=gr;t&&DN(e,t)?rw(r,n):(e.flags=e.flags&-4097|2,St=!1,gr=e)}}else{if(KE(e))throw Error(ie(418));e.flags=e.flags&-4097|2,St=!1,gr=e}}}function xN(e){
Line truncated
|
||||
`+i[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{jg=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Oc(e):""}function gG(e){switch(e.tag){case 5:return Oc(e.type);case 16:return Oc("Lazy");case 13:return Oc("Suspense");case 19:return Oc("SuspenseList");case 0:case 2:case 15:return e=Xg(e.type,!1),e;case 11:return e=Xg(e.type.render,!1),e;case 1:return e=Xg(e.type,!0),e;default:return""}}function NE(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ua:return"Fragment";case Pa:return"Portal";case yE:return"Profiler";case hT:return"StrictMode";case CE:return"Suspense";case RE:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case lI:return(e.displayName||"Context")+".Consumer";case aI:return(e._context.displayName||"Context")+".Provider";case ET:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ST:return t=e.displayName||null,t!==null?t:NE(e.type)||"Memo";case bo:t=e._payload,e=e._init;try{return NE(e(t))}catch{}}return null}function hG(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return NE(t);case 8:return t===hT?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Jo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function uI(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function EG(e){var t=uI(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function sp(e){e._valueTracker||(e._valueTracker=EG(e))}function dI(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=uI(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function b_(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function vE(e,t){var n=t.checked;return Nt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function nN(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Jo(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function pI(e,t){t=t.checked,t!=null&&gT(e,"checked",t,!1)}function OE(e,t){pI(e,t);var n=Jo(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?AE(e,t.type,n):t.hasOwnProperty("defaultValue")&&AE(e,t.type,Jo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function rN(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function AE(e,t,n){(t!=="number"||b_(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ac=Array.isArray;function Xa(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Jo(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function IE(e,t){if(t.dan
Line truncated
|
||||
`).replace(AY,"")}function fp(e,t,n){if(t=vN(t),vN(e)!==t&&n)throw Error(ie(425))}function I_(){}var HE=null,$E=null;function zE(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var VE=typeof setTimeout=="function"?setTimeout:void 0,IY=typeof clearTimeout=="function"?clearTimeout:void 0,ON=typeof Promise=="function"?Promise:void 0,wY=typeof queueMicrotask=="function"?queueMicrotask:typeof ON<"u"?function(e){return ON.resolve(null).then(e).catch(DY)}:VE;function DY(e){setTimeout(function(){throw e})}function uh(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),uu(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);uu(t)}function $o(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function AN(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Il=Math.random().toString(36).slice(2),hi="__reactFiber$"+Il,mu="__reactProps$"+Il,Xi="__reactContainer$"+Il,WE="__reactEvents$"+Il,xY="__reactListeners$"+Il,MY="__reactHandles$"+Il;function Ms(e){var t=e[hi];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Xi]||n[hi]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=AN(e);e!==null;){if(n=e[hi])return n;e=AN(e)}return t}e=n,n=e.parentNode}return null}function Ku(e){return e=e[hi]||e[Xi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ya(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ie(33))}function Kf(e){return e[mu]||null}var qE=[],Ha=-1;function ls(e){return{current:e}}function gt(e){0>Ha||(e.current=qE[Ha],qE[Ha]=null,Ha--)}function ct(e,t){Ha++,qE[Ha]=e.current,e.current=t}var es={},Tn=ls(es),Jn=ls(!1),Qs=es;function pl(e,t){var n=e.type.contextTypes;if(!n)return es;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function er(e){return e=e.childContextTypes,e!=null}function w_(){gt(Jn),gt(Tn)}function IN(e,t,n){if(Tn.current!==es)throw Error(ie(168));ct(Tn,t),ct(Jn,n)}function ew(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(ie(108,hG(e)||"Unknown",i));return Nt({},n,r)}function D_(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||es,Qs=Tn.current,ct(Tn,e),ct(Jn,Jn.current),!0}function wN(e,t,n){var r=e.stateNode;if(!r)throw Error(ie(169));n?(e=ew(e,t,Qs),r.__reactInternalMemoizedMergedChildContext=e,gt(Jn),gt(Tn),ct(Tn,e)):gt(Jn),ct(Jn,n)}var Hi=null,Qf=!1,dh=!1;function tw(e){Hi===null?Hi=[e]:Hi.push(e)}function LY(e){Qf=!0,tw(e)}function cs(){if(!dh&&Hi!==null){dh=!0;var e=0,t=Je;try{var n=Hi;for(Je=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Hi=null,Qf=!1}catch(i){throw Hi!==null&&(Hi=Hi.slice(e+1)),vI(bT,cs),i}finally{Je=t,dh=!1}}return null}var $a=[],za=0,x_=null,M_=0,xr=[],Mr=0,js=null,zi=1,Vi="";function Os(e,t){$a[za++]=M_,$a[za++]=x_,x_=e,M_=t}function nw(e,t,n){xr[Mr++]=zi,xr[Mr++]=Vi,xr[Mr++]=js,js=e;var r=zi;e=Vi;var i=32-Jr(r)-1;r&=~(1<<i),n+=1;var o=32-Jr(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,zi=1<<32-Jr(t)+i|n<<i|r,Vi=o+e}else zi=1<<o|n<<i|r,Vi=e}function wT(e){e.return!==null&&(Os(e,1),nw(e,1,0))}function DT(e){for(;e===x_;)x_=$a[--za],$a[za]=null,M_=$a[--za],$a[za]=null;for(;e===js;)js=xr[--Mr],xr[Mr]=null,Vi=xr[--Mr],xr[Mr]=null,zi=xr[--Mr],xr[Mr]=null}var gr=null,fr=null,St=!1,jr=null;function rw(e,t){var n=kr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function DN(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,gr=e,fr=$o(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,gr=e,fr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=js!==null?{id:zi,overflow:Vi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=kr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,gr=e,fr=null,!0):!1;default:return!1}}function KE(e){return(e.mode&1)!==0&&(e.flags&128)===0}function QE(e){if(St){var t=fr;if(t){var n=t;if(!DN(e,t)){if(KE(e))throw Error(ie(418));t=$o(n.nextSibling);var r=gr;t&&DN(e,t)?rw(r,n):(e.flags=e.flags&-4097|2,St=!1,gr=e)}}else{if(KE(e))throw Error(ie(418));e.flags=e.flags&-4097|2,St=!1,gr=e}}}function xN(e){
Line truncated
|
||||
Error generating stack: `+o.message+`
|
||||
`+o.stack}return{value:e,source:t,stack:i,digest:null}}function gh(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function JE(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var $Y=typeof WeakMap=="function"?WeakMap:Map;function ww(e,t,n){n=Ki(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Y_||(Y_=!0,cS=r),JE(e,t)},n}function Dw(e,t,n){n=Ki(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){JE(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){JE(e,t),typeof r!="function"&&(Vo===null?Vo=new Set([this]):Vo.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function GN(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new $Y;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=rH.bind(null,e,t,n),t.then(e,e))}function YN(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function HN(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Ki(-1,1),t.tag=2,zo(n,t,1))),n.lanes|=1),e)}var zY=to.ReactCurrentOwner,Xn=!1;function Ln(e,t,n,r){t.child=e===null?sw(t,null,n,r):fl(t,e.child,n,r)}function $N(e,t,n,r,i){n=n.render;var o=t.ref;return tl(t,i),r=HT(e,t,n,r,o,i),n=$T(),e!==null&&!Xn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Ji(e,t,i)):(St&&n&&wT(t),t.flags|=1,Ln(e,t,r,i),t.child)}function zN(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!JT(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,xw(e,t,o,r,i)):(e=u_(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:pu,n(s,r)&&e.ref===t.ref)return Ji(e,t,i)}return t.flags|=1,e=qo(o,r),e.ref=t.ref,e.return=t,t.child=e}function xw(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(pu(o,r)&&e.ref===t.ref)if(Xn=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(Xn=!0);else return t.lanes=e.lanes,Ji(e,t,i)}return eS(e,t,n,r,i)}function Mw(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ct(qa,dr),dr|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ct(qa,dr),dr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,ct(qa,dr),dr|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,ct(qa,dr),dr|=r;return Ln(e,t,i,n),t.child}function Lw(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function eS(e,t,n,r,i){var o=Jn(n)?Qs:Tn.current;return o=pl(t,o),tl(t,i),n=HT(e,t,n,r,o,i),r=$T(),e!==null&&!Xn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Ji(e,t,i)):(St&&r&&wT(t),t.flags|=1,Ln(e,t,n,i),t.child)}function VN(e,t,n,r,i){if(Jn(n)){var o=!0;D_(t)}else o=!1;if(tl(t,i),t.stateNode===null)a_(e,t),Iw(t,n,r),ZE(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Br(u):(u=Jn(n)?Qs:Tn.current,u=pl(t,u));var p=n.getDerivedStateFromProps,_=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function";_||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==u)&&BN(t,s,r,u),yo=!1;var f=t.memoizedState;s.state=f,P_(t,r,s,i),l=t.memoizedState,a!==r||f!==l||Zn.current||yo?(typeof p=="function"&&(XE(t,n,p,r),l=t.memoizedState),(a=yo||FN(t,n,a,r,f,l,u))?(_||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=u,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,lw(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:Kr(t.type,a),s.props=u,_=t.pendingProps,f=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Br(l):(l=Jn(n)?Qs:Tn.current,l=pl(t,l));var g=n.getDerivedStateFromProps;(p=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==_||f!==l)&&BN(t,s,r,l),yo=!1,f=t.memoizedState,s.state=f,P_(t,r,s,i);var h=t.memoizedS
Line truncated
|
||||
`+o.stack}return{value:e,source:t,stack:i,digest:null}}function gh(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function JE(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var $Y=typeof WeakMap=="function"?WeakMap:Map;function ww(e,t,n){n=Ki(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Y_||(Y_=!0,cS=r),JE(e,t)},n}function Dw(e,t,n){n=Ki(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){JE(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){JE(e,t),typeof r!="function"&&(Vo===null?Vo=new Set([this]):Vo.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function GN(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new $Y;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=rH.bind(null,e,t,n),t.then(e,e))}function YN(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function HN(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Ki(-1,1),t.tag=2,zo(n,t,1))),n.lanes|=1),e)}var zY=to.ReactCurrentOwner,Zn=!1;function Ln(e,t,n,r){t.child=e===null?sw(t,null,n,r):fl(t,e.child,n,r)}function $N(e,t,n,r,i){n=n.render;var o=t.ref;return tl(t,i),r=HT(e,t,n,r,o,i),n=$T(),e!==null&&!Zn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Ji(e,t,i)):(St&&n&&wT(t),t.flags|=1,Ln(e,t,r,i),t.child)}function zN(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!JT(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,xw(e,t,o,r,i)):(e=u_(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:pu,n(s,r)&&e.ref===t.ref)return Ji(e,t,i)}return t.flags|=1,e=qo(o,r),e.ref=t.ref,e.return=t,t.child=e}function xw(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(pu(o,r)&&e.ref===t.ref)if(Zn=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(Zn=!0);else return t.lanes=e.lanes,Ji(e,t,i)}return eS(e,t,n,r,i)}function Mw(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ct(qa,dr),dr|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ct(qa,dr),dr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,ct(qa,dr),dr|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,ct(qa,dr),dr|=r;return Ln(e,t,i,n),t.child}function Lw(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function eS(e,t,n,r,i){var o=er(n)?Qs:Tn.current;return o=pl(t,o),tl(t,i),n=HT(e,t,n,r,o,i),r=$T(),e!==null&&!Zn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Ji(e,t,i)):(St&&r&&wT(t),t.flags|=1,Ln(e,t,n,i),t.child)}function VN(e,t,n,r,i){if(er(n)){var o=!0;D_(t)}else o=!1;if(tl(t,i),t.stateNode===null)a_(e,t),Iw(t,n,r),ZE(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Br(u):(u=er(n)?Qs:Tn.current,u=pl(t,u));var p=n.getDerivedStateFromProps,_=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function";_||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==u)&&BN(t,s,r,u),yo=!1;var f=t.memoizedState;s.state=f,P_(t,r,s,i),l=t.memoizedState,a!==r||f!==l||Jn.current||yo?(typeof p=="function"&&(XE(t,n,p,r),l=t.memoizedState),(a=yo||FN(t,n,a,r,f,l,u))?(_||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=u,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,lw(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:Kr(t.type,a),s.props=u,_=t.pendingProps,f=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Br(l):(l=er(n)?Qs:Tn.current,l=pl(t,l));var g=n.getDerivedStateFromProps;(p=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==_||f!==l)&&BN(t,s,r,l),yo=!1,f=t.memoizedState,s.state=f,P_(t,r,s,i);var h=t.memoizedS
Line truncated
|
||||
`)}}ea.empty=new ea(!0);class TH{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function pD(e){let t=[];do t.push(bH(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function bH(e){let t=[];do t.push(yH(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function yH(e){let t=NH(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=CH(e,t);else break;return t}function sv(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function CH(e,t){let n=sv(e),r=n;return e.eat(",")&&(e.next!="}"?r=sv(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function RH(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.isInGroup(t)&&i.push(s)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function NH(e){if(e.eat("(")){let t=pD(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=RH(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function vH(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(s,a,l){let u={term:l,to:a};return t[s].push(u),u}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,u)=>l.concat(o(u,a)),[]);if(s.type=="seq")for(let l=0;;l++){let u=o(s.exprs[l],a);if(l==s.exprs.length-1)return u;i(u,a=n())}else if(s.type=="star"){let l=n();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let u=0;u<s.min;u++){let p=n();i(o(s.expr,l),p),l=p}if(s.max==-1)i(o(s.expr,l),l);else for(let u=s.min;u<s.max;u++){let p=n();r(l,p),i(o(s.expr,l),p),l=p}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function _D(e,t){return t-e}function av(e,t){let n=[];return r(t),n.sort(_D);function r(i){let o=e[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:a,to:l}=o[s];!a&&n.indexOf(l)==-1&&r(l)}}}function OH(e){let t=Object.create(null);return n(av(e,0));function n(r){let i=[];r.forEach(s=>{e[s].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let p=0;p<i.length;p++)i[p][0]==a&&(u=i[p][1]);av(e,l).forEach(p=>{u||i.push([a,u=[]]),u.indexOf(p)==-1&&u.push(p)})})});let o=t[r.join(",")]=new ea(r.indexOf(e.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(_D);o.next.push({type:i[s][0],next:t[a.join(",")]||n(a)})}return o}}function AH(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let a=0;a<i.next.length;a++){let{type:l,next:u}=i.next[a];s.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(u)==-1&&r.push(u)}o&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function fD(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function mD(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let o=e[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function gD(e,t,n,r){for(let i in t)if(!(i in e))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in e){let o=e[i];o.validate&&o.validate(t[i])}}function hD(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new wH(e,r,t[r]);return n}let lv=class ED{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=hD(t,r.attrs),this.defaultAttrs=fD(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==ea.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultA
Line truncated
|
||||
`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],a=t.previousSibling;(!s||a&&a.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(t)}else this.findInside(t)}addElement(t,n,r){let i=this.localPreserveWS,o=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let s=t.nodeName.toLowerCase(),a;bD.hasOwnProperty(s)&&this.parser.normalizeLists&&LH(t);let l=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(a=this.parser.matchTag(t,this,r));e:if(l?l.ignore:MH.hasOwnProperty(s))this.findInside(t),this.ignoreFallback(t,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(t=l.skip);let u,p=this.needsBlock;if(TD.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),u=!0,o.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let _=l&&l.skip?n:this.readStyles(t,n);_&&this.addAll(t,_),u&&this.sync(o),this.needsBlock=p}else{let u=this.readStyles(t,n);u&&this.addElementByRule(t,l,u,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
|
||||
`),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(t,n){let r=t.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(o,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(t,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(t,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(o=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(t);else if(i)this.addElement(t,r,i);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l,r));else{let l=t;typeof n.contentElement=="string"?l=t.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(t):n.contentElement&&(l=n.contentElement),this.findAround(t,l,!0),this.addAll(l,r),this.findAround(t,l,!1)}o&&this.sync(a)&&this.open--}addAll(t,n,r,i){let o=r||0;for(let s=r?t.childNodes[r]:t.firstChild,a=i==null?null:t.childNodes[i];s!=a;s=s.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(s,n);this.findAtPoint(t,o)}findPlace(t,n){let r,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],a=s.findWrapping(t);if(a&&(!r||r.length>a.length)&&(r=a,i=s,!a.length)||s.solid)break}if(!r)return null;this.sync(i);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(t,n){if(t.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(t,n);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(t.type));let o=it.none;for(let s of r.concat(t.marks))(i.type?i.type.allowsMarkType(s.type):_v(s.type,t.type))&&(o=s.addToSet(o));return i.content.push(t.mark(o)),!0}return!1}enter(t,n,r,i){let o=this.findPlace(t.create(n),r);return o&&(o=this.enterInner(t,n,r,!0,i)),o}enterInner(t,n,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(t);let a=uv(t,o,s.options);s.options&Kc&&s.content.length==0&&(a|=Kc);let l=it.none;return r=r.filter(u=>(s.type?s.type.allowsMarkType(u.type):_v(u.type,t))?(l=u.addToSet(l),!1):!0),this.nodes.push(new yp(t,n,l,i,null,a)),this.open++,r}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Cu)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let p=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!p||p.name!=u&&!p.isInGroup(u))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function LH(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&bD.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function kH(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function
Line truncated
|
||||
`))}})}function KH(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function QH(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Xt(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new ae(Z.from(s),0,0),1,!0))}function il(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,p=n-2;u>o;u--,p--){let _=i.node(u),f=i.index(u);if(_.type.spec.isolating)return!1;let g=_.content.cutByIndex(f,_.childCount),h=r&&r[p+1];h&&(g=g.replaceChild(0,h.type.create(h.attrs)));let E=r&&r[p]||_;if(!_.canReplace(f+1,_.childCount)||!E.type.validContent(g))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function jH(e,t,n=1,r){let i=e.doc.resolve(t),o=Z.empty,s=Z.empty;for(let a=i.depth,l=i.depth-n,u=n-1;a>l;a--,u--){o=Z.from(i.node(a).copy(o));let p=r&&r[u];s=Z.from(p?p.type.create(p.attrs,s):i.node(a).copy(s))}e.step(new Kt(t,t,new ae(o.append(s),n,n),!0))}function us(e,t){let n=e.resolve(t),r=n.index();return ID(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function XH(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let o=t.child(i),s=o.type==r?e.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n||!e.type.allowsMarks(o.marks))return!1}return n.validEnd}function ID(e,t){return!!(e&&t&&!e.isLeaf&&XH(e,t))}function sm(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&ID(o,s)&&r.node(i).canReplace(a,a+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function ZH(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,o=e.doc.resolve(t-n),s=o.node().type;if(i&&s.inlineContent){let p=s.whitespace=="pre",_=!!s.contentMatch.matchType(i);p&&!_?r=!1:!p&&_&&(r=!0)}let a=e.steps.length;if(r===!1){let p=e.doc.resolve(t+n);AD(e,p.node(),p.before(),a)}s.inlineContent&&ob(e,t+n-1,s,o.node().contentMatchAt(o.index()),r==null);let l=e.mapping.slice(a),u=l.map(t-n);if(e.step(new Kt(u,l.map(t+n,-1),ae.empty,!0)),r===!0){let p=e.doc.resolve(u);OD(e,p.node(),p.before(),e.steps.length)}return e}function JH(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function e$(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),u=r.node(s),p=!1;if(o==1)p=u.canReplace(l,l,i);else{let _=u.contentMatchAt(l).findWrapping(i.firstChild.type);p=_&&u.canReplaceWith(l,l,_[0])}if(p)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function am(e,t,n=t,r=ae.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return wD(i,o,r)?new Kt(t,n,r):new t$(i,o,r).fit()}function wD(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class t${constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=Z.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=Z.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new ae(o,s,a);return t>-1?new Xt(r.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Kt(r.pos,i.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let n=1;n<=2;n+
Line truncated
|
||||
`),_&&h==g.nodeValue.length)for(let E=g,b;E;E=E.parentNode){if(b=E.nextSibling){b.nodeName=="BR"&&(a=l={node:b.parentNode,offset:sn(b)+1});break}let T=E.pmViewDesc;if(T&&T.node&&T.node.isBlock)break}}else{let E=g.childNodes[h-1];_=E&&(E.nodeName=="BR"||E.contentEditable=="false")}}if(ii&&p.focusNode&&p.focusNode!=l.node&&p.focusNode.nodeType==1){let g=p.focusNode.childNodes[p.focusOffset];g&&g.contentEditable=="false"&&(i=!0)}if(!(i||_&&Un)&&ta(a.node,a.offset,p.anchorNode,p.anchorOffset)&&ta(l.node,l.offset,p.focusNode,p.focusOffset))return;let f=!1;if((u.extend||t==n)&&!_){u.collapse(a.node,a.offset);try{t!=n&&u.extend(l.node,l.offset),f=!0}catch{}}if(!f){if(t>n){let h=a;a=l,l=h}let g=document.createRange();g.setEnd(l.node,l.offset),g.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(g)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?t<=s&&n>=r:t<s&&n>r){let a=r+o.border,l=s-o.border;if(t>=a&&n<=l){this.dirty=t==r||n==s?Ps:Dv,t==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Ci:o.markDirty(t-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Ps:Ci}r=s}this.dirty=Ps}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?Ps:Dv;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(t){return!1}}class VD extends Ju{constructor(t,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(t){return this.dirty==Fr&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class L$ extends Ju{constructor(t,n,r,i){super(t,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class na extends Ju{constructor(t,n,r,i,o){super(t,[],r,i),this.mark=n,this.spec=o}static create(t,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=la.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new na(t,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Ci||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Ci&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Fr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Fr}}slice(t,n,r){let i=na.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=NS(o,n,s,r)),t>0&&(o=NS(o,0,t,r));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class jo extends Ju{constructor(t,n,r,i,o,s,a,l,u){super(t,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(t,n,r,i,o,s){let a=o.nodeViews[n.type.name],l,u=a&&a(n,o,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,i),p=u&&u.dom,_=u&&u.contentDOM;if(n.isText){if(!p)p=document.createTextNode(n.text);else if(p.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else p||({dom:p,contentDOM:_}=la.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!_&&!n.isText&&p.nodeName!="BR"&&(p.hasAttribute("contenteditable")||(p.contentEditable="false"),n.type.spec.draggable&&(p.draggable=!0));let f=p;return p=QD(p,r,n),u?l=new k$(t,n,r,i,p,_||null,f,u,o,s+1):n.isText?new um(t,n,r,i,p,f,o):new jo(t,n,r,i,p,_||null,f,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>Z.empty)}return t}matchesNode(t,n,r){return this.dirty==Fr&&t.eq(this.
Line truncated
|
||||
`))}})}function KH(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function QH(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Xt(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new ae(Z.from(s),0,0),1,!0))}function il(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,p=n-2;u>o;u--,p--){let _=i.node(u),f=i.index(u);if(_.type.spec.isolating)return!1;let g=_.content.cutByIndex(f,_.childCount),h=r&&r[p+1];h&&(g=g.replaceChild(0,h.type.create(h.attrs)));let E=r&&r[p]||_;if(!_.canReplace(f+1,_.childCount)||!E.type.validContent(g))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function jH(e,t,n=1,r){let i=e.doc.resolve(t),o=Z.empty,s=Z.empty;for(let a=i.depth,l=i.depth-n,u=n-1;a>l;a--,u--){o=Z.from(i.node(a).copy(o));let p=r&&r[u];s=Z.from(p?p.type.create(p.attrs,s):i.node(a).copy(s))}e.step(new Kt(t,t,new ae(o.append(s),n,n),!0))}function us(e,t){let n=e.resolve(t),r=n.index();return ID(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function XH(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let o=t.child(i),s=o.type==r?e.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n||!e.type.allowsMarks(o.marks))return!1}return n.validEnd}function ID(e,t){return!!(e&&t&&!e.isLeaf&&XH(e,t))}function sm(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&ID(o,s)&&r.node(i).canReplace(a,a+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function ZH(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,o=e.doc.resolve(t-n),s=o.node().type;if(i&&s.inlineContent){let p=s.whitespace=="pre",_=!!s.contentMatch.matchType(i);p&&!_?r=!1:!p&&_&&(r=!0)}let a=e.steps.length;if(r===!1){let p=e.doc.resolve(t+n);AD(e,p.node(),p.before(),a)}s.inlineContent&&ob(e,t+n-1,s,o.node().contentMatchAt(o.index()),r==null);let l=e.mapping.slice(a),u=l.map(t-n);if(e.step(new Kt(u,l.map(t+n,-1),ae.empty,!0)),r===!0){let p=e.doc.resolve(u);OD(e,p.node(),p.before(),e.steps.length)}return e}function JH(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function e$(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),u=r.node(s),p=!1;if(o==1)p=u.canReplace(l,l,i);else{let _=u.contentMatchAt(l).findWrapping(i.firstChild.type);p=_&&u.canReplaceWith(l,l,_[0])}if(p)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function am(e,t,n=t,r=ae.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return wD(i,o,r)?new Kt(t,n,r):new t$(i,o,r).fit()}function wD(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class t${constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=Z.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=Z.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new ae(o,s,a);return t>-1?new Xt(r.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Kt(r.pos,i.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let n=1;n<=2;n+
Line truncated
|
||||
`),_&&h==g.nodeValue.length)for(let E=g,b;E;E=E.parentNode){if(b=E.nextSibling){b.nodeName=="BR"&&(a=l={node:b.parentNode,offset:sn(b)+1});break}let T=E.pmViewDesc;if(T&&T.node&&T.node.isBlock)break}}else{let E=g.childNodes[h-1];_=E&&(E.nodeName=="BR"||E.contentEditable=="false")}}if(ii&&p.focusNode&&p.focusNode!=l.node&&p.focusNode.nodeType==1){let g=p.focusNode.childNodes[p.focusOffset];g&&g.contentEditable=="false"&&(i=!0)}if(!(i||_&&Fn)&&ta(a.node,a.offset,p.anchorNode,p.anchorOffset)&&ta(l.node,l.offset,p.focusNode,p.focusOffset))return;let f=!1;if((u.extend||t==n)&&!_){u.collapse(a.node,a.offset);try{t!=n&&u.extend(l.node,l.offset),f=!0}catch{}}if(!f){if(t>n){let h=a;a=l,l=h}let g=document.createRange();g.setEnd(l.node,l.offset),g.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(g)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?t<=s&&n>=r:t<s&&n>r){let a=r+o.border,l=s-o.border;if(t>=a&&n<=l){this.dirty=t==r||n==s?Ps:Dv,t==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Ci:o.markDirty(t-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Ps:Ci}r=s}this.dirty=Ps}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?Ps:Dv;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(t){return!1}}class VD extends Ju{constructor(t,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(t){return this.dirty==Fr&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class L$ extends Ju{constructor(t,n,r,i){super(t,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class na extends Ju{constructor(t,n,r,i,o){super(t,[],r,i),this.mark=n,this.spec=o}static create(t,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=la.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new na(t,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Ci||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Ci&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Fr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Fr}}slice(t,n,r){let i=na.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=NS(o,n,s,r)),t>0&&(o=NS(o,0,t,r));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class jo extends Ju{constructor(t,n,r,i,o,s,a,l,u){super(t,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(t,n,r,i,o,s){let a=o.nodeViews[n.type.name],l,u=a&&a(n,o,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,i),p=u&&u.dom,_=u&&u.contentDOM;if(n.isText){if(!p)p=document.createTextNode(n.text);else if(p.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else p||({dom:p,contentDOM:_}=la.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!_&&!n.isText&&p.nodeName!="BR"&&(p.hasAttribute("contenteditable")||(p.contentEditable="false"),n.type.spec.draggable&&(p.draggable=!0));let f=p;return p=QD(p,r,n),u?l=new k$(t,n,r,i,p,_||null,f,u,o,s+1):n.isText?new um(t,n,r,i,p,f,o):new jo(t,n,r,i,p,_||null,f,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>Z.empty)}return t}matchesNode(t,n,r){return this.dirty==Fr&&t.eq(this.
Line truncated
|
||||
|
||||
`);return{dom:l,text:f,slice:t}}function tx(e,t,n,r,i){let o=i.parent.type.spec.code,s,a;if(!n&&!t)return null;let l=t&&(r||o||!n);if(l){if(e.someProp("transformPastedText",f=>{t=f(t,o||r,e)}),o)return t?new ae(Z.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
||||
`))),0,0):ae.empty;let _=e.someProp("clipboardTextParser",f=>f(t,i,r,e));if(_)a=_;else{let f=i.marks(),{schema:g}=e.state,h=la.fromSchema(g);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(E=>{let b=s.appendChild(document.createElement("p"));E&&b.appendChild(h.serializeNode(g.text(E,f)))})}}else e.someProp("transformPastedHTML",_=>{n=_(n,e)}),s=n2(n),Zu&&r2(s);let u=s&&s.querySelector("[data-pm-slice]"),p=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(p&&p[3])for(let _=+p[3];_>0;_--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||qc.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||p),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!J$.test(f.parentNode.nodeName)?{ignore:!0}:null}})),p)a=i2(zv(a,+p[1],+p[2]),p[4]);else if(a=ae.maxOpen(e2(a.content,i),!0),a.openStart||a.openEnd){let _=0,f=0;for(let g=a.content.firstChild;_<a.openStart&&!g.type.spec.isolating;_++,g=g.firstChild);for(let g=a.content.lastChild;f<a.openEnd&&!g.type.spec.isolating;f++,g=g.lastChild);a=zv(a,_,f)}return e.someProp("transformPasted",_=>{a=_(a,e)}),a}const J$=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function e2(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),o,s=[];if(e.forEach(a=>{if(!s)return;let l=i.findWrapping(a.type),u;if(!l)return s=null;if(u=s.length&&o.length&&rx(l,o,a,s[s.length-1],0))s[s.length-1]=u;else{s.length&&(s[s.length-1]=ix(s[s.length-1],o.length));let p=nx(a,l);s.push(p),i=i.matchType(p.type),o=l}}),s)return Z.from(s)}return e}function nx(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,Z.from(e));return e}function rx(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=rx(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(Z.from(nx(n,e,i+1))))}}function ix(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,ix(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(Z.empty,!0);return e.copy(n.append(r))}function AS(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(o=0),i<r-1&&(a=AS(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(Z.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function zv(e,t,n){return t<e.openStart&&(e=new ae(AS(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new ae(AS(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const ox={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Vv=null;function sx(){return Vv||(Vv=document.implementation.createHTMLDocument("title"))}let wh=null;function t2(e){let t=window.trustedTypes;return t?(wh||(wh=t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),wh.createHTML(e)):e}function n2(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=sx().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&ox[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=t2(e),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function r2(e){let t=e.querySelectorAll(En?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function i2(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:o,openEnd:s}=e;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=Z.from(l.create(r[a+1],i)),o++,s++}return new ae(i,o,s)}const Fn={},Bn={},o2={touchstart:!0,touchmove:!0};class s2{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function a2(e){for(let t in Fn){let n=Fn[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{c2(e,r)&&!pb(e,r)&&(e.editable||!(r.type in Bn))&&n(e,r)},o2[t]?{passive:!0}:void 0)}Un&&e.dom.addEventListener("input",()=>null),
Line truncated
|
||||
`).scrollIntoView()),!0)};function bx(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const lz=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=bx(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let a=n.after(),l=e.tr.replaceWith(a,a,s.createAndFill());l.setSelection(we.near(l.doc.resolve(a),1)),t(l.scrollIntoView())}return!0},cz=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof ti||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=bx(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=e.tr.insert(s,o.createAndFill());a.setSelection(Ce.create(a.doc,s+1)),t(a.scrollIntoView())}return!0},uz=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(il(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&wl(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},dz=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),t&&t(e.tr.setSelection(Re.create(e.doc,i))),!0)};function pz(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(i.isTextblock||us(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function yx(e,t,n,r){let i=t.nodeBefore,o=t.nodeAfter,s,a,l=i.type.spec.isolating||o.type.spec.isolating;if(!l&&pz(e,t,n))return!0;let u=!l&&t.parent.canReplace(t.index(),t.index()+1);if(u&&(s=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(n){let g=t.pos+o.nodeSize,h=Z.empty;for(let T=s.length-1;T>=0;T--)h=Z.from(s[T].create(null,h));h=Z.from(i.copy(h));let E=e.tr.step(new Xt(t.pos-1,g,t.pos,g,new ae(h,1,0),s.length,!0)),b=E.doc.resolve(g+2*s.length);b.nodeAfter&&b.nodeAfter.type==i.type&&us(E.doc,b.pos)&&E.join(b.pos),n(E.scrollIntoView())}return!0}let p=o.type.spec.isolating||r>0&&l?null:we.findFrom(t,1),_=p&&p.$from.blockRange(p.$to),f=_&&wl(_);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(_,f).scrollIntoView()),!0;if(u&&bl(o,"start",!0)&&bl(i,"end")){let g=i,h=[];for(;h.push(g),!g.isTextblock;)g=g.lastChild;let E=o,b=1;for(;!E.isTextblock;E=E.firstChild)b++;if(g.canReplace(g.childCount,g.childCount,E.content)){if(n){let T=Z.empty;for(let R=h.length-1;R>=0;R--)T=Z.from(h[R].copy(T));let y=e.tr.step(new Xt(t.pos-h.length,t.pos+o.nodeSize,t.pos+b,t.pos+o.nodeSize-b,new ae(T,h.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}function Cx(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(t.tr.setSelection(Ce.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const _z=Cx(-1),fz=Cx(1);function mz(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&sb(s,e,t);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function rO(e,t=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[o];n.doc.nodesBetween(s,a,(l,u)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(e,t)))if(l.type==e)i=!0;else{let p=n.doc.resolve(u),_=p.index();i=p.parent.canReplaceWith(_,_+1,e)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];o.setBlockType(a,l,e,t)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function gz(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o);if(!s)return!1;let a=r?n.tr:null;return hz(a,s,e,t)?(r&&r(a.scrollIntoView()),!0):!1}}function hz(e,t,n,r=null){let i=!1,o=t,s=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let l=s.resolve(t.start-2);o=new K_(l,l,t.depth),t.endIndex<t.parent.childCount&&(t=new K_(t.$from,s.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let a=sb(o,n,r,t);return a?(e&&Ez(e,t,a,i,n),!0):!1}function Ez(e,t,n,r,i){let o=Z.empty;for(let p=n.length-1;p>=0;p--)o=Z.from(n[p].type.create(n[p].attrs,o));e.step(new Xt(t.start-(r?2:0),t.end,t.start,t.end,new ae(o,0,0),n.length,!0));let s=0;for(let p=0;p<n.length;p++)n[p].type==i&&(s=p+1);let a=n.length-s,l=t.start+n.length-(r?2:0),u=t.parent;for(let p=t.startIndex,_=t.endIndex,f=!0;p<_;p++,f=!1)!f&&il(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=u.child(p).nodeSize;return e}function Sz(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type=
Line truncated
|
||||
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function wz(e){return Object.prototype.toString.call(e).slice(8,-1)}function Np(e){return wz(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function mm(e,t){const n={...e};return Np(e)&&Np(t)&&Object.keys(t).forEach(r=>{Np(t[r])&&Np(e[r])?n[r]=mm(e[r],t[r]):n[r]=t[r]}),n}class un{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Be(ge(this,"addOptions",{name:this.name}))),this.storage=Be(ge(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new un(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>mm(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new un(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Be(ge(n,"addOptions",{name:n.name})),n.storage=Be(ge(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const l=s.find(u=>(u==null?void 0:u.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}}function Dz(e){return typeof e=="number"}class xz{constructor(t){this.find=t.find,this.handler=t.handler}}const Mz=(e,t,n)=>{if(Sb(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=e,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function Lz(e){const{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=e,{commands:l,chain:u,can:p}=new _m({editor:t,state:n}),_=[];return n.doc.nodesBetween(r,i,(g,h)=>{if(!g.isTextblock||g.type.spec.code)return;const E=Math.max(r,h),b=Math.min(i,h+g.content.size),T=g.textBetween(E-h,b-h,void 0,"");Mz(T,o.find,s).forEach(R=>{if(R.index===void 0)return;const A=E+R.index+1,I=A+R[0].length,D={from:n.tr.mapping.map(A),to:n.tr.mapping.map(I)},M=o.handler({state:n,range:D,match:R,commands:l,chain:u,can:p,pasteEvent:s,dropEvent:a});_.push(M)})}),_.every(g=>g!==null)}const kz=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)===null||t===void 0||t.setData("text/html",e),n};function Pz(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:p,from:_,to:f,rule:g,pasteEvt:h})=>{const E=p.tr,b=pm({state:p,transaction:E});if(!(!Lz({editor:t,state:b,from:Math.max(_-1,0),to:f.b-1,rule:g,pasteEvent:h,dropEvent:a})||!E.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,E}};return n.map(p=>new Ze({view(_){const f=g=>{var h;r=!((h=_.dom.parentElement)===null||h===void 0)&&h.contains(g.target)?_.dom.parentElement:null};return window.addEventListener("dragstart",f),{destroy(){window.removeEventListener("dragstart",f)}}},props:{handleDOMEvents:{drop:(_,f)=>(o=r===_.dom.parentElement,a=f,!1),paste:(_,f)=>{var g;const h=(g=f.clipboardData)===null||g===void 0?void 0:g.getData("text/html");return s=f,i=!!(h!=null&&h.includes("data-pm-slice")),!1}}},appendTransaction:(_,f,g)=>{const h=_[0],E=h.getMeta("uiEvent")==="paste"&&!i,b=h.getMeta("uiEvent")==="drop"&&!o,T=h.getMeta("applyPasteRules"),y=!!T;if(!E&&!b&&!y)return;if(y){let{text:I}=T;typeof I=="string"?I=I:I=ed(Z.from(I),g.schema);const{from:D}=T,M=D+I.length,$=kz(I);return l({rule:p,state:g,from:D,to:{b:M},pasteEvt:$})}const R=f.doc.content.findDiffStart(g.doc.content),A=f.doc.content.findDiffEnd(g.doc.content);if(!(!Dz(R)||!A||R===A.b))return l({rule:p,state:g,from:R,to:A,pasteEvt:s})}}))}function Uz(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}class Qa{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=Qa.resolve(t),this.schema=vz(this.extensions,n),this.setupExtensions()}static resolve(t){const n=Qa.sort(Qa.flatten(t)),r=Uz(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'
Line truncated
|
||||
`))),0,0):ae.empty;let _=e.someProp("clipboardTextParser",f=>f(t,i,r,e));if(_)a=_;else{let f=i.marks(),{schema:g}=e.state,h=la.fromSchema(g);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(E=>{let b=s.appendChild(document.createElement("p"));E&&b.appendChild(h.serializeNode(g.text(E,f)))})}}else e.someProp("transformPastedHTML",_=>{n=_(n,e)}),s=n2(n),Zu&&r2(s);let u=s&&s.querySelector("[data-pm-slice]"),p=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(p&&p[3])for(let _=+p[3];_>0;_--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||qc.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||p),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!J$.test(f.parentNode.nodeName)?{ignore:!0}:null}})),p)a=i2(zv(a,+p[1],+p[2]),p[4]);else if(a=ae.maxOpen(e2(a.content,i),!0),a.openStart||a.openEnd){let _=0,f=0;for(let g=a.content.firstChild;_<a.openStart&&!g.type.spec.isolating;_++,g=g.firstChild);for(let g=a.content.lastChild;f<a.openEnd&&!g.type.spec.isolating;f++,g=g.lastChild);a=zv(a,_,f)}return e.someProp("transformPasted",_=>{a=_(a,e)}),a}const J$=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function e2(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),o,s=[];if(e.forEach(a=>{if(!s)return;let l=i.findWrapping(a.type),u;if(!l)return s=null;if(u=s.length&&o.length&&rx(l,o,a,s[s.length-1],0))s[s.length-1]=u;else{s.length&&(s[s.length-1]=ix(s[s.length-1],o.length));let p=nx(a,l);s.push(p),i=i.matchType(p.type),o=l}}),s)return Z.from(s)}return e}function nx(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,Z.from(e));return e}function rx(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=rx(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(Z.from(nx(n,e,i+1))))}}function ix(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,ix(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(Z.empty,!0);return e.copy(n.append(r))}function AS(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(o=0),i<r-1&&(a=AS(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(Z.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function zv(e,t,n){return t<e.openStart&&(e=new ae(AS(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new ae(AS(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const ox={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Vv=null;function sx(){return Vv||(Vv=document.implementation.createHTMLDocument("title"))}let wh=null;function t2(e){let t=window.trustedTypes;return t?(wh||(wh=t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),wh.createHTML(e)):e}function n2(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=sx().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&ox[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=t2(e),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function r2(e){let t=e.querySelectorAll(En?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function i2(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:o,openEnd:s}=e;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=Z.from(l.create(r[a+1],i)),o++,s++}return new ae(i,o,s)}const Bn={},Gn={},o2={touchstart:!0,touchmove:!0};class s2{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function a2(e){for(let t in Bn){let n=Bn[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{c2(e,r)&&!pb(e,r)&&(e.editable||!(r.type in Gn))&&n(e,r)},o2[t]?{passive:!0}:void 0)}Fn&&e.dom.addEventListener("input",()=>null),
Line truncated
|
||||
`).scrollIntoView()),!0)};function bx(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const lz=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=bx(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let a=n.after(),l=e.tr.replaceWith(a,a,s.createAndFill());l.setSelection(we.near(l.doc.resolve(a),1)),t(l.scrollIntoView())}return!0},cz=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof ti||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=bx(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=e.tr.insert(s,o.createAndFill());a.setSelection(Ce.create(a.doc,s+1)),t(a.scrollIntoView())}return!0},uz=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(il(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&wl(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},dz=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),t&&t(e.tr.setSelection(Re.create(e.doc,i))),!0)};function pz(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(i.isTextblock||us(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function yx(e,t,n,r){let i=t.nodeBefore,o=t.nodeAfter,s,a,l=i.type.spec.isolating||o.type.spec.isolating;if(!l&&pz(e,t,n))return!0;let u=!l&&t.parent.canReplace(t.index(),t.index()+1);if(u&&(s=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(n){let g=t.pos+o.nodeSize,h=Z.empty;for(let T=s.length-1;T>=0;T--)h=Z.from(s[T].create(null,h));h=Z.from(i.copy(h));let E=e.tr.step(new Xt(t.pos-1,g,t.pos,g,new ae(h,1,0),s.length,!0)),b=E.doc.resolve(g+2*s.length);b.nodeAfter&&b.nodeAfter.type==i.type&&us(E.doc,b.pos)&&E.join(b.pos),n(E.scrollIntoView())}return!0}let p=o.type.spec.isolating||r>0&&l?null:we.findFrom(t,1),_=p&&p.$from.blockRange(p.$to),f=_&&wl(_);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(_,f).scrollIntoView()),!0;if(u&&bl(o,"start",!0)&&bl(i,"end")){let g=i,h=[];for(;h.push(g),!g.isTextblock;)g=g.lastChild;let E=o,b=1;for(;!E.isTextblock;E=E.firstChild)b++;if(g.canReplace(g.childCount,g.childCount,E.content)){if(n){let T=Z.empty;for(let R=h.length-1;R>=0;R--)T=Z.from(h[R].copy(T));let y=e.tr.step(new Xt(t.pos-h.length,t.pos+o.nodeSize,t.pos+b,t.pos+o.nodeSize-b,new ae(T,h.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}function Cx(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(t.tr.setSelection(Ce.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const _z=Cx(-1),fz=Cx(1);function mz(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&sb(s,e,t);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function rO(e,t=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[o];n.doc.nodesBetween(s,a,(l,u)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(e,t)))if(l.type==e)i=!0;else{let p=n.doc.resolve(u),_=p.index();i=p.parent.canReplaceWith(_,_+1,e)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];o.setBlockType(a,l,e,t)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function gz(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o);if(!s)return!1;let a=r?n.tr:null;return hz(a,s,e,t)?(r&&r(a.scrollIntoView()),!0):!1}}function hz(e,t,n,r=null){let i=!1,o=t,s=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let l=s.resolve(t.start-2);o=new K_(l,l,t.depth),t.endIndex<t.parent.childCount&&(t=new K_(t.$from,s.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let a=sb(o,n,r,t);return a?(e&&Ez(e,t,a,i,n),!0):!1}function Ez(e,t,n,r,i){let o=Z.empty;for(let p=n.length-1;p>=0;p--)o=Z.from(n[p].type.create(n[p].attrs,o));e.step(new Xt(t.start-(r?2:0),t.end,t.start,t.end,new ae(o,0,0),n.length,!0));let s=0;for(let p=0;p<n.length;p++)n[p].type==i&&(s=p+1);let a=n.length-s,l=t.start+n.length-(r?2:0),u=t.parent;for(let p=t.startIndex,_=t.endIndex,f=!0;p<_;p++,f=!1)!f&&il(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=u.child(p).nodeSize;return e}function Sz(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type=
Line truncated
|
||||
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function wz(e){return Object.prototype.toString.call(e).slice(8,-1)}function Np(e){return wz(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function mm(e,t){const n={...e};return Np(e)&&Np(t)&&Object.keys(t).forEach(r=>{Np(t[r])&&Np(e[r])?n[r]=mm(e[r],t[r]):n[r]=t[r]}),n}class un{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Be(ge(this,"addOptions",{name:this.name}))),this.storage=Be(ge(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new un(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>mm(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new un(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Be(ge(n,"addOptions",{name:n.name})),n.storage=Be(ge(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const l=s.find(u=>(u==null?void 0:u.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}}function Dz(e){return typeof e=="number"}class xz{constructor(t){this.find=t.find,this.handler=t.handler}}const Mz=(e,t,n)=>{if(Sb(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=e,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function Lz(e){const{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=e,{commands:l,chain:u,can:p}=new _m({editor:t,state:n}),_=[];return n.doc.nodesBetween(r,i,(g,h)=>{if(!g.isTextblock||g.type.spec.code)return;const E=Math.max(r,h),b=Math.min(i,h+g.content.size),T=g.textBetween(E-h,b-h,void 0,"");Mz(T,o.find,s).forEach(R=>{if(R.index===void 0)return;const O=E+R.index+1,I=O+R[0].length,D={from:n.tr.mapping.map(O),to:n.tr.mapping.map(I)},M=o.handler({state:n,range:D,match:R,commands:l,chain:u,can:p,pasteEvent:s,dropEvent:a});_.push(M)})}),_.every(g=>g!==null)}const kz=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)===null||t===void 0||t.setData("text/html",e),n};function Pz(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:p,from:_,to:f,rule:g,pasteEvt:h})=>{const E=p.tr,b=pm({state:p,transaction:E});if(!(!Lz({editor:t,state:b,from:Math.max(_-1,0),to:f.b-1,rule:g,pasteEvent:h,dropEvent:a})||!E.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,E}};return n.map(p=>new Xe({view(_){const f=g=>{var h;r=!((h=_.dom.parentElement)===null||h===void 0)&&h.contains(g.target)?_.dom.parentElement:null};return window.addEventListener("dragstart",f),{destroy(){window.removeEventListener("dragstart",f)}}},props:{handleDOMEvents:{drop:(_,f)=>(o=r===_.dom.parentElement,a=f,!1),paste:(_,f)=>{var g;const h=(g=f.clipboardData)===null||g===void 0?void 0:g.getData("text/html");return s=f,i=!!(h!=null&&h.includes("data-pm-slice")),!1}}},appendTransaction:(_,f,g)=>{const h=_[0],E=h.getMeta("uiEvent")==="paste"&&!i,b=h.getMeta("uiEvent")==="drop"&&!o,T=h.getMeta("applyPasteRules"),y=!!T;if(!E&&!b&&!y)return;if(y){let{text:I}=T;typeof I=="string"?I=I:I=ed(Z.from(I),g.schema);const{from:D}=T,M=D+I.length,$=kz(I);return l({rule:p,state:g,from:D,to:{b:M},pasteEvt:$})}const R=f.doc.content.findDiffStart(g.doc.content),O=f.doc.content.findDiffEnd(g.doc.content);if(!(!Dz(R)||!O||R===O.b))return l({rule:p,state:g,from:R,to:O,pasteEvt:s})}}))}function Uz(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}class Qa{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=Qa.resolve(t),this.schema=vz(this.extensions,n),this.setupExtensions()}static resolve(t){const n=Qa.sort(Qa.flatten(t)),r=Uz(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'
Line truncated
|
||||
|
||||
`,textSerializers:s={}}=n||{};let a="";return e.nodesBetween(r,i,(l,u,p,_)=>{var f;l.isBlock&&u>r&&(a+=o);const g=s==null?void 0:s[l.type.name];if(g)return p&&(a+=g({node:l,pos:u,parent:p,index:_,range:t})),!1;l.isText&&(a+=(f=l==null?void 0:l.text)===null||f===void 0?void 0:f.slice(Math.max(r,u)-u,i-u))}),a}function Ox(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const Fz=Tt.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Ze({key:new Ke("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map(p=>p.$from.pos)),a=Math.max(...o.map(p=>p.$to.pos)),l=Ox(n);return vx(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),Bz=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),Gz=(e=!1)=>({commands:t})=>t.setContent("",e),Yz=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{e.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:p}=t,_=u.resolve(p.map(l)),f=u.resolve(p.map(l+a.nodeSize)),g=_.blockRange(f);if(!g)return;const h=wl(g);if(a.type.isTextblock){const{defaultType:E}=_.parent.contentMatchAt(_.index());t.setNodeMarkup(g.start,E)}(h||h===0)&&t.lift(g,h)})}),!0},Hz=e=>t=>e(t),$z=()=>({state:e,dispatch:t})=>cz(e,t),zz=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const s=r.mapping.map(t);return r.insert(s,o.content),r.setSelection(new Ce(r.doc.resolve(s-1))),!0},Vz=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(t){const a=i.before(o),l=i.after(o);e.delete(a,l).scrollIntoView()}return!0}return!1},Wz=e=>({tr:t,state:n,dispatch:r})=>{const i=Jt(e,n.schema),o=t.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const l=o.before(s),u=o.after(s);t.delete(l,u).scrollIntoView()}return!0}return!1},qz=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},Kz=()=>({state:e,dispatch:t})=>X2(e,t),Qz=()=>({commands:e})=>e.keyboardShortcut("Enter"),jz=()=>({state:e,dispatch:t})=>lz(e,t);function rf(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:Sb(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function Ax(e,t,n={}){return e.find(r=>r.type===t&&rf(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function aO(e,t,n={}){return!!Ax(e,t,n)}function Tb(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if((!i.node||!i.node.marks.some(p=>p.type===t))&&(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some(p=>p.type===t)||(n=n||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!Ax([...i.node.marks],t,n)))return;let s=i.index,a=e.start()+i.offset,l=s+1,u=a+i.node.nodeSize;for(;s>0&&aO([...e.parent.child(s-1).marks],t,n);)s-=1,a-=e.parent.child(s).nodeSize;for(;l<e.parent.childCount&&aO([...e.parent.child(l).marks],t,n);)u+=e.parent.child(l).nodeSize,l+=1;return{from:a,to:u}}function ps(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}const Xz=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=ps(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:u,to:p}=a;if(i){const _=Tb(l,o,t);if(_&&_.from<=u&&_.to>=p){const f=Ce.create(s,_.from,_.to);n.setSelection(f)}}return!0},Zz=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function Ix(e){return e instanceof Ce}function ko(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function wx(e,t=null){if(!t)return null;const n=we.atStart(e),r=we.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,o=r.to;return t==="all"?Ce.create(e,ko(0,i,o),ko(e.content.size,i,o)):Ce.create(e,ko(t,i,o),ko(t,i,o))}function gm(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const Jz=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const s=()=>{gm()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&e===null||e===!1)return!0;if(o&&e===null&&!Ix(n.state.selection))return s(),!0;const a=wx(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},eV=(e,t)=>n=>e.every((r,i)=>t
Line truncated
|
||||
`,textSerializers:s={}}=n||{};let a="";return e.nodesBetween(r,i,(l,u,p,_)=>{var f;l.isBlock&&u>r&&(a+=o);const g=s==null?void 0:s[l.type.name];if(g)return p&&(a+=g({node:l,pos:u,parent:p,index:_,range:t})),!1;l.isText&&(a+=(f=l==null?void 0:l.text)===null||f===void 0?void 0:f.slice(Math.max(r,u)-u,i-u))}),a}function Ox(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const Fz=Tt.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Xe({key:new Ke("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map(p=>p.$from.pos)),a=Math.max(...o.map(p=>p.$to.pos)),l=Ox(n);return vx(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),Bz=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),Gz=(e=!1)=>({commands:t})=>t.setContent("",e),Yz=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{e.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:p}=t,_=u.resolve(p.map(l)),f=u.resolve(p.map(l+a.nodeSize)),g=_.blockRange(f);if(!g)return;const h=wl(g);if(a.type.isTextblock){const{defaultType:E}=_.parent.contentMatchAt(_.index());t.setNodeMarkup(g.start,E)}(h||h===0)&&t.lift(g,h)})}),!0},Hz=e=>t=>e(t),$z=()=>({state:e,dispatch:t})=>cz(e,t),zz=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const s=r.mapping.map(t);return r.insert(s,o.content),r.setSelection(new Ce(r.doc.resolve(s-1))),!0},Vz=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(t){const a=i.before(o),l=i.after(o);e.delete(a,l).scrollIntoView()}return!0}return!1},Wz=e=>({tr:t,state:n,dispatch:r})=>{const i=Jt(e,n.schema),o=t.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const l=o.before(s),u=o.after(s);t.delete(l,u).scrollIntoView()}return!0}return!1},qz=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},Kz=()=>({state:e,dispatch:t})=>X2(e,t),Qz=()=>({commands:e})=>e.keyboardShortcut("Enter"),jz=()=>({state:e,dispatch:t})=>lz(e,t);function rf(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:Sb(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function Ax(e,t,n={}){return e.find(r=>r.type===t&&rf(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function aO(e,t,n={}){return!!Ax(e,t,n)}function Tb(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if((!i.node||!i.node.marks.some(p=>p.type===t))&&(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some(p=>p.type===t)||(n=n||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!Ax([...i.node.marks],t,n)))return;let s=i.index,a=e.start()+i.offset,l=s+1,u=a+i.node.nodeSize;for(;s>0&&aO([...e.parent.child(s-1).marks],t,n);)s-=1,a-=e.parent.child(s).nodeSize;for(;l<e.parent.childCount&&aO([...e.parent.child(l).marks],t,n);)u+=e.parent.child(l).nodeSize,l+=1;return{from:a,to:u}}function ps(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}const Xz=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=ps(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:u,to:p}=a;if(i){const _=Tb(l,o,t);if(_&&_.from<=u&&_.to>=p){const f=Ce.create(s,_.from,_.to);n.setSelection(f)}}return!0},Zz=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function Ix(e){return e instanceof Ce}function ko(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function wx(e,t=null){if(!t)return null;const n=we.atStart(e),r=we.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,o=r.to;return t==="all"?Ce.create(e,ko(0,i,o),ko(e.content.size,i,o)):Ce.create(e,ko(t,i,o),ko(t,i,o))}function gm(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const Jz=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const s=()=>{gm()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&e===null||e===!1)return!0;if(o&&e===null&&!Ix(n.state.selection))return s(),!0;const a=wx(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},eV=(e,t)=>n=>e.every((r,i)=>t
Line truncated
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ img.ProseMirror-separator {
|
||||
opacity: 0
|
||||
}`;function pW(e,t,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return t&&i.setAttribute("nonce",t),i.setAttribute("data-tiptap-style",""),i.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(i),i}class kx extends Cz{constructor(t={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:i})=>this.options.onDrop(n,r,i)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=pW(dW,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,n=!0){this.setOptions({editable:t}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,n){const r=Nx(n)?n(t,[...this.state.plugins]):[...this.state.plugins,t],i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}unregisterPlugin(t){if(this.isDestroyed)return;const n=this.state.plugins;let r=n;if([].concat(t).forEach(o=>{const s=typeof o=="string"?`${o}$`:o.key;r=n.filter(a=>!a.key.startsWith(s))}),n.length===r.length)return;const i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}createExtensionManager(){var t,n;const i=[...this.options.enableCoreExtensions?[sW,Fz.configure({blockSeparator:(n=(t=this.options.coreExtensionOptions)===null||t===void 0?void 0:t.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),iW,aW,lW,uW,oW,cW].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new Qa(i,this)}createCommandManager(){this.commandManager=new _m({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var t;let n;try{n=wS(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(s){if(!(s instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(s.message))throw s;this.emit("contentError",{editor:this,error:s,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(a=>a.name!=="collaboration"),this.createExtensionManager()}}),n=wS(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const r=wx(n,this.options.autofocus);this.view=new Y2(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(t=this.options.editorProps)===null||t===void 0?void 0:t.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:Ka.create({doc:n,selection:r||void 0})});const i=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(i),this.createNodeViews(),this.prependClass();const o=this.view.dom;o.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isC
Line truncated
|
||||
|
||||
`,textSerializers:r={}}=t||{};return DV(this.state.doc,{blockSeparator:n,textSerializers:{...Ox(this.schema),...r}})}get isEmpty(){return Rb(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const t=this.view.dom;t&&t.editor&&delete t.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var t;return!(!((t=this.view)===null||t===void 0)&&t.docView)}$node(t,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(t,n))||null}$nodes(t,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(t,n))||null}$pos(t){const n=this.state.doc.resolve(t);return new Ds(n,this)}get $doc(){return this.$pos(0)}}function ra(e){return new td({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Be(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,s=r[r.length-1],a=r[0];if(s){const l=a.search(/\S/),u=n.from+a.indexOf(s),p=u+s.length;if(Cb(n.from,n.to,t.doc).filter(g=>g.mark.type.excluded.find(E=>E===e.type&&E!==g.mark.type)).filter(g=>g.to>u).length)return null;p<n.to&&o.delete(p,n.to),u>n.from&&o.delete(n.from+l,u);const f=n.from+l+s.length;o.addMark(n.from+l,f,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function Px(e){return new td({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Be(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from;let a=n.to;const l=e.type.create(i);if(r[1]){const u=r[0].lastIndexOf(r[1]);let p=s+u;p>a?p=a:a=p+r[1].length;const _=r[0][r[0].length-1];o.insertText(_,s+r[0].length-1),o.replaceWith(p,a,l)}else if(r[0]){const u=e.type.isInline?s:s-1;o.insert(u,e.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()}})}function MS(e){return new td({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=Be(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function Dt(e){return new td({find:e.find,handler:({state:t,range:n,match:r})=>{let i=e.replace,o=n.from;const s=n.to;if(r[1]){const a=r[0].lastIndexOf(r[1]);i+=r[0].slice(a+r[1].length),o+=a;const l=o-s;l>0&&(i=r[0].slice(a-l,a)+i,o=s)}t.tr.insertText(i,o,s)}})}function wu(e){return new td({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const o=Be(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),u=l&&sb(l,e.type,o);if(!u)return null;if(s.wrap(l,u),e.keepMarks&&e.editor){const{selection:_,storedMarks:f}=t,{splittableMarks:g}=e.editor.extensionManager,h=f||_.$to.parentOffset&&_.$from.marks();if(h){const E=h.filter(b=>g.includes(b.type.name));s.ensureMarks(E)}}if(e.keepAttributes){const _=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(_,o).run()}const p=s.doc.resolve(n.from-1).nodeBefore;p&&p.type===e.type&&us(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,p))&&s.join(n.from-1)}})}class ot{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Be(ge(this,"addOptions",{name:this.name}))),this.storage=Be(ge(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new ot(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>mm(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new ot(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Be(ge(n,"addOptions",{name:n.name})),n.storage=Be(ge(n,"addStorage",{name:n.name,options:n.options})),n}}function _W(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}class fW{constructor(t,n,r){this.isDragging=!1,this.component=t,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.innerDecorations=n.innerDecorations,this.view=n.view,this.HTMLAttributes=n.HTMLAttributes,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(t){var n,r,i,o,s,a,l;const{view:u}=this.editor,p=t.target,_=p.nodeType===3?(n=p.parentElement)===null||n===void 0?
Line truncated
|
||||
`,textSerializers:r={}}=t||{};return DV(this.state.doc,{blockSeparator:n,textSerializers:{...Ox(this.schema),...r}})}get isEmpty(){return Rb(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const t=this.view.dom;t&&t.editor&&delete t.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var t;return!(!((t=this.view)===null||t===void 0)&&t.docView)}$node(t,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(t,n))||null}$nodes(t,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(t,n))||null}$pos(t){const n=this.state.doc.resolve(t);return new Ds(n,this)}get $doc(){return this.$pos(0)}}function ra(e){return new td({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Be(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,s=r[r.length-1],a=r[0];if(s){const l=a.search(/\S/),u=n.from+a.indexOf(s),p=u+s.length;if(Cb(n.from,n.to,t.doc).filter(g=>g.mark.type.excluded.find(E=>E===e.type&&E!==g.mark.type)).filter(g=>g.to>u).length)return null;p<n.to&&o.delete(p,n.to),u>n.from&&o.delete(n.from+l,u);const f=n.from+l+s.length;o.addMark(n.from+l,f,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function Px(e){return new td({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Be(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from;let a=n.to;const l=e.type.create(i);if(r[1]){const u=r[0].lastIndexOf(r[1]);let p=s+u;p>a?p=a:a=p+r[1].length;const _=r[0][r[0].length-1];o.insertText(_,s+r[0].length-1),o.replaceWith(p,a,l)}else if(r[0]){const u=e.type.isInline?s:s-1;o.insert(u,e.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()}})}function MS(e){return new td({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=Be(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function Dt(e){return new td({find:e.find,handler:({state:t,range:n,match:r})=>{let i=e.replace,o=n.from;const s=n.to;if(r[1]){const a=r[0].lastIndexOf(r[1]);i+=r[0].slice(a+r[1].length),o+=a;const l=o-s;l>0&&(i=r[0].slice(a-l,a)+i,o=s)}t.tr.insertText(i,o,s)}})}function wu(e){return new td({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const o=Be(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),u=l&&sb(l,e.type,o);if(!u)return null;if(s.wrap(l,u),e.keepMarks&&e.editor){const{selection:_,storedMarks:f}=t,{splittableMarks:g}=e.editor.extensionManager,h=f||_.$to.parentOffset&&_.$from.marks();if(h){const E=h.filter(b=>g.includes(b.type.name));s.ensureMarks(E)}}if(e.keepAttributes){const _=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(_,o).run()}const p=s.doc.resolve(n.from-1).nodeBefore;p&&p.type===e.type&&us(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,p))&&s.join(n.from-1)}})}class ot{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Be(ge(this,"addOptions",{name:this.name}))),this.storage=Be(ge(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new ot(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>mm(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new ot(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Be(ge(n,"addOptions",{name:n.name})),n.storage=Be(ge(n,"addStorage",{name:n.name,options:n.options})),n}}function _W(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}class fW{constructor(t,n,r){this.isDragging=!1,this.component=t,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.innerDecorations=n.innerDecorations,this.view=n.view,this.HTMLAttributes=n.HTMLAttributes,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(t){var n,r,i,o,s,a,l;const{view:u}=this.editor,p=t.target,_=p.nodeType===3?(n=p.parentElement)===null||n===void 0?
Line truncated
|
||||
* @license React
|
||||
* use-sync-external-store-shim.production.min.js
|
||||
*
|
||||
@@ -133,7 +133,7 @@ img.ProseMirror-separator {
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var dO;function hW(){if(dO)return Fh;dO=1;var e=Xe;function t(_,f){return _===f&&(_!==0||1/_===1/f)||_!==_&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(_,f){var g=f(),h=r({inst:{value:g,getSnapshot:f}}),E=h[0].inst,b=h[1];return o(function(){E.value=g,E.getSnapshot=f,l(E)&&b({inst:E})},[_,g,f]),i(function(){return l(E)&&b({inst:E}),_(function(){l(E)&&b({inst:E})})},[_]),s(g),g}function l(_){var f=_.getSnapshot;_=_.value;try{var g=f();return!n(_,g)}catch{return!0}}function u(_,f){return f()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return Fh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Fh}Ux.exports=hW();var Nb=Ux.exports;const EW=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},SW=({contentComponent:e})=>{const t=Nb.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return Xe.createElement(Xe.Fragment,null,Object.values(t))};function TW(){const e=new Set;let t={};return{subscribe(n){return e.add(n),()=>{e.delete(n)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:fH.createPortal(r.reactElement,r.element,n)},e.forEach(i=>i())},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach(i=>i())}}}class bW extends Xe.Component{constructor(t){var n;super(t),this.editorContentRef=Xe.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=t.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const t=this.props.editor;if(t&&!t.isDestroyed&&t.options.element){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.options.element.childNodes),t.setOptions({element:n}),t.contentComponent=TW(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const t=this.props.editor;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null,!t.options.element.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:t,innerRef:n,...r}=this.props;return Xe.createElement(Xe.Fragment,null,Xe.createElement("div",{ref:EW(n,this.editorContentRef),...r}),(t==null?void 0:t.contentComponent)&&Xe.createElement(SW,{contentComponent:t.contentComponent}))}}const yW=P.forwardRef((e,t)=>{const n=Xe.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return Xe.createElement(bW,{key:n,innerRef:t,...e})}),CW=Xe.memo(yW);var RW=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;for(i of t.entries())if(!e(i[1],n.get(i[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(t[i]!==n[i])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(o=Object.keys(t),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!(s==="_owner"&&t.$$typeof)&&!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n},NW=gW(RW),Fx={exports:{}},Bh={};/**
|
||||
*/var dO;function hW(){if(dO)return Fh;dO=1;var e=rt;function t(_,f){return _===f&&(_!==0||1/_===1/f)||_!==_&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(_,f){var g=f(),h=r({inst:{value:g,getSnapshot:f}}),E=h[0].inst,b=h[1];return o(function(){E.value=g,E.getSnapshot=f,l(E)&&b({inst:E})},[_,g,f]),i(function(){return l(E)&&b({inst:E}),_(function(){l(E)&&b({inst:E})})},[_]),s(g),g}function l(_){var f=_.getSnapshot;_=_.value;try{var g=f();return!n(_,g)}catch{return!0}}function u(_,f){return f()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return Fh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Fh}Ux.exports=hW();var Nb=Ux.exports;const EW=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},SW=({contentComponent:e})=>{const t=Nb.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return rt.createElement(rt.Fragment,null,Object.values(t))};function TW(){const e=new Set;let t={};return{subscribe(n){return e.add(n),()=>{e.delete(n)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:fH.createPortal(r.reactElement,r.element,n)},e.forEach(i=>i())},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach(i=>i())}}}class bW extends rt.Component{constructor(t){var n;super(t),this.editorContentRef=rt.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=t.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const t=this.props.editor;if(t&&!t.isDestroyed&&t.options.element){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.options.element.childNodes),t.setOptions({element:n}),t.contentComponent=TW(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const t=this.props.editor;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null,!t.options.element.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:t,innerRef:n,...r}=this.props;return rt.createElement(rt.Fragment,null,rt.createElement("div",{ref:EW(n,this.editorContentRef),...r}),(t==null?void 0:t.contentComponent)&&rt.createElement(SW,{contentComponent:t.contentComponent}))}}const yW=k.forwardRef((e,t)=>{const n=rt.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return rt.createElement(bW,{key:n,innerRef:t,...e})}),CW=rt.memo(yW);var RW=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;for(i of t.entries())if(!e(i[1],n.get(i[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(t[i]!==n[i])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(o=Object.keys(t),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!(s==="_owner"&&t.$$typeof)&&!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n},NW=gW(RW),Fx={exports:{}},Bh={};/**
|
||||
* @license React
|
||||
* use-sync-external-store-shim/with-selector.production.min.js
|
||||
*
|
||||
@@ -141,65 +141,65 @@ img.ProseMirror-separator {
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var pO;function vW(){if(pO)return Bh;pO=1;var e=Xe,t=Nb;function n(u,p){return u===p&&(u!==0||1/u===1/p)||u!==u&&p!==p}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Bh.useSyncExternalStoreWithSelector=function(u,p,_,f,g){var h=o(null);if(h.current===null){var E={hasValue:!1,value:null};h.current=E}else E=h.current;h=a(function(){function T(D){if(!y){if(y=!0,R=D,D=f(D),g!==void 0&&E.hasValue){var M=E.value;if(g(M,D))return A=M}return A=D}if(M=A,r(R,D))return M;var $=f(D);return g!==void 0&&g(M,$)?M:(R=D,A=$)}var y=!1,R,A,I=_===void 0?null:_;return[function(){return T(p())},I===null?void 0:function(){return T(I())}]},[p,_,f,g]);var b=i(u,h[0],h[1]);return s(function(){E.hasValue=!0,E.value=b},[b]),l(b),b},Bh}Fx.exports=vW();var OW=Fx.exports;const AW=typeof window<"u"?P.useLayoutEffect:P.useEffect;class IW{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const n=()=>{this.transactionNumber+=1,this.subscribers.forEach(i=>i())},r=this.editor;return r.on("transaction",n),()=>{r.off("transaction",n)}}}}function wW(e){var t;const[n]=P.useState(()=>new IW(e.editor)),r=OW.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!==null&&t!==void 0?t:NW);return AW(()=>n.watch(e.editor),[e.editor,n]),P.useDebugValue(r),r}const DW=!1,LS=typeof window>"u",xW=LS||!!(typeof window<"u"&&window.next);class MW{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return LS||xW?null:this.createEditor();if(this.options.current.immediatelyRender&&LS&&DW)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const t={...this.options.current,onBeforeCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onBeforeCreate)===null||o===void 0?void 0:o.call(i,...r)},onBlur:(...r)=>{var i,o;return(o=(i=this.options.current).onBlur)===null||o===void 0?void 0:o.call(i,...r)},onCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onCreate)===null||o===void 0?void 0:o.call(i,...r)},onDestroy:(...r)=>{var i,o;return(o=(i=this.options.current).onDestroy)===null||o===void 0?void 0:o.call(i,...r)},onFocus:(...r)=>{var i,o;return(o=(i=this.options.current).onFocus)===null||o===void 0?void 0:o.call(i,...r)},onSelectionUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onSelectionUpdate)===null||o===void 0?void 0:o.call(i,...r)},onTransaction:(...r)=>{var i,o;return(o=(i=this.options.current).onTransaction)===null||o===void 0?void 0:o.call(i,...r)},onUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onUpdate)===null||o===void 0?void 0:o.call(i,...r)},onContentError:(...r)=>{var i,o;return(o=(i=this.options.current).onContentError)===null||o===void 0?void 0:o.call(i,...r)},onDrop:(...r)=>{var i,o;return(o=(i=this.options.current).onDrop)===null||o===void 0?void 0:o.call(i,...r)},onPaste:(...r)=>{var i,o;return(o=(i=this.options.current).onPaste)===null||o===void 0?void 0:o.call(i,...r)}};return new kx(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?this.editor.setOptions({...this.options.curreLine truncated
|
||||
*/var pO;function vW(){if(pO)return Bh;pO=1;var e=rt,t=Nb;function n(u,p){return u===p&&(u!==0||1/u===1/p)||u!==u&&p!==p}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Bh.useSyncExternalStoreWithSelector=function(u,p,_,f,g){var h=o(null);if(h.current===null){var E={hasValue:!1,value:null};h.current=E}else E=h.current;h=a(function(){function T(D){if(!y){if(y=!0,R=D,D=f(D),g!==void 0&&E.hasValue){var M=E.value;if(g(M,D))return O=M}return O=D}if(M=O,r(R,D))return M;var $=f(D);return g!==void 0&&g(M,$)?M:(R=D,O=$)}var y=!1,R,O,I=_===void 0?null:_;return[function(){return T(p())},I===null?void 0:function(){return T(I())}]},[p,_,f,g]);var b=i(u,h[0],h[1]);return s(function(){E.hasValue=!0,E.value=b},[b]),l(b),b},Bh}Fx.exports=vW();var OW=Fx.exports;const AW=typeof window<"u"?k.useLayoutEffect:k.useEffect;class IW{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const n=()=>{this.transactionNumber+=1,this.subscribers.forEach(i=>i())},r=this.editor;return r.on("transaction",n),()=>{r.off("transaction",n)}}}}function wW(e){var t;const[n]=k.useState(()=>new IW(e.editor)),r=OW.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!==null&&t!==void 0?t:NW);return AW(()=>n.watch(e.editor),[e.editor,n]),k.useDebugValue(r),r}const DW=!1,LS=typeof window>"u",xW=LS||!!(typeof window<"u"&&window.next);class MW{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return LS||xW?null:this.createEditor();if(this.options.current.immediatelyRender&&LS&&DW)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const t={...this.options.current,onBeforeCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onBeforeCreate)===null||o===void 0?void 0:o.call(i,...r)},onBlur:(...r)=>{var i,o;return(o=(i=this.options.current).onBlur)===null||o===void 0?void 0:o.call(i,...r)},onCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onCreate)===null||o===void 0?void 0:o.call(i,...r)},onDestroy:(...r)=>{var i,o;return(o=(i=this.options.current).onDestroy)===null||o===void 0?void 0:o.call(i,...r)},onFocus:(...r)=>{var i,o;return(o=(i=this.options.current).onFocus)===null||o===void 0?void 0:o.call(i,...r)},onSelectionUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onSelectionUpdate)===null||o===void 0?void 0:o.call(i,...r)},onTransaction:(...r)=>{var i,o;return(o=(i=this.options.current).onTransaction)===null||o===void 0?void 0:o.call(i,...r)},onUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onUpdate)===null||o===void 0?void 0:o.call(i,...r)},onContentError:(...r)=>{var i,o;return(o=(i=this.options.current).onContentError)===null||o===void 0?void 0:o.call(i,...r)},onDrop:(...r)=>{var i,o;return(o=(i=this.options.current).onDrop)===null||o===void 0?void 0:o.call(i,...r)},onPaste:(...r)=>{var i,o;return(o=(i=this.options.current).onPaste)===null||o===void 0?void 0:o.call(i,...r)}};return new kx(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?this.editor.setOptions({...this.options.curreLine truncated
|
||||
* @license
|
||||
* Lodash <https://lodash.com/>
|
||||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||||
* Released under MIT license <https://lodash.com/license>
|
||||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||
*/sf.exports;(function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,p="__lodash_placeholder__",_=1,f=2,g=4,h=1,E=2,b=1,T=2,y=4,R=8,A=16,I=32,D=64,M=128,$=256,H=512,B=30,se="...",de=800,pe=16,ce=1,ee=2,ue=3,L=1/0,w=9007199254740991,G=17976931348623157e292,q=NaN,V=4294967295,te=V-1,Ee=V>>>1,be=[["ary",M],["bind",b],["bindKey",T],["curry",R],["curryRight",A],["flip",H],["partial",I],["partialRight",D],["rearg",$]],ye="[object Arguments]",Ie="[object Array]",tt="[object AsyncFunction]",Ft="[object Boolean]",De="[object Date]",xt="[object DOMException]",Nn="[object Error]",Te="[object Function]",si="[object GeneratorFunction]",pt="[object Map]",vn="[object Number]",nt="[object Null]",en="[object Object]",Qe="[object Promise]",ne="[object Proxy]",On="[object RegExp]",Ae="[object Set]",Se="[object String]",An="[object Symbol]",zt="[object Undefined]",Hn="[object WeakMap]",ai="[object WeakSet]",z="[object ArrayBuffer]",Q="[object DataView]",oe="[object Float32Array]",me="[object Float64Array]",Ge="[object Int8Array]",ht="[object Int16Array]",ro="[object Int32Array]",io="[object Uint8Array]",sd="[object Uint8ClampedArray]",ad="[object Uint16Array]",ld="[object Uint32Array]",sy=/\b__p \+= '';/g,ay=/\b(__p \+=) '' \+/g,ly=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Om=/&(?:amp|lt|gt|quot|#39);/g,Am=/[&<>"']/g,cy=RegExp(Om.source),uy=RegExp(Am.source),dy=/<%-([\s\S]+?)%>/g,py=/<%([\s\S]+?)%>/g,Im=/<%=([\s\S]+?)%>/g,_y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fy=/^\w*$/,my=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,cd=/[\\^$.*+?()[\]{}|]/g,gy=RegExp(cd.source),ud=/^\s+/,hy=/\s/,Ey=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Sy=/\{\n\/\* \[wrapped with (.+)\] \*/,Ty=/,? & /,by=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,yy=/[()=,{}\[\]\/\s]/,Cy=/\\(\\)?/g,Ry=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,wm=/\w*$/,Ny=/^[-+]0x[0-9a-f]+$/i,vy=/^0b[01]+$/i,Oy=/^\[object .+?Constructor\]$/,Ay=/^0o[0-7]+$/i,Iy=/^(?:0|[1-9]\d*)$/,wy=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Fl=/($^)/,Dy=/['\n\r\u2028\u2029\\]/g,Bl="\\ud800-\\udfff",xy="\\u0300-\\u036f",My="\\ufe20-\\ufe2f",Ly="\\u20d0-\\u20ff",Dm=xy+My+Ly,xm="\\u2700-\\u27bf",Mm="a-z\\xdf-\\xf6\\xf8-\\xff",ky="\\xac\\xb1\\xd7\\xf7",Py="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Uy="\\u2000-\\u206f",Fy=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Lm="A-Z\\xc0-\\xd6\\xd8-\\xde",km="\\ufe0e\\ufe0f",Pm=ky+Py+Uy+Fy,dd="['’]",By="["+Bl+"]",Um="["+Pm+"]",Gl="["+Dm+"]",Fm="\\d+",Gy="["+xm+"]",Bm="["+Mm+"]",Gm="[^"+Bl+Pm+Fm+xm+Mm+Lm+"]",Yl="\\ud83c[\\udffb-\\udfff]",Ym="(?:"+Gl+"|"+Yl+")",pd="[^"+Bl+"]",Hl="(?:\\ud83c[\\udde6-\\uddff]){2}",$l="[\\ud800-\\udbff][\\udc00-\\udfff]",oo="["+Lm+"]",_d="\\u200d",zl="(?:"+Bm+"|"+Gm+")",fd="(?:"+oo+"|"+Gm+")",Vl="(?:"+dd+"(?:d|ll|m|re|s|t|ve))?",md="(?:"+dd+"(?:D|LL|M|RE|S|T|VE))?",gd=Ym+"?",Wl="["+km+"]?",da="(?:"+_d+"(?:"+[pd,Hl,$l].join("|")+")"+Wl+gd+")*",ql="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",hd="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Kl=Wl+gd+da,Ed="(?:"+[Gy,Hl,$l].join("|")+")"+Kl,Yy="(?:"+[pd+Gl+"?",Gl,Hl,$l,By].join("|")+")",Hy=RegExp(dd,"g"),JL=RegExp(Gl,"g"),Hm=RegExp(Yl+"(?="+Yl+")|"+Yy+Kl,"g"),ek=RegExp([oo+"?"+Bm+"+"+Vl+"(?="+[Um,oo,"$"].join("|")+")",fd+"+"+md+"(?="+[Um,oo+zl,"$"].join("|")+")",oo+"?"+zl+"+"+Vl,oo+"+"+md,hd,ql,Fm,Ed].join("|"),"g"),tk=RegExp("["+_d+Bl+Dm+km+"]"),nk=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rk=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ik=-1,_t={};_t[oe]=_t[me]=_t[Ge]=_t[ht]=_t[ro]=_t[io]=_t[sd]=_t[ad]=_t[ld]=!0,_t[ye]=_t[Ie]=_t[z]=_t[Ft]=_t[Q]=_t[De]=_t[Nn]=_t[Te]=_t[pt]=_t[vn]=_t[en]=_t[On]=_t[Ae]=_t[Se]=_t[Hn]=!1;var st={};st[ye]=st[Ie]=st[z]=st[Q]=st[Ft]=st[De]=st[oe]=st[me]=st[Ge]=st[ht]=st[ro]=st[pt]=st[vn]=st[en]=st[On]=st[Ae]=st[Se]=st[An]=st[io]=st[sd]=st[ad]=st[ld]=!0,st[Nn]=st[Te]=st[Hn]=!1;var ok={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",Line truncated
|
||||
*/sf.exports;(function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,p="__lodash_placeholder__",_=1,f=2,g=4,h=1,E=2,b=1,T=2,y=4,R=8,O=16,I=32,D=64,M=128,$=256,H=512,B=30,se="...",de=800,pe=16,ce=1,ee=2,ue=3,L=1/0,w=9007199254740991,G=17976931348623157e292,q=NaN,V=4294967295,te=V-1,Ee=V>>>1,be=[["ary",M],["bind",b],["bindKey",T],["curry",R],["curryRight",O],["flip",H],["partial",I],["partialRight",D],["rearg",$]],ye="[object Arguments]",Ie="[object Array]",et="[object AsyncFunction]",Bt="[object Boolean]",De="[object Date]",xt="[object DOMException]",Nn="[object Error]",Te="[object Function]",si="[object GeneratorFunction]",pt="[object Map]",vn="[object Number]",tt="[object Null]",en="[object Object]",Qe="[object Promise]",ne="[object Proxy]",On="[object RegExp]",Ae="[object Set]",Se="[object String]",An="[object Symbol]",zt="[object Undefined]",$n="[object WeakMap]",ai="[object WeakSet]",z="[object ArrayBuffer]",Q="[object DataView]",oe="[object Float32Array]",me="[object Float64Array]",Ge="[object Int8Array]",ht="[object Int16Array]",ro="[object Int32Array]",io="[object Uint8Array]",sd="[object Uint8ClampedArray]",ad="[object Uint16Array]",ld="[object Uint32Array]",sy=/\b__p \+= '';/g,ay=/\b(__p \+=) '' \+/g,ly=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Om=/&(?:amp|lt|gt|quot|#39);/g,Am=/[&<>"']/g,cy=RegExp(Om.source),uy=RegExp(Am.source),dy=/<%-([\s\S]+?)%>/g,py=/<%([\s\S]+?)%>/g,Im=/<%=([\s\S]+?)%>/g,_y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fy=/^\w*$/,my=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,cd=/[\\^$.*+?()[\]{}|]/g,gy=RegExp(cd.source),ud=/^\s+/,hy=/\s/,Ey=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Sy=/\{\n\/\* \[wrapped with (.+)\] \*/,Ty=/,? & /,by=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,yy=/[()=,{}\[\]\/\s]/,Cy=/\\(\\)?/g,Ry=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,wm=/\w*$/,Ny=/^[-+]0x[0-9a-f]+$/i,vy=/^0b[01]+$/i,Oy=/^\[object .+?Constructor\]$/,Ay=/^0o[0-7]+$/i,Iy=/^(?:0|[1-9]\d*)$/,wy=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Fl=/($^)/,Dy=/['\n\r\u2028\u2029\\]/g,Bl="\\ud800-\\udfff",xy="\\u0300-\\u036f",My="\\ufe20-\\ufe2f",Ly="\\u20d0-\\u20ff",Dm=xy+My+Ly,xm="\\u2700-\\u27bf",Mm="a-z\\xdf-\\xf6\\xf8-\\xff",ky="\\xac\\xb1\\xd7\\xf7",Py="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Uy="\\u2000-\\u206f",Fy=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Lm="A-Z\\xc0-\\xd6\\xd8-\\xde",km="\\ufe0e\\ufe0f",Pm=ky+Py+Uy+Fy,dd="['’]",By="["+Bl+"]",Um="["+Pm+"]",Gl="["+Dm+"]",Fm="\\d+",Gy="["+xm+"]",Bm="["+Mm+"]",Gm="[^"+Bl+Pm+Fm+xm+Mm+Lm+"]",Yl="\\ud83c[\\udffb-\\udfff]",Ym="(?:"+Gl+"|"+Yl+")",pd="[^"+Bl+"]",Hl="(?:\\ud83c[\\udde6-\\uddff]){2}",$l="[\\ud800-\\udbff][\\udc00-\\udfff]",oo="["+Lm+"]",_d="\\u200d",zl="(?:"+Bm+"|"+Gm+")",fd="(?:"+oo+"|"+Gm+")",Vl="(?:"+dd+"(?:d|ll|m|re|s|t|ve))?",md="(?:"+dd+"(?:D|LL|M|RE|S|T|VE))?",gd=Ym+"?",Wl="["+km+"]?",da="(?:"+_d+"(?:"+[pd,Hl,$l].join("|")+")"+Wl+gd+")*",ql="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",hd="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Kl=Wl+gd+da,Ed="(?:"+[Gy,Hl,$l].join("|")+")"+Kl,Yy="(?:"+[pd+Gl+"?",Gl,Hl,$l,By].join("|")+")",Hy=RegExp(dd,"g"),JL=RegExp(Gl,"g"),Hm=RegExp(Yl+"(?="+Yl+")|"+Yy+Kl,"g"),ek=RegExp([oo+"?"+Bm+"+"+Vl+"(?="+[Um,oo,"$"].join("|")+")",fd+"+"+md+"(?="+[Um,oo+zl,"$"].join("|")+")",oo+"?"+zl+"+"+Vl,oo+"+"+md,hd,ql,Fm,Ed].join("|"),"g"),tk=RegExp("["+_d+Bl+Dm+km+"]"),nk=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rk=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ik=-1,_t={};_t[oe]=_t[me]=_t[Ge]=_t[ht]=_t[ro]=_t[io]=_t[sd]=_t[ad]=_t[ld]=!0,_t[ye]=_t[Ie]=_t[z]=_t[Bt]=_t[Q]=_t[De]=_t[Nn]=_t[Te]=_t[pt]=_t[vn]=_t[en]=_t[On]=_t[Ae]=_t[Se]=_t[$n]=!1;var st={};st[ye]=st[Ie]=st[z]=st[Q]=st[Bt]=st[De]=st[oe]=st[me]=st[Ge]=st[ht]=st[ro]=st[pt]=st[vn]=st[en]=st[On]=st[Ae]=st[Se]=st[An]=st[io]=st[sd]=st[ad]=st[ld]=!0,st[Nn]=st[Te]=st[$n]=!1;var ok={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",Line truncated
|
||||
/* [wrapped with `+d+`] */
|
||||
`)}function b0(c){return Me(c)||ys(c)||!!(dC&&c&&c[dC])}function wi(c,d){var m=typeof c;return d=d??w,!!d&&(m=="number"||m!="symbol"&&Iy.test(c))&&c>-1&&c%1==0&&c<d}function wn(c,d,m){if(!bt(m))return!1;var S=typeof d;return(S=="number"?zn(m)&&wi(d,m.length):S=="string"&&d in m)?$r(m[d],c):!1}function Ig(c,d){if(Me(c))return!1;var m=typeof c;return m=="number"||m=="symbol"||m=="boolean"||c==null||lr(c)?!0:fy.test(c)||!_y.test(c)||d!=null&&c in rt(d)}function y0(c){var d=typeof c;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?c!=="__proto__":c===null}function wg(c){var d=qd(c),m=v[d];if(typeof m!="function"||!(d in $e.prototype))return!1;if(c===m)return!0;var S=vg(m);return!!S&&c===S[0]}function C0(c){return!!aC&&aC in c}var R0=Cd?Di:qg;function ac(c){var d=c&&c.constructor,m=typeof d=="function"&&d.prototype||ga;return c===m}function aR(c){return c===c&&!bt(c)}function lR(c,d){return function(m){return m==null?!1:m[c]===d&&(d!==n||c in rt(m))}}function N0(c){var d=Jd(c,function(S){return m.size===u&&m.clear(),S}),m=d.cache;return d}function v0(c,d){var m=c[1],S=d[1],C=m|S,O=C<(b|T|M),x=S==M&&m==R||S==M&&m==$&&c[7].length<=d[8]||S==(M|$)&&d[7].length<=d[8]&&m==R;if(!(O||x))return c;S&b&&(c[2]=d[2],C|=m&b?0:y);var k=d[3];if(k){var Y=c[3];c[3]=Y?zC(Y,k,d[4]):k,c[4]=Y?lo(c[3],p):d[4]}return k=d[5],k&&(Y=c[5],c[5]=Y?VC(Y,k,d[6]):k,c[6]=Y?lo(c[5],p):d[6]),k=d[7],k&&(c[7]=k),S&M&&(c[8]=c[8]==null?d[8]:dn(c[8],d[8])),c[9]==null&&(c[9]=d[9]),c[0]=d[0],c[1]=C,c}function O0(c){var d=[];if(c!=null)for(var m in rt(c))d.push(m);return d}function A0(c){return Nd.call(c)}function cR(c,d,m){return d=Gt(d===n?c.length-1:d,0),function(){for(var S=arguments,C=-1,O=Gt(S.length-d,0),x=W(O);++C<O;)x[C]=S[d+C];C=-1;for(var k=W(d+1);++C<d;)k[C]=S[C];return k[d]=m(x),or(c,this,k)}}function uR(c,d){return d.length<2?c:Ss(c,Nr(d,0,-1))}function I0(c,d){for(var m=c.length,S=dn(d.length,m),C=$n(c);S--;){var O=d[S];c[S]=wi(O,m)?C[O]:n}return c}function Dg(c,d){if(!(d==="constructor"&&typeof c[d]=="function")&&d!="__proto__")return c[d]}var dR=_R(LC),lc=zk||function(c,d){return tn.setTimeout(c,d)},xg=_R(ZP);function pR(c,d,m){var S=d+"";return xg(c,T0(S,w0(h0(S),m)))}function _R(c){var d=0,m=0;return function(){var S=Kk(),C=pe-(S-m);if(m=S,C>0){if(++d>=de)return arguments[0]}else d=0;return c.apply(n,arguments)}}function Qd(c,d){var m=-1,S=c.length,C=S-1;for(d=d===n?S:d;++m<d;){var O=fg(m,C),x=c[O];c[O]=c[m],c[m]=x}return c.length=d,c}var fR=N0(function(c){var d=[];return c.charCodeAt(0)===46&&d.push(""),c.replace(my,function(m,S,C,O){d.push(C?O.replace(Cy,"$1"):S||m)}),d});function ui(c){if(typeof c=="string"||lr(c))return c;var d=c+"";return d=="0"&&1/c==-L?"-0":d}function bs(c){if(c!=null){try{return Rd.call(c)}catch{}try{return c+""}catch{}}return""}function w0(c,d){return br(be,function(m){var S="_."+m[0];d&m[1]&&!Sd(c,S)&&c.push(S)}),c.sort()}function mR(c){if(c instanceof $e)return c.clone();var d=new Cr(c.__wrapped__,c.__chain__);return d.__actions__=$n(c.__actions__),d.__index__=c.__index__,d.__values__=c.__values__,d}function D0(c,d,m){(m?wn(c,d,m):d===n)?d=1:d=Gt(Le(d),0);var S=c==null?0:c.length;if(!S||d<1)return[];for(var C=0,O=0,x=W(Dd(S/d));C<S;)x[O++]=Nr(c,C,C+=d);return x}function x0(c){for(var d=-1,m=c==null?0:c.length,S=0,C=[];++d<m;){var O=c[d];O&&(C[S++]=O)}return C}function M0(){var c=arguments.length;if(!c)return[];for(var d=W(c-1),m=arguments[0],S=c;S--;)d[S-1]=arguments[S];return ao(Me(m)?$n(m):[m],nn(d,1))}var L0=Fe(function(c,d){return Mt(c)?nc(c,nn(d,1,Mt,!0)):[]}),k0=Fe(function(c,d){var m=vr(d);return Mt(m)&&(m=n),Mt(c)?nc(c,nn(d,1,Mt,!0),Ne(m,2)):[]}),P0=Fe(function(c,d){var m=vr(d);return Mt(m)&&(m=n),Mt(c)?nc(c,nn(d,1,Mt,!0),n,m):[]});function U0(c,d,m){var S=c==null?0:c.length;return S?(d=m||d===n?1:Le(d),Nr(c,d<0?0:d,S)):[]}function F0(c,d,m){var S=c==null?0:c.length;return S?(d=m||d===n?1:Le(d),d=S-d,Nr(c,0,d<0?0:d)):[]}function B0(c,d){return c&&c.length?Yd(c,Ne(d,3),!0,!0):[]}function G0(c,d){return c&&c.length?Yd(c,Ne(d,3),!0):[]}function Y0(c,d,m,S){var C=c==null?0:c.length;return C?(m&&typeof m!="number"&&wn(c,d,m)&&(m=0,S=C),MP(c,d,m,S)):[]}function gR(c,d,m){var S=c==null?0:c.length;if(!S)return-1;var C=m==null?0:Le(m);return C<0&&(C=Gt(S+C,0)),Td(c,Ne(d,3),C)}function hR(c,d,m){var S=c==null?0:c.length;if(!S)return-1;var C=S-1;return m!==n&&(C=Le(m),C=m<0?Gt(S+C,0):dn(C,S-1)),Td(c,Ne(d,3),C,!0)}function ER(c){var d=c==null?0:c.length;return d?nn(c,1):[]}function H0(c){var d=c==null?0:c.length;return d?nn(c,L):[]}function $0(c,d){var m=c==null?0:c.length;return m?(d=d===n?1:Le(d),nn(c,d)):[]}function z0(c){for(var d=-1,m=c==null?0:c.length,S={};++d<m;){var C=c[d];S[C[0]]=C[1]}return S}function SR(c){return c&&c.length?c[0]:n}function V0(c,d,m){var S=c==null?0:c.length;if(!S)return-1;var C=m==null?0:Le(m);return C<0&&(C=Gt(S+C,0)),pa(c,d,C)}function W0(c){var d=c==null?0:c.length;return d?Nr(c,0,-1):[]}var q0=Fe(function(c){var d=Et(c,Sg);return d.length&&d[0]===c[0]?cg(d):[]}),K0=Fe(
Line truncated
|
||||
`;c.replace(le,function(Oe,Ye,ze,cr,Dn,ur){return ze||(ze=cr),J+=c.slice(j,ur).replace(Dy,Rk),Ye&&(k=!0,J+=`' +
|
||||
`)}function b0(c){return Me(c)||ys(c)||!!(dC&&c&&c[dC])}function wi(c,d){var m=typeof c;return d=d??w,!!d&&(m=="number"||m!="symbol"&&Iy.test(c))&&c>-1&&c%1==0&&c<d}function wn(c,d,m){if(!bt(m))return!1;var S=typeof d;return(S=="number"?Vn(m)&&wi(d,m.length):S=="string"&&d in m)?$r(m[d],c):!1}function Ig(c,d){if(Me(c))return!1;var m=typeof c;return m=="number"||m=="symbol"||m=="boolean"||c==null||lr(c)?!0:fy.test(c)||!_y.test(c)||d!=null&&c in nt(d)}function y0(c){var d=typeof c;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?c!=="__proto__":c===null}function wg(c){var d=qd(c),m=v[d];if(typeof m!="function"||!(d in $e.prototype))return!1;if(c===m)return!0;var S=vg(m);return!!S&&c===S[0]}function C0(c){return!!aC&&aC in c}var R0=Cd?Di:qg;function ac(c){var d=c&&c.constructor,m=typeof d=="function"&&d.prototype||ga;return c===m}function aR(c){return c===c&&!bt(c)}function lR(c,d){return function(m){return m==null?!1:m[c]===d&&(d!==n||c in nt(m))}}function N0(c){var d=Jd(c,function(S){return m.size===u&&m.clear(),S}),m=d.cache;return d}function v0(c,d){var m=c[1],S=d[1],C=m|S,A=C<(b|T|M),x=S==M&&m==R||S==M&&m==$&&c[7].length<=d[8]||S==(M|$)&&d[7].length<=d[8]&&m==R;if(!(A||x))return c;S&b&&(c[2]=d[2],C|=m&b?0:y);var P=d[3];if(P){var Y=c[3];c[3]=Y?zC(Y,P,d[4]):P,c[4]=Y?lo(c[3],p):d[4]}return P=d[5],P&&(Y=c[5],c[5]=Y?VC(Y,P,d[6]):P,c[6]=Y?lo(c[5],p):d[6]),P=d[7],P&&(c[7]=P),S&M&&(c[8]=c[8]==null?d[8]:dn(c[8],d[8])),c[9]==null&&(c[9]=d[9]),c[0]=d[0],c[1]=C,c}function O0(c){var d=[];if(c!=null)for(var m in nt(c))d.push(m);return d}function A0(c){return Nd.call(c)}function cR(c,d,m){return d=Yt(d===n?c.length-1:d,0),function(){for(var S=arguments,C=-1,A=Yt(S.length-d,0),x=W(A);++C<A;)x[C]=S[d+C];C=-1;for(var P=W(d+1);++C<d;)P[C]=S[C];return P[d]=m(x),or(c,this,P)}}function uR(c,d){return d.length<2?c:Ss(c,Nr(d,0,-1))}function I0(c,d){for(var m=c.length,S=dn(d.length,m),C=zn(c);S--;){var A=d[S];c[S]=wi(A,m)?C[A]:n}return c}function Dg(c,d){if(!(d==="constructor"&&typeof c[d]=="function")&&d!="__proto__")return c[d]}var dR=_R(LC),lc=zk||function(c,d){return tn.setTimeout(c,d)},xg=_R(ZP);function pR(c,d,m){var S=d+"";return xg(c,T0(S,w0(h0(S),m)))}function _R(c){var d=0,m=0;return function(){var S=Kk(),C=pe-(S-m);if(m=S,C>0){if(++d>=de)return arguments[0]}else d=0;return c.apply(n,arguments)}}function Qd(c,d){var m=-1,S=c.length,C=S-1;for(d=d===n?S:d;++m<d;){var A=fg(m,C),x=c[A];c[A]=c[m],c[m]=x}return c.length=d,c}var fR=N0(function(c){var d=[];return c.charCodeAt(0)===46&&d.push(""),c.replace(my,function(m,S,C,A){d.push(C?A.replace(Cy,"$1"):S||m)}),d});function ui(c){if(typeof c=="string"||lr(c))return c;var d=c+"";return d=="0"&&1/c==-L?"-0":d}function bs(c){if(c!=null){try{return Rd.call(c)}catch{}try{return c+""}catch{}}return""}function w0(c,d){return br(be,function(m){var S="_."+m[0];d&m[1]&&!Sd(c,S)&&c.push(S)}),c.sort()}function mR(c){if(c instanceof $e)return c.clone();var d=new Cr(c.__wrapped__,c.__chain__);return d.__actions__=zn(c.__actions__),d.__index__=c.__index__,d.__values__=c.__values__,d}function D0(c,d,m){(m?wn(c,d,m):d===n)?d=1:d=Yt(Le(d),0);var S=c==null?0:c.length;if(!S||d<1)return[];for(var C=0,A=0,x=W(Dd(S/d));C<S;)x[A++]=Nr(c,C,C+=d);return x}function x0(c){for(var d=-1,m=c==null?0:c.length,S=0,C=[];++d<m;){var A=c[d];A&&(C[S++]=A)}return C}function M0(){var c=arguments.length;if(!c)return[];for(var d=W(c-1),m=arguments[0],S=c;S--;)d[S-1]=arguments[S];return ao(Me(m)?zn(m):[m],nn(d,1))}var L0=Fe(function(c,d){return Mt(c)?nc(c,nn(d,1,Mt,!0)):[]}),k0=Fe(function(c,d){var m=vr(d);return Mt(m)&&(m=n),Mt(c)?nc(c,nn(d,1,Mt,!0),Ne(m,2)):[]}),P0=Fe(function(c,d){var m=vr(d);return Mt(m)&&(m=n),Mt(c)?nc(c,nn(d,1,Mt,!0),n,m):[]});function U0(c,d,m){var S=c==null?0:c.length;return S?(d=m||d===n?1:Le(d),Nr(c,d<0?0:d,S)):[]}function F0(c,d,m){var S=c==null?0:c.length;return S?(d=m||d===n?1:Le(d),d=S-d,Nr(c,0,d<0?0:d)):[]}function B0(c,d){return c&&c.length?Yd(c,Ne(d,3),!0,!0):[]}function G0(c,d){return c&&c.length?Yd(c,Ne(d,3),!0):[]}function Y0(c,d,m,S){var C=c==null?0:c.length;return C?(m&&typeof m!="number"&&wn(c,d,m)&&(m=0,S=C),MP(c,d,m,S)):[]}function gR(c,d,m){var S=c==null?0:c.length;if(!S)return-1;var C=m==null?0:Le(m);return C<0&&(C=Yt(S+C,0)),Td(c,Ne(d,3),C)}function hR(c,d,m){var S=c==null?0:c.length;if(!S)return-1;var C=S-1;return m!==n&&(C=Le(m),C=m<0?Yt(S+C,0):dn(C,S-1)),Td(c,Ne(d,3),C,!0)}function ER(c){var d=c==null?0:c.length;return d?nn(c,1):[]}function H0(c){var d=c==null?0:c.length;return d?nn(c,L):[]}function $0(c,d){var m=c==null?0:c.length;return m?(d=d===n?1:Le(d),nn(c,d)):[]}function z0(c){for(var d=-1,m=c==null?0:c.length,S={};++d<m;){var C=c[d];S[C[0]]=C[1]}return S}function SR(c){return c&&c.length?c[0]:n}function V0(c,d,m){var S=c==null?0:c.length;if(!S)return-1;var C=m==null?0:Le(m);return C<0&&(C=Yt(S+C,0)),pa(c,d,C)}function W0(c){var d=c==null?0:c.length;return d?Nr(c,0,-1):[]}var q0=Fe(function(c){var d=Et(c,Sg);return d.length&&d[0]===c[0]?cg(d):[]}),K0=Fe(
Line truncated
|
||||
`;c.replace(le,function(Oe,Ye,ze,cr,Dn,ur){return ze||(ze=cr),J+=c.slice(j,ur).replace(Dy,Rk),Ye&&(P=!0,J+=`' +
|
||||
__e(`+Ye+`) +
|
||||
'`),Dn&&(Y=!0,J+=`';
|
||||
`+Dn+`;
|
||||
__p += '`),ze&&(J+=`' +
|
||||
((__t = (`+ze+`)) == null ? '' : __t) +
|
||||
'`),j=ur+Oe.length,Oe}),J+=`';
|
||||
`;var ve=Je.call(d,"variable")&&d.variable;if(!ve)J=`with (obj) {
|
||||
`;var ve=Ze.call(d,"variable")&&d.variable;if(!ve)J=`with (obj) {
|
||||
`+J+`
|
||||
}
|
||||
`;else if(yy.test(ve))throw new xe(a);J=(Y?J.replace(sy,""):J).replace(ay,"$1").replace(ly,"$1;"),J="function("+(ve||"obj")+`) {
|
||||
`+(ve?"":`obj || (obj = {});
|
||||
`)+"var __t, __p = ''"+(k?", __e = _.escape":"")+(Y?`, __j = Array.prototype.join;
|
||||
`)+"var __t, __p = ''"+(P?", __e = _.escape":"")+(Y?`, __j = Array.prototype.join;
|
||||
function print() { __p += __j.call(arguments, '') }
|
||||
`:`;
|
||||
`)+J+`return __p
|
||||
}`;var ke=qR(function(){return qe(O,he+"return "+J).apply(n,x)});if(ke.source=J,Ug(ke))throw ke;return ke}function jF(c){return je(c).toLowerCase()}function XF(c){return je(c).toUpperCase()}function ZF(c,d,m){if(c=je(c),c&&(m||d===n))return nC(c);if(!c||!(d=ar(d)))return c;var S=Yr(c),C=Yr(d),O=rC(S,C),x=iC(S,C)+1;return fo(S,O,x).join("")}function JF(c,d,m){if(c=je(c),c&&(m||d===n))return c.slice(0,sC(c)+1);if(!c||!(d=ar(d)))return c;var S=Yr(c),C=iC(S,Yr(d))+1;return fo(S,0,C).join("")}function eB(c,d,m){if(c=je(c),c&&(m||d===n))return c.replace(ud,"");if(!c||!(d=ar(d)))return c;var S=Yr(c),C=rC(S,Yr(d));return fo(S,C).join("")}function tB(c,d){var m=B,S=se;if(bt(d)){var C="separator"in d?d.separator:C;m="length"in d?Le(d.length):m,S="omission"in d?ar(d.omission):S}c=je(c);var O=c.length;if(_a(c)){var x=Yr(c);O=x.length}if(m>=O)return c;var k=m-fa(S);if(k<1)return S;var Y=x?fo(x,0,k).join(""):c.slice(0,k);if(C===n)return Y+S;if(x&&(k+=Y.length-k),Fg(C)){if(c.slice(k).search(C)){var j,X=Y;for(C.global||(C=eg(C.source,je(wm.exec(C))+"g")),C.lastIndex=0;j=C.exec(X);)var J=j.index;Y=Y.slice(0,J===n?k:J)}}else if(c.indexOf(ar(C),k)!=k){var le=Y.lastIndexOf(C);le>-1&&(Y=Y.slice(0,le))}return Y+S}function nB(c){return c=je(c),c&&cy.test(c)?c.replace(Om,Dk):c}var rB=ba(function(c,d,m){return c+(m?" ":"")+d.toUpperCase()}),Yg=KC("toUpperCase");function WR(c,d,m){return c=je(c),d=m?n:d,d===n?vk(c)?Lk(c):hk(c):c.match(d)||[]}var qR=Fe(function(c,d){try{return or(c,n,d)}catch(m){return Ug(m)?m:new xe(m)}}),iB=Ii(function(c,d){return br(d,function(m){m=ui(m),Oi(c,m,kg(c[m],c))}),c});function oB(c){var d=c==null?0:c.length,m=Ne();return c=d?Et(c,function(S){if(typeof S[1]!="function")throw new yr(s);return[m(S[0]),S[1]]}):[],Fe(function(S){for(var C=-1;++C<d;){var O=c[C];if(or(O[0],this,S))return or(O[1],this,S)}})}function sB(c){return DP(Rr(c,_))}function Hg(c){return function(){return c}}function aB(c,d){return c==null||c!==c?d:c}var lB=jC(),cB=jC(!0);function Wn(c){return c}function $g(c){return vC(typeof c=="function"?c:Rr(c,_))}function uB(c){return AC(Rr(c,_))}function dB(c,d){return IC(c,Rr(d,_))}var pB=Fe(function(c,d){return function(m){return rc(m,c,d)}}),_B=Fe(function(c,d){return function(m){return rc(c,m,d)}});function zg(c,d,m){var S=Vt(d),C=Fd(d,S);m==null&&!(bt(d)&&(C.length||!S.length))&&(m=d,d=c,c=this,C=Fd(d,Vt(d)));var O=!(bt(m)&&"chain"in m)||!!m.chain,x=Di(c);return br(C,function(k){var Y=d[k];c[k]=Y,x&&(c.prototype[k]=function(){var j=this.__chain__;if(O||j){var X=c(this.__wrapped__),J=X.__actions__=$n(this.__actions__);return J.push({func:Y,args:arguments,thisArg:c}),X.__chain__=j,X}return Y.apply(c,ao([this.value()],arguments))})}),c}function fB(){return tn._===this&&(tn._=Gk),this}function Vg(){}function mB(c){return c=Le(c),Fe(function(d){return wC(d,c)})}var gB=yg(Et),hB=yg(Xy),EB=yg(qm);function KR(c){return Ig(c)?Km(ui(c)):KP(c)}function SB(c){return function(d){return c==null?n:Ss(c,d)}}var TB=ZC(),bB=ZC(!0);function Wg(){return[]}function qg(){return!1}function yB(){return{}}function CB(){return""}function RB(){return!0}function NB(c,d){if(c=Le(c),c<1||c>w)return[];var m=V,S=dn(c,V);d=Ne(d),c-=V;for(var C=Xm(S,d);++m<c;)d(m);return C}function vB(c){return Me(c)?Et(c,ui):lr(c)?[c]:$n(fR(je(c)))}function OB(c){var d=++Fk;return je(c)+d}var AB=zd(function(c,d){return c+d},0),IB=Cg("ceil"),wB=zd(function(c,d){return c/d},1),DB=Cg("floor");function xB(c){return c&&c.length?Ud(c,Wn,lg):n}function MB(c,d){return c&&c.length?Ud(c,Ne(d,2),lg):n}function LB(c){return eC(c,Wn)}function kB(c,d){return eC(c,Ne(d,2))}function PB(c){return c&&c.length?Ud(c,Wn,pg):n}function UB(c,d){return c&&c.length?Ud(c,Ne(d,2),pg):n}var FB=zd(function(c,d){return c*d},1),BB=Cg("round"),GB=zd(function(c,d){return c-d},0);function YB(c){return c&&c.length?jm(c,Wn):0}function HB(c,d){return c&&c.length?jm(c,Ne(d,2)):0}return v.after=uU,v.ary=NR,v.assign=XU,v.assignIn=BR,v.assignInWith=rp,v.assignWith=ZU,v.at=JU,v.before=vR,v.bind=kg,v.bindAll=iB,v.bindKey=OR,v.castArray=yU,v.chain=yR,v.chunk=D0,v.compact=x0,v.concat=M0,v.cond=oB,v.conforms=sB,v.constant=Hg,v.countBy=Y1,v.create=eF,v.curry=AR,v.curryRight=IR,v.debounce=wR,v.defaults=tF,v.defaultsDeep=nF,v.defer=dU,v.delay=pU,v.difference=L0,v.differenceBy=k0,v.differenceWith=P0,v.drop=U0,v.dropRight=F0,v.dropRightWhile=B0,v.dropWhile=G0,v.fill=Y0,v.filter=$1,v.flatMap=W1,v.flatMapDeep=q1,v.flatMapDepth=K1,v.flatten=ER,v.flattenDeep=H0,v.flattenDepth=$0,v.flip=_U,v.flow=lB,v.flowRight=cB,v.fromPairs=z0,v.functions=cF,v.functionsIn=uF,v.groupBy=Q1,v.initial=W0,v.intersection=q0,v.intersectionBy=K0,v.intersectionWith=Q0,v.invert=pF,v.invertBy=_F,v.invokeMap=X1,v.iteratee=$g,v.keyBy=Z1,v.keys=Vt,v.keysIn=Vn,v.map=Xd,v.mapKeys=mF,v.mapValues=gF,v.matches=uB,v.matchesProperty=dB,v.memoize=Jd,v.merge=hF,v.mergeWith=GR,v.method=pB,v.methodOf=_B,v.mixin=zg,v.negate=ep,v.nthArg=mB,v.omit=EF,v.omitBy=SF,v.once=fU,v.orderBy=J1,v.over=gB,v.overArgs=mU,v.overEvery=hB,v.overSome=EB,
Line truncated
|
||||
}`;var ke=qR(function(){return qe(A,he+"return "+J).apply(n,x)});if(ke.source=J,Ug(ke))throw ke;return ke}function jF(c){return je(c).toLowerCase()}function XF(c){return je(c).toUpperCase()}function ZF(c,d,m){if(c=je(c),c&&(m||d===n))return nC(c);if(!c||!(d=ar(d)))return c;var S=Yr(c),C=Yr(d),A=rC(S,C),x=iC(S,C)+1;return fo(S,A,x).join("")}function JF(c,d,m){if(c=je(c),c&&(m||d===n))return c.slice(0,sC(c)+1);if(!c||!(d=ar(d)))return c;var S=Yr(c),C=iC(S,Yr(d))+1;return fo(S,0,C).join("")}function eB(c,d,m){if(c=je(c),c&&(m||d===n))return c.replace(ud,"");if(!c||!(d=ar(d)))return c;var S=Yr(c),C=rC(S,Yr(d));return fo(S,C).join("")}function tB(c,d){var m=B,S=se;if(bt(d)){var C="separator"in d?d.separator:C;m="length"in d?Le(d.length):m,S="omission"in d?ar(d.omission):S}c=je(c);var A=c.length;if(_a(c)){var x=Yr(c);A=x.length}if(m>=A)return c;var P=m-fa(S);if(P<1)return S;var Y=x?fo(x,0,P).join(""):c.slice(0,P);if(C===n)return Y+S;if(x&&(P+=Y.length-P),Fg(C)){if(c.slice(P).search(C)){var j,X=Y;for(C.global||(C=eg(C.source,je(wm.exec(C))+"g")),C.lastIndex=0;j=C.exec(X);)var J=j.index;Y=Y.slice(0,J===n?P:J)}}else if(c.indexOf(ar(C),P)!=P){var le=Y.lastIndexOf(C);le>-1&&(Y=Y.slice(0,le))}return Y+S}function nB(c){return c=je(c),c&&cy.test(c)?c.replace(Om,Dk):c}var rB=ba(function(c,d,m){return c+(m?" ":"")+d.toUpperCase()}),Yg=KC("toUpperCase");function WR(c,d,m){return c=je(c),d=m?n:d,d===n?vk(c)?Lk(c):hk(c):c.match(d)||[]}var qR=Fe(function(c,d){try{return or(c,n,d)}catch(m){return Ug(m)?m:new xe(m)}}),iB=Ii(function(c,d){return br(d,function(m){m=ui(m),Oi(c,m,kg(c[m],c))}),c});function oB(c){var d=c==null?0:c.length,m=Ne();return c=d?Et(c,function(S){if(typeof S[1]!="function")throw new yr(s);return[m(S[0]),S[1]]}):[],Fe(function(S){for(var C=-1;++C<d;){var A=c[C];if(or(A[0],this,S))return or(A[1],this,S)}})}function sB(c){return DP(Rr(c,_))}function Hg(c){return function(){return c}}function aB(c,d){return c==null||c!==c?d:c}var lB=jC(),cB=jC(!0);function qn(c){return c}function $g(c){return vC(typeof c=="function"?c:Rr(c,_))}function uB(c){return AC(Rr(c,_))}function dB(c,d){return IC(c,Rr(d,_))}var pB=Fe(function(c,d){return function(m){return rc(m,c,d)}}),_B=Fe(function(c,d){return function(m){return rc(c,m,d)}});function zg(c,d,m){var S=Vt(d),C=Fd(d,S);m==null&&!(bt(d)&&(C.length||!S.length))&&(m=d,d=c,c=this,C=Fd(d,Vt(d)));var A=!(bt(m)&&"chain"in m)||!!m.chain,x=Di(c);return br(C,function(P){var Y=d[P];c[P]=Y,x&&(c.prototype[P]=function(){var j=this.__chain__;if(A||j){var X=c(this.__wrapped__),J=X.__actions__=zn(this.__actions__);return J.push({func:Y,args:arguments,thisArg:c}),X.__chain__=j,X}return Y.apply(c,ao([this.value()],arguments))})}),c}function fB(){return tn._===this&&(tn._=Gk),this}function Vg(){}function mB(c){return c=Le(c),Fe(function(d){return wC(d,c)})}var gB=yg(Et),hB=yg(Xy),EB=yg(qm);function KR(c){return Ig(c)?Km(ui(c)):KP(c)}function SB(c){return function(d){return c==null?n:Ss(c,d)}}var TB=ZC(),bB=ZC(!0);function Wg(){return[]}function qg(){return!1}function yB(){return{}}function CB(){return""}function RB(){return!0}function NB(c,d){if(c=Le(c),c<1||c>w)return[];var m=V,S=dn(c,V);d=Ne(d),c-=V;for(var C=Xm(S,d);++m<c;)d(m);return C}function vB(c){return Me(c)?Et(c,ui):lr(c)?[c]:zn(fR(je(c)))}function OB(c){var d=++Fk;return je(c)+d}var AB=zd(function(c,d){return c+d},0),IB=Cg("ceil"),wB=zd(function(c,d){return c/d},1),DB=Cg("floor");function xB(c){return c&&c.length?Ud(c,qn,lg):n}function MB(c,d){return c&&c.length?Ud(c,Ne(d,2),lg):n}function LB(c){return eC(c,qn)}function kB(c,d){return eC(c,Ne(d,2))}function PB(c){return c&&c.length?Ud(c,qn,pg):n}function UB(c,d){return c&&c.length?Ud(c,Ne(d,2),pg):n}var FB=zd(function(c,d){return c*d},1),BB=Cg("round"),GB=zd(function(c,d){return c-d},0);function YB(c){return c&&c.length?jm(c,qn):0}function HB(c,d){return c&&c.length?jm(c,Ne(d,2)):0}return v.after=uU,v.ary=NR,v.assign=XU,v.assignIn=BR,v.assignInWith=rp,v.assignWith=ZU,v.at=JU,v.before=vR,v.bind=kg,v.bindAll=iB,v.bindKey=OR,v.castArray=yU,v.chain=yR,v.chunk=D0,v.compact=x0,v.concat=M0,v.cond=oB,v.conforms=sB,v.constant=Hg,v.countBy=Y1,v.create=eF,v.curry=AR,v.curryRight=IR,v.debounce=wR,v.defaults=tF,v.defaultsDeep=nF,v.defer=dU,v.delay=pU,v.difference=L0,v.differenceBy=k0,v.differenceWith=P0,v.drop=U0,v.dropRight=F0,v.dropRightWhile=B0,v.dropWhile=G0,v.fill=Y0,v.filter=$1,v.flatMap=W1,v.flatMapDeep=q1,v.flatMapDepth=K1,v.flatten=ER,v.flattenDeep=H0,v.flattenDepth=$0,v.flip=_U,v.flow=lB,v.flowRight=cB,v.fromPairs=z0,v.functions=cF,v.functionsIn=uF,v.groupBy=Q1,v.initial=W0,v.intersection=q0,v.intersectionBy=K0,v.intersectionWith=Q0,v.invert=pF,v.invertBy=_F,v.invokeMap=X1,v.iteratee=$g,v.keyBy=Z1,v.keys=Vt,v.keysIn=Wn,v.map=Xd,v.mapKeys=mF,v.mapValues=gF,v.matches=uB,v.matchesProperty=dB,v.memoize=Jd,v.merge=hF,v.mergeWith=GR,v.method=pB,v.methodOf=_B,v.mixin=zg,v.negate=ep,v.nthArg=mB,v.omit=EF,v.omitBy=SF,v.once=fU,v.orderBy=J1,v.over=gB,v.overArgs=mU,v.overEvery=hB,v.overSome=EB,
Line truncated
|
||||
|
||||
`);return!o||!s?!1:e.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0?!1:r.nodeAt(a)?e.commands.command(({tr:u})=>(u.setSelection(we.near(r.resolve(a))),!0)):e.commands.exitCode()}}},addInputRules(){return[MS({find:eq,type:this.type,getAttributes:e=>({language:e[1]})}),MS({find:tq,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Ze({key:new Ke("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:s,schema:a}=e.state,l=a.text(n.replace(/\r\n?/g,`
|
||||
`));return s.replaceSelectionWith(this.type.create({language:o},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(Ce.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}});function rq(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Qx(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&Qx(n)}),e}let bO=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function jx(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Po(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const i in r)n[i]=r[i]}),n}const iq="</span>",yO=e=>!!e.scope,oq=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${t}${e}`};let sq=class{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=jx(t)}openNode(t){if(!yO(t))return;const n=oq(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){yO(t)&&(this.buffer+=iq)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}};const CO=(e={})=>{const t={children:[]};return Object.assign(t,e),t};let aq=class Xx{constructor(){this.rootNode=CO(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=CO({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{Xx._collapse(n)}))}},lq=class extends aq{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new sq(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Du(e){return e?typeof e=="string"?e:e.source:null}function Zx(e){return ca("(?=",e,")")}function cq(e){return ca("(?:",e,")*")}function uq(e){return ca("(?:",e,")?")}function ca(...e){return e.map(n=>Du(n)).join("")}function dq(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Ab(...e){return"("+(dq(e).capture?"":"?:")+e.map(r=>Du(r)).join("|")+")"}function Jx(e){return new RegExp(e.toString()+"|").exec("").length-1}function pq(e,t){const n=e&&e.exec(t);return n&&n.index===0}const _q=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Ib(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const i=n;let o=Du(r),s="";for(;o.length>0;){const a=_q.exec(o);if(!a){s+=o;break}s+=o.substring(0,a.index),o=o.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?s+="\\"+String(Number(a[1])+i):(s+=a[0],a[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(t)}const fq=/\b\B/,eM="[a-zA-Z]\\w*",wb="[a-zA-Z_]\\w*",tM="\\b\\d+(\\.\\d+)?",nM="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",rM="\\b(0b[01]+)",mq="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",gq=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=ca(t,/.*\b/,e.binary,/\b.*/)),Po({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},xu={begin:"\\\\[\\s\\S]",relevance:0},hq={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[xu]},Eq={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[xu]},Sq={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Tm=function(e,t,n={}){const r=Po({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=Ab("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:ca(/[ ]
Line truncated
|
||||
https://github.com/highlightjs/highlight.js/issues/2277`),V=L,q=w),G===void 0&&(G=!0);const te={code:q,language:V};ee("before:highlight",te);const Ee=te.result?te.result:_(te.language,te.code,G);return Ee.code=te.code,ee("after:highlight",Ee),Ee}function _(L,w,G,q){const V=Object.create(null);function te(z,Q){return z.keywords[Q]}function Ee(){if(!ne.keywords){Ae.addText(Se);return}let z=0;ne.keywordPatternRe.lastIndex=0;let Q=ne.keywordPatternRe.exec(Se),oe="";for(;Q;){oe+=Se.substring(z,Q.index);const me=nt.case_insensitive?Q[0].toLowerCase():Q[0],Ge=te(ne,me);if(Ge){const[ht,ro]=Ge;if(Ae.addText(oe),oe="",V[me]=(V[me]||0)+1,V[me]<=jq&&(An+=ro),ht.startsWith("_"))oe+=Q[0];else{const io=nt.classNameAliases[ht]||ht;Ie(Q[0],io)}}else oe+=Q[0];z=ne.keywordPatternRe.lastIndex,Q=ne.keywordPatternRe.exec(Se)}oe+=Se.substring(z),Ae.addText(oe)}function be(){if(Se==="")return;let z=null;if(typeof ne.subLanguage=="string"){if(!t[ne.subLanguage]){Ae.addText(Se);return}z=_(ne.subLanguage,Se,!0,On[ne.subLanguage]),On[ne.subLanguage]=z._top}else z=g(Se,ne.subLanguage.length?ne.subLanguage:null);ne.relevance>0&&(An+=z.relevance),Ae.__addSublanguage(z._emitter,z.language)}function ye(){ne.subLanguage!=null?be():Ee(),Se=""}function Ie(z,Q){z!==""&&(Ae.startScope(Q),Ae.addText(z),Ae.endScope())}function tt(z,Q){let oe=1;const me=Q.length-1;for(;oe<=me;){if(!z._emit[oe]){oe++;continue}const Ge=nt.classNameAliases[z[oe]]||z[oe],ht=Q[oe];Ge?Ie(ht,Ge):(Se=ht,Ee(),Se=""),oe++}}function Ft(z,Q){return z.scope&&typeof z.scope=="string"&&Ae.openNode(nt.classNameAliases[z.scope]||z.scope),z.beginScope&&(z.beginScope._wrap?(Ie(Se,nt.classNameAliases[z.beginScope._wrap]||z.beginScope._wrap),Se=""):z.beginScope._multi&&(tt(z.beginScope,Q),Se="")),ne=Object.create(z,{parent:{value:ne}}),ne}function De(z,Q,oe){let me=pq(z.endRe,oe);if(me){if(z["on:end"]){const Ge=new bO(z);z["on:end"](Q,Ge),Ge.isMatchIgnored&&(me=!1)}if(me){for(;z.endsParent&&z.parent;)z=z.parent;return z}}if(z.endsWithParent)return De(z.parent,Q,oe)}function xt(z){return ne.matcher.regexIndex===0?(Se+=z[0],1):(ai=!0,0)}function Nn(z){const Q=z[0],oe=z.rule,me=new bO(oe),Ge=[oe.__beforeBegin,oe["on:begin"]];for(const ht of Ge)if(ht&&(ht(z,me),me.isMatchIgnored))return xt(Q);return oe.skip?Se+=Q:(oe.excludeBegin&&(Se+=Q),ye(),!oe.returnBegin&&!oe.excludeBegin&&(Se=Q)),Ft(oe,z),oe.returnBegin?0:Q.length}function Te(z){const Q=z[0],oe=w.substring(z.index),me=De(ne,z,oe);if(!me)return OO;const Ge=ne;ne.endScope&&ne.endScope._wrap?(ye(),Ie(Q,ne.endScope._wrap)):ne.endScope&&ne.endScope._multi?(ye(),tt(ne.endScope,z)):Ge.skip?Se+=Q:(Ge.returnEnd||Ge.excludeEnd||(Se+=Q),ye(),Ge.excludeEnd&&(Se=Q));do ne.scope&&Ae.closeNode(),!ne.skip&&!ne.subLanguage&&(An+=ne.relevance),ne=ne.parent;while(ne!==me.parent);return me.starts&&Ft(me.starts,z),Ge.returnEnd?0:Q.length}function si(){const z=[];for(let Q=ne;Q!==nt;Q=Q.parent)Q.scope&&z.unshift(Q.scope);z.forEach(Q=>Ae.openNode(Q))}let pt={};function vn(z,Q){const oe=Q&&Q[0];if(Se+=z,oe==null)return ye(),0;if(pt.type==="begin"&&Q.type==="end"&&pt.index===Q.index&&oe===""){if(Se+=w.slice(Q.index,Q.index+1),!i){const me=new Error(`0 width match regex (${L})`);throw me.languageName=L,me.badRule=pt.rule,me}return 1}if(pt=Q,Q.type==="begin")return Nn(Q);if(Q.type==="illegal"&&!G){const me=new Error('Illegal lexeme "'+oe+'" for mode "'+(ne.scope||"<unnamed>")+'"');throw me.mode=ne,me}else if(Q.type==="end"){const me=Te(Q);if(me!==OO)return me}if(Q.type==="illegal"&&oe==="")return 1;if(Hn>1e5&&Hn>Q.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Se+=oe,oe.length}const nt=H(L);if(!nt)throw Ws(o.replace("{}",L)),new Error('Unknown language: "'+L+'"');const en=Wq(nt);let Qe="",ne=q||en;const On={},Ae=new a.__emitter(a);si();let Se="",An=0,zt=0,Hn=0,ai=!1;try{if(nt.__emitTokens)nt.__emitTokens(w,Ae);else{for(ne.matcher.considerAll();;){Hn++,ai?ai=!1:ne.matcher.considerAll(),ne.matcher.lastIndex=zt;const z=ne.matcher.exec(w);if(!z)break;const Q=w.substring(zt,z.index),oe=vn(Q,z);zt=z.index+oe}vn(w.substring(zt))}return Ae.finalize(),Qe=Ae.toHTML(),{language:L,value:Qe,relevance:An,illegal:!1,_emitter:Ae,_top:ne}}catch(z){if(z.message&&z.message.includes("Illegal"))return{language:L,value:$h(w),illegal:!0,relevance:0,_illegalBy:{message:z.message,index:zt,context:w.slice(zt-100,zt+100),mode:z.mode,resultSoFar:Qe},_emitter:Ae};if(i)return{language:L,value:$h(w),illegal:!1,relevance:0,errorRaised:z,_emitter:Ae,_top:ne};throw z}}function f(L){const w={value:$h(L),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return w._emitter.addText(L),w}function g(L,w){w=w||a.languages||Object.keys(t);const G=f(L),q=w.filter(H).filter(se).map(ye=>_(ye,L,!1));q.unshift(G);const V=q.sort((ye,Ie)=>{if(ye.relevance!==Ie.relevance)return Ie.relevance-ye.relevance;if(ye.language&&Ie.language){if(H(ye.language).supersetOf===Ie.language)return 1;if(H(Ie.language).supersetOf===ye.language)return-1}return 0}),[te,Ee]=V,
Line truncated
|
||||
]*;`,relevance:0},{begin:"[vp][0-9]+"}]}}function BQ(e){const t="[a-z][a-zA-Z0-9_]*",n={className:"string",begin:"\\$.{1}"},r={className:"symbol",begin:"#"+e.UNDERSCORE_IDENT_RE};return{name:"Smalltalk",aliases:["st"],keywords:["self","super","nil","true","false","thisContext"],contains:[e.COMMENT('"','"'),e.APOS_STRING_MODE,{className:"type",begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},{begin:t+":",relevance:0},e.C_NUMBER_MODE,r,n,{begin:"\\|[ ]*"+t+"([ ]+"+t+")*[ ]*\\|",returnBegin:!0,end:/\|/,illegal:/\S/,contains:[{begin:"(\\|[ ]*)?"+t}]},{begin:"#\\(",end:"\\)",contains:[e.APOS_STRING_MODE,n,e.C_NUMBER_MODE,r]}]}}function GQ(e){return{name:"SML (Standard ML)",aliases:["ml"],keywords:{$pattern:"[a-z_]\\w*!?",keyword:"abstype and andalso as case datatype do else end eqtype exception fn fun functor handle if in include infix infixr let local nonfix of op open orelse raise rec sharing sig signature struct structure then type val with withtype where while",built_in:"array bool char exn int list option order real ref string substring vector unit word",literal:"true false NONE SOME LESS EQUAL GREATER nil"},illegal:/\/\/|>>/,contains:[{className:"literal",begin:/\[(\|\|)?\]|\(\)/,relevance:0},e.COMMENT("\\(\\*","\\*\\)",{contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[\\w']*"},{className:"type",begin:"`[A-Z][\\w']*"},{className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},{begin:"[a-z_]\\w*'[\\w']*"},e.inherit(e.APOS_STRING_MODE,{className:"string",relevance:0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"number",begin:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",relevance:0},{begin:/[-=]>/}]}}function YQ(e){const t={className:"variable",begin:/\b_+[a-zA-Z]\w*/},n={className:"title",begin:/[a-zA-Z][a-zA-Z_0-9]*_fnc_[a-zA-Z_0-9]+/},r={className:"string",variants:[{begin:'"',end:'"',contains:[{begin:'""',relevance:0}]},{begin:"'",end:"'",contains:[{begin:"''",relevance:0}]}]},i=["break","breakWith","breakOut","breakTo","case","catch","continue","continueWith","default","do","else","exit","exitWith","for","forEach","from","if","local","private","switch","step","then","throw","to","try","waitUntil","while","with"],o=["blufor","civilian","configNull","controlNull","displayNull","diaryRecordNull","east","endl","false","grpNull","independent","lineBreak","locationNull","nil","objNull","opfor","pi","resistance","scriptNull","sideAmbientLife","sideEmpty","sideEnemy","sideFriendly","sideLogic","sideUnknown","taskNull","teamMemberNull","true","west"],s=["abs","accTime","acos","action","actionIDs","actionKeys","actionKeysEx","actionKeysImages","actionKeysNames","actionKeysNamesArray","actionName","actionParams","activateAddons","activatedAddons","activateKey","activeTitleEffectParams","add3DENConnection","add3DENEventHandler","add3DENLayer","addAction","addBackpack","addBackpackCargo","addBackpackCargoGlobal","addBackpackGlobal","addBinocularItem","addCamShake","addCuratorAddons","addCuratorCameraArea","addCuratorEditableObjects","addCuratorEditingArea","addCuratorPoints","addEditorObject","addEventHandler","addForce","addForceGeneratorRTD","addGoggles","addGroupIcon","addHandgunItem","addHeadgear","addItem","addItemCargo","addItemCargoGlobal","addItemPool","addItemToBackpack","addItemToUniform","addItemToVest","addLiveStats","addMagazine","addMagazineAmmoCargo","addMagazineCargo","addMagazineCargoGlobal","addMagazineGlobal","addMagazinePool","addMagazines","addMagazineTurret","addMenu","addMenuItem","addMissionEventHandler","addMPEventHandler","addMusicEventHandler","addonFiles","addOwnedMine","addPlayerScores","addPrimaryWeaponItem","addPublicVariableEventHandler","addRating","addResources","addScore","addScoreSide","addSecondaryWeaponItem","addSwitchableUnit","addTeamMember","addToRemainsCollector","addTorque","addUniform","addUserActionEventHandler","addVehicle","addVest","addWaypoint","addWeapon","addWeaponCargo","addWeaponCargoGlobal","addWeaponGlobal","addWeaponItem","addWeaponPool","addWeaponTurret","addWeaponWithAttachmentsCargo","addWeaponWithAttachmentsCargoGlobal","admin","agent","agents","AGLToASL","aimedAtTarget","aimPos","airDensityCurveRTD","airDensityRTD","airplaneThrottle","airportSide","AISFinishHeal","alive","all3DENEntities","allActiveTitleEffects","allAddonsInfo","allAirports","allControls","allCurators","allCutLayers","allDead","allDeadMen","allDiaryRecords","allDiarySubjects","allDisplays","allEnv3DSoundSources","allGroups","allLODs","allMapMarkers","allMines","allMissionObjects","allObjects","allow3DMode","allowCrewInImmobile","allowCuratorLogicIgnoreAreas","allowDamage","allowDammage","allowedService","allowFileOperations","allowFleeing","allowGetIn","allowService","allowSprint","allPlayers","allSimpleObjects","allSites","allTurrets","allUnits","allUnitsUAV","allUsers","allVariables","ambientTemperature","ammo","ammoOnPylon","and","animate","animateBay","animateDoor","animatePylon","animateSouLine truncated
|
||||
`);return!o||!s?!1:e.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0?!1:r.nodeAt(a)?e.commands.command(({tr:u})=>(u.setSelection(we.near(r.resolve(a))),!0)):e.commands.exitCode()}}},addInputRules(){return[MS({find:ZW,type:this.type,getAttributes:e=>({language:e[1]})}),MS({find:JW,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Xe({key:new Ke("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:s,schema:a}=e.state,l=a.text(n.replace(/\r\n?/g,`
|
||||
`));return s.replaceSelectionWith(this.type.create({language:o},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(Ce.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}});function tq(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Qx(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&Qx(n)}),e}let bO=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function jx(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Po(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const i in r)n[i]=r[i]}),n}const nq="</span>",yO=e=>!!e.scope,rq=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${t}${e}`};let iq=class{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=jx(t)}openNode(t){if(!yO(t))return;const n=rq(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){yO(t)&&(this.buffer+=nq)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}};const CO=(e={})=>{const t={children:[]};return Object.assign(t,e),t};let oq=class Xx{constructor(){this.rootNode=CO(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=CO({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{Xx._collapse(n)}))}},sq=class extends oq{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new iq(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Du(e){return e?typeof e=="string"?e:e.source:null}function Zx(e){return ca("(?=",e,")")}function aq(e){return ca("(?:",e,")*")}function lq(e){return ca("(?:",e,")?")}function ca(...e){return e.map(n=>Du(n)).join("")}function cq(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Ab(...e){return"("+(cq(e).capture?"":"?:")+e.map(r=>Du(r)).join("|")+")"}function Jx(e){return new RegExp(e.toString()+"|").exec("").length-1}function uq(e,t){const n=e&&e.exec(t);return n&&n.index===0}const dq=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Ib(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const i=n;let o=Du(r),s="";for(;o.length>0;){const a=dq.exec(o);if(!a){s+=o;break}s+=o.substring(0,a.index),o=o.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?s+="\\"+String(Number(a[1])+i):(s+=a[0],a[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(t)}const pq=/\b\B/,eM="[a-zA-Z]\\w*",wb="[a-zA-Z_]\\w*",tM="\\b\\d+(\\.\\d+)?",nM="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",rM="\\b(0b[01]+)",_q="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",fq=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=ca(t,/.*\b/,e.binary,/\b.*/)),Po({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},xu={begin:"\\\\[\\s\\S]",relevance:0},mq={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[xu]},gq={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[xu]},hq={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Tm=function(e,t,n={}){const r=Po({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=Ab("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:ca(/[ ]
Line truncated
|
||||
https://github.com/highlightjs/highlight.js/issues/2277`),V=L,q=w),G===void 0&&(G=!0);const te={code:q,language:V};ee("before:highlight",te);const Ee=te.result?te.result:_(te.language,te.code,G);return Ee.code=te.code,ee("after:highlight",Ee),Ee}function _(L,w,G,q){const V=Object.create(null);function te(z,Q){return z.keywords[Q]}function Ee(){if(!ne.keywords){Ae.addText(Se);return}let z=0;ne.keywordPatternRe.lastIndex=0;let Q=ne.keywordPatternRe.exec(Se),oe="";for(;Q;){oe+=Se.substring(z,Q.index);const me=tt.case_insensitive?Q[0].toLowerCase():Q[0],Ge=te(ne,me);if(Ge){const[ht,ro]=Ge;if(Ae.addText(oe),oe="",V[me]=(V[me]||0)+1,V[me]<=Kq&&(An+=ro),ht.startsWith("_"))oe+=Q[0];else{const io=tt.classNameAliases[ht]||ht;Ie(Q[0],io)}}else oe+=Q[0];z=ne.keywordPatternRe.lastIndex,Q=ne.keywordPatternRe.exec(Se)}oe+=Se.substring(z),Ae.addText(oe)}function be(){if(Se==="")return;let z=null;if(typeof ne.subLanguage=="string"){if(!t[ne.subLanguage]){Ae.addText(Se);return}z=_(ne.subLanguage,Se,!0,On[ne.subLanguage]),On[ne.subLanguage]=z._top}else z=g(Se,ne.subLanguage.length?ne.subLanguage:null);ne.relevance>0&&(An+=z.relevance),Ae.__addSublanguage(z._emitter,z.language)}function ye(){ne.subLanguage!=null?be():Ee(),Se=""}function Ie(z,Q){z!==""&&(Ae.startScope(Q),Ae.addText(z),Ae.endScope())}function et(z,Q){let oe=1;const me=Q.length-1;for(;oe<=me;){if(!z._emit[oe]){oe++;continue}const Ge=tt.classNameAliases[z[oe]]||z[oe],ht=Q[oe];Ge?Ie(ht,Ge):(Se=ht,Ee(),Se=""),oe++}}function Bt(z,Q){return z.scope&&typeof z.scope=="string"&&Ae.openNode(tt.classNameAliases[z.scope]||z.scope),z.beginScope&&(z.beginScope._wrap?(Ie(Se,tt.classNameAliases[z.beginScope._wrap]||z.beginScope._wrap),Se=""):z.beginScope._multi&&(et(z.beginScope,Q),Se="")),ne=Object.create(z,{parent:{value:ne}}),ne}function De(z,Q,oe){let me=uq(z.endRe,oe);if(me){if(z["on:end"]){const Ge=new bO(z);z["on:end"](Q,Ge),Ge.isMatchIgnored&&(me=!1)}if(me){for(;z.endsParent&&z.parent;)z=z.parent;return z}}if(z.endsWithParent)return De(z.parent,Q,oe)}function xt(z){return ne.matcher.regexIndex===0?(Se+=z[0],1):(ai=!0,0)}function Nn(z){const Q=z[0],oe=z.rule,me=new bO(oe),Ge=[oe.__beforeBegin,oe["on:begin"]];for(const ht of Ge)if(ht&&(ht(z,me),me.isMatchIgnored))return xt(Q);return oe.skip?Se+=Q:(oe.excludeBegin&&(Se+=Q),ye(),!oe.returnBegin&&!oe.excludeBegin&&(Se=Q)),Bt(oe,z),oe.returnBegin?0:Q.length}function Te(z){const Q=z[0],oe=w.substring(z.index),me=De(ne,z,oe);if(!me)return OO;const Ge=ne;ne.endScope&&ne.endScope._wrap?(ye(),Ie(Q,ne.endScope._wrap)):ne.endScope&&ne.endScope._multi?(ye(),et(ne.endScope,z)):Ge.skip?Se+=Q:(Ge.returnEnd||Ge.excludeEnd||(Se+=Q),ye(),Ge.excludeEnd&&(Se=Q));do ne.scope&&Ae.closeNode(),!ne.skip&&!ne.subLanguage&&(An+=ne.relevance),ne=ne.parent;while(ne!==me.parent);return me.starts&&Bt(me.starts,z),Ge.returnEnd?0:Q.length}function si(){const z=[];for(let Q=ne;Q!==tt;Q=Q.parent)Q.scope&&z.unshift(Q.scope);z.forEach(Q=>Ae.openNode(Q))}let pt={};function vn(z,Q){const oe=Q&&Q[0];if(Se+=z,oe==null)return ye(),0;if(pt.type==="begin"&&Q.type==="end"&&pt.index===Q.index&&oe===""){if(Se+=w.slice(Q.index,Q.index+1),!i){const me=new Error(`0 width match regex (${L})`);throw me.languageName=L,me.badRule=pt.rule,me}return 1}if(pt=Q,Q.type==="begin")return Nn(Q);if(Q.type==="illegal"&&!G){const me=new Error('Illegal lexeme "'+oe+'" for mode "'+(ne.scope||"<unnamed>")+'"');throw me.mode=ne,me}else if(Q.type==="end"){const me=Te(Q);if(me!==OO)return me}if(Q.type==="illegal"&&oe==="")return 1;if($n>1e5&&$n>Q.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Se+=oe,oe.length}const tt=H(L);if(!tt)throw Ws(o.replace("{}",L)),new Error('Unknown language: "'+L+'"');const en=zq(tt);let Qe="",ne=q||en;const On={},Ae=new a.__emitter(a);si();let Se="",An=0,zt=0,$n=0,ai=!1;try{if(tt.__emitTokens)tt.__emitTokens(w,Ae);else{for(ne.matcher.considerAll();;){$n++,ai?ai=!1:ne.matcher.considerAll(),ne.matcher.lastIndex=zt;const z=ne.matcher.exec(w);if(!z)break;const Q=w.substring(zt,z.index),oe=vn(Q,z);zt=z.index+oe}vn(w.substring(zt))}return Ae.finalize(),Qe=Ae.toHTML(),{language:L,value:Qe,relevance:An,illegal:!1,_emitter:Ae,_top:ne}}catch(z){if(z.message&&z.message.includes("Illegal"))return{language:L,value:$h(w),illegal:!0,relevance:0,_illegalBy:{message:z.message,index:zt,context:w.slice(zt-100,zt+100),mode:z.mode,resultSoFar:Qe},_emitter:Ae};if(i)return{language:L,value:$h(w),illegal:!1,relevance:0,errorRaised:z,_emitter:Ae,_top:ne};throw z}}function f(L){const w={value:$h(L),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return w._emitter.addText(L),w}function g(L,w){w=w||a.languages||Object.keys(t);const G=f(L),q=w.filter(H).filter(se).map(ye=>_(ye,L,!1));q.unshift(G);const V=q.sort((ye,Ie)=>{if(ye.relevance!==Ie.relevance)return Ie.relevance-ye.relevance;if(ye.language&&Ie.language){if(H(ye.language).supersetOf===Ie.language)return 1;if(H(Ie.language).supersetOf===ye.language)return-1}return 0}),[te,Ee]=V,
Line truncated
|
||||
]*;`,relevance:0},{begin:"[vp][0-9]+"}]}}function UQ(e){const t="[a-z][a-zA-Z0-9_]*",n={className:"string",begin:"\\$.{1}"},r={className:"symbol",begin:"#"+e.UNDERSCORE_IDENT_RE};return{name:"Smalltalk",aliases:["st"],keywords:["self","super","nil","true","false","thisContext"],contains:[e.COMMENT('"','"'),e.APOS_STRING_MODE,{className:"type",begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},{begin:t+":",relevance:0},e.C_NUMBER_MODE,r,n,{begin:"\\|[ ]*"+t+"([ ]+"+t+")*[ ]*\\|",returnBegin:!0,end:/\|/,illegal:/\S/,contains:[{begin:"(\\|[ ]*)?"+t}]},{begin:"#\\(",end:"\\)",contains:[e.APOS_STRING_MODE,n,e.C_NUMBER_MODE,r]}]}}function FQ(e){return{name:"SML (Standard ML)",aliases:["ml"],keywords:{$pattern:"[a-z_]\\w*!?",keyword:"abstype and andalso as case datatype do else end eqtype exception fn fun functor handle if in include infix infixr let local nonfix of op open orelse raise rec sharing sig signature struct structure then type val with withtype where while",built_in:"array bool char exn int list option order real ref string substring vector unit word",literal:"true false NONE SOME LESS EQUAL GREATER nil"},illegal:/\/\/|>>/,contains:[{className:"literal",begin:/\[(\|\|)?\]|\(\)/,relevance:0},e.COMMENT("\\(\\*","\\*\\)",{contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[\\w']*"},{className:"type",begin:"`[A-Z][\\w']*"},{className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},{begin:"[a-z_]\\w*'[\\w']*"},e.inherit(e.APOS_STRING_MODE,{className:"string",relevance:0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"number",begin:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",relevance:0},{begin:/[-=]>/}]}}function BQ(e){const t={className:"variable",begin:/\b_+[a-zA-Z]\w*/},n={className:"title",begin:/[a-zA-Z][a-zA-Z_0-9]*_fnc_[a-zA-Z_0-9]+/},r={className:"string",variants:[{begin:'"',end:'"',contains:[{begin:'""',relevance:0}]},{begin:"'",end:"'",contains:[{begin:"''",relevance:0}]}]},i=["break","breakWith","breakOut","breakTo","case","catch","continue","continueWith","default","do","else","exit","exitWith","for","forEach","from","if","local","private","switch","step","then","throw","to","try","waitUntil","while","with"],o=["blufor","civilian","configNull","controlNull","displayNull","diaryRecordNull","east","endl","false","grpNull","independent","lineBreak","locationNull","nil","objNull","opfor","pi","resistance","scriptNull","sideAmbientLife","sideEmpty","sideEnemy","sideFriendly","sideLogic","sideUnknown","taskNull","teamMemberNull","true","west"],s=["abs","accTime","acos","action","actionIDs","actionKeys","actionKeysEx","actionKeysImages","actionKeysNames","actionKeysNamesArray","actionName","actionParams","activateAddons","activatedAddons","activateKey","activeTitleEffectParams","add3DENConnection","add3DENEventHandler","add3DENLayer","addAction","addBackpack","addBackpackCargo","addBackpackCargoGlobal","addBackpackGlobal","addBinocularItem","addCamShake","addCuratorAddons","addCuratorCameraArea","addCuratorEditableObjects","addCuratorEditingArea","addCuratorPoints","addEditorObject","addEventHandler","addForce","addForceGeneratorRTD","addGoggles","addGroupIcon","addHandgunItem","addHeadgear","addItem","addItemCargo","addItemCargoGlobal","addItemPool","addItemToBackpack","addItemToUniform","addItemToVest","addLiveStats","addMagazine","addMagazineAmmoCargo","addMagazineCargo","addMagazineCargoGlobal","addMagazineGlobal","addMagazinePool","addMagazines","addMagazineTurret","addMenu","addMenuItem","addMissionEventHandler","addMPEventHandler","addMusicEventHandler","addonFiles","addOwnedMine","addPlayerScores","addPrimaryWeaponItem","addPublicVariableEventHandler","addRating","addResources","addScore","addScoreSide","addSecondaryWeaponItem","addSwitchableUnit","addTeamMember","addToRemainsCollector","addTorque","addUniform","addUserActionEventHandler","addVehicle","addVest","addWaypoint","addWeapon","addWeaponCargo","addWeaponCargoGlobal","addWeaponGlobal","addWeaponItem","addWeaponPool","addWeaponTurret","addWeaponWithAttachmentsCargo","addWeaponWithAttachmentsCargoGlobal","admin","agent","agents","AGLToASL","aimedAtTarget","aimPos","airDensityCurveRTD","airDensityRTD","airplaneThrottle","airportSide","AISFinishHeal","alive","all3DENEntities","allActiveTitleEffects","allAddonsInfo","allAirports","allControls","allCurators","allCutLayers","allDead","allDeadMen","allDiaryRecords","allDiarySubjects","allDisplays","allEnv3DSoundSources","allGroups","allLODs","allMapMarkers","allMines","allMissionObjects","allObjects","allow3DMode","allowCrewInImmobile","allowCuratorLogicIgnoreAreas","allowDamage","allowDammage","allowedService","allowFileOperations","allowFleeing","allowGetIn","allowService","allowSprint","allPlayers","allSimpleObjects","allSites","allTurrets","allUnits","allUnitsUAV","allUsers","allVariables","ambientTemperature","ammo","ammoOnPylon","and","animate","animateBay","animateDoor","animatePylon","animateSouLine truncated
|
||||
]*?"'`},{begin:`"[^\r
|
||||
"]*"`}]},{className:"built_in",variants:[{begin:"\\b(abs|acos|asin|atan|atan2|atanh|ceil|cloglog|comb|cos|digamma|exp|floor|invcloglog|invlogit|ln|lnfact|lnfactorial|lngamma|log|log10|max|min|mod|reldif|round|sign|sin|sqrt|sum|tan|tanh|trigamma|trunc|betaden|Binomial|binorm|binormal|chi2|chi2tail|dgammapda|dgammapdada|dgammapdadx|dgammapdx|dgammapdxdx|F|Fden|Ftail|gammaden|gammap|ibeta|invbinomial|invchi2|invchi2tail|invF|invFtail|invgammap|invibeta|invnchi2|invnFtail|invnibeta|invnorm|invnormal|invttail|nbetaden|nchi2|nFden|nFtail|nibeta|norm|normal|normalden|normd|npnchi2|tden|ttail|uniform|abbrev|char|index|indexnot|length|lower|ltrim|match|plural|proper|real|regexm|regexr|regexs|reverse|rtrim|string|strlen|strlower|strltrim|strmatch|strofreal|strpos|strproper|strreverse|strrtrim|strtrim|strupper|subinstr|subinword|substr|trim|upper|word|wordcount|_caller|autocode|byteorder|chop|clip|cond|e|epsdouble|epsfloat|group|inlist|inrange|irecode|matrix|maxbyte|maxdouble|maxfloat|maxint|maxlong|mi|minbyte|mindouble|minfloat|minint|minlong|missing|r|recode|replay|return|s|scalar|d|date|day|dow|doy|halfyear|mdy|month|quarter|week|year|d|daily|dofd|dofh|dofm|dofq|dofw|dofy|h|halfyearly|hofd|m|mofd|monthly|q|qofd|quarterly|tin|twithin|w|weekly|wofd|y|yearly|yh|ym|yofd|yq|yw|cholesky|colnumb|colsof|corr|det|diag|diag0cnt|el|get|hadamard|I|inv|invsym|issym|issymmetric|J|matmissing|matuniform|mreldif|nullmat|rownumb|rowsof|sweep|syminv|trace|vec|vecdiag)(?=\\()"}]},e.COMMENT("^[ ]*\\*.*$",!1),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]}}function zQ(e){return{name:"STEP Part 21",aliases:["p21","step","stp"],case_insensitive:!0,keywords:{$pattern:"[A-Z_][A-Z0-9_.]*",keyword:["HEADER","ENDSEC","DATA"]},contains:[{className:"meta",begin:"ISO-10303-21;",relevance:10},{className:"meta",begin:"END-ISO-10303-21;",relevance:10},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.COMMENT("/\\*\\*!","\\*/"),e.C_NUMBER_MODE,e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"'",end:"'"},{className:"symbol",variants:[{begin:"#",end:"\\d+",illegal:"\\W"}]}]}}const VQ=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),WQ=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],qQ=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],KQ=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],QQ=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],jQ=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","backgrou
Line truncated
|
||||
"]*"`}]},{className:"built_in",variants:[{begin:"\\b(abs|acos|asin|atan|atan2|atanh|ceil|cloglog|comb|cos|digamma|exp|floor|invcloglog|invlogit|ln|lnfact|lnfactorial|lngamma|log|log10|max|min|mod|reldif|round|sign|sin|sqrt|sum|tan|tanh|trigamma|trunc|betaden|Binomial|binorm|binormal|chi2|chi2tail|dgammapda|dgammapdada|dgammapdadx|dgammapdx|dgammapdxdx|F|Fden|Ftail|gammaden|gammap|ibeta|invbinomial|invchi2|invchi2tail|invF|invFtail|invgammap|invibeta|invnchi2|invnFtail|invnibeta|invnorm|invnormal|invttail|nbetaden|nchi2|nFden|nFtail|nibeta|norm|normal|normalden|normd|npnchi2|tden|ttail|uniform|abbrev|char|index|indexnot|length|lower|ltrim|match|plural|proper|real|regexm|regexr|regexs|reverse|rtrim|string|strlen|strlower|strltrim|strmatch|strofreal|strpos|strproper|strreverse|strrtrim|strtrim|strupper|subinstr|subinword|substr|trim|upper|word|wordcount|_caller|autocode|byteorder|chop|clip|cond|e|epsdouble|epsfloat|group|inlist|inrange|irecode|matrix|maxbyte|maxdouble|maxfloat|maxint|maxlong|mi|minbyte|mindouble|minfloat|minint|minlong|missing|r|recode|replay|return|s|scalar|d|date|day|dow|doy|halfyear|mdy|month|quarter|week|year|d|daily|dofd|dofh|dofm|dofq|dofw|dofy|h|halfyearly|hofd|m|mofd|monthly|q|qofd|quarterly|tin|twithin|w|weekly|wofd|y|yearly|yh|ym|yofd|yq|yw|cholesky|colnumb|colsof|corr|det|diag|diag0cnt|el|get|hadamard|I|inv|invsym|issym|issymmetric|J|matmissing|matuniform|mreldif|nullmat|rownumb|rowsof|sweep|syminv|trace|vec|vecdiag)(?=\\()"}]},e.COMMENT("^[ ]*\\*.*$",!1),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]}}function HQ(e){return{name:"STEP Part 21",aliases:["p21","step","stp"],case_insensitive:!0,keywords:{$pattern:"[A-Z_][A-Z0-9_.]*",keyword:["HEADER","ENDSEC","DATA"]},contains:[{className:"meta",begin:"ISO-10303-21;",relevance:10},{className:"meta",begin:"END-ISO-10303-21;",relevance:10},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.COMMENT("/\\*\\*!","\\*/"),e.C_NUMBER_MODE,e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"'",end:"'"},{className:"symbol",variants:[{begin:"#",end:"\\d+",illegal:"\\W"}]}]}}const $Q=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),zQ=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],VQ=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],WQ=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],qQ=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],KQ=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","backgrou
Line truncated
|
||||
(multipart)?`,end:`\\]
|
||||
`},{className:"string",begin:"\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}.\\d+Z"},{className:"string",begin:"(\\+|-)\\d+"},{className:"keyword",relevance:10,variants:[{begin:"^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?"},{begin:"^progress(:?)(\\s+)?(pop|push)?"},{begin:"^tags:"},{begin:"^time:"}]}]}}function JQ(e){return{name:"Tagger Script",contains:[{className:"comment",begin:/\$noop\(/,end:/\)/,contains:[{begin:/\\[()]/},{begin:/\(/,end:/\)/,contains:[{begin:/\\[()]/},"self"]}],relevance:10},{className:"keyword",begin:/\$[_a-zA-Z0-9]+(?=\()/},{className:"variable",begin:/%[_a-zA-Z0-9:]+%/},{className:"symbol",begin:/\\[\\nt$%,()]/},{className:"symbol",begin:/\\u[a-fA-F0-9]{4}/}]}}function e4(e){return{name:"Test Anything Protocol",case_insensitive:!0,contains:[e.HASH_COMMENT_MODE,{className:"meta",variants:[{begin:"^TAP version (\\d+)$"},{begin:"^1\\.\\.(\\d+)$"}]},{begin:/---$/,end:"\\.\\.\\.$",subLanguage:"yaml",relevance:0},{className:"number",begin:" (\\d+) "},{className:"symbol",variants:[{begin:"^ok"},{begin:"^not ok"}]}]}}function t4(e){const t=e.regex,n=/[a-zA-Z_][a-zA-Z0-9_]*/,r={className:"number",variants:[e.BINARY_NUMBER_MODE,e.C_NUMBER_MODE]};return{name:"Tcl",aliases:["tk"],keywords:["after","append","apply","array","auto_execok","auto_import","auto_load","auto_mkindex","auto_mkindex_old","auto_qualify","auto_reset","bgerror","binary","break","catch","cd","chan","clock","close","concat","continue","dde","dict","encoding","eof","error","eval","exec","exit","expr","fblocked","fconfigure","fcopy","file","fileevent","filename","flush","for","foreach","format","gets","glob","global","history","http","if","incr","info","interp","join","lappend|10","lassign|10","lindex|10","linsert|10","list","llength|10","load","lrange|10","lrepeat|10","lreplace|10","lreverse|10","lsearch|10","lset|10","lsort|10","mathfunc","mathop","memory","msgcat","namespace","open","package","parray","pid","pkg::create","pkg_mkIndex","platform","platform::shell","proc","puts","pwd","read","refchan","regexp","registry","regsub|10","rename","return","safe","scan","seek","set","socket","source","split","string","subst","switch","tcl_endOfWord","tcl_findLibrary","tcl_startOfNextWord","tcl_startOfPreviousWord","tcl_wordBreakAfter","tcl_wordBreakBefore","tcltest","tclvars","tell","time","tm","trace","unknown","unload","unset","update","uplevel","upvar","variable","vwait","while"],contains:[e.COMMENT(";[ \\t]*#","$"),e.COMMENT("^[ \\t]*#","$"),{beginKeywords:"proc",end:"[\\{]",excludeEnd:!0,contains:[{className:"title",begin:"[ \\t\\n\\r]+(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"[ \\t\\n\\r]",endsWithParent:!0,excludeEnd:!0}]},{className:"variable",variants:[{begin:t.concat(/\$/,t.optional(/::/),n,"(::",n,")*")},{begin:"\\$\\{(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"\\}",contains:[r]}]},{className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.inherit(e.QUOTE_STRING_MODE,{illegal:null})]},r]}}function n4(e){const t=["bool","byte","i16","i32","i64","double","string","binary"];return{name:"Thrift",keywords:{keyword:["namespace","const","typedef","struct","enum","service","exception","void","oneway","set","list","map","required","optional"],type:t,literal:"true false"},contains:[e.QUOTE_STRING_MODE,e.NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"class",beginKeywords:"struct enum service exception",end:/\{/,illegal:/\n/,contains:[e.inherit(e.TITLE_MODE,{starts:{endsWithParent:!0,excludeEnd:!0}})]},{begin:"\\b(set|list|map)\\s*<",keywords:{type:[...t,"set","list","map"]},end:">",contains:["self"]}]}}function r4(e){const t={className:"number",begin:"[1-9][0-9]*",relevance:0},n={className:"symbol",begin:":[^\\]]+"},r={className:"built_in",begin:"(AR|P|PAYLOAD|PR|R|SR|RSR|LBL|VR|UALM|MESSAGE|UTOOL|UFRAME|TIMER|TIMER_OVERFLOW|JOINT_MAX_SPEED|RESUME_PROG|DIAG_REC)\\[",end:"\\]",contains:["self",t,n]},i={className:"built_in",begin:"(AI|AO|DI|DO|F|RI|RO|UI|UO|GI|GO|SI|SO)\\[",end:"\\]",contains:["self",t,e.QUOTE_STRING_MODE,n]};return{name:"TP",keywords:{keyword:["ABORT","ACC","ADJUST","AND","AP_LD","BREAK","CALL","CNT","COL","CONDITION","CONFIG","DA","DB","DIV","DETECT","ELSE","END","ENDFOR","ERR_NUM","ERROR_PROG","FINE","FOR","GP","GUARD","INC","IF","JMP","LINEAR_MAX_SPEED","LOCK","MOD","MONITOR","OFFSET","Offset","OR","OVERRIDE","PAUSE","PREG","PTH","RT_LD","RUN","SELECT","SKIP","Skip","TA","TB","TO","TOOL_OFFSET","Tool_Offset","UF","UT","UFRAME_NUM","UTOOL_NUM","UNLOCK","WAIT","X","Y","Z","W","P","R","STRLEN","SUBSTR","FINDSTR","VOFFSET","PROG","ATTR","MN","POS"],literal:["ON","OFF","max_speed","LPOS","JPOS","ENABLE","DISABLE","START","STOP","RESET"]},contains:[r,i,{className:"keyword",begin:"/(PROG|ATTR|MN|POS|END)\\b"},{className:"keyword",begin:"(CALL|RUN|POINT_LOGIC|LBL)\\b"},{className:"keyword",begin:"\\b(ACC|CNT|Skip|Offset|PSPD|RT_LD|AP_LD|Tool_Offset)"},{className:"number",begin:"\\d+(sec|msec|mm/sec|cm/min|inch/min|deg/sec|mm|in|cm)?\\b",relevance:0},e.COMMENT
Line truncated
|
||||
`},u]}}const H4=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),$4=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],z4=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],fM=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],mM=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],V4=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","fon
Line truncated
|
||||
]`,g={scope:"string",variants:[u,l,p,_]},h={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},E=["false","null","true"],b=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],T=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],R={keyword:b,literal:(pe=>{const ce=[];return pe.forEach(ee=>{ce.push(ee),ee.toLowerCase()===ee?ce.push(ee.toUpperCase()):ce.push(ee.toLowerCase())}),ce})(E),built_in:T},A=pe=>pe.map(ce=>ce.replace(/\|\d+$/,"")),I={variants:[{match:[/new/,t.concat(f,"+"),t.concat("(?!",A(T).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},D=t.concat(r,"\\b(?!\\()"),M={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),D],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),D],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},$={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},H={relevance:0,begin:/\(/,end:/\)/,keywords:R,contains:[$,o,M,e.C_BLOCK_COMMENT_MODE,g,h,I]},B={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",A(b).join("\\b|"),"|",A(T).join("\\b|"),"\\b)"),r,t.concat(f,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[H]};H.contains.push(B);const se=[$,M,e.C_BLOCK_COMMENT_MODE,g,h,I],de={begin:t.concat(/#\[\s*/,i),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:E,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:E,keyword:["new","array"]},contains:["self",...se]},...se,{scope:"meta",match:i}]};return{case_insensitive:!1,keywords:R,contains:[de,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},s,{scope:"variable.language",match:/\$this\b/},o,B,M,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},I,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:R,contains:["self",o,M,e.C_BLOCK_COMMENT_MODE,g,h]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trai
Line truncated
|
||||
https://github.com/highlightjs/highlight.js/issues/2277`),V=L,q=w),G===void 0&&(G=!0);const te={code:q,language:V};ee("before:highlight",te);const Ee=te.result?te.result:_(te.language,te.code,G);return Ee.code=te.code,ee("after:highlight",Ee),Ee}function _(L,w,G,q){const V=Object.create(null);function te(z,Q){return z.keywords[Q]}function Ee(){if(!ne.keywords){Ae.addText(Se);return}let z=0;ne.keywordPatternRe.lastIndex=0;let Q=ne.keywordPatternRe.exec(Se),oe="";for(;Q;){oe+=Se.substring(z,Q.index);const me=nt.case_insensitive?Q[0].toLowerCase():Q[0],Ge=te(ne,me);if(Ge){const[ht,ro]=Ge;if(Ae.addText(oe),oe="",V[me]=(V[me]||0)+1,V[me]<=bj&&(An+=ro),ht.startsWith("_"))oe+=Q[0];else{const io=nt.classNameAliases[ht]||ht;Ie(Q[0],io)}}else oe+=Q[0];z=ne.keywordPatternRe.lastIndex,Q=ne.keywordPatternRe.exec(Se)}oe+=Se.substring(z),Ae.addText(oe)}function be(){if(Se==="")return;let z=null;if(typeof ne.subLanguage=="string"){if(!t[ne.subLanguage]){Ae.addText(Se);return}z=_(ne.subLanguage,Se,!0,On[ne.subLanguage]),On[ne.subLanguage]=z._top}else z=g(Se,ne.subLanguage.length?ne.subLanguage:null);ne.relevance>0&&(An+=z.relevance),Ae.__addSublanguage(z._emitter,z.language)}function ye(){ne.subLanguage!=null?be():Ee(),Se=""}function Ie(z,Q){z!==""&&(Ae.startScope(Q),Ae.addText(z),Ae.endScope())}function tt(z,Q){let oe=1;const me=Q.length-1;for(;oe<=me;){if(!z._emit[oe]){oe++;continue}const Ge=nt.classNameAliases[z[oe]]||z[oe],ht=Q[oe];Ge?Ie(ht,Ge):(Se=ht,Ee(),Se=""),oe++}}function Ft(z,Q){return z.scope&&typeof z.scope=="string"&&Ae.openNode(nt.classNameAliases[z.scope]||z.scope),z.beginScope&&(z.beginScope._wrap?(Ie(Se,nt.classNameAliases[z.beginScope._wrap]||z.beginScope._wrap),Se=""):z.beginScope._multi&&(tt(z.beginScope,Q),Se="")),ne=Object.create(z,{parent:{value:ne}}),ne}function De(z,Q,oe){let me=U5(z.endRe,oe);if(me){if(z["on:end"]){const Ge=new kO(z);z["on:end"](Q,Ge),Ge.isMatchIgnored&&(me=!1)}if(me){for(;z.endsParent&&z.parent;)z=z.parent;return z}}if(z.endsWithParent)return De(z.parent,Q,oe)}function xt(z){return ne.matcher.regexIndex===0?(Se+=z[0],1):(ai=!0,0)}function Nn(z){const Q=z[0],oe=z.rule,me=new kO(oe),Ge=[oe.__beforeBegin,oe["on:begin"]];for(const ht of Ge)if(ht&&(ht(z,me),me.isMatchIgnored))return xt(Q);return oe.skip?Se+=Q:(oe.excludeBegin&&(Se+=Q),ye(),!oe.returnBegin&&!oe.excludeBegin&&(Se=Q)),Ft(oe,z),oe.returnBegin?0:Q.length}function Te(z){const Q=z[0],oe=w.substring(z.index),me=De(ne,z,oe);if(!me)return YO;const Ge=ne;ne.endScope&&ne.endScope._wrap?(ye(),Ie(Q,ne.endScope._wrap)):ne.endScope&&ne.endScope._multi?(ye(),tt(ne.endScope,z)):Ge.skip?Se+=Q:(Ge.returnEnd||Ge.excludeEnd||(Se+=Q),ye(),Ge.excludeEnd&&(Se=Q));do ne.scope&&Ae.closeNode(),!ne.skip&&!ne.subLanguage&&(An+=ne.relevance),ne=ne.parent;while(ne!==me.parent);return me.starts&&Ft(me.starts,z),Ge.returnEnd?0:Q.length}function si(){const z=[];for(let Q=ne;Q!==nt;Q=Q.parent)Q.scope&&z.unshift(Q.scope);z.forEach(Q=>Ae.openNode(Q))}let pt={};function vn(z,Q){const oe=Q&&Q[0];if(Se+=z,oe==null)return ye(),0;if(pt.type==="begin"&&Q.type==="end"&&pt.index===Q.index&&oe===""){if(Se+=w.slice(Q.index,Q.index+1),!i){const me=new Error(`0 width match regex (${L})`);throw me.languageName=L,me.badRule=pt.rule,me}return 1}if(pt=Q,Q.type==="begin")return Nn(Q);if(Q.type==="illegal"&&!G){const me=new Error('Illegal lexeme "'+oe+'" for mode "'+(ne.scope||"<unnamed>")+'"');throw me.mode=ne,me}else if(Q.type==="end"){const me=Te(Q);if(me!==YO)return me}if(Q.type==="illegal"&&oe==="")return 1;if(Hn>1e5&&Hn>Q.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Se+=oe,oe.length}const nt=H(L);if(!nt)throw qs(o.replace("{}",L)),new Error('Unknown language: "'+L+'"');const en=hj(nt);let Qe="",ne=q||en;const On={},Ae=new a.__emitter(a);si();let Se="",An=0,zt=0,Hn=0,ai=!1;try{if(nt.__emitTokens)nt.__emitTokens(w,Ae);else{for(ne.matcher.considerAll();;){Hn++,ai?ai=!1:ne.matcher.considerAll(),ne.matcher.lastIndex=zt;const z=ne.matcher.exec(w);if(!z)break;const Q=w.substring(zt,z.index),oe=vn(Q,z);zt=z.index+oe}vn(w.substring(zt))}return Ae.finalize(),Qe=Ae.toHTML(),{language:L,value:Qe,relevance:An,illegal:!1,_emitter:Ae,_top:ne}}catch(z){if(z.message&&z.message.includes("Illegal"))return{language:L,value:Kh(w),illegal:!0,relevance:0,_illegalBy:{message:z.message,index:zt,context:w.slice(zt-100,zt+100),mode:z.mode,resultSoFar:Qe},_emitter:Ae};if(i)return{language:L,value:Kh(w),illegal:!1,relevance:0,errorRaised:z,_emitter:Ae,_top:ne};throw z}}function f(L){const w={value:Kh(L),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return w._emitter.addText(L),w}function g(L,w){w=w||a.languages||Object.keys(t);const G=f(L),q=w.filter(H).filter(se).map(ye=>_(ye,L,!1));q.unshift(G);const V=q.sort((ye,Ie)=>{if(ye.relevance!==Ie.relevance)return Ie.relevance-ye.relevance;if(ye.language&&Ie.language){if(H(ye.language).supersetOf===Ie.language)return 1;if(H(Ie.language).supersetOf===ye.language)return-1}return 0}),[te,Ee]=V,
Line truncated
|
||||
`},{className:"string",begin:"\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}.\\d+Z"},{className:"string",begin:"(\\+|-)\\d+"},{className:"keyword",relevance:10,variants:[{begin:"^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?"},{begin:"^progress(:?)(\\s+)?(pop|push)?"},{begin:"^tags:"},{begin:"^time:"}]}]}}function XQ(e){return{name:"Tagger Script",contains:[{className:"comment",begin:/\$noop\(/,end:/\)/,contains:[{begin:/\\[()]/},{begin:/\(/,end:/\)/,contains:[{begin:/\\[()]/},"self"]}],relevance:10},{className:"keyword",begin:/\$[_a-zA-Z0-9]+(?=\()/},{className:"variable",begin:/%[_a-zA-Z0-9:]+%/},{className:"symbol",begin:/\\[\\nt$%,()]/},{className:"symbol",begin:/\\u[a-fA-F0-9]{4}/}]}}function ZQ(e){return{name:"Test Anything Protocol",case_insensitive:!0,contains:[e.HASH_COMMENT_MODE,{className:"meta",variants:[{begin:"^TAP version (\\d+)$"},{begin:"^1\\.\\.(\\d+)$"}]},{begin:/---$/,end:"\\.\\.\\.$",subLanguage:"yaml",relevance:0},{className:"number",begin:" (\\d+) "},{className:"symbol",variants:[{begin:"^ok"},{begin:"^not ok"}]}]}}function JQ(e){const t=e.regex,n=/[a-zA-Z_][a-zA-Z0-9_]*/,r={className:"number",variants:[e.BINARY_NUMBER_MODE,e.C_NUMBER_MODE]};return{name:"Tcl",aliases:["tk"],keywords:["after","append","apply","array","auto_execok","auto_import","auto_load","auto_mkindex","auto_mkindex_old","auto_qualify","auto_reset","bgerror","binary","break","catch","cd","chan","clock","close","concat","continue","dde","dict","encoding","eof","error","eval","exec","exit","expr","fblocked","fconfigure","fcopy","file","fileevent","filename","flush","for","foreach","format","gets","glob","global","history","http","if","incr","info","interp","join","lappend|10","lassign|10","lindex|10","linsert|10","list","llength|10","load","lrange|10","lrepeat|10","lreplace|10","lreverse|10","lsearch|10","lset|10","lsort|10","mathfunc","mathop","memory","msgcat","namespace","open","package","parray","pid","pkg::create","pkg_mkIndex","platform","platform::shell","proc","puts","pwd","read","refchan","regexp","registry","regsub|10","rename","return","safe","scan","seek","set","socket","source","split","string","subst","switch","tcl_endOfWord","tcl_findLibrary","tcl_startOfNextWord","tcl_startOfPreviousWord","tcl_wordBreakAfter","tcl_wordBreakBefore","tcltest","tclvars","tell","time","tm","trace","unknown","unload","unset","update","uplevel","upvar","variable","vwait","while"],contains:[e.COMMENT(";[ \\t]*#","$"),e.COMMENT("^[ \\t]*#","$"),{beginKeywords:"proc",end:"[\\{]",excludeEnd:!0,contains:[{className:"title",begin:"[ \\t\\n\\r]+(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"[ \\t\\n\\r]",endsWithParent:!0,excludeEnd:!0}]},{className:"variable",variants:[{begin:t.concat(/\$/,t.optional(/::/),n,"(::",n,")*")},{begin:"\\$\\{(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"\\}",contains:[r]}]},{className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.inherit(e.QUOTE_STRING_MODE,{illegal:null})]},r]}}function e4(e){const t=["bool","byte","i16","i32","i64","double","string","binary"];return{name:"Thrift",keywords:{keyword:["namespace","const","typedef","struct","enum","service","exception","void","oneway","set","list","map","required","optional"],type:t,literal:"true false"},contains:[e.QUOTE_STRING_MODE,e.NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"class",beginKeywords:"struct enum service exception",end:/\{/,illegal:/\n/,contains:[e.inherit(e.TITLE_MODE,{starts:{endsWithParent:!0,excludeEnd:!0}})]},{begin:"\\b(set|list|map)\\s*<",keywords:{type:[...t,"set","list","map"]},end:">",contains:["self"]}]}}function t4(e){const t={className:"number",begin:"[1-9][0-9]*",relevance:0},n={className:"symbol",begin:":[^\\]]+"},r={className:"built_in",begin:"(AR|P|PAYLOAD|PR|R|SR|RSR|LBL|VR|UALM|MESSAGE|UTOOL|UFRAME|TIMER|TIMER_OVERFLOW|JOINT_MAX_SPEED|RESUME_PROG|DIAG_REC)\\[",end:"\\]",contains:["self",t,n]},i={className:"built_in",begin:"(AI|AO|DI|DO|F|RI|RO|UI|UO|GI|GO|SI|SO)\\[",end:"\\]",contains:["self",t,e.QUOTE_STRING_MODE,n]};return{name:"TP",keywords:{keyword:["ABORT","ACC","ADJUST","AND","AP_LD","BREAK","CALL","CNT","COL","CONDITION","CONFIG","DA","DB","DIV","DETECT","ELSE","END","ENDFOR","ERR_NUM","ERROR_PROG","FINE","FOR","GP","GUARD","INC","IF","JMP","LINEAR_MAX_SPEED","LOCK","MOD","MONITOR","OFFSET","Offset","OR","OVERRIDE","PAUSE","PREG","PTH","RT_LD","RUN","SELECT","SKIP","Skip","TA","TB","TO","TOOL_OFFSET","Tool_Offset","UF","UT","UFRAME_NUM","UTOOL_NUM","UNLOCK","WAIT","X","Y","Z","W","P","R","STRLEN","SUBSTR","FINDSTR","VOFFSET","PROG","ATTR","MN","POS"],literal:["ON","OFF","max_speed","LPOS","JPOS","ENABLE","DISABLE","START","STOP","RESET"]},contains:[r,i,{className:"keyword",begin:"/(PROG|ATTR|MN|POS|END)\\b"},{className:"keyword",begin:"(CALL|RUN|POINT_LOGIC|LBL)\\b"},{className:"keyword",begin:"\\b(ACC|CNT|Skip|Offset|PSPD|RT_LD|AP_LD|Tool_Offset)"},{className:"number",begin:"\\d+(sec|msec|mm/sec|cm/min|inch/min|deg/sec|mm|in|cm)?\\b",relevance:0},e.COMMENT
Line truncated
|
||||
`},u]}}const G4=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),Y4=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],H4=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],fM=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],mM=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],$4=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","fon
Line truncated
|
||||
]`,g={scope:"string",variants:[u,l,p,_]},h={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},E=["false","null","true"],b=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],T=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],R={keyword:b,literal:(pe=>{const ce=[];return pe.forEach(ee=>{ce.push(ee),ee.toLowerCase()===ee?ce.push(ee.toUpperCase()):ce.push(ee.toLowerCase())}),ce})(E),built_in:T},O=pe=>pe.map(ce=>ce.replace(/\|\d+$/,"")),I={variants:[{match:[/new/,t.concat(f,"+"),t.concat("(?!",O(T).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},D=t.concat(r,"\\b(?!\\()"),M={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),D],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),D],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},$={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},H={relevance:0,begin:/\(/,end:/\)/,keywords:R,contains:[$,o,M,e.C_BLOCK_COMMENT_MODE,g,h,I]},B={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",O(b).join("\\b|"),"|",O(T).join("\\b|"),"\\b)"),r,t.concat(f,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[H]};H.contains.push(B);const se=[$,M,e.C_BLOCK_COMMENT_MODE,g,h,I],de={begin:t.concat(/#\[\s*/,i),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:E,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:E,keyword:["new","array"]},contains:["self",...se]},...se,{scope:"meta",match:i}]};return{case_insensitive:!1,keywords:R,contains:[de,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},s,{scope:"variable.language",match:/\$this\b/},o,B,M,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},I,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:R,contains:["self",o,M,e.C_BLOCK_COMMENT_MODE,g,h]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trai
Line truncated
|
||||
https://github.com/highlightjs/highlight.js/issues/2277`),V=L,q=w),G===void 0&&(G=!0);const te={code:q,language:V};ee("before:highlight",te);const Ee=te.result?te.result:_(te.language,te.code,G);return Ee.code=te.code,ee("after:highlight",Ee),Ee}function _(L,w,G,q){const V=Object.create(null);function te(z,Q){return z.keywords[Q]}function Ee(){if(!ne.keywords){Ae.addText(Se);return}let z=0;ne.keywordPatternRe.lastIndex=0;let Q=ne.keywordPatternRe.exec(Se),oe="";for(;Q;){oe+=Se.substring(z,Q.index);const me=tt.case_insensitive?Q[0].toLowerCase():Q[0],Ge=te(ne,me);if(Ge){const[ht,ro]=Ge;if(Ae.addText(oe),oe="",V[me]=(V[me]||0)+1,V[me]<=Sj&&(An+=ro),ht.startsWith("_"))oe+=Q[0];else{const io=tt.classNameAliases[ht]||ht;Ie(Q[0],io)}}else oe+=Q[0];z=ne.keywordPatternRe.lastIndex,Q=ne.keywordPatternRe.exec(Se)}oe+=Se.substring(z),Ae.addText(oe)}function be(){if(Se==="")return;let z=null;if(typeof ne.subLanguage=="string"){if(!t[ne.subLanguage]){Ae.addText(Se);return}z=_(ne.subLanguage,Se,!0,On[ne.subLanguage]),On[ne.subLanguage]=z._top}else z=g(Se,ne.subLanguage.length?ne.subLanguage:null);ne.relevance>0&&(An+=z.relevance),Ae.__addSublanguage(z._emitter,z.language)}function ye(){ne.subLanguage!=null?be():Ee(),Se=""}function Ie(z,Q){z!==""&&(Ae.startScope(Q),Ae.addText(z),Ae.endScope())}function et(z,Q){let oe=1;const me=Q.length-1;for(;oe<=me;){if(!z._emit[oe]){oe++;continue}const Ge=tt.classNameAliases[z[oe]]||z[oe],ht=Q[oe];Ge?Ie(ht,Ge):(Se=ht,Ee(),Se=""),oe++}}function Bt(z,Q){return z.scope&&typeof z.scope=="string"&&Ae.openNode(tt.classNameAliases[z.scope]||z.scope),z.beginScope&&(z.beginScope._wrap?(Ie(Se,tt.classNameAliases[z.beginScope._wrap]||z.beginScope._wrap),Se=""):z.beginScope._multi&&(et(z.beginScope,Q),Se="")),ne=Object.create(z,{parent:{value:ne}}),ne}function De(z,Q,oe){let me=k5(z.endRe,oe);if(me){if(z["on:end"]){const Ge=new kO(z);z["on:end"](Q,Ge),Ge.isMatchIgnored&&(me=!1)}if(me){for(;z.endsParent&&z.parent;)z=z.parent;return z}}if(z.endsWithParent)return De(z.parent,Q,oe)}function xt(z){return ne.matcher.regexIndex===0?(Se+=z[0],1):(ai=!0,0)}function Nn(z){const Q=z[0],oe=z.rule,me=new kO(oe),Ge=[oe.__beforeBegin,oe["on:begin"]];for(const ht of Ge)if(ht&&(ht(z,me),me.isMatchIgnored))return xt(Q);return oe.skip?Se+=Q:(oe.excludeBegin&&(Se+=Q),ye(),!oe.returnBegin&&!oe.excludeBegin&&(Se=Q)),Bt(oe,z),oe.returnBegin?0:Q.length}function Te(z){const Q=z[0],oe=w.substring(z.index),me=De(ne,z,oe);if(!me)return YO;const Ge=ne;ne.endScope&&ne.endScope._wrap?(ye(),Ie(Q,ne.endScope._wrap)):ne.endScope&&ne.endScope._multi?(ye(),et(ne.endScope,z)):Ge.skip?Se+=Q:(Ge.returnEnd||Ge.excludeEnd||(Se+=Q),ye(),Ge.excludeEnd&&(Se=Q));do ne.scope&&Ae.closeNode(),!ne.skip&&!ne.subLanguage&&(An+=ne.relevance),ne=ne.parent;while(ne!==me.parent);return me.starts&&Bt(me.starts,z),Ge.returnEnd?0:Q.length}function si(){const z=[];for(let Q=ne;Q!==tt;Q=Q.parent)Q.scope&&z.unshift(Q.scope);z.forEach(Q=>Ae.openNode(Q))}let pt={};function vn(z,Q){const oe=Q&&Q[0];if(Se+=z,oe==null)return ye(),0;if(pt.type==="begin"&&Q.type==="end"&&pt.index===Q.index&&oe===""){if(Se+=w.slice(Q.index,Q.index+1),!i){const me=new Error(`0 width match regex (${L})`);throw me.languageName=L,me.badRule=pt.rule,me}return 1}if(pt=Q,Q.type==="begin")return Nn(Q);if(Q.type==="illegal"&&!G){const me=new Error('Illegal lexeme "'+oe+'" for mode "'+(ne.scope||"<unnamed>")+'"');throw me.mode=ne,me}else if(Q.type==="end"){const me=Te(Q);if(me!==YO)return me}if(Q.type==="illegal"&&oe==="")return 1;if($n>1e5&&$n>Q.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Se+=oe,oe.length}const tt=H(L);if(!tt)throw qs(o.replace("{}",L)),new Error('Unknown language: "'+L+'"');const en=mj(tt);let Qe="",ne=q||en;const On={},Ae=new a.__emitter(a);si();let Se="",An=0,zt=0,$n=0,ai=!1;try{if(tt.__emitTokens)tt.__emitTokens(w,Ae);else{for(ne.matcher.considerAll();;){$n++,ai?ai=!1:ne.matcher.considerAll(),ne.matcher.lastIndex=zt;const z=ne.matcher.exec(w);if(!z)break;const Q=w.substring(zt,z.index),oe=vn(Q,z);zt=z.index+oe}vn(w.substring(zt))}return Ae.finalize(),Qe=Ae.toHTML(),{language:L,value:Qe,relevance:An,illegal:!1,_emitter:Ae,_top:ne}}catch(z){if(z.message&&z.message.includes("Illegal"))return{language:L,value:Kh(w),illegal:!0,relevance:0,_illegalBy:{message:z.message,index:zt,context:w.slice(zt-100,zt+100),mode:z.mode,resultSoFar:Qe},_emitter:Ae};if(i)return{language:L,value:Kh(w),illegal:!1,relevance:0,errorRaised:z,_emitter:Ae,_top:ne};throw z}}function f(L){const w={value:Kh(L),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return w._emitter.addText(L),w}function g(L,w){w=w||a.languages||Object.keys(t);const G=f(L),q=w.filter(H).filter(se).map(ye=>_(ye,L,!1));q.unshift(G);const V=q.sort((ye,Ie)=>{if(ye.relevance!==Ie.relevance)return Ie.relevance-ye.relevance;if(ye.language&&Ie.language){if(H(ye.language).supersetOf===Ie.language)return 1;if(H(Ie.language).supersetOf===ye.language)return-1}return 0}),[te,Ee]=V,
Line truncated
|
||||
|
||||
`);return!r||!i?!1:!!e.chain().command(({tr:o})=>(o.delete(t.pos-2,t.pos),!0)).exitCode().run()}function kj(){if(this.options.codeMode)return!1;const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?!!this.editor.commands.clearNodes():!1}function Pj({editor:e}){const t=e.state.selection.$from.parent.textContent.slice(0,e.state.selection.$from.parentOffset);return(t==null?void 0:t.split(`
|
||||
`))||[]}const Ub=["arduino","bash","c","cpp","csharp","css","diff","go","graphql","ini","java","javascript","json","kotlin","less","lua","makefile","markdown","objectivec","perl","php","php-template","plaintext","python","python-repl","r","ruby","rust","scss","shell","sql","swift","typescript","vbnet","wasm","xml","yaml","ipsphtml","ipscss"],Uj=ot.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",We(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Pu=Uj.extend({parseHTML(){return[{tag:"li",getAttrs:e=>{var t;if(((t=e.childNodes)==null?void 0:t.length)>1){const n=document.createElement("div");n.innerHTML=e.innerHTML,e.innerHTML="",e.appendChild(n)}return null}}]}});function Qt(e,t="",n=!0){const r=i=>{t&&(i.message=t+": "+i.message),window.Debug[n?"warn":"error"](i)};try{const i=e();return i instanceof Promise?new Promise(o=>{i.catch(r).finally(()=>o(!1))}):!0}catch(i){return r(i),!1}}const rr=Db.extend({addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this)}},addAttributes(){var e;return{language:{default:this.options.defaultLanguage||((e=this.options.allowedLanguages)==null?void 0:e[0])||"plaintext",parseHTML:t=>{var r,i;const n=(r=(()=>{if(t.hasAttribute("language"))return t.getAttribute("language");for(const o of t.classList)if(o.match(/^language-([a-z0-9\-_]+)$/i))return o.match(/^language-([a-z0-9\-_]+)$/i)[1];if(t.dataset.language&&t.dataset.language in df)return df[t.dataset.language];for(const o of t.querySelectorAll("code")){if(o.hasAttribute("language"))return o.getAttribute("language");for(const s of o.classList)if(s.match(/^language-([a-z0-9\-_]+)$/i))return s.match(/^language-([a-z0-9\-_]+)$/i)[1]}})())==null?void 0:r.toLowerCase();return this.options.codeMode&&(!n||!Ub.includes(n)||n!==this.options.defaultLanguage&&this.options.allowedLanguages&&!this.options.allowedLanguages.includes(n))?this.options.defaultLanguage||((i=this.options.allowedLanguages)==null?void 0:i[0])||"plaintext":n}}}},addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),codeMode:!1,allowedLanguages:null}},renderHTML({HTMLAttributes:e}){var n;const t=this.options.codeMode?this.editor.options.lastLang||((n=this.editor.options.allowedLanguages)==null?void 0:n[0])||"plaintext":e.language;return["pre",{spellcheck:"false",class:`${this.options.codeMode?"":"ipsCode "}language-${t}`,"data-language":Rl[t]||t},["code",{},0]]},onUpdate({editor:e}){this.options.codeMode&&e.options.lastLang&&e.options.lastLang!==e.getAttributes(this).language&&e.chain().setCodeBlock({language:e.options.lastLang}).run()},addKeyboardShortcuts(){const e=this.editor;return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{var o;if(!e.state.selection.empty||((o=e.state.selection.$from.parent)==null?void 0:o.type.name)!==this.name)return!1;if(kj.call(this))return!0;if(!this.options.codeMode&&(!e.state.selection.$from.parent.attrs.language||["plaintext","bash","shell","zsh","sh"].includes(e.state.selection.$from.parent.attrs.language)))return!1;const n=e.state.selection.$from.parent.textContent.slice(0,e.state.selection.$from.parentOffset),r=e.state.selection.$from.parent.textContent.slice(e.state.selection.$from.parentOffset);if(n&&r){for(const s in qt)if(n.endsWith(s)&&r.startsWith(qt[s]))return e.chain().deleteRange({from:e.state.selection.from-s.length,to:e.state.selection.from+qt[s].length}).setTextSelection(e.state.selection.from-s.length).focus().run()}const i=n.match(/(\t)[^\n]*(\n\t+)$/);return i?e.chain().deleteRange({from:e.state.selection.from-i[2].length,to:e.state.selection.from}).setTextSelection(e.state.selection.from-i[2].length).focus().run():!1},Enter:({editor:t})=>{var y,R,A,I,D,M,$,H,B,se,de;if(Lj.call(this,{editor:t}))return!0;const{$from:r}=t.state.selection,{parent:i}=r;if(!t.state.selection.empty||(i==null?void 0:i.type.name)!==this.name||!this.options.codeMode&&(!i.attrs.language||["plaintext","bash","shell","zsh","sh"].includes(i.attrs.language)))return!1;const o=Pj({editor:t});if(!o.length)return!1;const s=o[o.length-1],a=o[o.length-2];let l=((R=(y=s.match(/^\t*/))==null?void 0:y[0])==null?void 0:R.length)||0,u=!1;const p=i.attrs.language,_=["ipsphtml","xml","html","xhtml","html5"].includes(p),f=["ipscss","css","scss","sass","less"].includes(p),g=["plaintext","rtf","markdown","md","bbcode"].includes(p),h=_?/(<[^>/]*>)$/:/([{[(.:]|->)$/,E=_?/(<\/[^/>]*>)$/:/^\s*([}\])]+[,;]?)$/;let b=!1;if(!_&&!f&&!g&&s.match(/^\s+(\.|->)?[a-z0-9_-]/i))if(s.match(/^\s+(\.|->)/))b=!0,l--;else{let pe=1;for(;pe<o.length&&((D=(I=(A=o[o.length-1-pe])==null?void 0:A.match(/^\t*/))==null?void 0:I[0])==null?void 0:D.length)<
Line truncated
|
||||
`);return!r||!i?!1:!!e.chain().command(({tr:o})=>(o.delete(t.pos-2,t.pos),!0)).exitCode().run()}function Mj(){if(this.options.codeMode)return!1;const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?!!this.editor.commands.clearNodes():!1}function Lj({editor:e}){const t=e.state.selection.$from.parent.textContent.slice(0,e.state.selection.$from.parentOffset);return(t==null?void 0:t.split(`
|
||||
`))||[]}const Ub=["arduino","bash","c","cpp","csharp","css","diff","go","graphql","ini","java","javascript","json","kotlin","less","lua","makefile","markdown","objectivec","perl","php","php-template","plaintext","python","python-repl","r","ruby","rust","scss","shell","sql","swift","typescript","vbnet","wasm","xml","yaml","ipsphtml","ipscss"],kj=ot.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",We(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Pu=kj.extend({parseHTML(){return[{tag:"li",getAttrs:e=>{var t;if(((t=e.childNodes)==null?void 0:t.length)>1){const n=document.createElement("div");n.innerHTML=e.innerHTML,e.innerHTML="",e.appendChild(n)}return null}}]}});function Qt(e,t="",n=!0){const r=i=>{t&&(i.message=t+": "+i.message),window.Debug[n?"warn":"error"](i)};try{const i=e();return i instanceof Promise?new Promise(o=>{i.catch(r).finally(()=>o(!1))}):!0}catch(i){return r(i),!1}}const rr=Db.extend({addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this)}},addAttributes(){var e;return{language:{default:this.options.defaultLanguage||((e=this.options.allowedLanguages)==null?void 0:e[0])||"plaintext",parseHTML:t=>{var r,i;const n=(r=(()=>{if(t.hasAttribute("language"))return t.getAttribute("language");for(const o of t.classList)if(o.match(/^language-([a-z0-9\-_]+)$/i))return o.match(/^language-([a-z0-9\-_]+)$/i)[1];if(t.dataset.language&&t.dataset.language in df)return df[t.dataset.language];for(const o of t.querySelectorAll("code")){if(o.hasAttribute("language"))return o.getAttribute("language");for(const s of o.classList)if(s.match(/^language-([a-z0-9\-_]+)$/i))return s.match(/^language-([a-z0-9\-_]+)$/i)[1]}})())==null?void 0:r.toLowerCase();return this.options.codeMode&&(!n||!Ub.includes(n)||n!==this.options.defaultLanguage&&this.options.allowedLanguages&&!this.options.allowedLanguages.includes(n))?this.options.defaultLanguage||((i=this.options.allowedLanguages)==null?void 0:i[0])||"plaintext":n}}}},addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),codeMode:!1,allowedLanguages:null}},renderHTML({HTMLAttributes:e}){var n;const t=this.options.codeMode?this.editor.options.lastLang||((n=this.editor.options.allowedLanguages)==null?void 0:n[0])||"plaintext":e.language;return["pre",{spellcheck:"false",class:`${this.options.codeMode?"":"ipsCode "}language-${t}`,"data-language":Rl[t]||t},["code",{},0]]},onUpdate({editor:e}){this.options.codeMode&&e.options.lastLang&&e.options.lastLang!==e.getAttributes(this).language&&e.chain().setCodeBlock({language:e.options.lastLang}).run()},addKeyboardShortcuts(){const e=this.editor;return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{var o;if(!e.state.selection.empty||((o=e.state.selection.$from.parent)==null?void 0:o.type.name)!==this.name)return!1;if(Mj.call(this))return!0;if(!this.options.codeMode&&(!e.state.selection.$from.parent.attrs.language||["plaintext","bash","shell","zsh","sh"].includes(e.state.selection.$from.parent.attrs.language)))return!1;const n=e.state.selection.$from.parent.textContent.slice(0,e.state.selection.$from.parentOffset),r=e.state.selection.$from.parent.textContent.slice(e.state.selection.$from.parentOffset);if(n&&r){for(const s in qt)if(n.endsWith(s)&&r.startsWith(qt[s]))return e.chain().deleteRange({from:e.state.selection.from-s.length,to:e.state.selection.from+qt[s].length}).setTextSelection(e.state.selection.from-s.length).focus().run()}const i=n.match(/(\t)[^\n]*(\n\t+)$/);return i?e.chain().deleteRange({from:e.state.selection.from-i[2].length,to:e.state.selection.from}).setTextSelection(e.state.selection.from-i[2].length).focus().run():!1},Enter:({editor:t})=>{var y,R,O,I,D,M,$,H,B,se,de;if(xj.call(this,{editor:t}))return!0;const{$from:r}=t.state.selection,{parent:i}=r;if(!t.state.selection.empty||(i==null?void 0:i.type.name)!==this.name||!this.options.codeMode&&(!i.attrs.language||["plaintext","bash","shell","zsh","sh"].includes(i.attrs.language)))return!1;const o=Lj({editor:t});if(!o.length)return!1;const s=o[o.length-1],a=o[o.length-2];let l=((R=(y=s.match(/^\t*/))==null?void 0:y[0])==null?void 0:R.length)||0,u=!1;const p=i.attrs.language,_=["ipsphtml","xml","html","xhtml","html5"].includes(p),f=["ipscss","css","scss","sass","less"].includes(p),g=["plaintext","rtf","markdown","md","bbcode"].includes(p),h=_?/(<[^>/]*>)$/:/([{[(.:]|->)$/,E=_?/(<\/[^/>]*>)$/:/^\s*([}\])]+[,;]?)$/;let b=!1;if(!_&&!f&&!g&&s.match(/^\s+(\.|->)?[a-z0-9_-]/i))if(s.match(/^\s+(\.|->)/))b=!0,l--;else{let pe=1;for(;pe<o.length&&((D=(I=(O=o[o.length-1-pe])==null?void 0:O.match(/^\t*/))==null?void 0:I[0])==null?void 0:D.length)<
Line truncated
|
||||
`+" ".repeat(l);u?(pe-=s.length,ee=s.replace(/^\t/,"")+ee):T&&(ce=`
|
||||
`+(l>1?" ".repeat(l-1):""),ee+=ce);let ue=this.editor.chain().insertContentAt({from:pe,to:t.state.selection.from},{type:"text",text:ee});return ce&&(ue=ue.setTextSelection(t.state.selection.from+ee.length-ce.length)),ue.focus().run()}return!1},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown||this.options.codeMode)return!1;const{state:n}=t,{selection:r,doc:i}=n,{$from:o,empty:s}=r;if(!s||o.parent.type!==this.type||!(o.parentOffset===o.parent.nodeSize-2))return!1;const l=o.after();return l===void 0||i.nodeAt(l)?!1:!!t.commands.exitCode()},ArrowUp:Fj.bind(this),Tab:Pp.bind(this,!1,{editor:e}),"Shift-Tab":Pp.bind(this,!0,{editor:e}),"Alt-Tab":Pp.bind(this,!1,{editor:e},!0),"Shift-Alt-Tab":Pp.bind(this,!0,{editor:e},!0)}},addProseMirrorPlugins(){var t;const e={};for(const n in qt)e[qt[n]]=n;return[...((t=this.parent)==null?void 0:t.call(this))||[],new Ze({key:new Ke("ipsCodeModeSyntaxHelpers"),props:{handleKeyDown:(n,r)=>{var o;if(!(r instanceof KeyboardEvent)||r.metaKey||r.altKey)return;const i=this.editor;if(((o=r.key)==null?void 0:o.toLowerCase())in qt)return r.key.toLowerCase()in e&&HO({editor:i,opener:r.key.toLowerCase()})?!0:!!Bj({editor:i,char:r.key.toLowerCase()});if(r.key.toLowerCase()in e)return!!HO({editor:i,opener:e[r.key.toLowerCase()]})}}})]}});function Fj({editor:e}){if(e.options.codeMode)return!1;const{$from:t,empty:n}=e.state.selection;if(t.nodeBefore||!n||t.parent.type!==this.type)return!1;let r=0,i;for(const s of[...t.path].reverse()){if(!Number.isInteger(s)&&(r++,r===2))break;i=s}return!r||!Number.isInteger(i)||i!==0||!(t.parentOffset===0)?!1:(e.chain().insertContentAt(t.before(),"<p> </p>",{updateSelection:!0}).run(),!0)}function Pp(e=!1,{editor:t=null},n=!1){var r,i,o,s;if((!t.state.selection.empty||e)&&t.isActive(this.name)&&(t.options.codeMode||[...t.state.selection.$from.path].reverse()[3]===[...t.state.selection.$to.path].reverse()[3]))return t.state.selection.empty&&e&&t.state.selection.$from.parentOffset===0||Qt(()=>{t.chain().command(({tr:a,chain:l})=>{var u,p,_,f;try{const{from:g,to:h}=t.state.selection,E=[...t.state.selection.$from.path].reverse()[3]+1;let b=g;if(b>[...t.state.selection.$from.path].reverse()[3]){for(;b>[...t.state.selection.$from.path].reverse()[3]&&!((u=a.doc.slice(b-1,b--).content.content[0])!=null&&u.textContent.startsWith(`
|
||||
`+(l>1?" ".repeat(l-1):""),ee+=ce);let ue=this.editor.chain().insertContentAt({from:pe,to:t.state.selection.from},{type:"text",text:ee});return ce&&(ue=ue.setTextSelection(t.state.selection.from+ee.length-ce.length)),ue.focus().run()}return!1},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown||this.options.codeMode)return!1;const{state:n}=t,{selection:r,doc:i}=n,{$from:o,empty:s}=r;if(!s||o.parent.type!==this.type||!(o.parentOffset===o.parent.nodeSize-2))return!1;const l=o.after();return l===void 0||i.nodeAt(l)?!1:!!t.commands.exitCode()},ArrowUp:Pj.bind(this),Tab:Pp.bind(this,!1,{editor:e}),"Shift-Tab":Pp.bind(this,!0,{editor:e}),"Alt-Tab":Pp.bind(this,!1,{editor:e},!0),"Shift-Alt-Tab":Pp.bind(this,!0,{editor:e},!0)}},addProseMirrorPlugins(){var t;const e={};for(const n in qt)e[qt[n]]=n;return[...((t=this.parent)==null?void 0:t.call(this))||[],new Xe({key:new Ke("ipsCodeModeSyntaxHelpers"),props:{handleKeyDown:(n,r)=>{var o;if(!(r instanceof KeyboardEvent)||r.metaKey||r.altKey)return;const i=this.editor;if(((o=r.key)==null?void 0:o.toLowerCase())in qt)return r.key.toLowerCase()in e&&HO({editor:i,opener:r.key.toLowerCase()})?!0:!!Uj({editor:i,char:r.key.toLowerCase()});if(r.key.toLowerCase()in e)return!!HO({editor:i,opener:e[r.key.toLowerCase()]})}}})]}});function Pj({editor:e}){if(e.options.codeMode)return!1;const{$from:t,empty:n}=e.state.selection;if(t.nodeBefore||!n||t.parent.type!==this.type)return!1;let r=0,i;for(const s of[...t.path].reverse()){if(!Number.isInteger(s)&&(r++,r===2))break;i=s}return!r||!Number.isInteger(i)||i!==0||!(t.parentOffset===0)?!1:(e.chain().insertContentAt(t.before(),"<p> </p>",{updateSelection:!0}).run(),!0)}function Pp(e=!1,{editor:t=null},n=!1){var r,i,o,s;if((!t.state.selection.empty||e)&&t.isActive(this.name)&&(t.options.codeMode||[...t.state.selection.$from.path].reverse()[3]===[...t.state.selection.$to.path].reverse()[3]))return t.state.selection.empty&&e&&t.state.selection.$from.parentOffset===0||Qt(()=>{t.chain().command(({tr:a,chain:l})=>{var u,p,_,f;try{const{from:g,to:h}=t.state.selection,E=[...t.state.selection.$from.path].reverse()[3]+1;let b=g;if(b>[...t.state.selection.$from.path].reverse()[3]){for(;b>[...t.state.selection.$from.path].reverse()[3]&&!((u=a.doc.slice(b-1,b--).content.content[0])!=null&&u.textContent.startsWith(`
|
||||
`)););b++}const T=((p=a.doc.slice(b,h).content.content[0])==null?void 0:p.textContent)||"",y=g-b,R=T.split(`
|
||||
`),A=R.map(M=>e?M.replace(/^\t/,""):" "+M).join(`
|
||||
`);let I=!1;try{e&&R.length>1&&R[R.length-1].match(/^\t/)&&((f=(_=a.doc.slice(h,h+1))==null?void 0:_.content.content[0])==null?void 0:f.textContent)===" "&&(I=!0)}catch{}a.insertText(A,b,h);const D={from:b+y,to:b+A.length};e&&T.startsWith(" ")?D.from--:e||D.from++,I&&D.to++,E>D.from&&(D.from=E),l().setTextSelection(D).focus().run()}catch{}return!0}).run()},"Something went wrong when modifying indents in a codeblock selection"),!0;if(!n&&t.isActive(Pu.name))return!1;if(t.state.selection.empty){if(e){if(t.state.selection.$from.parentOffset>0){const a=t.state.doc.slice(t.state.selection.from-1,t.state.selection.from);if(((i=(r=a==null?void 0:a.content)==null?void 0:r.content[0])==null?void 0:i.textContent)===" "){const{from:l}=t.state.selection;return t.chain().command(({tr:u})=>(u.deleteRange(l-1,l),!0)).setTextSelection({from:l-1,to:l-1}).run(),!0}}if(t.state.selection.$from.parentOffset<t.state.selection.$from.parent.nodeSize-2){const a=t.state.doc.slice(t.state.selection.from,t.state.selection.from+1);if(((s=(o=a==null?void 0:a.content)==null?void 0:o.content[0])==null?void 0:s.textContent)===" "){const{from:l}=t.state.selection;return t.chain().command(({tr:u})=>(u.deleteRange(l,l+1),!0)).setTextSelection({from:l,to:l}).run(),!0}}}}else return!0;return t.chain().insertContent(" ").focus().run(),!0}function Bj({editor:e,char:t}){var _,f,g;if(!(t in qt))return!1;const{$from:n,$to:r}=e.state.selection,i=n.parent,o=r.parent;if(((_=i==null?void 0:i.type)==null?void 0:_.name)!==Db.name||i!==o)return!1;if(e.state.selection.empty)return e.chain().insertContent(`${t}${qt[t]}`).setTextSelection(e.state.selection.from+t.length).focus().run();const s=i.textContent;let a=s.slice(n.parentOffset,r.parentOffset);if(!a)return!1;if(['"',"'","`"].includes(t)){const h=new RegExp(`(^|[^\\\\])\\${t}`,"g");a=a.replaceAll(h,`$1\\${t}`).replaceAll(/\n/g,"\\n")}let l="",u=0;if(a.match(/\n/)){const E=s.slice(0,n.parentOffset).split(`
|
||||
`),O=R.map(M=>e?M.replace(/^\t/,""):" "+M).join(`
|
||||
`);let I=!1;try{e&&R.length>1&&R[R.length-1].match(/^\t/)&&((f=(_=a.doc.slice(h,h+1))==null?void 0:_.content.content[0])==null?void 0:f.textContent)===" "&&(I=!0)}catch{}a.insertText(O,b,h);const D={from:b+y,to:b+O.length};e&&T.startsWith(" ")?D.from--:e||D.from++,I&&D.to++,E>D.from&&(D.from=E),l().setTextSelection(D).focus().run()}catch{}return!0}).run()},"Something went wrong when modifying indents in a codeblock selection"),!0;if(!n&&t.isActive(Pu.name))return!1;if(t.state.selection.empty){if(e){if(t.state.selection.$from.parentOffset>0){const a=t.state.doc.slice(t.state.selection.from-1,t.state.selection.from);if(((i=(r=a==null?void 0:a.content)==null?void 0:r.content[0])==null?void 0:i.textContent)===" "){const{from:l}=t.state.selection;return t.chain().command(({tr:u})=>(u.deleteRange(l-1,l),!0)).setTextSelection({from:l-1,to:l-1}).run(),!0}}if(t.state.selection.$from.parentOffset<t.state.selection.$from.parent.nodeSize-2){const a=t.state.doc.slice(t.state.selection.from,t.state.selection.from+1);if(((s=(o=a==null?void 0:a.content)==null?void 0:o.content[0])==null?void 0:s.textContent)===" "){const{from:l}=t.state.selection;return t.chain().command(({tr:u})=>(u.deleteRange(l,l+1),!0)).setTextSelection({from:l,to:l}).run(),!0}}}}else return!0;return t.chain().insertContent(" ").focus().run(),!0}function Uj({editor:e,char:t}){var _,f,g;if(!(t in qt))return!1;const{$from:n,$to:r}=e.state.selection,i=n.parent,o=r.parent;if(((_=i==null?void 0:i.type)==null?void 0:_.name)!==Db.name||i!==o)return!1;if(e.state.selection.empty)return e.chain().insertContent(`${t}${qt[t]}`).setTextSelection(e.state.selection.from+t.length).focus().run();const s=i.textContent;let a=s.slice(n.parentOffset,r.parentOffset);if(!a)return!1;if(['"',"'","`"].includes(t)){const h=new RegExp(`(^|[^\\\\])\\${t}`,"g");a=a.replaceAll(h,`$1\\${t}`).replaceAll(/\n/g,"\\n")}let l="",u=0;if(a.match(/\n/)){const E=s.slice(0,n.parentOffset).split(`
|
||||
`).pop(),b=s.slice(r.parentOffset).split(`
|
||||
`).shift();let T=Math.max(0,((g=(f=E.match(/^\t*/))==null?void 0:f[0])==null?void 0:g.length)+1);E.match(/^\t*$/)&&b.match(/^\t+$/)&&(T+=b.match(/^\t+$/)[0].length),b.match(/^\s*$/)&&(a=a.replace(/^\s*?\n\s*(.?)/,"$1")),u=T+1;const y=" ".repeat(T),R=new RegExp(`\\n\\t{0,${T?T-1:0}}`,"g");if(a=a.replaceAll(R,`
|
||||
${y}`),a=`${t}
|
||||
${y}${a}
|
||||
${y?y.slice(0,y.length-1):""}${qt[t]}`,r.parentOffset<s.length)try{const A=s.slice(r.parentOffset,r.parentOffset+1);A!=null&&A.match(/\n/)||(l=`
|
||||
`+(y?y.slice(0,y.length-1):""),a+=l)}catch{}}else a=`${t}${a}${qt[t]}`;const p={from:e.state.selection.from+t.length+u,to:e.state.selection.from+a.length-qt[t].length-l.length-(u?u-1:0)};return e.chain().insertContentAt({from:e.state.selection.from,to:e.state.selection.to},{type:"text",text:a}).setTextSelection(p).focus().run()}function HO({editor:e,opener:t}){var o;if(!(t in qt)||!e.state.selection.empty)return!1;const{$from:n}=e.state.selection,r=n.parent;if((r==null?void 0:r.type.name)!==Db.name)return!1;const i=(o=n.parent)==null?void 0:o.textContent;if(n.parentOffset<1||n.parentOffset>=i.length)return!1;try{const s=n.parentOffset;let a=i==null?void 0:i.slice(s,s+qt[t].length);if(!a)return;if(a.startsWith(qt[t]))return s>0&&['"',"'","`"].includes(t)&&(i==null?void 0:i[s-1])==="\\"?e.chain().insertContent({type:"text",text:qt[t]}).focus().run():e.chain().setTextSelection(e.state.selection.from+qt[t].length).focus().run()}catch{return!1}return!1}const qt={"{":"}","[":"]","(":")","'":"'",'"':'"',"`":"`"},yc={};function $M(e,t,n=[]){var r;if(!((r=yc[e])!=null&&r.to)){let i=!1;if(e===t)i=[e];else if(e in Fo){const o=[e];if(t in Fo[e])o.push(t);else{let s;n=[...n,...o];for(const a in Fo[e])if(!(n.includes(a)||a===e)&&Fo[a]){const l=$M(a,t,n);Array.isArray(l)&&(!s||s.length>l.length)&&(s=l)}Array.isArray(s)&&o.splice(1,0,...s)}o.length&&o[o.length-1]===t&&(i=o)}e in yc||(yc[e]={}),yc[e][t]=i}return yc[e][t]}function Gj(e,t,n){const r=$M(e,t);if(!Array.isArray(r))throw new RangeError(`Cannot convert ${e} to ${t} because there is not a known conversion pathway`);r.length===1&&e===bn.name&&n.chain().toggleHeading({level:n.level||1});for(let i=0;i<r.length-1;i++){const o=Fo[r[i]][r[i+1]](n);if(o!==void 0&&!o)throw new Error(`Could not convert ${r[i]} to ${r[i+1]}`)}return!0}function Fb(e){const t=[...e.state.selection.$from.path].reverse()[2],n=t==null?void 0:t.type.name;return n===bn.name?[n,{level:t.attrs.level||1}]:[n||"",{}]}function m_(e){var n;if(e[0]===bn.name)return`Heading ${((n=e[1])==null?void 0:n.level)||""}`;const t=e[0]in HS?e[0]:wt.name;return HS[t]}function Yj(e){if(e in $O)return[$O[e],{}];const t=m_([bn.name,{}]);if(e.startsWith(t)){const n=parseInt(e.replace("Heading","").trim())||1;return[bn.name,{level:n}]}return[wt.name,{}]}const HS={[eo.name]:"Ordered List",[rs.name]:"Bullet List",[rr.name]:"Code Block",[wt.name]:"Paragraph"},$O=Object.fromEntries([...Object.entries(HS)].map(e=>e.reverse()));function Hj(e){for(let t of bn.options.levels)if(e.isActive(bn.name,{level:t}))return{level:t};return null}function zM(e){const t=Fb(e);return t[0]in Fo?$j(...t).filter(n=>{var r,i;return(n[0]!==bn.name||!((r=e.options.restrictions)!=null&&r.has("heading")))&&!(n[0]===bn.name&&n[1].level===1&&((i=e.options.restrictions)!=null&&i.has("heading_1")))}):[]}const Cc={};function $j(e,t={}){const n=JSON.stringify({name:e,attributes:t});if(!(n in Cc)){const r=VM(e);Cc[n]=[];for(const i of r)if(i===bn.name)for(let o=1;o<=6;o++)Cc[n].push([bn.name,{level:o}]);else Cc[n].push([i,{}])}return Cc[n]}function VM(e,t){if(t=t||new Set,t.add(e),e in Fo)for(const n in Fo[e])t.has(n)||VM(n,t);return t}const Fo={[wt.name]:{[rr.name]:({chain:e})=>e().setCodeBlock(),[bn.name]:({chain:e,level:t=1})=>e().setHeading({level:t})},[rr.name]:{[wt.name]:({chain:e})=>e().toggleCodeBlock()},[bn.name]:{[wt.name]:({chain:e,editor:t,level:n})=>{var r;return n=n||((r=Hj(t))==null?void 0:r.level),n?e().toggleHeading({level:n}):!1}}};function zj({...e}){const{editor:t}=P.useContext(Ue),n=Fb(t);return e.dropdownOptions=e.dropdownOptions||{},e.dropdownOptions.className=e.dropdownOptions.className||"",e.dropdownOptions.className=[...e.dropdownOptions.className.split(/\s+/),"ipsRichText"].join(" "),N.jsx(_s,{current:N.jsx(N.Fragment,{children:N.jsx("i",{className:"fa-solid fa-paragraph"})}),currentValue:m_(n),blank:N.jsx(zO,{block:[wt.title,{}]}),items:zM(t).map(r=>[m_(r),N.jsx(zO,{block:r},m_(r))]),onChange:r=>{const i=Yj(r);t.chain().command(o=>Gj(n[0],i[0],{...i[1]||{},...o})).focus().run()},...e,dropdownOptions:{...e.dropdownOptions,location:"se"}})}function zO({block:e,style:t=!0}){if(e[0]===bn.name){const n=`h${e[1].level}`;return t?N.jsxs(n,{children:["Heading ",e[1].level]}):N.jsxs(N.Fragment,{children:["Heading ",e[1].level]})}return e[0]===rr.name?t?N.jsx("code",{children:"Code Block"}):N.jsx(N.Fragment,{children:"Code Block"}):N.jsx(N.Fragment,{children:"Paragraph"})}const Uu=un.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(e){return e!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:e}){return["sub",We(this.options.HTMLAttributes,e),0]},addCommands(){return{setSubscript:()=>({commands:e})=>e.setMark(this.name),toggleSubscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSubscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),Fu=un.create({name:"superscript",addOptionsLine truncated
|
||||
`,Jj="️",e6="",Jh="";let Up=null,Fp=null;function t6(e=[]){const t={};Qn.groups=t;const n=new Qn;Up==null&&(Up=qO(qj)),Fp==null&&(Fp=qO(Kj)),re(n,"'",Yb),re(n,"{",Zc),re(n,"}",Jc),re(n,"[",pf),re(n,"]",_f),re(n,"(",ff),re(n,")",mf),re(n,"<",gf),re(n,">",hf),re(n,"(",Ef),re(n,")",Sf),re(n,"「",Tf),re(n,"」",bf),re(n,"『",yf),re(n,"』",Cf),re(n,"<",Rf),re(n,">",Nf),re(n,"&",vf),re(n,"*",Of),re(n,"@",Ro),re(n,"`",If),re(n,"^",wf),re(n,":",Io),re(n,",",Hb),re(n,"$",Df),re(n,".",fi),re(n,"=",xf),re(n,"!",$b),re(n,"-",wr),re(n,"%",eu),re(n,"|",Mf),re(n,"+",Lf),re(n,"#",kf),re(n,"?",tu),re(n,'"',zb),re(n,"/",mi),re(n,";",Vb),re(n,"~",nu),re(n,"_",Pf),re(n,"\\",Af),re(n,"・",QM);const r=Ot(n,Pi,Bb,{[$S]:!0});Ot(r,Pi,r);const i=Ot(r,ki,qM,{[Xc]:!0}),o=Ot(r,Rc,KM,{[Lc]:!0}),s=Ot(n,ki,Fi,{[zS]:!0});Ot(s,Pi,i),Ot(s,ki,s),Ot(i,Pi,i),Ot(i,ki,i);const a=Ot(n,Rc,qS,{[VS]:!0});Ot(a,ki),Ot(a,Pi,o),Ot(a,Rc,a),Ot(o,Pi,o),Ot(o,ki),Ot(o,Rc,o);const l=re(n,Zh,Gb,{[Qh]:!0}),u=re(n,WO,jS,{[Qh]:!0}),p=Ot(n,Xh,jS,{[Qh]:!0});re(n,Jh,p),re(u,Zh,l),re(u,Jh,p),Ot(u,Xh,p),re(p,WO),re(p,Zh),Ot(p,Xh,p),re(p,Jh,p);const _=Ot(n,jh,jM,{[WM]:!0});re(_,"#"),Ot(_,jh,_),re(_,Jj,_);const f=re(_,e6);re(f,"#"),Ot(f,jh,_);const g=[[ki,s],[Pi,i]],h=[[ki,null],[Rc,a],[Pi,o]];for(let E=0;E<Up.length;E++)ho(n,Up[E],KS,Fi,g);for(let E=0;E<Fp.length;E++)ho(n,Fp[E],QS,qS,h);Fs(KS,{tld:!0,ascii:!0},t),Fs(QS,{utld:!0,alpha:!0},t),ho(n,"file",g_,Fi,g),ho(n,"mailto",g_,Fi,g),ho(n,"http",ka,Fi,g),ho(n,"https",ka,Fi,g),ho(n,"ftp",ka,Fi,g),ho(n,"ftps",ka,Fi,g),Fs(g_,{scheme:!0,ascii:!0},t),Fs(ka,{slashscheme:!0,ascii:!0},t),e=e.sort((E,b)=>E[0]>b[0]?1:-1);for(let E=0;E<e.length;E++){const b=e[E][0],y=e[E][1]?{[Qj]:!0}:{[jj]:!0};b.indexOf("-")>=0?y[WS]=!0:ki.test(b)?Pi.test(b)?y[Xc]=!0:y[zS]=!0:y[$S]=!0,VO(n,b,b,y)}return VO(n,"localhost",Bu,{ascii:!0}),n.jd=new Qn(Uf),{start:n,tokens:ia({groups:t},XM)}}function ZM(e,t){const n=n6(t.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[];let o=0,s=0;for(;s<r;){let a=e,l=null,u=0,p=null,_=-1,f=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(_=0,f=0,p=a):_>=0&&(_+=n[s].length,f++),u+=n[s].length,o+=n[s].length,s++;o-=_,s-=f,u-=_,i.push({t:p.t,v:t.slice(o-u,o),s:o-u,e:o})}return i}function n6(e){const t=[],n=e.length;let r=0;for(;r<n;){let i=e.charCodeAt(r),o,s=i<55296||i>56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}function ho(e,t,n,r,i){let o;const s=t.length;for(let a=0;a<s-1;a++){const l=t[a];e.j[l]?o=e.j[l]:(o=new Qn(r),o.jr=i.slice(),e.j[l]=o),e=o}return o=new Qn(n),o.jr=i.slice(),e.j[t[s-1]]=o,o}function qO(e){const t=[],n=[];let r=0,i="0123456789";for(;r<e.length;){let o=0;for(;i.indexOf(e[r+o])>=0;)o++;if(o>0){t.push(n.join(""));for(let s=parseInt(e.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(e[r]),r++}return t}const Nl={defaultProtocol:"http",events:null,format:KO,formatHref:KO,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function ym(e,t=null){let n=ia({},Nl);e&&(n=ia(n,e instanceof ym?e.o:e));const r=n.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}ym.prototype={o:Nl,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=t!=null;let i=this.o[e];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:Nl[e],typeof i=="function"&&r&&(i=i(t,n))):typeof i=="function"&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r=="function"&&t!=null&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function KO(e){return e}var r6=Object.freeze({__proto__:null,defaults:Nl,Options:ym,assign:ia});function JM(e,t){this.t="token",this.v=e,this.tk=t}JM.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Nl.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),i=e.get("tagName",n,t),o=this.toFormattedString(e),s={},a=e.get("className",n,t),l=e.get("target",n,t),u=e.get("rel",n,t),p=e.getObj("attributes",n,t),_=e.getObj("events",n,t);return s.href=r,a&&(s.class=a),l&&(s.target=l),u&&(s.rel=u),p&&ia(s,p),{tagName:i,aLine truncated
|
||||
${y?y.slice(0,y.length-1):""}${qt[t]}`,r.parentOffset<s.length)try{const O=s.slice(r.parentOffset,r.parentOffset+1);O!=null&&O.match(/\n/)||(l=`
|
||||
`+(y?y.slice(0,y.length-1):""),a+=l)}catch{}}else a=`${t}${a}${qt[t]}`;const p={from:e.state.selection.from+t.length+u,to:e.state.selection.from+a.length-qt[t].length-l.length-(u?u-1:0)};return e.chain().insertContentAt({from:e.state.selection.from,to:e.state.selection.to},{type:"text",text:a}).setTextSelection(p).focus().run()}function HO({editor:e,opener:t}){var o;if(!(t in qt)||!e.state.selection.empty)return!1;const{$from:n}=e.state.selection,r=n.parent;if((r==null?void 0:r.type.name)!==Db.name)return!1;const i=(o=n.parent)==null?void 0:o.textContent;if(n.parentOffset<1||n.parentOffset>=i.length)return!1;try{const s=n.parentOffset;let a=i==null?void 0:i.slice(s,s+qt[t].length);if(!a)return;if(a.startsWith(qt[t]))return s>0&&['"',"'","`"].includes(t)&&(i==null?void 0:i[s-1])==="\\"?e.chain().insertContent({type:"text",text:qt[t]}).focus().run():e.chain().setTextSelection(e.state.selection.from+qt[t].length).focus().run()}catch{return!1}return!1}const qt={"{":"}","[":"]","(":")","'":"'",'"':'"',"`":"`"},yc={};function $M(e,t,n=[]){var r;if(!((r=yc[e])!=null&&r.to)){let i=!1;if(e===t)i=[e];else if(e in Fo){const o=[e];if(t in Fo[e])o.push(t);else{let s;n=[...n,...o];for(const a in Fo[e])if(!(n.includes(a)||a===e)&&Fo[a]){const l=$M(a,t,n);Array.isArray(l)&&(!s||s.length>l.length)&&(s=l)}Array.isArray(s)&&o.splice(1,0,...s)}o.length&&o[o.length-1]===t&&(i=o)}e in yc||(yc[e]={}),yc[e][t]=i}return yc[e][t]}function Fj(e,t,n){const r=$M(e,t);if(!Array.isArray(r))throw new RangeError(`Cannot convert ${e} to ${t} because there is not a known conversion pathway`);r.length===1&&e===bn.name&&n.chain().toggleHeading({level:n.level||1});for(let i=0;i<r.length-1;i++){const o=Fo[r[i]][r[i+1]](n);if(o!==void 0&&!o)throw new Error(`Could not convert ${r[i]} to ${r[i+1]}`)}return!0}function Fb(e){const t=[...e.state.selection.$from.path].reverse()[2],n=t==null?void 0:t.type.name;return n===bn.name?[n,{level:t.attrs.level||1}]:[n||"",{}]}function m_(e){var n;if(e[0]===bn.name)return`Heading ${((n=e[1])==null?void 0:n.level)||""}`;const t=e[0]in HS?e[0]:wt.name;return HS[t]}function Bj(e){if(e in $O)return[$O[e],{}];const t=m_([bn.name,{}]);if(e.startsWith(t)){const n=parseInt(e.replace("Heading","").trim())||1;return[bn.name,{level:n}]}return[wt.name,{}]}const HS={[eo.name]:"Ordered List",[rs.name]:"Bullet List",[rr.name]:"Code Block",[wt.name]:"Paragraph"},$O=Object.fromEntries([...Object.entries(HS)].map(e=>e.reverse()));function Gj(e){for(let t of bn.options.levels)if(e.isActive(bn.name,{level:t}))return{level:t};return null}function zM(e){const t=Fb(e);return t[0]in Fo?Yj(...t).filter(n=>{var r,i;return(n[0]!==bn.name||!((r=e.options.restrictions)!=null&&r.has("heading")))&&!(n[0]===bn.name&&n[1].level===1&&((i=e.options.restrictions)!=null&&i.has("heading_1")))}):[]}const Cc={};function Yj(e,t={}){const n=JSON.stringify({name:e,attributes:t});if(!(n in Cc)){const r=VM(e);Cc[n]=[];for(const i of r)if(i===bn.name)for(let o=1;o<=6;o++)Cc[n].push([bn.name,{level:o}]);else Cc[n].push([i,{}])}return Cc[n]}function VM(e,t){if(t=t||new Set,t.add(e),e in Fo)for(const n in Fo[e])t.has(n)||VM(n,t);return t}const Fo={[wt.name]:{[rr.name]:({chain:e})=>e().setCodeBlock(),[bn.name]:({chain:e,level:t=1})=>e().setHeading({level:t})},[rr.name]:{[wt.name]:({chain:e})=>e().toggleCodeBlock()},[bn.name]:{[wt.name]:({chain:e,editor:t,level:n})=>{var r;return n=n||((r=Gj(t))==null?void 0:r.level),n?e().toggleHeading({level:n}):!1}}};function Hj({...e}){const{editor:t}=k.useContext(Ue),n=Fb(t);return e.dropdownOptions=e.dropdownOptions||{},e.dropdownOptions.className=e.dropdownOptions.className||"",e.dropdownOptions.className=[...e.dropdownOptions.className.split(/\s+/),"ipsRichText"].join(" "),N.jsx(_s,{current:N.jsx(N.Fragment,{children:N.jsx("i",{className:"fa-solid fa-paragraph"})}),currentValue:m_(n),blank:N.jsx(zO,{block:[wt.title,{}]}),items:zM(t).map(r=>[m_(r),N.jsx(zO,{block:r},m_(r))]),onChange:r=>{const i=Bj(r);t.chain().command(o=>Fj(n[0],i[0],{...i[1]||{},...o})).focus().run()},...e,dropdownOptions:{...e.dropdownOptions,location:"se"}})}function zO({block:e,style:t=!0}){if(e[0]===bn.name){const n=`h${e[1].level}`;return t?N.jsxs(n,{children:["Heading ",e[1].level]}):N.jsxs(N.Fragment,{children:["Heading ",e[1].level]})}return e[0]===rr.name?t?N.jsx("code",{children:"Code Block"}):N.jsx(N.Fragment,{children:"Code Block"}):N.jsx(N.Fragment,{children:"Paragraph"})}const Uu=un.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(e){return e!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:e}){return["sub",We(this.options.HTMLAttributes,e),0]},addCommands(){return{setSubscript:()=>({commands:e})=>e.setMark(this.name),toggleSubscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSubscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),Fu=un.create({name:"superscript",addOptionsLine truncated
|
||||
`,Xj="️",Zj="",Jh="";let Up=null,Fp=null;function Jj(e=[]){const t={};jn.groups=t;const n=new jn;Up==null&&(Up=qO(Vj)),Fp==null&&(Fp=qO(Wj)),re(n,"'",Yb),re(n,"{",Zc),re(n,"}",Jc),re(n,"[",pf),re(n,"]",_f),re(n,"(",ff),re(n,")",mf),re(n,"<",gf),re(n,">",hf),re(n,"(",Ef),re(n,")",Sf),re(n,"「",Tf),re(n,"」",bf),re(n,"『",yf),re(n,"』",Cf),re(n,"<",Rf),re(n,">",Nf),re(n,"&",vf),re(n,"*",Of),re(n,"@",Ro),re(n,"`",If),re(n,"^",wf),re(n,":",Io),re(n,",",Hb),re(n,"$",Df),re(n,".",fi),re(n,"=",xf),re(n,"!",$b),re(n,"-",wr),re(n,"%",eu),re(n,"|",Mf),re(n,"+",Lf),re(n,"#",kf),re(n,"?",tu),re(n,'"',zb),re(n,"/",mi),re(n,";",Vb),re(n,"~",nu),re(n,"_",Pf),re(n,"\\",Af),re(n,"・",QM);const r=Ot(n,Pi,Bb,{[$S]:!0});Ot(r,Pi,r);const i=Ot(r,ki,qM,{[Xc]:!0}),o=Ot(r,Rc,KM,{[Lc]:!0}),s=Ot(n,ki,Fi,{[zS]:!0});Ot(s,Pi,i),Ot(s,ki,s),Ot(i,Pi,i),Ot(i,ki,i);const a=Ot(n,Rc,qS,{[VS]:!0});Ot(a,ki),Ot(a,Pi,o),Ot(a,Rc,a),Ot(o,Pi,o),Ot(o,ki),Ot(o,Rc,o);const l=re(n,Zh,Gb,{[Qh]:!0}),u=re(n,WO,jS,{[Qh]:!0}),p=Ot(n,Xh,jS,{[Qh]:!0});re(n,Jh,p),re(u,Zh,l),re(u,Jh,p),Ot(u,Xh,p),re(p,WO),re(p,Zh),Ot(p,Xh,p),re(p,Jh,p);const _=Ot(n,jh,jM,{[WM]:!0});re(_,"#"),Ot(_,jh,_),re(_,Xj,_);const f=re(_,Zj);re(f,"#"),Ot(f,jh,_);const g=[[ki,s],[Pi,i]],h=[[ki,null],[Rc,a],[Pi,o]];for(let E=0;E<Up.length;E++)ho(n,Up[E],KS,Fi,g);for(let E=0;E<Fp.length;E++)ho(n,Fp[E],QS,qS,h);Fs(KS,{tld:!0,ascii:!0},t),Fs(QS,{utld:!0,alpha:!0},t),ho(n,"file",g_,Fi,g),ho(n,"mailto",g_,Fi,g),ho(n,"http",ka,Fi,g),ho(n,"https",ka,Fi,g),ho(n,"ftp",ka,Fi,g),ho(n,"ftps",ka,Fi,g),Fs(g_,{scheme:!0,ascii:!0},t),Fs(ka,{slashscheme:!0,ascii:!0},t),e=e.sort((E,b)=>E[0]>b[0]?1:-1);for(let E=0;E<e.length;E++){const b=e[E][0],y=e[E][1]?{[qj]:!0}:{[Kj]:!0};b.indexOf("-")>=0?y[WS]=!0:ki.test(b)?Pi.test(b)?y[Xc]=!0:y[zS]=!0:y[$S]=!0,VO(n,b,b,y)}return VO(n,"localhost",Bu,{ascii:!0}),n.jd=new jn(Uf),{start:n,tokens:ia({groups:t},XM)}}function ZM(e,t){const n=e6(t.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[];let o=0,s=0;for(;s<r;){let a=e,l=null,u=0,p=null,_=-1,f=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(_=0,f=0,p=a):_>=0&&(_+=n[s].length,f++),u+=n[s].length,o+=n[s].length,s++;o-=_,s-=f,u-=_,i.push({t:p.t,v:t.slice(o-u,o),s:o-u,e:o})}return i}function e6(e){const t=[],n=e.length;let r=0;for(;r<n;){let i=e.charCodeAt(r),o,s=i<55296||i>56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}function ho(e,t,n,r,i){let o;const s=t.length;for(let a=0;a<s-1;a++){const l=t[a];e.j[l]?o=e.j[l]:(o=new jn(r),o.jr=i.slice(),e.j[l]=o),e=o}return o=new jn(n),o.jr=i.slice(),e.j[t[s-1]]=o,o}function qO(e){const t=[],n=[];let r=0,i="0123456789";for(;r<e.length;){let o=0;for(;i.indexOf(e[r+o])>=0;)o++;if(o>0){t.push(n.join(""));for(let s=parseInt(e.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(e[r]),r++}return t}const Nl={defaultProtocol:"http",events:null,format:KO,formatHref:KO,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function ym(e,t=null){let n=ia({},Nl);e&&(n=ia(n,e instanceof ym?e.o:e));const r=n.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}ym.prototype={o:Nl,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=t!=null;let i=this.o[e];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:Nl[e],typeof i=="function"&&r&&(i=i(t,n))):typeof i=="function"&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r=="function"&&t!=null&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function KO(e){return e}var t6=Object.freeze({__proto__:null,defaults:Nl,Options:ym,assign:ia});function JM(e,t){this.t="token",this.v=e,this.tk=t}JM.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Nl.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),i=e.get("tagName",n,t),o=this.toFormattedString(e),s={},a=e.get("className",n,t),l=e.get("target",n,t),u=e.get("rel",n,t),p=e.getObj("attributes",n,t),_=e.getObj("events",n,t);return s.href=r,a&&(s.class=a),l&&(s.target=l),u&&(s.rel=u),p&&ia(s,p),{tagName:i,aLine truncated
|
||||
1. Must only contain digits, lowercase ASCII letters or "-"
|
||||
2. Cannot start or end with "-"
|
||||
3. "-" cannot repeat`);mt.customSchemes.push([e,t])}function u6(){mt.scanner=t6(mt.customSchemes);for(let e=0;e<mt.tokenQueue.length;e++)mt.tokenQueue[e][1]({scanner:mt.scanner});mt.parser=o6(mt.scanner.tokens);for(let e=0;e<mt.pluginQueue.length;e++)mt.pluginQueue[e][1]({scanner:mt.scanner,parser:mt.parser});return mt.initialized=!0,mt}function Wb(e){return mt.initialized||u6(),s6(mt.parser.start,e,ZM(mt.scanner.start,e))}Wb.scan=ZM;function qb(e,t=null,n=null){if(t&&typeof t=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new ym(n),i=Wb(e),o=[];for(let s=0;s<i.length;s++){const a=i[s];a.isLink&&(!t||a.t===t)&&r.check(a)&&o.push(a.toFormattedObject(r))}return o}function d6(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function p6(e){return new Ze({key:new Ke("autolink"),appendTransaction:(t,n,r)=>{const i=t.some(u=>u.docChanged)&&!n.doc.eq(r.doc),o=t.some(u=>u.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,a=AV(n.doc,[...t]);if(kV(a).forEach(({newRange:u})=>{const p=wV(r.doc,u,g=>g.isTextblock);let _,f;if(p.length>1?(_=p[0],f=r.doc.textBetween(_.pos,_.pos+_.node.nodeSize,void 0," ")):p.length&&r.doc.textBetween(u.from,u.to," "," ").endsWith(" ")&&(_=p[0],f=r.doc.textBetween(_.pos,u.to,void 0," ")),_&&f){const g=f.split(" ").filter(T=>T!=="");if(g.length<=0)return!1;const h=g[g.length-1],E=_.pos+f.lastIndexOf(h);if(!h)return!1;const b=Wb(h).map(T=>T.toObject(e.defaultProtocol));if(!d6(b))return!1;b.filter(T=>T.isLink).map(T=>({...T,from:E+T.start+1,to:E+T.end+1})).filter(T=>r.schema.marks.code?!r.doc.rangeHasMark(T.from,T.to,r.schema.marks.code):!0).filter(T=>e.validate(T.value)).filter(T=>e.shouldAutoLink(T.value)).forEach(T=>{Cb(T.from,T.to,r.doc).some(y=>y.mark.type===e.type)||s.addMark(T.from,T.to,e.type.create({href:T.href}))})}}),!!s.steps.length)return s}})}function _6(e){return new Ze({key:new Ke("handleClickLink"),props:{handleClick:(t,n,r)=>{var i,o;if(r.button!==0||!t.editable)return!1;let s=r.target;const a=[];for(;s.nodeName!=="DIV";)a.push(s),s=s.parentNode;if(!a.find(f=>f.nodeName==="A"))return!1;const l=yb(t.state,e.type.name),u=r.target,p=(i=u==null?void 0:u.href)!==null&&i!==void 0?i:l.href,_=(o=u==null?void 0:u.target)!==null&&o!==void 0?o:l.target;return u&&p?(window.open(p,_),!0):!1}}})}function f6(e){return new Ze({key:new Ke("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{state:i}=t,{selection:o}=i,{empty:s}=o;if(s)return!1;let a="";r.content.forEach(u=>{a+=u.textContent});const l=qb(a,{defaultProtocol:e.defaultProtocol}).find(u=>u.isLink&&u.value===a);return!a||!l?!1:(e.editor.commands.setMark(e.type,{href:l.href}),!0)}}})}const m6=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Nc(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!e||e.replace(m6,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}const vc=un.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e=="string"){XO(e);return}XO(e.scheme,e.optionalSlashes)})},onDestroy(){c6()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!Nc(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!Nc(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!Nc(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",We(this.options.HTMLAttributes,e),0]:["a",We(this.options.HTMLAttributes,{...e,href:""}),0]},addCommands(){return{setLink:e=>({chain:t})=>t().setMark(this.name,e).setMeta("preventAutolink",!0).run(),toggleLink:e=>({chain:t})=>t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[ns({find:e=>{const t=[];if(e){const{protocols:n,defaul
Line truncated
|
||||
`},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:u,dispatch:p})=>{if(p&&l&&s){const _=l.filter(f=>a.includes(f.type.name));u.ensureMarks(_)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),S_=ot.create({name:"doc",topNode:!0,content:"block+"}),PL=Tt.create({name:"ipsAutosave",addCommands(){return{clearAutosave:()=>({editor:e,chain:t})=>(e.options.autoSaveKey&&(window.ips.utils.db.remove("editorSave",e.options.autoSaveKey),t().hideMessage("autosave").run()),!0)}},onUpdate(){this.storage.updateCallback()},onCreate(){var e,t;if(this.storage.updateCallback=nr.debounce(()=>{var n;(n=this.editor)!=null&&n.options.autoSaveKey&&(this.editor.getHTML().trim()&&this.editor.getHTML()!=="<p></p>"?window.ips.utils.db.set("editorSave",this.editor.options.autoSaveKey,{content:this.editor.getHTML(),time:Math.round(Date.now()/1e3)}):this.editor.commands.clearAutosave(),this.editor.commands.hideMessage("autosave"))},500),(e=this.editor)!=null&&e.options.autoSaveKey){const n=window.ips.utils.db.get("editorSave",this.editor.options.autoSaveKey);if((t=n==null?void 0:n.content)!=null&&t.trim()&&(!n.time||Date.now()/1e3-86400*3<parseInt(n.time))){const r=new DOMParser().parseFromString(n.content,"text/html");if(!(r.body.innerText.trim().length||r.body.querySelector("iframe,img,video,audio,a,embed,.ipsEmoji,.ipsEmbeddedVideo,.ipsEmbeddedBrightcove,.ipsEmbeddedOther,.ipsEmbeddedPhoto")))return;this.storage.initial=this.editor.getHTML(),this.editor.chain().setContent(n.content).command(({tr:i,chain:o})=>(!i.docChanged||UL(i.doc)?o().undo().hideMessage("autosave").run():o().showMessage("autosave").focus().run(),!0)).run()}}},addStorage(){return{initial:"",updateCallback:()=>{}}}});function UL(e){var t,n,r;return e.textContent==="<p></p>"?!0:!((t=e.textContent)!=null&&t.trim().length||![S_.name,wt.name,ni.name,$u.name].includes(e.type.name)||(r=(n=e.content)==null?void 0:n.content)!=null&&r.length&&!e.content.content.some(i=>!UL(i)))}function HX(){const{editor:e}=P.useContext(Ue);return N.jsxs(N.Fragment,{children:["The content was restored from an automatically saved draft. Click to ",N.jsx("button",{className:"ipsEditor__autosave-clear",onClick:()=>e.chain().clearAutosave().setContent(e.storage[PL.name].initial||"").focus().run(),children:"clear draft."})]})}function $X({positions:e="",href:t}){const{editor:n}=P.useContext(Ue),r=()=>{if(!e.length){n.commands.hideMessage("autoembed");return}let i=n.chain();for(const o of e)i=i.command(({tr:s,chain:a})=>a().insertContentAt({from:Math.max(0,s.mapping.map(o[0])),to:Math.min(s.doc.nodeSize-2,s.mapping.map(o[1]))},`<a href="${encodeURI(t)}" >${o[2]}</a>`));i.hideMessage("autoembed").focus().run()};return N.jsxs(N.Fragment,{children:["A URL was inserted as embedded content. Click to ",N.jsx("button",{className:"ipsEditor__autosave-clear",onClick:r,children:"insert as link"})," instead."]})}function vA({name:e}){const{editor:t}=P.useContext(Ue);return N.jsxs("div",{className:`ipsEditor__global-message ipsEditor__global-message--${e}`,children:[N.jsxs("div",{className:"ipsEditor__global-message-content",children:[N.jsx("i",{className:"fa-solid fa-circle-info"})," ",N.jsx(zX,{name:e})]}),N.jsx("button",{className:"ipsEditor__global-message-close",onClick:()=>t==null?void 0:t.commands.hideMessage(e),children:N.jsx("i",{className:"fa-solid fa-times-circle"})})]})}function zX({name:e}){const{messages:t}=P.useContext(cT),n=t.get(e);switch(e){case"autosave":return N.jsx(HX,{});case"autoembed":return N.jsx($X,{...n});default:return typeof n=="string"&&n?N.jsx("span",{"data-ipseditorcustommessage":"true",dangerouslySetInnerHTML:{__html:n}}):N.jsx(N.Fragment,{children:"This is a global message!"})}}const cT=P.createContext({messages:new Map,addMessage(e,t=""){this.messages.set(e,t)},removeMessage(e){this.messages.has(e)&&this.messages.delete(e)}});function VX({children:e}){var l;const[t,n]=P.useState(()=>new Map),[r,i]=P.useState(!1),{editor:o}=P.useContext(Ue),s=P.useMemo(()=>({messages:t,addMessage:(u,p="")=>{if(!t.has(u)||t.get(u)!==p){t.set(u,p);const _=new Map;for(const[f,g]of t.entries())_.set(f,g);n(_)}},removeMessage:u=>{if(t.has(u)){t.delete(u);const p=new Map;for(const[_,f]of t.entries())p.set(_,f);n(p)}},onVisibilityChange(u=!1){u!==r&&i(u)},visible:r}),[t,n,r,i]);if(P.useEffect(()=>{!o.options.codeMode&&!o.options.simpleRichText&&o.can().registerMessageInterface(s)&&(o==null||o.commands.registerMessageInterface(s))},[s,o]),o.options.codeMode||o.options.simpleRichText)return N.jsx(N.Fragment,{children:e});const a=[...t.keys()];return o.options.messagesCLine truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e8(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function DA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wA(Object(n),!0).forEach(function(r){e8(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function t8(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(i,o){return o(i)},r)}}function Pc(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(i,a))}}}function Gf(e){return{}.toString.call(e).includes("Object")}function n8(e){return!Object.keys(e).length}function zu(e){return typeof e=="function"}function r8(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function i8(e,t){return Gf(t)||Zo("changeType"),Object.keys(t).some(function(n){return!r8(e,n)})&&Zo("changeField"),t}function o8(e){zu(e)||Zo("selectorType")}function s8(e){zu(e)||Gf(e)||Zo("handlerType"),Gf(e)&&Object.values(e).some(function(t){return!zu(t)})&&Zo("handlersType")}function a8(e){e||Zo("initialIsRequired"),Gf(e)||Zo("initialType"),n8(e)&&Zo("initialContent")}function l8(e,t){throw new Error(e[t]||e.default)}var c8={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Zo=Pc(l8)(c8),Qp={changes:i8,selector:o8,handler:s8,initial:a8};function u8(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Qp.initial(e),Qp.handler(t);var n={current:e},r=Pc(_8)(n,t),i=Pc(p8)(n),o=Pc(Qp.changes)(e),s=Pc(d8)(n);function a(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(p){return p};return Qp.selector(u),u(n.current)}function l(u){t8(r,i,o,s)(u)}return[a,l]}function d8(e,t){return zu(t)?t(e.current):t}function p8(e,t){return e.current=DA(DA({},e.current),t),t}function _8(e,t,n){return zu(t)?t(e.current):Object.keys(n).forEach(function(r){var i;return(i=t[r])===null||i===void 0?void 0:i.call(t,e.current[r])}),n}var f8={create:u8},m8={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function g8(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(i,a))}}}function h8(e){return{}.toString.call(e).includes("Object")}function E8(e){return e||xA("configIsRequired"),h8(e)||xA("configType"),e.urls?(S8(),{paths:{vs:e.urls.monacoBase}}):e}function S8(){console.warn(FL.deprecation)}function T8(e,t){throw new Error(e[t]||e.default)}var FL={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
||||
3. "-" cannot repeat`);mt.customSchemes.push([e,t])}function l6(){mt.scanner=Jj(mt.customSchemes);for(let e=0;e<mt.tokenQueue.length;e++)mt.tokenQueue[e][1]({scanner:mt.scanner});mt.parser=r6(mt.scanner.tokens);for(let e=0;e<mt.pluginQueue.length;e++)mt.pluginQueue[e][1]({scanner:mt.scanner,parser:mt.parser});return mt.initialized=!0,mt}function Wb(e){return mt.initialized||l6(),i6(mt.parser.start,e,ZM(mt.scanner.start,e))}Wb.scan=ZM;function qb(e,t=null,n=null){if(t&&typeof t=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new ym(n),i=Wb(e),o=[];for(let s=0;s<i.length;s++){const a=i[s];a.isLink&&(!t||a.t===t)&&r.check(a)&&o.push(a.toFormattedObject(r))}return o}function c6(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function u6(e){return new Xe({key:new Ke("autolink"),appendTransaction:(t,n,r)=>{const i=t.some(u=>u.docChanged)&&!n.doc.eq(r.doc),o=t.some(u=>u.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,a=AV(n.doc,[...t]);if(kV(a).forEach(({newRange:u})=>{const p=wV(r.doc,u,g=>g.isTextblock);let _,f;if(p.length>1?(_=p[0],f=r.doc.textBetween(_.pos,_.pos+_.node.nodeSize,void 0," ")):p.length&&r.doc.textBetween(u.from,u.to," "," ").endsWith(" ")&&(_=p[0],f=r.doc.textBetween(_.pos,u.to,void 0," ")),_&&f){const g=f.split(" ").filter(T=>T!=="");if(g.length<=0)return!1;const h=g[g.length-1],E=_.pos+f.lastIndexOf(h);if(!h)return!1;const b=Wb(h).map(T=>T.toObject(e.defaultProtocol));if(!c6(b))return!1;b.filter(T=>T.isLink).map(T=>({...T,from:E+T.start+1,to:E+T.end+1})).filter(T=>r.schema.marks.code?!r.doc.rangeHasMark(T.from,T.to,r.schema.marks.code):!0).filter(T=>e.validate(T.value)).filter(T=>e.shouldAutoLink(T.value)).forEach(T=>{Cb(T.from,T.to,r.doc).some(y=>y.mark.type===e.type)||s.addMark(T.from,T.to,e.type.create({href:T.href}))})}}),!!s.steps.length)return s}})}function d6(e){return new Xe({key:new Ke("handleClickLink"),props:{handleClick:(t,n,r)=>{var i,o;if(r.button!==0||!t.editable)return!1;let s=r.target;const a=[];for(;s.nodeName!=="DIV";)a.push(s),s=s.parentNode;if(!a.find(f=>f.nodeName==="A"))return!1;const l=yb(t.state,e.type.name),u=r.target,p=(i=u==null?void 0:u.href)!==null&&i!==void 0?i:l.href,_=(o=u==null?void 0:u.target)!==null&&o!==void 0?o:l.target;return u&&p?(window.open(p,_),!0):!1}}})}function p6(e){return new Xe({key:new Ke("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{state:i}=t,{selection:o}=i,{empty:s}=o;if(s)return!1;let a="";r.content.forEach(u=>{a+=u.textContent});const l=qb(a,{defaultProtocol:e.defaultProtocol}).find(u=>u.isLink&&u.value===a);return!a||!l?!1:(e.editor.commands.setMark(e.type,{href:l.href}),!0)}}})}const _6=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Nc(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!e||e.replace(_6,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}const vc=un.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e=="string"){XO(e);return}XO(e.scheme,e.optionalSlashes)})},onDestroy(){a6()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!Nc(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!Nc(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!Nc(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",We(this.options.HTMLAttributes,e),0]:["a",We(this.options.HTMLAttributes,{...e,href:""}),0]},addCommands(){return{setLink:e=>({chain:t})=>t().setMark(this.name,e).setMeta("preventAutolink",!0).run(),toggleLink:e=>({chain:t})=>t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[ns({find:e=>{const t=[];if(e){const{protocols:n,defaul
Line truncated
|
||||
`},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:u,dispatch:p})=>{if(p&&l&&s){const _=l.filter(f=>a.includes(f.type.name));u.ensureMarks(_)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),S_=ot.create({name:"doc",topNode:!0,content:"block+"}),PL=Tt.create({name:"ipsAutosave",addCommands(){return{clearAutosave:()=>({editor:e,chain:t})=>(e.options.autoSaveKey&&(window.ips.utils.db.remove("editorSave",e.options.autoSaveKey),t().hideMessage("autosave").run()),!0)}},onUpdate(){this.storage.updateCallback()},onCreate(){var e,t;if(this.storage.updateCallback=Un.debounce(()=>{var n;(n=this.editor)!=null&&n.options.autoSaveKey&&(this.editor.getHTML().trim()&&this.editor.getHTML()!=="<p></p>"?window.ips.utils.db.set("editorSave",this.editor.options.autoSaveKey,{content:this.editor.getHTML(),time:Math.round(Date.now()/1e3)}):this.editor.commands.clearAutosave(),this.editor.commands.hideMessage("autosave"))},500),(e=this.editor)!=null&&e.options.autoSaveKey){const n=window.ips.utils.db.get("editorSave",this.editor.options.autoSaveKey);if((t=n==null?void 0:n.content)!=null&&t.trim()&&(!n.time||Date.now()/1e3-86400*3<parseInt(n.time))){const r=new DOMParser().parseFromString(n.content,"text/html");if(!(r.body.innerText.trim().length||r.body.querySelector("iframe,img,video,audio,a,embed,.ipsEmoji,.ipsEmbeddedVideo,.ipsEmbeddedBrightcove,.ipsEmbeddedOther,.ipsEmbeddedPhoto")))return;this.storage.initial=this.editor.getHTML(),this.editor.chain().setContent(n.content).command(({tr:i,chain:o})=>(!i.docChanged||UL(i.doc)?o().undo().hideMessage("autosave").run():o().showMessage("autosave").focus().run(),!0)).run()}}},addStorage(){return{initial:"",updateCallback:()=>{}}}});function UL(e){var t,n,r;return e.textContent==="<p></p>"?!0:!((t=e.textContent)!=null&&t.trim().length||![S_.name,wt.name,ni.name,$u.name].includes(e.type.name)||(r=(n=e.content)==null?void 0:n.content)!=null&&r.length&&!e.content.content.some(i=>!UL(i)))}function GX(){const{editor:e}=k.useContext(Ue);return N.jsxs(N.Fragment,{children:["The content was restored from an automatically saved draft. Click to ",N.jsx("button",{className:"ipsEditor__autosave-clear",onClick:()=>e.chain().clearAutosave().setContent(e.storage[PL.name].initial||"").focus().run(),children:"clear draft."})]})}function YX({positions:e="",href:t}){const{editor:n}=k.useContext(Ue),r=()=>{if(!e.length){n.commands.hideMessage("autoembed");return}let i=n.chain();for(const o of e)i=i.command(({tr:s,chain:a})=>a().insertContentAt({from:Math.max(0,s.mapping.map(o[0])),to:Math.min(s.doc.nodeSize-2,s.mapping.map(o[1]))},`<a href="${encodeURI(t)}" >${o[2]}</a>`));i.hideMessage("autoembed").focus().run()};return N.jsxs(N.Fragment,{children:["A URL was inserted as embedded content. Click to ",N.jsx("button",{className:"ipsEditor__autosave-clear",onClick:r,children:"insert as link"})," instead."]})}function vA({name:e}){const{editor:t}=k.useContext(Ue);return N.jsxs("div",{className:`ipsEditor__global-message ipsEditor__global-message--${e}`,children:[N.jsxs("div",{className:"ipsEditor__global-message-content",children:[N.jsx("i",{className:"fa-solid fa-circle-info"})," ",N.jsx(HX,{name:e})]}),N.jsx("button",{className:"ipsEditor__global-message-close",onClick:()=>t==null?void 0:t.commands.hideMessage(e),children:N.jsx("i",{className:"fa-solid fa-times-circle"})})]})}function HX({name:e}){const{messages:t}=k.useContext(cT),n=t.get(e);switch(e){case"autosave":return N.jsx(GX,{});case"autoembed":return N.jsx(YX,{...n});default:return typeof n=="string"&&n?N.jsx("span",{"data-ipseditorcustommessage":"true",dangerouslySetInnerHTML:{__html:n}}):N.jsx(N.Fragment,{children:"This is a global message!"})}}const cT=k.createContext({messages:new Map,addMessage(e,t=""){this.messages.set(e,t)},removeMessage(e){this.messages.has(e)&&this.messages.delete(e)}});function $X({children:e}){var l;const[t,n]=k.useState(()=>new Map),[r,i]=k.useState(!1),{editor:o}=k.useContext(Ue),s=k.useMemo(()=>({messages:t,addMessage:(u,p="")=>{if(!t.has(u)||t.get(u)!==p){t.set(u,p);const _=new Map;for(const[f,g]of t.entries())_.set(f,g);n(_)}},removeMessage:u=>{if(t.has(u)){t.delete(u);const p=new Map;for(const[_,f]of t.entries())p.set(_,f);n(p)}},onVisibilityChange(u=!1){u!==r&&i(u)},visible:r}),[t,n,r,i]);if(k.useEffect(()=>{!o.options.codeMode&&!o.options.simpleRichText&&o.can().registerMessageInterface(s)&&(o==null||o.commands.registerMessageInterface(s))},[s,o]),o.options.codeMode||o.options.simpleRichText)return N.jsx(N.Fragment,{children:e});const a=[...t.keys()];return o.options.messagesCLine truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZX(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function DA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wA(Object(n),!0).forEach(function(r){ZX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function JX(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(i,o){return o(i)},r)}}function Pc(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(i,a))}}}function Gf(e){return{}.toString.call(e).includes("Object")}function e8(e){return!Object.keys(e).length}function zu(e){return typeof e=="function"}function t8(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function n8(e,t){return Gf(t)||Zo("changeType"),Object.keys(t).some(function(n){return!t8(e,n)})&&Zo("changeField"),t}function r8(e){zu(e)||Zo("selectorType")}function i8(e){zu(e)||Gf(e)||Zo("handlerType"),Gf(e)&&Object.values(e).some(function(t){return!zu(t)})&&Zo("handlersType")}function o8(e){e||Zo("initialIsRequired"),Gf(e)||Zo("initialType"),e8(e)&&Zo("initialContent")}function s8(e,t){throw new Error(e[t]||e.default)}var a8={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Zo=Pc(s8)(a8),Qp={changes:n8,selector:r8,handler:i8,initial:o8};function l8(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Qp.initial(e),Qp.handler(t);var n={current:e},r=Pc(d8)(n,t),i=Pc(u8)(n),o=Pc(Qp.changes)(e),s=Pc(c8)(n);function a(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(p){return p};return Qp.selector(u),u(n.current)}function l(u){JX(r,i,o,s)(u)}return[a,l]}function c8(e,t){return zu(t)?t(e.current):t}function u8(e,t){return e.current=DA(DA({},e.current),t),t}function d8(e,t,n){return zu(t)?t(e.current):Object.keys(n).forEach(function(r){var i;return(i=t[r])===null||i===void 0?void 0:i.call(t,e.current[r])}),n}var p8={create:l8},_8={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function f8(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(i,a))}}}function m8(e){return{}.toString.call(e).includes("Object")}function g8(e){return e||xA("configIsRequired"),m8(e)||xA("configType"),e.urls?(h8(),{paths:{vs:e.urls.monacoBase}}):e}function h8(){console.warn(FL.deprecation)}function E8(e,t){throw new Error(e[t]||e.default)}var FL={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
||||
You are using deprecated way of configuration.
|
||||
|
||||
Instead of using
|
||||
@@ -208,10 +208,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
||||
monaco.config({ paths: { vs: '...' } })
|
||||
|
||||
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
||||
`},xA=g8(T8)(FL),b8={config:E8},y8=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(i){return n.reduceRight(function(o,s){return s(o)},i)}};function BL(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],BL(e[n],t[n]))}),AA(AA({},e),t)}var C8={type:"cancelation",msg:"operation is manually canceled"};function pE(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(C8):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var R8=f8.create({config:m8,isInitialized:!1,resolve:null,reject:null,monaco:null}),GL=QX(R8,2),od=GL[0],vm=GL[1];function N8(e){var t=b8.config(e),n=t.monaco,r=KX(t,["monaco"]);vm(function(i){return{config:BL(i.config,r),monaco:n}})}function v8(){var e=od(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(vm({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),pE(_E);if(window.monaco&&window.monaco.editor)return YL(window.monaco),e.resolve(window.monaco),pE(_E);y8(O8,I8)(w8)}return pE(_E)}function O8(e){return document.body.appendChild(e)}function A8(e){var t=document.createElement("script");return e&&(t.src=e),t}function I8(e){var t=od(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=A8("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function w8(){var e=od(function(n){var r=n.config,i=n.resolve,o=n.reject;return{config:r,resolve:i,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){YL(n),e.resolve(n)},function(n){e.reject(n)})}function YL(e){od().monaco||vm({monaco:e})}function D8(){return od(function(e){var t=e.monaco;return t})}var _E=new Promise(function(e,t){return vm({resolve:e,reject:t})}),HL={config:N8,init:v8,__getMonacoInstance:D8},x8={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},fE=x8,M8={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},L8=M8;function k8({children:e}){return Xe.createElement("div",{style:L8.container},e)}var P8=k8,U8=P8;function F8({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:s}){return Xe.createElement("section",{style:{...fE.wrapper,width:e,height:t},...s},!n&&Xe.createElement(U8,null,r),Xe.createElement("div",{ref:i,style:{...fE.fullWidth,...!n&&fE.hide},className:o}))}var B8=F8,$L=P.memo(B8);function G8(e){P.useEffect(e,[])}var zL=G8;function Y8(e,t,n=!0){let r=P.useRef(!0);P.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var pr=Y8;function iu(){}function ja(e,t,n,r){return H8(e,r)||$8(e,t,n,r)}function H8(e,t){return e.editor.getModel(VL(e,t))}function $8(e,t,n,r){return e.editor.createModel(t,n,r?VL(e,r):void 0)}function VL(e,t){return e.Uri.parse(t)}function z8({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:u="light",loading:p="Loading...",options:_={},height:f="100%",width:g="100%",className:h,wrapperProps:E={},beforeMount:b=iu,onMount:T=iu}){let[y,R]=P.useState(!1),[A,I]=P.useState(!0),D=P.useRef(null),M=P.useRef(null),$=P.useRef(null),H=P.useRef(T),B=P.useRef(b),se=P.useRef(!1);zL(()=>{let ee=HL.init();return ee.then(ue=>(M.current=ue)&&I(!1)).catch(ue=>(ue==null?void 0:ue.type)!=="cancelation"&&console.error("Monaco initialization: error:",ue)),()=>D.current?ce():ee.cancel()}),pr(()=>{if(D.current&&M.current){let ee=D.current.getOriginalEditor(),ue=ja(M.current,e||"",r||n||"text",o||"");ue!==ee.getModel()&&ee.setModel(ue)}},[o],y),pr(()=>{if(D.current&&M.current){let ee=D.current.getModifiedEditor(),ue=ja(M.current,t||"",i||n||"text",s||"");ue!==ee.getModel()&&ee.setModel(ue)}},[s],y),pr(()=>{let ee=D.current.getModifiedEditor();ee.getOption(M.current.editor.EditorOption.readOnly)?ee.setValue(t||""):t!==ee.getValue()&&(ee.executeEdits("",[{range:ee.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),ee.pushUndoStop())},[t],y),pr(()=>{var ee,ue;(ue=(ee=D.current)==null?void 0:ee.getModel())==null||ue.original.setValue(e||"")},[e],y),pr(()=>{let{original:ee,modified:ue}=D.current.getModel();M.current.editor.setModelLanguage(ee,r||n||"text"),M.current.editor.setModelLanguage(ue,i||n||"text")},[n,r,i],y),pr(()=>{var ee;(ee=M.current)==null||ee.editor.setTheme(u)},[u],y),pr(()=>{var ee;(ee=D.current)==null||ee.updateOptions(_)},[_],y);let de=P.useCallback(()=>{var L;if(!M.current)return;B.current(M.current);let ee=ja(M.current,e||"",r||n||"text",o||""),ue=ja(M.current,t||"",i||n||"text",s||"");(L=D.current)==null||L.setModel({original:ee,modified:ue})},[n,t,i,e,r,o,s]),pe=P.useCallback(()=>{var ee;!se.current&&$.current&&(D.current=M.current.editor.createDiffEditor($.current,{automaticLayout:!0,..._}),de(),(ee=M.current)==null||ee.editor.setTheme(u),R(!0),se.current
Line truncated
|
||||
`+t.message,window.Debug.error(t),Zp=null}).finally(()=>{for(const t of YA)t(Zp),YA.delete(t);e(Zp)})})}const s7=Tt.create({name:"ipsMessages",addCommands(){let e={_messages:new Map,addMessage(n,r=""){this._messages.set(n,r)},removeMessage(n){this._messages.delete(n)},get messages(){return this._messages},onVisibilityChange(n){t=n}},t=!1;return{showMessage:(n,r="")=>()=>{e==null||e.addMessage(n,r)},hideMessage:n=>()=>{e==null||e.removeMessage(n)},registerMessageInterface:n=>()=>{var i,o,s;if(Object.is(n,e))return!1;let r=!1;for(const a in n)if(!Object.is(n[a],e[a])){r=!0;break}if(!r)return!1;if(e.messages instanceof Map)for(const a of e.messages.keys())(o=(i=n==null?void 0:n.messages)==null?void 0:i.has)!=null&&o.call(i,a)&&n.messages.get(a)===e.messages.get(a)||n.addMessage(a,e.messages.get(a));(!("visible"in n)||n.visible!==t)&&((s=n.onVisibilityChange)==null||s.call(n,t)),e=n},fireVisibilityChange:n=>()=>{var r;t=!!n,(r=e==null?void 0:e.onVisibilityChange)==null||r.call(e,t)}}}}),a7=({key:e,editor:t,onPaste:n,onDrop:r,allowedMimeTypes:i})=>new Ze({key:e||new Ke("fileHandler"),props:{handleDrop(o,s){var a;if(!r||!(!((a=s.dataTransfer)===null||a===void 0)&&a.files.length))return!1;const l=o.posAtCoords({left:s.clientX,top:s.clientY});let u=Array.from(s.dataTransfer.files);return i&&(u=u.filter(p=>i.includes(p.type))),u.length!==0&&(s.preventDefault(),s.stopPropagation(),r(t,u,(l==null?void 0:l.pos)||0),!0)},handlePaste(o,s){var a;if(!n||!(!((a=s.clipboardData)===null||a===void 0)&&a.files.length))return!1;let l=Array.from(s.clipboardData.files);const u=s.clipboardData.getData("text/html");return i&&(l=l.filter(p=>i.includes(p.type))),l.length!==0&&(s.preventDefault(),s.stopPropagation(),n(t,l,u),!(u.length>0))}}}),l7=Tt.create({name:"fileHandler",addOptions:()=>({onPaste:void 0,onDrop:void 0,allowedMimeTypes:void 0}),addProseMirrorPlugins(){return[a7({key:new Ke(this.name),editor:this.editor,allowedMimeTypes:this.options.allowedMimeTypes,onDrop:this.options.onDrop,onPaste:this.options.onPaste})]}});function c7({mimeTypes:e,handler:t}){let n;Array.isArray(e)&&(n=new Set(e.map(i=>i.toLowerCase())));const r=i=>{const o=i instanceof DragEvent?i.dataTransfer:i.clipboardData;if(o.files.length){const s=[];for(const a of o.files)(!n||n.has(a.type.toLowerCase()))&&s.push(a);if(s.length)return t(s),!0}};return new Ze({key:new Ke("ipsDataTransferFixer"),props:{handlePaste:(i,o)=>r(o),handleDrop:(i,o)=>r(o)}})}const u7=l7.extend({addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),injectAttachments:t=>({editor:n,chain:r})=>{const i=d7(n.options.postkey);if(!i)return!1;let o=r();for(const s of t){const a=Math.round(Math.random()*Math.pow(10,8));let l=!1;o=o.insertContent({type:ut.name,attrs:{attachmentType:"file",attachmentSrc:"",attachmentLink:"",fileId:a,attachmentTitle:"Uploading Attachment..."}}),i.dispatchEvent(new p7({file:s,data:{ready:u=>{if(l)return;l=!0;const p=Qb(n.$doc,a);p.length&&n.commands.command(({tr:_,chain:f})=>{let g=f();for(const{to:h,from:E}of p)g=g.insertContentAt({from:_.mapping.map(E),to:_.mapping.map(h)},u,{parseOptions:{preserveWhitespace:!1}});return!0})},error:u=>{l||(l=!0,u instanceof Error&&(u.message=`File upload failed:
|
||||
${u.message}`,window.Debug.warn(u),n.commands.showMessage("file-attach","Couldn't insert one or more files pasted or dropped in the editor.")),n.commands.removeAttachment(a))}}}))}return o.run(),!0}}},addProseMirrorPlugins(){var e;return[c7({mimeTypes:this.options.allowedMimeTypes,handler:t=>this.options.onPaste(this.editor,t)}),...((e=this.parent)==null?void 0:e.call(this))||[]]}}).configure({onPaste(e,t){return e.commands.injectAttachments(t)},onDrop(e,t){return e.commands.injectAttachments(t)}});function d7(e){return!e||typeof e!="string"?null:document.querySelector(`[data-ipsuploader-postkey="${e}"]`)}class p7 extends Event{constructor(t){super("injectFile"),this.data=t}}const _7=["name","group","isInline","isBlock","isText","selectable","exitable","atom","addOptions","addKeyboardShortcuts","addAttributes","addGlobalAttributes","renderHTML","parseHTML","onCreate","onUpdate","onBeforeCreate","onFocus","onBlur","onBeforeCreate","onSelectionUpdate","onDestroy","onTransaction","priority","defaultOptions","addInputRules","marks","addNodeView","whitespace","defining","isolating","renderText"];function f7(e,t){var a,l,u;if(!e.ipsPlugins){e.ipsPlugins={buttons:{},extensions:[],nodes:[],marks:[]};return}e.ipsPlugins.buttons={},Array.isArray((a=e.ipsPlugins)==null?void 0:a.extensions)?s(e.ipsPlugins.extensions,Tt):e.ipsPlugins.extensions=[],Array.isArray((l=e.ipsPlugins)==null?void 0:l.nodes)?s(e.ipsPlugins.nodes,ot):e.ipsPlugins.nodes=[],Array.isArray((u=e.ipsPlugins)==null?void 0:u.marks)?s(e.ipsPlugins.marks,un):e.ipsPlugins.marks=[],e.ipsPlugins.nestedToolbars={},e.pluginButtonKeys=new Set;const n=new Set(e.tools.toolbar);for(const p in e.ipsPlugins.buttons)for(const{before:_,after:f}of e.ipsPlugins.buttons[p].locations){let g,h=!1;if(typeof f=="string"&&f in cA){const E=cA[f];e.ipsPlugins.nestedToolbars[E]=e.ipsPlugins.nestedToolbars[E]||[...ss[E]],e.ipsPlugins.nestedToolbars[E].push(`custom:${p}`),h=!0}else if(typeof f=="string"&&n.has(f))g=e.tools.toolbar.indexOf(f)+1;else if(typeof _=="string"&&n.has(_))g=e.tools.toolbar.indexOf(_);else if(!_&&!f||_===null||f===null)g=e.tools.toolbar.length;else continue;e.pluginButtonKeys.add(`custom:${p}`),h||(n.add(`custom:${p}`),e.tools.toolbar.splice(g,0,`custom:${p}`))}function r(p){for(const _ of p.attributes)["class","style","id","src","title","rel","alt"].includes(_.name.toLowerCase())||p.removeAttribute(_.name);for(const _ of p.querySelectorAll(":scope > *"))r(_)}function i(p,_){var f;if(p.addButtons instanceof Function){const g=p.addButtons.bind(_)();if(typeof g!="object")throw new TypeError;const h=new DOMParser;for(const E in g){let{html:b,command:T,locations:y,element:R,isActive:A,isAvailable:I}=g[E];if(typeof b!="string"&&!(R instanceof HTMLElement)||!(T instanceof Function)||!Array.isArray(y))throw new TypeError;A!==void 0&&typeof A!="boolean"&&!(A instanceof Function)&&(window.Debug.warn(`Expected isActive to be a boolean or a Function, got a ${typeof A}. Casting to boolean.`),A=!!A),I!==void 0&&typeof I!="boolean"&&!(I instanceof Function)&&(window.Debug.warn(`Expected isAvailable to be a boolean or a Function, got a ${typeof I}. Casting to boolean.`),I=!!I);const D=[];for(const B of y)if(B===null)D.push({after:null,before:void 0});else if(typeof B=="object"){if(![void 0,null].includes(B.before)&&typeof B.before!="string"||![void 0,null].includes(B.after)&&typeof B.after!="string")throw new TypeError;D.push({after:B.after,before:B.before})}else typeof B=="string"?D.push({after:B,before:void 0}):D.push({after:void 0,before:void 0});y=D;const M=["script","link","style","pre","code","iframe","object","embed","noscript","video"];if(R instanceof Element)R.querySelectorAll(M.join(",")).forEach(B=>B.remove());else{const B=h.parseFromString(b,"text/html");if(!(B instanceof Document))throw new RangeError("The html passed in for the button is not readable");if(B.querySelectorAll(M.join(",")).forEach(se=>se.remove()),!(((f=B==null?void 0:B.body)==null?void 0:f.firstElementChild)instanceof HTMLElement)||!B.body.firstElementChild.innerHTML.length)throw new RangeError("The html passed in for the button is not readable");R=B.body.firstElementChild}if(r(R),M.includes(R.tagName.toLowerCase()))throw new RangeError(`The element of type ${R.tagName} cannot be used as a toolbar button`);const $=R.cloneNode(!0),H=`${p.name}_${E}`;e.ipsPlugins.buttons[H]={get element(){return $},set element(B){throw new Error("Cannot update the element of an ipsPlugin button!")},get command(){return T.bind(_)},set command(B){throw new Error("Cannot update the command of an ipsPlugin button!")},get isActive(){return A instanceof Function?A.bind(_):A},set isActive(B){throw new Error("Cannot update the isActive property of an ipsPlugin button!")},get isAvailable(){return I instanceof Function?I.bind(_):I},set isAvailable(B){throw new Error("Cannot update the isAvailable property of an ipsPlugin button!")},get locations(){return y},set locations(B){throw new Error("Cannot update properties of ips
Line truncated
|
||||
`},xA=f8(E8)(FL),S8={config:g8},T8=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(i){return n.reduceRight(function(o,s){return s(o)},i)}};function BL(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],BL(e[n],t[n]))}),AA(AA({},e),t)}var b8={type:"cancelation",msg:"operation is manually canceled"};function pE(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(b8):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var y8=p8.create({config:_8,isInitialized:!1,resolve:null,reject:null,monaco:null}),GL=qX(y8,2),od=GL[0],vm=GL[1];function C8(e){var t=S8.config(e),n=t.monaco,r=WX(t,["monaco"]);vm(function(i){return{config:BL(i.config,r),monaco:n}})}function R8(){var e=od(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(vm({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),pE(_E);if(window.monaco&&window.monaco.editor)return YL(window.monaco),e.resolve(window.monaco),pE(_E);T8(N8,O8)(A8)}return pE(_E)}function N8(e){return document.body.appendChild(e)}function v8(e){var t=document.createElement("script");return e&&(t.src=e),t}function O8(e){var t=od(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=v8("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function A8(){var e=od(function(n){var r=n.config,i=n.resolve,o=n.reject;return{config:r,resolve:i,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){YL(n),e.resolve(n)},function(n){e.reject(n)})}function YL(e){od().monaco||vm({monaco:e})}function I8(){return od(function(e){var t=e.monaco;return t})}var _E=new Promise(function(e,t){return vm({resolve:e,reject:t})}),HL={config:C8,init:R8,__getMonacoInstance:I8},w8={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},fE=w8,D8={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},x8=D8;function M8({children:e}){return rt.createElement("div",{style:x8.container},e)}var L8=M8,k8=L8;function P8({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:s}){return rt.createElement("section",{style:{...fE.wrapper,width:e,height:t},...s},!n&&rt.createElement(k8,null,r),rt.createElement("div",{ref:i,style:{...fE.fullWidth,...!n&&fE.hide},className:o}))}var U8=P8,$L=k.memo(U8);function F8(e){k.useEffect(e,[])}var zL=F8;function B8(e,t,n=!0){let r=k.useRef(!0);k.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var pr=B8;function iu(){}function ja(e,t,n,r){return G8(e,r)||Y8(e,t,n,r)}function G8(e,t){return e.editor.getModel(VL(e,t))}function Y8(e,t,n,r){return e.editor.createModel(t,n,r?VL(e,r):void 0)}function VL(e,t){return e.Uri.parse(t)}function H8({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:u="light",loading:p="Loading...",options:_={},height:f="100%",width:g="100%",className:h,wrapperProps:E={},beforeMount:b=iu,onMount:T=iu}){let[y,R]=k.useState(!1),[O,I]=k.useState(!0),D=k.useRef(null),M=k.useRef(null),$=k.useRef(null),H=k.useRef(T),B=k.useRef(b),se=k.useRef(!1);zL(()=>{let ee=HL.init();return ee.then(ue=>(M.current=ue)&&I(!1)).catch(ue=>(ue==null?void 0:ue.type)!=="cancelation"&&console.error("Monaco initialization: error:",ue)),()=>D.current?ce():ee.cancel()}),pr(()=>{if(D.current&&M.current){let ee=D.current.getOriginalEditor(),ue=ja(M.current,e||"",r||n||"text",o||"");ue!==ee.getModel()&&ee.setModel(ue)}},[o],y),pr(()=>{if(D.current&&M.current){let ee=D.current.getModifiedEditor(),ue=ja(M.current,t||"",i||n||"text",s||"");ue!==ee.getModel()&&ee.setModel(ue)}},[s],y),pr(()=>{let ee=D.current.getModifiedEditor();ee.getOption(M.current.editor.EditorOption.readOnly)?ee.setValue(t||""):t!==ee.getValue()&&(ee.executeEdits("",[{range:ee.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),ee.pushUndoStop())},[t],y),pr(()=>{var ee,ue;(ue=(ee=D.current)==null?void 0:ee.getModel())==null||ue.original.setValue(e||"")},[e],y),pr(()=>{let{original:ee,modified:ue}=D.current.getModel();M.current.editor.setModelLanguage(ee,r||n||"text"),M.current.editor.setModelLanguage(ue,i||n||"text")},[n,r,i],y),pr(()=>{var ee;(ee=M.current)==null||ee.editor.setTheme(u)},[u],y),pr(()=>{var ee;(ee=D.current)==null||ee.updateOptions(_)},[_],y);let de=k.useCallback(()=>{var L;if(!M.current)return;B.current(M.current);let ee=ja(M.current,e||"",r||n||"text",o||""),ue=ja(M.current,t||"",i||n||"text",s||"");(L=D.current)==null||L.setModel({original:ee,modified:ue})},[n,t,i,e,r,o,s]),pe=k.useCallback(()=>{var ee;!se.current&&$.current&&(D.current=M.current.editor.createDiffEditor($.current,{automaticLayout:!0,..._}),de(),(ee=M.current)==null||ee.editor.setTheme(u),R(!0),se.current
Line truncated
|
||||
`+t.message,window.Debug.error(t),Zp=null}).finally(()=>{for(const t of YA)t(Zp),YA.delete(t);e(Zp)})})}const o7=Tt.create({name:"ipsMessages",addCommands(){let e={_messages:new Map,addMessage(n,r=""){this._messages.set(n,r)},removeMessage(n){this._messages.delete(n)},get messages(){return this._messages},onVisibilityChange(n){t=n}},t=!1;return{showMessage:(n,r="")=>()=>{e==null||e.addMessage(n,r)},hideMessage:n=>()=>{e==null||e.removeMessage(n)},registerMessageInterface:n=>()=>{var i,o,s;if(Object.is(n,e))return!1;let r=!1;for(const a in n)if(!Object.is(n[a],e[a])){r=!0;break}if(!r)return!1;if(e.messages instanceof Map)for(const a of e.messages.keys())(o=(i=n==null?void 0:n.messages)==null?void 0:i.has)!=null&&o.call(i,a)&&n.messages.get(a)===e.messages.get(a)||n.addMessage(a,e.messages.get(a));(!("visible"in n)||n.visible!==t)&&((s=n.onVisibilityChange)==null||s.call(n,t)),e=n},fireVisibilityChange:n=>()=>{var r;t=!!n,(r=e==null?void 0:e.onVisibilityChange)==null||r.call(e,t)}}}}),s7=({key:e,editor:t,onPaste:n,onDrop:r,allowedMimeTypes:i})=>new Xe({key:e||new Ke("fileHandler"),props:{handleDrop(o,s){var a;if(!r||!(!((a=s.dataTransfer)===null||a===void 0)&&a.files.length))return!1;const l=o.posAtCoords({left:s.clientX,top:s.clientY});let u=Array.from(s.dataTransfer.files);return i&&(u=u.filter(p=>i.includes(p.type))),u.length!==0&&(s.preventDefault(),s.stopPropagation(),r(t,u,(l==null?void 0:l.pos)||0),!0)},handlePaste(o,s){var a;if(!n||!(!((a=s.clipboardData)===null||a===void 0)&&a.files.length))return!1;let l=Array.from(s.clipboardData.files);const u=s.clipboardData.getData("text/html");return i&&(l=l.filter(p=>i.includes(p.type))),l.length!==0&&(s.preventDefault(),s.stopPropagation(),n(t,l,u),!(u.length>0))}}}),a7=Tt.create({name:"fileHandler",addOptions:()=>({onPaste:void 0,onDrop:void 0,allowedMimeTypes:void 0}),addProseMirrorPlugins(){return[s7({key:new Ke(this.name),editor:this.editor,allowedMimeTypes:this.options.allowedMimeTypes,onDrop:this.options.onDrop,onPaste:this.options.onPaste})]}});function l7({mimeTypes:e,handler:t}){let n;Array.isArray(e)&&(n=new Set(e.map(i=>i.toLowerCase())));const r=i=>{const o=i instanceof DragEvent?i.dataTransfer:i.clipboardData;if(o.files.length){const s=[];for(const a of o.files)(!n||n.has(a.type.toLowerCase()))&&s.push(a);if(s.length)return t(s),!0}};return new Xe({key:new Ke("ipsDataTransferFixer"),props:{handlePaste:(i,o)=>r(o),handleDrop:(i,o)=>r(o)}})}const c7=a7.extend({addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),injectAttachments:t=>({editor:n,chain:r})=>{const i=u7(n.options.postkey);if(!i)return!1;let o=r();for(const s of t){const a=Math.round(Math.random()*Math.pow(10,8));let l=!1;o=o.insertContent({type:ut.name,attrs:{attachmentType:"file",attachmentSrc:"",attachmentLink:"",fileId:a,attachmentTitle:"Uploading Attachment..."}}),i.dispatchEvent(new d7({file:s,data:{ready:u=>{if(l)return;l=!0;const p=Qb(n.$doc,a);p.length&&n.commands.command(({tr:_,chain:f})=>{let g=f();for(const{to:h,from:E}of p)g=g.insertContentAt({from:_.mapping.map(E),to:_.mapping.map(h)},u,{parseOptions:{preserveWhitespace:!1}});return!0})},error:u=>{l||(l=!0,u instanceof Error&&(u.message=`File upload failed:
|
||||
${u.message}`,window.Debug.warn(u),n.commands.showMessage("file-attach","Couldn't insert one or more files pasted or dropped in the editor.")),n.commands.removeAttachment(a))}}}))}return o.run(),!0}}},addProseMirrorPlugins(){var e;return[l7({mimeTypes:this.options.allowedMimeTypes,handler:t=>this.options.onPaste(this.editor,t)}),...((e=this.parent)==null?void 0:e.call(this))||[]]}}).configure({onPaste(e,t){return e.commands.injectAttachments(t)},onDrop(e,t){return e.commands.injectAttachments(t)}});function u7(e){return!e||typeof e!="string"?null:document.querySelector(`[data-ipsuploader-postkey="${e}"]`)}class d7 extends Event{constructor(t){super("injectFile"),this.data=t}}const p7=["name","group","isInline","isBlock","isText","selectable","exitable","atom","addOptions","addKeyboardShortcuts","addAttributes","addGlobalAttributes","renderHTML","parseHTML","onCreate","onUpdate","onBeforeCreate","onFocus","onBlur","onBeforeCreate","onSelectionUpdate","onDestroy","onTransaction","priority","defaultOptions","addInputRules","marks","addNodeView","whitespace","defining","isolating","renderText"];function _7(e,t){var a,l,u;if(!e.ipsPlugins){e.ipsPlugins={buttons:{},extensions:[],nodes:[],marks:[]};return}e.ipsPlugins.buttons={},Array.isArray((a=e.ipsPlugins)==null?void 0:a.extensions)?s(e.ipsPlugins.extensions,Tt):e.ipsPlugins.extensions=[],Array.isArray((l=e.ipsPlugins)==null?void 0:l.nodes)?s(e.ipsPlugins.nodes,ot):e.ipsPlugins.nodes=[],Array.isArray((u=e.ipsPlugins)==null?void 0:u.marks)?s(e.ipsPlugins.marks,un):e.ipsPlugins.marks=[],e.ipsPlugins.nestedToolbars={},e.pluginButtonKeys=new Set;const n=new Set(e.tools.toolbar);for(const p in e.ipsPlugins.buttons)for(const{before:_,after:f}of e.ipsPlugins.buttons[p].locations){let g,h=!1;if(typeof f=="string"&&f in cA){const E=cA[f];e.ipsPlugins.nestedToolbars[E]=e.ipsPlugins.nestedToolbars[E]||[...ss[E]],e.ipsPlugins.nestedToolbars[E].push(`custom:${p}`),h=!0}else if(typeof f=="string"&&n.has(f))g=e.tools.toolbar.indexOf(f)+1;else if(typeof _=="string"&&n.has(_))g=e.tools.toolbar.indexOf(_);else if(!_&&!f||_===null||f===null)g=e.tools.toolbar.length;else continue;e.pluginButtonKeys.add(`custom:${p}`),h||(n.add(`custom:${p}`),e.tools.toolbar.splice(g,0,`custom:${p}`))}function r(p){for(const _ of p.attributes)["class","style","id","src","title","rel","alt"].includes(_.name.toLowerCase())||p.removeAttribute(_.name);for(const _ of p.querySelectorAll(":scope > *"))r(_)}function i(p,_){var f;if(p.addButtons instanceof Function){const g=p.addButtons.bind(_)();if(typeof g!="object")throw new TypeError;const h=new DOMParser;for(const E in g){let{html:b,command:T,locations:y,element:R,isActive:O,isAvailable:I}=g[E];if(typeof b!="string"&&!(R instanceof HTMLElement)||!(T instanceof Function)||!Array.isArray(y))throw new TypeError;O!==void 0&&typeof O!="boolean"&&!(O instanceof Function)&&(window.Debug.warn(`Expected isActive to be a boolean or a Function, got a ${typeof O}. Casting to boolean.`),O=!!O),I!==void 0&&typeof I!="boolean"&&!(I instanceof Function)&&(window.Debug.warn(`Expected isAvailable to be a boolean or a Function, got a ${typeof I}. Casting to boolean.`),I=!!I);const D=[];for(const B of y)if(B===null)D.push({after:null,before:void 0});else if(typeof B=="object"){if(![void 0,null].includes(B.before)&&typeof B.before!="string"||![void 0,null].includes(B.after)&&typeof B.after!="string")throw new TypeError;D.push({after:B.after,before:B.before})}else typeof B=="string"?D.push({after:B,before:void 0}):D.push({after:void 0,before:void 0});y=D;const M=["script","link","style","pre","code","iframe","object","embed","noscript","video"];if(R instanceof Element)R.querySelectorAll(M.join(",")).forEach(B=>B.remove());else{const B=h.parseFromString(b,"text/html");if(!(B instanceof Document))throw new RangeError("The html passed in for the button is not readable");if(B.querySelectorAll(M.join(",")).forEach(se=>se.remove()),!(((f=B==null?void 0:B.body)==null?void 0:f.firstElementChild)instanceof HTMLElement)||!B.body.firstElementChild.innerHTML.length)throw new RangeError("The html passed in for the button is not readable");R=B.body.firstElementChild}if(r(R),M.includes(R.tagName.toLowerCase()))throw new RangeError(`The element of type ${R.tagName} cannot be used as a toolbar button`);const $=R.cloneNode(!0),H=`${p.name}_${E}`;e.ipsPlugins.buttons[H]={get element(){return $},set element(B){throw new Error("Cannot update the element of an ipsPlugin button!")},get command(){return T.bind(_)},set command(B){throw new Error("Cannot update the command of an ipsPlugin button!")},get isActive(){return O instanceof Function?O.bind(_):O},set isActive(B){throw new Error("Cannot update the isActive property of an ipsPlugin button!")},get isAvailable(){return I instanceof Function?I.bind(_):I},set isAvailable(B){throw new Error("Cannot update the isAvailable property of an ipsPlugin button!")},get locations(){return y},set locations(B){throw new Error("Cannot update properties of ips
Line truncated
|
||||
${g.message}`,window.Debug.warn(g)}}}const SE=Tt.create({name:"ipsHomeEnd",addKeyboardShortcuts(){return{Home:({editor:e})=>(Qt(()=>{var i,o,s;const{$from:t}=e.state.selection,n=t.pos-t.parentOffset;let r=t.pos;for(;r>n;){const a=e.state.doc.slice(r-1,r);if(((i=a.content.content[0])==null?void 0:i.textContent)===`
|
||||
`||((s=(o=a.content.content[0])==null?void 0:o.type)==null?void 0:s.name)===$u.name)break;r--}e.chain().setTextSelection(r).focus().run()},"Something went wrong handling the 'Home' key press"),!0),End:({editor:e})=>(Qt(()=>{var i,o,s;const{$to:t}=e.state.selection,n=[...t.path].reverse()[3]+t.parent.nodeSize-1;let r=t.pos;for(;r<n;){const a=e.state.doc.slice(r,r+1);if(((i=a.content.content[0])==null?void 0:i.textContent)===`
|
||||
`||((s=(o=a.content.content[0])==null?void 0:o.type)==null?void 0:s.name)===$u.name)break;r++}e.chain().setTextSelection(r).focus().run()},"Something went wrong handling the 'End' key press"),!0)}}}),m7=Tt.create({name:"IPSSimpleRichText",addProseMirrorPlugins(){return[new Ze({key:new Ke("ipsSimpleRichTextPlugin"),filterTransaction:e=>!(this.editor.options.lengthFunction instanceof Function&&typeof this.editor.options.maxLength=="number"&&this.editor.options.lengthFunction(ed(e.doc.content,this.editor.schema))>this.editor.options.maxLength),appendTransaction:(e,t,n)=>{const r=[];let i;const{from:o,to:s}=n.selection;n.doc.descendants((l,u)=>{var p,_;if(typeof l.textContent=="string"&&!l.textContent&&!l.isInline){const f=n.doc.resolve(u),g=g7(f,n.doc),h=h7(f,n.doc);if([o,s].some(E=>g.pos<E&&h.pos>E)){if(i===void 0&&e.some(E=>{var b;return(b=E.steps)==null?void 0:b.length})){let E=1,b=l;for(;(_=(p=b.content)==null?void 0:p.content)!=null&&_.length;)E++,b=b.content.content[0];i=E+u}return!1}return r.push([u,u+l.nodeSize]),!1}if(l.isInline||!l.content.content.length)return!1});const{tr:a}=n;for(const[l,u]of r.reverse())a.delete(l,u);if(i!==void 0){const l=Ce.atStart(n.doc).from,u=Ce.atEnd(n.doc).to,p=Ce.create(n.doc,ko(i,l,u));o===p.from&&o===s||a.setSelection(p)}return a}})]},addKeyboardShortcuts(){return{Enter:({editor:e})=>{const t=e.view.dom.closest("form");if(t){let n=t.querySelector('button:is([type="submit"], :not([type]))');n||(n=document.createElement("button"),n.setAttribute("type","button"),n.setAttribute("hidden",""),t.appendChild(n),setTimeout(()=>n.documentElement===document.documentElement&&n.remove(),200)),n.click()}return!0},"Shift-Enter":({editor:e})=>(e.isActive(Pu.name)?e.commands.splitListItem(Pu.name):e.commands.splitBlock(),!1)}},onCreate(){this.editor.view.dom.addEventListener("clear",e=>{var t;this.editor.commands.setContent(((t=e.detail)==null?void 0:t.content)||"")})}});function g7(e,t){var r,i;const n=[...e.path].reverse();for(;n.length>=3;){if(n[1]>0){let o=n[2].content.content[n[1]-1],s=0;for(;o;)o=(i=(r=o.content)==null?void 0:r.content)!=null&&i.length?o.content.content[o.content.content.length-1]:null,s++;return t.resolve(e.pos-s)}n.splice(0,3)}return t.resolve(0)}function h7(e,t){var r,i;const n=[...e.path].reverse();for(;n.length>=3;){if(n[1]<n[2].content.content.length-1){let o=n[2].content.content[n[1]+1],s=0;for(;o;)s++,o=(i=(r=o.content)==null?void 0:r.content)==null?void 0:i[0];return t.resolve(e.pos+n[2].content.content[n[1]].nodeSize+s)}n.splice(0,3)}return t.resolve(t.nodeSize-2)}const E7=ot.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:e}){return["tr",We(this.options.HTMLAttributes,e),0]}}),S7=ot.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:e}){return["th",We(this.options.HTMLAttributes,e),0]}}),T7=ot.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:e}){return["td",We(this.options.HTMLAttributes,e),0]}}),b7=Tt.create({name:"ipsClearNewLine",addOptions(){return{removeNewLinesBefore:[]}},addStorage(){return{observedNodes:[rr.name,ir.name,cl.name,is.name,ey.name,ut.name]}},onCreate(){this.options.removeNewLinesBefore.length&&(this.storage.observedNodes=[...new Set([...this.storage.observedNodes,...this.options.removeNewLinesBefore])])},addKeyboardShortcuts(){return{Backspace:({editor:e})=>{var o,s,a,l,u,p,_;const{observedNodes:t}=this.storage;if(!(t!=null&&t.length))return;const n=e.state.selection;if(!n.empty)return;const r=n.$from.parent;if(!r||r.type.name!==wt.name)return;const i=[...n.$from.path].reverse();if(r.content.size){if(!((u=(l=r==null?void 0:r.content)==null?void 0:l.content)!=null&&u.length)||r.content.content.length<2||((p=n.$from.nodeAfter)==null?void 0:p.type.name)!==$u.name||!t.includes((_=r.content.content[n.$from.parentOffset+1])==null?void 0:_.type.name))return;const f=i[1];let g;if(f!==0){if(!t.includes(r.content.content[f-1]))return;g=n.from-r.content.content[f-1].nodeSize}else{const h=i[5],E=i[4],b=h.type.name===cl.name?1:0;E>b&&t.includes(h.content.content[E-1].type.name)&&(g=i[3]-h.content.content[E-1].nodeSize)}return(typeof g!="number"||Number.isNaN(g))&&(g=n.from),e.chain().deleteRange({from:n.from,to:n.from+1}).setNodeSelection(g).run(),!0}else{const f=i[5],g=i[4];if(!f||g===void 0)return;co
Line truncated
|
||||
`}}),...(f=e.restrictions)!=null&&f.has("tables")?[!1]:[ML.configure({resizable:!0,cellMinWidth:((g=e.table)==null?void 0:g.cellMinWidth)||100}),E7,S7,T7],kL,b7].filter(R=>!!R);return window.navigator.platform==="MacIntel"&&t.push(SE),e.autoSaveKey&&t.push(PL),e.postkey&&(t.push(u7),t.push(ut.configure({externalImages:!((h=e.restrictions)!=null&&h.has("external_image")),externalVideos:!((E=e.restrictions)!=null&&E.has("external_video")),float:!((b=e.restrictions)!=null&&b.has("float"))}))),(T=e.restrictions)!=null&&T.has("heading")||t.push(bn.configure({levels:(y=e.restrictions)!=null&&y.has("heading_1")?[2,3,4,5,6]:[1,2,3,4,5,6]})),t}async function HA(e,t){var n,r;if(e.pluginButtonKeys=new Set,e.simpleRichText?(delete e.codeMode,e.tools={toolbar:[...bL]},e.react&&VW(e.react)):await Mj(),e.restrictions&&Symbol.iterator in e.restrictions?e.restrictions=new Set(e.restrictions):delete e.restrictions,e.jQuery=e.jQuery||window.jQuery,e.editorProps={attributes:{class:e.codeMode?"":"ipsRichText"}},e.itemStates={},e.extensions=y7(e),!(e.messagesContainer instanceof Element)&&((n=t==null?void 0:t.closest(".ipsEditor"))!=null&&n.querySelector('[data-role="editor-messages-container"]'))&&(e.messagesContainer=(r=t==null?void 0:t.closest(".ipsEditor"))==null?void 0:r.querySelector('[data-role="editor-messages-container"]')),e.codeMode)return e.tools={toolbar:["codelanguage"]},e;if(e.simpleRichText||f7(e,e.extensions),e.stockrepliesenabled){const i=await Jb();Object.keys(i).length?window.Debug.log("Loaded stock replies"):(e.stockrepliesenabled=!1,window.Debug.log("No stock replies, disabling the button"))}if(!e.codeMode){for(const i in e.tools)e.tools[i]=e.tools[i].filter(o=>o==="giphy"&&!e.giphyenabled||o==="stockreply"&&!e.stockrepliesenabled?!1:!(e.hidebuttons instanceof Array&&e.hidebuttons.includes(o)));e.parseOptions=e.parseOptions||{},e.parseOptions.preserveWhitespace=!1}return e.tools.toolbar&&e.tools.toolbar[0]!=="block"&&(e.tools.toolbar=["block",...e.tools.toolbar.filter(i=>i!=="block")]),e}let $A=!1;function C7(){if(!$A){for(const e of["click","focus","keydown","keyup"])document.addEventListener(e,t=>{var n,r,i;(r=(n=t.target)==null?void 0:n.closest)!=null&&r.call(n,".ipsEditor__toolbar-item--unavailable")&&(t.preventDefault(),t.stopPropagation(),(i=t.stopImmediatePropagation)==null||i.call(t))},{capture:!0});$A=!0}}setTimeout(()=>window.ips.createModule("ips.utils.tiptap",()=>{const e={tools:{toolbar:["block","insert","bold","italic","underline","size","color","link","icon","stockreply","giphy","clear","format","tableOptions"]},allowedIframeDomains:window.ips.getSetting("allowedIframeDomains")||[],restrictions:new Set};return document.dispatchEvent(new CustomEvent("ipsTiptapLoaded")),{editorInstance(t,n={}){const r=TE.createRoot(t),i=nr.debounce((o,s)=>{s([o,r]),o instanceof kx&&o.options.name&&setTimeout(()=>o.options.jQuery(o.view.dom.closest("[data-ipseditorv5]")).trigger("editorWidgetInitialized",{id:o.options.name}))},10,{leading:!1});return C7(),new Promise(o=>{HA({...e,...n},t).then(s=>{r.render(N.jsx(Xe.StrictMode,{children:N.jsx(J8,{resolve:a=>{i(a,o)},config:s})}))})})},allCodeLanguages:Rl,async decorateSimpleRichTextConfig(t){return t.simpleRichText=!0,await HA(t)}}}));
|
||||
`||((s=(o=a.content.content[0])==null?void 0:o.type)==null?void 0:s.name)===$u.name)break;r++}e.chain().setTextSelection(r).focus().run()},"Something went wrong handling the 'End' key press"),!0)}}}),f7=Tt.create({name:"IPSSimpleRichText",addProseMirrorPlugins(){return[new Xe({key:new Ke("ipsSimpleRichTextPlugin"),filterTransaction:e=>!(this.editor.options.lengthFunction instanceof Function&&typeof this.editor.options.maxLength=="number"&&this.editor.options.lengthFunction(ed(e.doc.content,this.editor.schema))>this.editor.options.maxLength),appendTransaction:(e,t,n)=>{const r=[];let i;const{from:o,to:s}=n.selection;n.doc.descendants((l,u)=>{var p,_;if(typeof l.textContent=="string"&&!l.textContent&&!l.isInline){const f=n.doc.resolve(u),g=m7(f,n.doc),h=g7(f,n.doc);if([o,s].some(E=>g.pos<E&&h.pos>E)){if(i===void 0&&e.some(E=>{var b;return(b=E.steps)==null?void 0:b.length})){let E=1,b=l;for(;(_=(p=b.content)==null?void 0:p.content)!=null&&_.length;)E++,b=b.content.content[0];i=E+u}return!1}return r.push([u,u+l.nodeSize]),!1}if(l.isInline||!l.content.content.length)return!1});const{tr:a}=n;for(const[l,u]of r.reverse())a.delete(l,u);if(i!==void 0){const l=Ce.atStart(n.doc).from,u=Ce.atEnd(n.doc).to,p=Ce.create(n.doc,ko(i,l,u));o===p.from&&o===s||a.setSelection(p)}return a}})]},addKeyboardShortcuts(){return{Enter:({editor:e})=>{const t=e.view.dom.closest("form");if(t){let n=t.querySelector('button:is([type="submit"], :not([type]))');n||(n=document.createElement("button"),n.setAttribute("type","button"),n.setAttribute("hidden",""),t.appendChild(n),setTimeout(()=>n.documentElement===document.documentElement&&n.remove(),200)),n.click()}return!0},"Shift-Enter":({editor:e})=>(e.isActive(Pu.name)?e.commands.splitListItem(Pu.name):e.commands.splitBlock(),!1)}},onCreate(){this.editor.view.dom.addEventListener("clear",e=>{var t;this.editor.commands.setContent(((t=e.detail)==null?void 0:t.content)||"")})}});function m7(e,t){var r,i;const n=[...e.path].reverse();for(;n.length>=3;){if(n[1]>0){let o=n[2].content.content[n[1]-1],s=0;for(;o;)o=(i=(r=o.content)==null?void 0:r.content)!=null&&i.length?o.content.content[o.content.content.length-1]:null,s++;return t.resolve(e.pos-s)}n.splice(0,3)}return t.resolve(0)}function g7(e,t){var r,i;const n=[...e.path].reverse();for(;n.length>=3;){if(n[1]<n[2].content.content.length-1){let o=n[2].content.content[n[1]+1],s=0;for(;o;)s++,o=(i=(r=o.content)==null?void 0:r.content)==null?void 0:i[0];return t.resolve(e.pos+n[2].content.content[n[1]].nodeSize+s)}n.splice(0,3)}return t.resolve(t.nodeSize-2)}const h7=ot.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:e}){return["tr",We(this.options.HTMLAttributes,e),0]}}),E7=ot.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:e}){return["th",We(this.options.HTMLAttributes,e),0]}}),S7=ot.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:e}){return["td",We(this.options.HTMLAttributes,e),0]}}),T7=Tt.create({name:"ipsClearNewLine",addOptions(){return{removeNewLinesBefore:[]}},addStorage(){return{observedNodes:[rr.name,ir.name,cl.name,is.name,ey.name,ut.name]}},onCreate(){this.options.removeNewLinesBefore.length&&(this.storage.observedNodes=[...new Set([...this.storage.observedNodes,...this.options.removeNewLinesBefore])])},addKeyboardShortcuts(){return{Backspace:({editor:e})=>{var o,s,a,l,u,p,_;const{observedNodes:t}=this.storage;if(!(t!=null&&t.length))return;const n=e.state.selection;if(!n.empty)return;const r=n.$from.parent;if(!r||r.type.name!==wt.name)return;const i=[...n.$from.path].reverse();if(r.content.size){if(!((u=(l=r==null?void 0:r.content)==null?void 0:l.content)!=null&&u.length)||r.content.content.length<2||((p=n.$from.nodeAfter)==null?void 0:p.type.name)!==$u.name||!t.includes((_=r.content.content[n.$from.parentOffset+1])==null?void 0:_.type.name))return;const f=i[1];let g;if(f!==0){if(!t.includes(r.content.content[f-1]))return;g=n.from-r.content.content[f-1].nodeSize}else{const h=i[5],E=i[4],b=h.type.name===cl.name?1:0;E>b&&t.includes(h.content.content[E-1].type.name)&&(g=i[3]-h.content.content[E-1].nodeSize)}return(typeof g!="number"||Number.isNaN(g))&&(g=n.from),e.chain().deleteRange({from:n.from,to:n.from+1}).setNodeSelection(g).run(),!0}else{const f=i[5],g=i[4];if(!f||g===void 0)return;co
Line truncated
|
||||
`}}),...(f=e.restrictions)!=null&&f.has("tables")?[!1]:[ML.configure({resizable:!0,cellMinWidth:((g=e.table)==null?void 0:g.cellMinWidth)||100}),h7,E7,S7],kL,T7].filter(R=>!!R);return window.navigator.platform==="MacIntel"&&t.push(SE),e.autoSaveKey&&t.push(PL),e.postkey&&(t.push(c7),t.push(ut.configure({externalImages:!((h=e.restrictions)!=null&&h.has("external_image")),externalVideos:!((E=e.restrictions)!=null&&E.has("external_video")),float:!((b=e.restrictions)!=null&&b.has("float"))}))),(T=e.restrictions)!=null&&T.has("heading")||t.push(bn.configure({levels:(y=e.restrictions)!=null&&y.has("heading_1")?[2,3,4,5,6]:[1,2,3,4,5,6]})),t}async function HA(e,t){var n,r;if(e.pluginButtonKeys=new Set,e.simpleRichText?(delete e.codeMode,e.tools={toolbar:[...bL]},e.react&&$W(e.react)):await Dj(),e.restrictions&&Symbol.iterator in e.restrictions?e.restrictions=new Set(e.restrictions):delete e.restrictions,e.jQuery=e.jQuery||window.jQuery,e.editorProps={attributes:{class:e.codeMode?"":"ipsRichText"}},e.itemStates={},e.extensions=b7(e),!(e.messagesContainer instanceof Element)&&((n=t==null?void 0:t.closest(".ipsEditor"))!=null&&n.querySelector('[data-role="editor-messages-container"]'))&&(e.messagesContainer=(r=t==null?void 0:t.closest(".ipsEditor"))==null?void 0:r.querySelector('[data-role="editor-messages-container"]')),e.codeMode)return e.tools={toolbar:["codelanguage"]},e;if(e.simpleRichText||_7(e,e.extensions),e.stockrepliesenabled){const i=await Jb();Object.keys(i).length?window.Debug.log("Loaded stock replies"):(e.stockrepliesenabled=!1,window.Debug.log("No stock replies, disabling the button"))}if(!e.codeMode){for(const i in e.tools)e.tools[i]=e.tools[i].filter(o=>o==="giphy"&&!e.giphyenabled||o==="stockreply"&&!e.stockrepliesenabled?!1:!(e.hidebuttons instanceof Array&&e.hidebuttons.includes(o)));e.parseOptions=e.parseOptions||{},e.parseOptions.preserveWhitespace=!1}return e.tools.toolbar&&e.tools.toolbar[0]!=="block"&&(e.tools.toolbar=["block",...e.tools.toolbar.filter(i=>i!=="block")]),e}let $A=!1;function y7(){if(!$A){for(const e of["click","focus","keydown","keyup"])document.addEventListener(e,t=>{var n,r,i;(r=(n=t.target)==null?void 0:n.closest)!=null&&r.call(n,".ipsEditor__toolbar-item--unavailable")&&(t.preventDefault(),t.stopPropagation(),(i=t.stopImmediatePropagation)==null||i.call(t))},{capture:!0});$A=!0}}setTimeout(()=>window.ips.createModule("ips.utils.tiptap",()=>{const e={tools:{toolbar:["block","insert","bold","italic","underline","size","color","link","icon","stockreply","giphy","clear","format","tableOptions"]},allowedIframeDomains:window.ips.getSetting("allowedIframeDomains")||[],restrictions:new Set};return document.dispatchEvent(new CustomEvent("ipsTiptapLoaded")),{editorInstance(t,n={}){const r=TE.createRoot(t),i=Un.debounce((o,s)=>{s([o,r]),o instanceof kx&&o.options.name&&setTimeout(()=>o.options.jQuery(o.view.dom.closest("[data-ipseditorv5]")).trigger("editorWidgetInitialized",{id:o.options.name}))},10,{leading:!1});return y7(),new Promise(o=>{HA({...e,...n},t).then(s=>{r.render(N.jsx(rt.StrictMode,{children:N.jsx(X8,{resolve:a=>{i(a,o)},config:s})}))})})},allCodeLanguages:Rl,async decorateSimpleRichTextConfig(t){return t.simpleRichText=!0,await HA(t)}}}));
|
||||
@@ -69,7 +69,7 @@
|
||||
"isDynamicEntry": true
|
||||
},
|
||||
"src/main.jsx": {
|
||||
"file": "assets/main-DuMoUIOM.js",
|
||||
"file": "assets/main-CbPFTxeK.js",
|
||||
"name": "main",
|
||||
"src": "src/main.jsx",
|
||||
"isEntry": true,
|
||||
|
||||
Reference in new issue
Block a user