|
|
(self.webpackChunk=self.webpackChunk||[]).push([[8821],{89489:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var i=n(14809),r=n(59301),a={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"},s=n(7657),o=function(e,t){return r.createElement(s.Z,(0,i.Z)({},e,{ref:t,icon:a}))};var l=r.forwardRef(o)},49198:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var i=n(14809),r=n(59301),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"},s=n(7657),o=function(e,t){return r.createElement(s.Z,(0,i.Z)({},e,{ref:t,icon:a}))};var l=r.forwardRef(o)},62772:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var i=n(14809),r=n(59301),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},s=n(7657),o=function(e,t){return r.createElement(s.Z,(0,i.Z)({},e,{ref:t,icon:a}))};var l=r.forwardRef(o)},34685:function(e,t,n){"use strict";var i=n(59301),r=n(95237),a=n(43604),s=n(99313),o=n(3113),l=n(5627),c=n(99587),u=(n(48136),n(37712)),d=(0,i.forwardRef)((function(e,t){var n=e.callback,d=e.showSaveButton,h=e.value,p=void 0===h?"":h,f=(0,i.useRef)(),m=function(e){f.current.setValue(f.current.getValue()+" "+e.value+" ")},g=[{key:"1",label:"快捷模板",children:(0,u.jsx)(r.Z,{className:c.Z.lists,gutter:[10,10],children:[{name:"分数得分",value:"\\frac{x}{y}",children:[{name:"分数 Fractions",data:[{value:"\\frac{a}{b}"},{value:"x\\tfrac{x}{a} "},{value:"\\mathrm{d}t"},{value:"\\partial t"},{value:"\\frac{\\partial y}{\\partial x}"},{value:"\\nabla\\psi"},{value:"\\frac{\\partial^2}{\\partial x_1\\partial x_2}y"},{value:"\\cfrac{1}{a + \\cfrac{7}{b + \\cfrac{2}{9}}} = c"}]},{name:"导数 Derivative",data:[{value:"\\dot{a} "},{value:"\\ddot{a}"},{value:"{f}^{\\prime}"},{value:"{f}^{\\prime\\prime}"},{value:"{f}^{(n)}"}]},{name:"模算术 Modular arithmetic",data:[{value:"a \\bmod b"},{value:"a \\equiv b \\pmod{m} "},{value:"\\gcd(m, n) "},{value:"\\operatorname{lcm}(m, n) "}]}]},{name:"根式角标",value:"\\sqrt{x}",children:[{name:"根式 Radicals",data:[{value:"\\sqrt{x}"},{value:"\\sqrt[y]{x}"}]},{name:"上下标 Sub&Super",data:[{value:"x^{a}"},{value:"x_{a}"},{value:"x_{a}^{b} "},{value:"_{a}^{b} x"},{value:"x_{a}^{b} "}]},{name:"重音符及其他 Accents and Others",data:[{value:"\\hat{a} "},{value:"\\sqrt[y]{x}"},{value:"\\check{} "},{value:"\\grave{a} "},{value:"\\acute{a}"},{value:"\\tilde{a}"},{value:"\\breve{a}"},{value:"\\bar{a}"},{value:"\\vec{a}"},{value:"\\not{a}"},{value:"\\widetilde{abc}"},{value:"\\widehat{abc}"},{value:"\\overleftarrow{abc} "},{value:"\\overrightarrow{abc}"},{value:"\\overline{abc}"},{value:"\\underline{abc}"},{value:"\\overbrace{abc}"},{value:"\\underbrace{abc}"},{value:"\\overset{a}{abc}"},{value:"\\underset{a}{abc} \\stackrel\\frown{ab}"},{value:"\\overline{ab} "},{value:"\\overleftrightarrow{ab}"},{value:"\\overset{a}{\\leftarrow}"},{value:"\\overset{a}{\\rightarrow}"},{value:"\\xleftarrow[abc]{a}"},{value:"\\xrightarrow[abc]{a} "}]}]},{name:"极限对数",value:"\\lim_{x \\to 0}",children:[{name:"极限 Limits",data:[{value:"\\lim a"},{value:"\\lim_{x \\to 0}"},{value:"\\lim_{x \\to \\infty}"},{value:"\\max_b{a}"},{value:"\\min_a{b}"}]},{name:"对数指数 Logarithms and exponentials",data:[{value:"\\log_{a}{b}"},{value:"\\lg_{a}{b}"},{value:"\\ln_{a}{b}"},{value:"\\exp a"}]},{name:"界限 Bounds",data:[{value:"\\min x"},{value:"\\sup t"},{value:"\\inf s"},{value:"\\lim u"},{value:"\\limsup w"},{value:"\\dim p"},{value:"\\ker\\phi "}]}]},{name:"三角函数",value:"\\sin a",children:[{name:"三角函数 Trigonometric functions",data:[{value:"\\sin a"},{value:"\\cos a"},{value:"\\tan a"},{value:"\\cot a "},{value:"\\sec a "},{value:"\\csc a "}]},{name:"反三角函数 Inverse trigonometric functions",data:[{value:"\\sin^{-1}"},{value:"\\cos^{-1}"},{value:"\\tan^{-1}"},{value:"\\cot^{-1}"},{value:"\\sec^{-1}"},{value:"\\csc^{-1}"},{value:"\\arcsin a"},{value:"\\arccos a"},{value:"\\arctan a"},{value:"\\operatorname{arccot} a"},{value:"\\operatorname{arcsec} a"},{value:"\\operatorname{arccsc} a"}]},{name:"双曲函数 Hyperblic functions",data:[{value:"\\sinh a"},{value:"\\cosh a"},{value:"\\tanh a"},{value:"\\coth a"},{value:"\\operatorname{sech} a"},{value:"\\operatorname{csch} a"}]},{name:"反双曲函数 Inverse hyperbolic functions",data:[{value:"\\sinh^{-1}"},{value:"a\\cosh^{-1} a"},{value:"\\tanh^{-1} a"},{value:"\\coth^{-1} a"},{value:"\\operatorname{sech}^{-1} a"},{value:"\\operatorname{csch}^{-1} a"}]}]},{name:"积分运算",value:"\\int_{a}^{b}",children:[{name:"积分 Integral",data:[{value:"\\int"},{value:"\\int_{a}^{b}"},{value:"\\int\\limits_{a}^{b}"}]},{name:"双重积分 Double integral",data:[{value:"\\iint"},{value:"\\iint_{a}^{b} "},{value:"\\iint\\limits_{a}^{b} "}]},{name:"三重积分 Triple integral",data:[{value:"\\iiint"},{value:"\\iiint_{a}^{b}"},{value:"\\iiint\\limits_{a}^{b} "}]},{name:"曲线积分 Closed line or path integral",data:[{value:"\\oint"},{value:"\\oint_{a}^{b} "}]}]},{name:"大型运算",value:"\\sum_{a}^{b}",children:[{name:"求和 Summation",data:[{value:"\\sum"},{value:"\\sum_{a}^{b}"},{value:"{\\textstyle \\sum_{a}^{b}} "}]},{name:"乘积余积 Product and coproduct",data:[{value:"\\prod"},{value:"\\prod_{a}^{b}"},{value:"{\\textstyle \\prod_{a}^{b}}"},{value:"\\coprod"},{value:"\\coprod_{a}^{b}"},{value:"{\\textstyle \\coprod_{a}^{b}} "}]},{name:"并集交集 Union and intersection",data:[{value:"\\bigcup"},{value:"\\bigcup_{a}^{b}"},{value:"{\\textstyle \\bigcup_{a}^{b}}"},{value:"\\bigcap"},{value:"\\bigcap_{a}^{b}"}]},{name:"析取合取 Disjunction and conjunction",data:[{value:"\\bigvee"},{value:"\\bigvee_{a}^{b}"},{value:"\\bigwedge"},{value:"\\bigwedge_{a}^{b}"}]}]},{name:"括号取整",value:"\\left [ \\left ( \\right ) \\right ] ",children:[{name:"括号 Brackets",data:[{value:"\\left ( \\right )"},{value:"\\left [ \\right ]"},{value:"\\left \\langle \\right \\rangle "},{value:"\\left | \\right | "},{value:"\\left \\lfloor \\right \\rfloor "},{value:"\\left \\lceil \\right \\rceil "}]}]}].map((function(e,t){return(0,u.jsxs)(a.Z,{flex:"110px",className:c.Z.item,children:[(0,u.jsxs)("div",{children:[(0,u.jsx)(l.Z,{value:"$$".concat(e.value,"$$")}),e.name]}),(0,u.jsx)("div",{className:c.Z.children,children:e.children.map((function(e,t){return(0,u.jsxs)("div",{children:[(0,u.jsx)("h1",{children:e.name}),(0,u.jsx)(r.Z,{gutter:[10,10],children:e.data.map((function(e,t){return(0,u.jsx)(a.Z,{onClick:function(){return m(e)},className:c.Z.diamond,children:(0,u.jsx)(l.Z,{value:"`$$"+e.value+"$$`"})},t)}))})]},t)}))})]})}))})},{key:"2",label:"公式模板",children:(0,u.jsx)(r.Z,{className:c.Z.lists,gutter:[10,10],children:[{name:"代数",value:"\\sqrt{a^2+b^2}",children:[{data:[{value:"\\left(x-1\\right)\\left(x+3\\right) "},{value:"\\sqrt{a^2+b^2}"},{value:"\\left ( \\frac{a}{b}\\right )^{n}= \\frac{a^{n}}{b^{n}}"},{value:"\\frac{a}{b}\\pm \\frac{c}{d}= \\frac{ad \\pm bc}{bd} "},{value:"\\frac{x^{2}}{a^{2}}-\\frac{y^{2}}{b^{2}}=1 "},{value:"\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0 "},{value:"\\sqrt[n]{a^{n}}=\\left ( \\sqrt[n]{a}\\right )^{n} "},{value:"x ={-b \\pm \\sqrt{b^2-4ac}\\over 2a} "},{value:"y-y_{1}=k \\left( x-x_{1}\\right) "},{value:"\\left\\{\\begin{matrix} \r\n x=a + r\\text{cos}\\theta \\ \r\n y=b + r\\text{sin}\\theta \r\n\\end{matrix}\\right. "},{value:"\\begin{array}{l} \r\n \\text{对于方程形如:}x^{3}-1=0 \\ \r\n \\text{设}\\text{:}\\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r\n x_{1}=1,x_{2}= \\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r\n x_{3}= \\omega ^{2}=\\frac{-1-\\sqrt{3}i}{2} \r\n\\end{array} "},{value:"\\begin{array}{l} \r\n a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r\n \\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r\n \\left\\{\\begin{matrix} \r\n \\Delta \\gt 0\\text{方程有两个不相等的实根} \\ \r\n \\Delta = 0\\text{方程有两个相等的实根} \\ \r\n \\Delta \\lt 0\\text{方程无实根} \r\n\\end{matrix}\\right. \r\n\\end{array} "},{value:"\\begin{array}{l} \r\n a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r\n \\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r\n \\mathop{{x}}\\nolimits_{{1,2}}=\\frac{{-b \\pm \r\n \\sqrt{{\\mathop{{b}}\\nolimits^{{2}}-4ac}}}}{{2a}} \\ \r\n \\mathop{{x}}\\nolimits_{{1}}+\\mathop{{x}}\\nolimits_{{2}}=-\\frac{{b}}{{a}} \\ \r\n \\mathop{{x}}\\nolimits_{{1}}\\mathop{{x}}\\nolimits_{{2}}=\\frac{{c}}{{a}} \r\n\\end{array} "}]}]},{name:"几何",value:"\\Delta A B C ",children:[{data:[{value:"\\Delta A B C "},{value:"a \\parallel c,b \\parallel c \\Rightarrow a \\parallel b "},{value:"l \\perp \\beta ,l \\subset \\alpha \\Rightarrow \\alpha \\perp \\beta"},{value:"\\left.\\begin{matrix} \r\n a \\perp \\alpha \\ \r\n b \\perp \\alpha \r\n\\end{matrix}\\right\\}\\Rightarrow a \\parallel b"},{value:"P \\in \\alpha ,P \\in \\beta , \\alpha \\cap \\beta =l \\Rightarrow P \\in l "},{value:"\\alpha \\perp \\beta , \\alpha \\cap \\beta =l,a \\subset \\alpha ,a \\perp l \r\n \\Rightarrow a \\perp \\beta "},{value:"\\left.\\begin{matrix} \r\n a \\subset \\beta ,b \\subset \\beta ,a \\cap b=P \\ \r\n a \\parallel \\partial ,b \\parallel \\partial \r\n\\end{matrix}\\right\\}\\Rightarrow \\beta \\parallel \\alpha "},{value:"\\alpha \\parallel \\beta , \\gamma \\cap \\alpha =a, \\gamma \\cap \\beta =b \\Rightarrow a \\parallel b "},{value:"A \\in l,B \\in l,A \\in \\alpha ,B \\in \\alpha \\Rightarrow l \\subset \\alpha "},{value:"\\left.\\begin{matrix} \r\n m \\subset \\alpha ,n \\subset \\alpha ,m \\cap n=P \\ \r\n a \\perp m,a \\perp n \r\n\\end{matrix}\\right\\}\\Rightarrow a \\perp \\alpha "},{value:"\\begin{array}{c} \r\n \\text{直角三角形中,直角边长a,b,斜边边长c} \\ \r\n a^{2}+b^{2}=c^{2} \r\n\\end{array}"}]}]},{name:"不等式",value:"a > b",children:[{data:[{value:"a > b,b > c \\Rightarrow a > c "},{value:"a > b,c > d \\Rightarrow a+c > b+d "},{value:"a > b > 0,c > d > 0 \\Rightarrow ac bd "},{value:"\\begin{array}{c} \r\n a \\gt b,c \\gt 0 \\Rightarrow ac \\gt bc \\ \r\n a \\gt b,c \\lt 0 \\Rightarrow ac \\lt bc \r\n\\end{array}"},{value:"\\left | a-b \\right | \\geqslant \\left | a \\right | -\\left | b \\right | "},{value:"-\\left | a \\right |\\leq a\\leqslant \\left | a \\right | "},{value:"\\left | a \\right |\\leqslant b \\Rightarrow -b \\leqslant a \\leqslant \\left | b \\right | "},{value:"\\left | a+b \\right | \\leqslant \\left | a \\right | + \\left | b \\right | "},{value:"\\begin{array}{c} \r\n a \\gt b \\gt 0,n \\in N^{\\ast},n \\gt 1 \\ \r\n \\Rightarrow a^{n}\\gt b^{n}, \\sqrt[n]{a}\\gt \\sqrt[n]{b} \r\n\\end{array}"},{value:"\\left( \\sum_{k=1}^n a_k b_k \\right)^{\\!\\!2}\\leq \r\n\\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right) "},{value:"\\begin{array}{c} \r\n a,b \\in R^{+} \\ \r\n \\Rightarrow \\frac{a+b}{{2}}\\ge \\sqrt{ab} \\ \r\n \\left( \\text{当且仅当}a=b\\text{时取“}=\\text{”号}\\right) \r\n\\end{array}"},{value:"\\begin{array}{c} \r\n a,b \\in R \\ \r\n \\Rightarrow a^{2}+b^{2}\\gt 2ab \\ \r\n \\left( \\text{当且仅当}a=b\\text{时取“}=\\text{”号}\\right) \r\n\\end{array}"},{value:"\\begin{array}{c} \r\n H_{n}=\\frac{n}{\\sum \\limits_{i=1}^{n}\\frac{1}{x_{i}}}= \\frac{n}{\\frac{1}{x_{1}}+ \\frac{1}{x_{2}}+ \\cdots + \\frac{1}{x_{n}}} \\ G_{n}=\\sqrt[n]{\\prod \\limits_{i=1}^{n}x_{i}}= \\sqrt[n]{x_{1}x_{2}\\cdots x_{n}} \\ A_{n}=\\frac{1}{n}\\sum \\limits_{i=1}^{n}x_{i}=\\frac{x_{1}+ x_{2}+ \\cdots + x_{n}}{n} \\ Q_{n}=\\sqrt{\\sum \\limits_{i=1}^{n}x_{i}^{2}}= \\sqrt{\\frac{x_{1}^{2}+ x_{2}^{2}+ \\cdots + x_{n}^{2}}{n}} \\ H_{n}\\leq G_{n}\\leq A_{n}\\leq Q_{n} \r\n\\end{array}"}]}]},{name:"积分",value:"\\frac{\\mathrm{d}\\partial}{\\partial x}",children:[{data:[{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}x^n=nx^{n-1} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}e^{ax}=a\\,e^{ax} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\ln(x)=\\frac{1}{x} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\sin x=\\cos x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cos x=-\\sin x "},{value:"\\int k\\mathrm{d}x = kx+C "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\tan x=\\sec^2 x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cot x=-\\csc^2 x "},{value:"\\int \\frac{1}{x}\\mathrm{d}x= \\ln \\left| x \\right| +C "},{value:"\\int \\frac{1}{\\sqrt{1-x^{2}}}\\mathrm{d}x= \\arcsin x +C "},{value:"\\int \\frac{1}{1+x^{2}}\\mathrm{d}x= \\arctan x +C "},{value:"\\int u \\frac{\\mathrm{d}v}{\\mathrm{d}x}\\,\\mathrm{d}x=uv-\\int \\frac{\\mathrm{d}u}{\\mathrm{d}x}v\\,\\mathrm{d}x "},{value:"f(x) = \\int_{-\\infty}^\\infty \\hat f(x)\\xi\\,e^{2 \\pi i \\xi x} \\,\\mathrm{d}\\xi "},{value:"\\int x^{\\mu}\\mathrm{d}x=\\frac{x^{\\mu +1}}{\\mu +1}+C, \\left({\\mu \\neq -1}\\right) "}]}]},{name:"三角",value:"e^{i \\theta}",children:[{name:"求和 Summation",data:[{value:"e^{i \\theta} "},{value:"\\left(\\frac{\\pi}{2}-\\theta \\right ) "},{value:"\\text{sin}^{2}\\frac{\\alpha}{2}=\\frac{1- \\text{cos}\\alpha}{2} "},{value:"\\text{cos}^{2}\\frac{\\alpha}{2}=\\frac{1+ \\text{cos}\\alpha}{2} "},{value:"\\text{tan}\\frac{\\alpha}{2}=\\frac{\\text{sin}\\alpha}{1+ \\text{cos}\\alpha} "},{value:"\\sin \\alpha + \\sin \\beta =2 \\sin \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\sin \\alpha - \\sin \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha + \\cos \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha - \\cos \\beta =-2\\sin \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"a^{2}=b^{2}+c^{2}-2bc\\cos A "},{value:"\\frac{\\sin A}{a}=\\frac{\\sin B}{b}=\\frac{\\sin C}{c}=\\frac{1}{2R} "},{value:"\\sin \\left ( \\frac{\\pi}{2}-\\alpha \\right ) = \\cos \\alpha "},{value:"\\sin \\left ( \\frac{\\pi}{2}+\\alpha \\right ) = \\cos \\alpha "}]}]},{name:"统计",value:"C_{r}^{n}",children:[{data:[{value:"C_{r}^{n} "},{value:"\\frac{n!}{r!(n-r)!} "},{value:"\\sum_{i=1}^{n}{X_i} "},{value:"\\sum_{i=1}^{n}{X_i^2} "},{value:"X_1, \\cdots,X_n "},{value:"\\frac{x-\\mu}{\\sigma} "},{value:"\\sum_{i=1}^{n}{(X_i - \\overline{X})^2} "},{value:"\\begin{array}{c} \r\n \\text{若}P \\left( AB \\right) =P \\left( A \\right) P \\left( B \\right) \\\\ \r\n \\text{则}P \\left( A \\left| B\\right. \\right) =P \\left({B}\\right) \r\n\\end{array}"},{value:"P(E) ={n \\choose k}p^k (1-p)^{n-k} "},{value:"P \\left( A \\right) = \\lim \\limits_{n \\to \\infty}f_{n}\\left ( A \\right ) "},{value:"P \\left( \\bigcup \\limits_{i=1}^{+ \\infty}A_{i}\\right) = \\prod \\limits_{i=1}^{+ \\infty}P{\\left( A_{i}\\right)} "},{value:"\\begin{array}{c} \r\n P \\left( \\emptyset \\right) =0 \\\\ \r\n P \\left( S \\right) =1 \r\n\\end{array}"},{value:"\\begin{array}{c} \r\n \\forall A \\in S \\\\ \r\n P \\left( A \\right) \\ge 0 \r\n\\end{array}"},{value:"P \\left( \\bigcup \\limits_{i=1}^{n}A_{i}\\right) = \\prod \\limits_{i=1}^{n}P \\left( A_{i}\\right) "},{value:"\\begin{array}{c} \r\n S= \\binom{N}{n},A_{k}=\\binom{M}{k}\\cdot \\binom{N-M}{n-k} \\\\ \r\n P\\left ( A_{k}\\right ) = \\frac{\\binom{M}{k}\\cdot \\binom{N-M}{n-k}}{\\binom{N}{n}} \r\n\\end{array}"},{value:"\\begin{array}{c} \r\n P_{n}=n! \\\\ \r\n A_{n}^{k}=\\frac{n!}{\\left( n-k \\left) !\\right. \\right.} \r\n\\end{array}"}]}]}].map((function(e,t){return(0,u.jsxs)(a.Z,{flex:"110px",className:c.Z.item,children:[(0,u.jsxs)("div",{children:[(0,u.jsx)(l.Z,{value:"`$$"+e.value+"$$`"}),e.name]}),(0,u.jsx)("div",{className:c.Z.children,children:e.children.map((function(e,t){return(0,u.jsxs)("div",{children:[e.name&&(0,u.jsx)("h1",{children:e.name}),(0,u.jsx)(r.Z,{gutter:[10,10],children:e.data.map((function(e,t){return(0,u.jsx)(a.Z,{onClick:function(){return m(e)},className:c.Z.diamond,children:(0,u.jsx)(l.Z,{value:"`$$"+e.value+"$$`"})},t)}))})]},t)}))})]})}))})}],v=function(){var e=document.createElement("div");e.innerHTML=f.current.getValue();var t=e.innerText;return n&&n(t),t};return(0,i.useImperativeHandle)(t,(function(){return{getData:v}})),(0,u.jsxs)("div",{className:c.Z.mathWrap,children:[(0,u.jsx)(s.Z,{defaultActiveKey:"1",items:g}),(0,u.jsx)("math-field",{locale:"zh_cn",className:c.Z.mathField,placeholder:"请打开键盘,输入公式",ref:f,style:{width:800,marginTop:30,fontSize:18},children:p||""}),d&&(0,u.jsx)("div",{className:c.Z.button,children:(0,u.jsx)(o.ZP,{size:"large",onClick:v,style:{zIndex:8,marginTop:10},type:"primary",children:"保存到编辑器"})})]})}));t.Z=d},46172:function(e,t,n){"use strict";var i=n(82242),r=n.n(i),a=(n(59301),n(93314)),s=n(3113),o=n(37712);t.Z=function(e){var t=e.img,n=e.buttonProps,i=void 0===n?{}:n,l=e.styles,c=void 0===l?{}:l,u=e.customText,d=e.ButtonText,h=e.ButtonClick,p=e.Buttonclass,f=e.ButtonTwo,m=e.imgStyles,g=e.loading,v=void 0!==g&&g;return(0,o.jsxs)("section",{className:"tc animated fadeIn",style:r()(r()({},{color:"#999",margin:"100px auto",visibility:v?"hidden":"visible"}),c),children:[(0,o.jsx)("img",{src:t||a,style:r()(r()({},m),{},{pointerEvents:"none",userSelect:"none"})}),(0,o.jsx)("p",{className:"mt20 font14",children:u||"暂时还没有相关数据哦!"}),d&&(0,o.jsx)(s.ZP,r()(r()({className:p,onClick:h},i),{},{children:d})),f&&f]})}},97562:function(e,t,n){"use strict";n.d(t,{Z:function(){return oe}});var i=n(82242),r=n.n(i),a=n(7557),s=n.n(a),o=n(41498),l=n.n(o),c=n(79800),u=n.n(c),d=n(59301),h={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},p=n(3113),f=n(14809),m={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M862 465.3h-81c-4.6 0-9 2-12.1 5.5L550 723.1V160c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v563.1L255.1 470.8c-3-3.5-7.4-5.5-12.1-5.5h-81c-6.8 0-10.5 8.1-6 13.2L487.9 861a31.96 31.96 0 0048.3 0L868 478.5c4.5-5.2.8-13.2-6-13.2z"}}]},name:"arrow-down",theme:"outlined"},g=n(7657),v=function(e,t){return d.createElement(g.Z,(0,f.Z)({},e,{ref:t,icon:m}))};var b=d.forwardRef(v),y=n(37205),_=n.n(y),w=n(91232),x=n.n(w),k=n(39647),S=n.n(k),E=n(76374),C={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},T={quickKey:[{label:"main",content:["public static void main(String[] args) {","\t$0","}"].join("\n")},{label:"System.out.println",content:["System.out.println($0)"].join("\n")},{label:"System.out.print",content:["System.out.print($0)"].join("\n")}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},A={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {","\t$0","} else {","\t","}"].join("\n")},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {","\t$0","}"].join("\n")},{label:"if",content:["if () {","\t$0","}"].join("\n")},{label:"for",content:["for(int j=0 ; j<10; j++){","\t$0","}"].join("\n")},{label:"trycatch",content:["try{","\t$0","}catch(ExceptionName e){","}"].join("\n")},{label:"using namespace std;",content:["using namespace std;"].join("\n")},{label:"include <iostream>",content:["#include <iostream>"].join("\n")},{label:"include <vector>",content:["#include <vector>"].join("\n")},{label:"include <cstdio>",content:["#include <cstdio>"].join("\n")},{label:"include <cstring>",content:["#include <cstring>"].join("\n")},{label:"include <sstream>",content:["#include <sstream>"].join("\n")},{label:"include <fstream>",content:["#include <fstream>"].join("\n")},{label:"include <map>",content:["#include <map>"].join("\n")},{label:"include <string>",content:["#include <string>"].join("\n")},{label:"include <cmath>",content:["#include <cmath>"].join("\n")}]},M={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join("\n")}]},L={keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],quickKey:[{label:"println",content:["println($0)"].join("\n")}]},D=n(53184),I=n.n(D),R={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}};var P=n(82100),O=n.n(P),N=n(29186),B=n.n(N),$=n(85573),F=n.n($),z=function(){function e(t,n,i){var r=this;O()(this,e),this.placeholder=t,this.editor=n,this.monaco=i,n.onDidChangeModelContent((function(){return r.onDidChangeModelContent()})),this.onDidChangeModelContent()}return B()(e,[{key:"onDidChangeModelContent",value:function(){""===this.editor.getValue()?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}},{key:"getId",value:function(){return e.ID}},{key:"getDomNode",value:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.style.width="max-content",this.domNode.textContent=this.placeholder,this.domNode.style.fontStyle="initial",this.domNode.style.color="#D7D7D7",this.domNode.style.pointerEvents="none",this.editor.applyFontInfo(this.domNode)),this.domNode}},{key:"getPosition",value:function(){return{position:{lineNumber:1,column:1},preference:[this.monaco.editor.ContentWidgetPositionPreference.EXACT]}}},{key:"dispose",value:function(){this.editor.removeContentWidget(this)}}]),e}();F()(z,"ID","editor.widget.placeholderHint");var K=z,U=n(96236),j=n(8591),q=n(6848),H=n(89392),V=n(1499),G=n(56102),Z=n(37712),W=["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder"];function Y(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}function X(){}var J={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python",Scala:"scale",solidity:"sol"};function Q(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e;if(Array.isArray(e)){for(var n=0;n<e.length;n++){var i=J[e[n]];if(i)return i}return t[0]}return J[t]||t}var ee=null,te=function(e){var t=e.width,i=void 0===t?"100%":t,a=e.height,o=void 0===a?"100%":a,c=e.value,h=e.language,p=void 0===h?"javascript":h,f=e.style,m=void 0===f?{}:f,g=e.options,v=void 0===g?{}:g,b=e.overrideServices,y=void 0===b?{}:b,w=e.theme,k=void 0===w?"vs-dark":w,D=e.onEditBlur,P=e.isCopy,O=void 0!==P&&P,N=e.onSave,B=e.autoHeight,$=void 0!==B&&B,F=e.forbidCopy,z=void 0!==F&&F,J=e.onChange,te=void 0===J?X:J,ne=e.editorDidMount,ie=void 0===ne?X:ne,re=e.onFocus,ae=void 0===re?X:re,se=e.onBreakPoint,oe=void 0===se?X:se,le=e.breakPointValue,ce=void 0===le?[]:le,ue=e.filename,de=void 0===ue?"educoder.txt":ue,he=e.errorLine,pe=e.errorContent,fe=void 0===pe?"":pe,me=e.highlightLine,ge=e.openBreakPoint,ve=void 0!==ge&&ge,be=e.placeholder,ye=void 0===be?"":be,_e=(S()(e,W),(0,d.useRef)()),we=(0,d.useRef)({}),xe=(0,d.useRef)(),ke=(0,d.useRef)(),Se=(0,d.useRef)([]),Ee=(0,d.useRef)(!1),Ce=(0,d.useRef)(),Te=(0,d.useRef)(),Ae=(0,d.useRef)(!1),Me=(0,d.useState)(!1),Le=u()(Me,2),De=Le[0],Ie=Le[1];(0,d.useEffect)((function(){var e=V.Z.subscribe("formatDocument",(function(e){var t,n=we.current.instance;null==n||null===(t=n.getAction)||void 0===t||t.call(n,"editor.action.formatDocument").run()}));return window.updateMonacoValue=function(e){te(e)},e}),[]),(0,d.useEffect)((function(){var e,t=we.current.instance;(ke.current&&clearTimeout(ke.current),ke.current=setTimeout((function(){!function(){var e=we.current.instance;if(null!=c&&e&&De){var t=e.getModel();t&&c!==t.getValue()&&(!0,t.setValue(c),e.layout(),!1)}}()}),500),c&&null!=c&&c.length)&&(null==t||null===(e=t.updateOptions)||void 0===e||e.call(t,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(c.split(/\r\n|\r|\n/g).length))+3,5)}))}),[c,De,we.current]),(0,d.useEffect)((function(){if(he&&we.current&&we.current.instance){var e=we.current.instance;e.changeViewZones((function(e){var t=document.createElement("div");t.style.padding="10px 20px",t.style.width="calc(100% - 20px)",t.className="my-error-line-wrp",t.innerHTML=fe,e.addZone({afterLineNumber:he||11,heightInLines:3,domNode:t})}));var t={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};e.addOverlayWidget(t),e.revealPositionInCenter({lineNumber:20,column:1})}}),[he,we.current,De]);var Re=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!e||""===e.trim())return!0;for(var n=we.current.instance.getModel(),i=n.getLineTokens(t),r=!1,a=0;a<2;a++)1===i.getStandardTokenType(a)&&(r=!0);return r};function Pe(e){(window.navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)&&83==e.keyCode&&(e.preventDefault(),N())}(0,d.useEffect)((function(){var e,t=null===(e=we.current)||void 0===e?void 0:e.instance;if(t&&De&&z){var n=t.onDidBlurEditorWidget((function(){Ae.current=!1})),i=t.onDidFocusEditorText((function(){Ae.current=!0}));return function(){n.dispose(),i.dispose()}}}),[we.current,De,z]),(0,d.useEffect)((function(){var e;if(null!==(e=we.current)&&void 0!==e&&e.instance&&De&&ve){var t=we.current.instance,n=t.getModel();if(!n)return;!function(){var e,i=[],r=[],a=n.getAllDecorations(),s=x()(a);try{for(s.s();!(e=s.n()).done;){var o,l=e.value;if("highlighted-line"===l.options.className)i.push(null==l||null===(o=l.range)||void 0===o?void 0:o.startLineNumber),r.push(null==l?void 0:l.id)}}catch(e){s.e(e)}finally{s.f()}if(me!==i[0]){n.deltaDecorations(r,[]);var c=n.getLineCount();me&&me<=c&&(t.deltaDecorations([],[{range:new ee.Range(me,1,me,n.getLineMaxColumn(me)),options:{isWholeLine:!0,className:"highlighted-line"}}]),t.revealLineInCenter(me))}}();var i=function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=[],r=[],a=n.getAllDecorations(),s=x()(a);try{for(s.s();!(e=s.n()).done;){var o,l=e.value;if("breakpoints-select"===l.options.linesDecorationsClassName)i.push(null==l||null===(o=l.range)||void 0===o?void 0:o.startLineNumber),r.push(null==l?void 0:l.id)}}catch(e){s.e(e)}finally{s.f()}if(t)return{lines:i,ids:r};oe(i)},r=function(){var e=l()(s()().mark((function e(t){var r;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={range:new ee.Range(t,1,t,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}},e.next=3,n.deltaDecorations([],[r]);case 3:i();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),a=function(){var e=l()(s()().mark((function e(r){var a,o,l,c,u;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=[],o=t.getLineDecorations(r),l=x()(o);try{for(l.s();!(c=l.n()).done;)"breakpoints-select"===(u=c.value).options.linesDecorationsClassName&&a.push(u.id)}catch(e){l.e(e)}finally{l.f()}return e.next=6,n.deltaDecorations(a,[]);case 6:i();case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),o=function(e){var n,i=t.getLineDecorations(e),r=x()(i);try{for(r.s();!(n=r.n()).done;){if("breakpoints-select"===n.value.options.linesDecorationsClassName)return!0}}catch(e){r.e(e)}finally{r.f()}return!1};if(!(0,H.isEqual)(ce,i(!0).lines)){n.deltaDecorations(i(!0).ids,[]);var c=ce.map((function(e){return{range:new ee.Range(e,1,e,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}}));n.deltaDecorations([],c)}var u=t.onDidChangeModelContent((function(e){var s=t.getPosition();if(s){var l=s.lineNumber;clearTimeout(Te.current),Te.current=setTimeout((function(){Re(n.getLineContent(l),l)?a(l):o(l)?(a(l),r(l)):i()}),100)}})),d=t.onMouseDown((function(e){var t;if(e.target.detail&&null!==(t=e.target)&&void 0!==t&&null!==(t=t.element)&&void 0!==t&&null!==(t=t.className)&&void 0!==t&&t.includes("line-numbers")){var i=e.target.position.lineNumber;if(Re(n.getLineContent(i),i))return;o(i)?a(i):r(i)}})),h=function(){Se.current=t.deltaDecorations(Se.current,[])},p=t.onMouseMove((function(e){var i;if(h(),e.target.detail&&null!==(i=e.target)&&void 0!==i&&null!==(i=i.element)&&void 0!==i&&null!==(i=i.className)&&void 0!==i&&i.includes("line-numbers")){var r=e.target.position.lineNumber;if(Re(n.getLineContent(r),r))return;!function(e){var n={range:new ee.Range(e,1,e,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Se.current=t.deltaDecorations(Se.current,[n])}(r)}})),f=t.onMouseLeave((function(){h()}));return function(){u.dispose(),d.dispose(),p.dispose(),f.dispose()}}}),[we.current,De,ce,me,ve,p]),(0,d.useEffect)((function(){var e;null!==(e=we.current)&&void 0!==e&&e.instance&&ve&&we.current.instance.setPosition({lineNumber:0,column:0})}),[me]);var Oe=function(){if($&&we.current.instance){var e=we.current.instance.getContentHeight();qe(e<o?o:e)}else qe(o)};var Ne=function(e){if(Ae.current){var t=e.keyCode,n=e.ctrlKey,i=e.metaKey,r=e.target;return"paste"!==e.type&&(67!==t&&86!==t||!i&&!n)||"TEXTAREA"!==r.nodeName||(j.ZP.warning({content:decodeURIComponent("该任务关卡设置了禁止复制粘贴,请手动输入代码。"),key:"monaco-editor-tip"}),e.preventDefault()),!1}};function Be(e,t){var n,i,r=window.URL||window.webkitURL||window,a=new Blob([t]),s=document.createElementNS("http://www.w3.org/1999/xhtml","a");s.href=r.createObjectURL(a),s.download=e,n=s,(i=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}(0,d.useEffect)((function(){Oe()}),[Oe]),(0,d.useEffect)((function(){_e.current&&!De&&Promise.all([n.e(8909),n.e(6656)]).then(n.bind(n,71448)).then((function(e){try{ee=e,we.current.instance=ee.editor.create(_e.current,{value:c,language:Q(p),theme:k,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},y);var t=we.current.instance,n=U.BH._menuItems,i=_()(n).find((function(e){return"EditorContext"==e[0]._debugName}))[1];if(ie(t,ee),setTimeout((function(){Oe(),we.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Be(de||"educoder.txt",t.getValue())}})}),500),we.current.subscription=t.onDidChangeModelContent((function(e){Ee.current?clearTimeout(Ce.current):(Oe(),te(t.getValue(),e)),Ce.current=setTimeout((function(){Ee.current=!1}),500)})),window.Monaco||function(e){R.languages.map((function(t){return e.languages.registerDocumentFormattingEditProvider(t,{provideDocumentFormattingEdits:function(e,t,n){return l()(s()().mark((function t(){var n;return s()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=I()(e.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),t.abrupt("return",[{range:e.getFullModelRange(),text:n}]);case 2:case"end":return t.stop()}}),t)})))()}}),t})),A.quickKey.map((function(t){return{label:t.label,kind:e.languages.CompletionItemKind.Method,insertText:t.content,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet}})),M.quickKey.map((function(t){return{label:t.label,kind:e.languages.CompletionItemKind.Method,insertText:t.content,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet}})),T.quickKey.map((function(t){return{label:t.label,kind:e.languages.CompletionItemKind.Method,insertText:t.content,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet}})),e.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(t,n){var i=t.getWordUntilPosition(n),r={startLineNumber:n.lineNumber,endLineNumber:n.lineNumber,startColumn:i.startColumn,endColumn:i.endColumn},a=t.getLineContent(n.lineNumber).substring(i.startColumn-2,i.endColumn);return{suggestions:[].concat(_()(A.keywords.map((function(t){return{label:t,kind:e.languages.CompletionItemKind.Function,documentation:t,insertText:t,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:r}}))),_()(A.quickKey.map((function(t){return{label:t.label,kind:e.languages.CompletionItemKind.Function,documentation:t.content,insertText:a.startsWith("#")?t.content.replace(/#/,""):t.content,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:r}}))))}}}),e.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(t,n){var i=t.getWordUntilPosition(n),r={startLineNumber:n.lineNumber,endLineNumber:n.lineNumber,startColumn:i.startColumn,endColumn:i.endColumn};return{suggestions:_()(C.keywords.map((function(t){return{label:t,kind:e.languages.CompletionItemKind.Function,documentation:t,insertText:t,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:r}})))}}}),e.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(t,n){var i=t.getWordUntilPosition(n),r={startLineNumber:n.lineNumber,endLineNumber:n.lineNumber,startColumn:i.startColumn,endColumn:i.endColumn},a=t.getLineContent(n.lineNumber).substring(i.startColumn-2,i.endColumn);return{suggestions:[].concat(_()(T.keywords.map((function(t){return{label:t,kind:e.languages.CompletionItemKind.Function,documentation:t,insertText:t,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:r}}))),_()(T.quickKey.map((function(t){return{label:t.label,kind:e.languages.CompletionItemKind.Function,documentation:t.content,insertText:a.startsWith("#")?t.content.replace(/#/,""):t.content,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:r}}))))}}}),e.languages.registerCompletionItemProvider("scala",{provideCompletionItems:function(t,n){var i=t.getWordUntilPosition(n),r={startLineNumber:n.lineNumber,endLineNumber:n.lineNumber,startColumn:i.startColumn,endColumn:i.endColumn},a=t.getLineContent(n.lineNumber).substring(i.startColumn-2,i.endColumn);return{suggestions:[].concat(_()(L.keywords.map((function(t){return{label:t,kind:e.languages.CompletionItemKind.Function,documentation:t,insertText:t,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:r}}))),_()(L.quickKey.map((function(t){return{label:t.label,kind:e.languages.CompletionItemKind.Function,documentation:t.content,insertText:a.startsWith("#")?t.content.replace(/#/,""):t.content,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:r}}))))}}}),e.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(t,n){var i=t.getWordUntilPosition(n),r={startLineNumber:n.lineNumber,endLineNumber:n.lineNumber,startColumn:i.startColumn,endColumn:i.endColumn},a=t.getLineContent(n.lineNumber).substring(i.startColumn-2,i.endColumn);return{suggestions:[].concat(_()(M.keywords.map((function(t){return{label:t,kind:e.languages.CompletionItemKind.Function,documentation:t,insertText:t,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:r}}))),_()(M.quickKey.map((function(t){return{label:t.label,kind:e.languages.CompletionItemKind.Function,documentation:t.content,insertText:a.startsWith("#")?t.content.replace(/#/,""):t.content,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:r}}))))}}})}(ee,Q(p)),z&&(!function(e,t){var n=e._first;do{var i;t.includes(null===(i=n.element)||void 0===i||null===(i=i.command)||void 0===i?void 0:i.id)&&e._remove(n)}while(n=n.next)}(i,["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"]),_e.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",Ne),window.removeEventListener("paste",Ne),window.addEventListener("keydown",Ne),window.addEventListener("paste",Ne)),window.Monaco=ee,D&&t.onDidBlurEditorWidget((function(){D(t.getValue())})),ae&&t.onDidFocusEditorText((function(){ae(t.getValue())})),z)try{t.onDidPaste((function(e){var n=t.getSelection(),i=we.current.pastePos||{};new ee.Range(i.startLineNumber||n.endLineNumber,i.startColumn||n.endColumn,i.endLineNumber||n.endLineNumber,i.endColumn||n.endColumn);t.executeEdits("",[{range:e.range,text:""}])}))}catch(e){}var r=function(){var e;return _e.current&&(e=new E.Z((function(e){var t,n=x()(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&we.current.instance.layout()}}catch(e){n.e(e)}finally{n.f()}}))).observe(_e.current),e}();return ye&&"string"==typeof ye&&new K(ye,t,ee),Ie(!0),function(){var e=we.current.instance;e.dispose();var t=e.getModel();t&&t.dispose(),we.current.subscription&&we.current.subscription.dispose(),r.unobserve(_e.current)}}catch(e){}}))}),[]),(0,d.useEffect)((function(){if(we.current.instance&&De)return document.addEventListener("keydown",Pe,!1),function(){document.removeEventListener("keydown",Pe)}}),[N,De]),(0,d.useEffect)((function(){var e=we.current.instance;if(e&&De){var t=Q(p);ee.editor.setModelLanguage(e.getModel(),t)}}),[p,De]),(0,d.useEffect)((function(){we.current.instance&&De&&ee.editor.setTheme(k)}),[k,De]),(0,d.useEffect)((function(){var e=we.current.instance;xe.current=v,e&&De&&(e.updateOptions(r()({},v)),setTimeout((function(){e.getModel().updateOptions(r()({},v))}),200))}),[JSON.stringify(v),De]),(0,d.useEffect)((function(){var e=we.current.instance;e&&De&&e.layout()}),[i,o,De]);var $e=(0,d.useState)(Y(i)),Fe=u()($e,2),ze=Fe[0],Ke=(Fe[1],(0,d.useState)(Y(o))),Ue=u()(Ke,2),je=Ue[0],qe=Ue[1],He=r()(r()({},m),{},{width:ze,height:je,position:"relative"});return(0,Z.jsx)("div",{className:"my-monaco-editor",ref:_e,style:He,children:O&&(0,Z.jsx)(G.CopyToClipboard,{text:c,onCopy:function(){return j.ZP.success("复制成功")},children:(0,Z.jsx)(q.Z,{title:"复制代码",children:(0,Z.jsxs)("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"},children:[(0,Z.jsx)("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," 复制代码"]})})})})};var ne=n(1079),ie=n(26613),re=n(46172),ae=n(67390),se=n(78318),oe=function(e){var t,n,i,a,o,c,f=e.editOffice,m=void 0===f?"view":f,g=e.data,v=(e.theme,e.type),y=e.filename,_=e.monacoEditor,w=e.className,x=e.style,k=e.close,S=e.onClose,E=e.hasMask,C=e.disabledDownload,T=e.onImgDimensions,A=e.showNodata,M=e.recordInfo,L=(0,d.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),D=u()(L,2),I=(D[0],D[1],(0,d.useState)("")),R=u()(I,2),P=(R[0],R[1]),O=(0,d.useState)(),N=u()(O,2),B=N[0],$=N[1],F="build"===window.ENV?"/react/build":"",z=location.host.startsWith("localhost")?ae.Z.PROXY_SERVER:ae.Z.API_SERVER,K=(0,d.useRef)();null!==(t=g)&&void 0!==t&&t.startsWith("/api")&&"txt"!==v&&(g=ae.Z.API_SERVER+g);y&&_&&(_.filename=y),(0,d.useEffect)((function(){var e,t=null===(e=document.cookie)||void 0===e||null===(e=e.replace(/\s/g,""))||void 0===e?void 0:e.split(";");null==t||t.map((function(e){var t=e.split("=");"_educoder_session"===t[0]&&P(t[1])}))}),[]),(0,d.useEffect)((function(){var e;"office"===v&&(g.indexOf("bigfilescdn.")>-1||g.indexOf("bigfiles1")>-1?$({url:g,fileType:(e=g,e.substring(e.lastIndexOf("/")+1).split(".").pop()),model:g.indexOf("model=edit")?"edit":"view"}):U())}),[v,g]);var U=function(){var e=l()(s()().mark((function e(){var t,n,i;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("data:",g),t=g,g.startsWith("http")||(t=location.origin+t),n=new URL(t).pathname.split("/").pop(),e.next=6,(0,ie.gJ)({attachment_id:n});case 6:(i=e.sent).url=z+i.url,$(i);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),j=function(){g.startsWith("http")||g.startsWith("blob:")?H():(0,ne.Sv)(y||"educoder",g,y)},H=function(){M&&(0,se.fc)({id:null==M?void 0:M.id,watch_type:1,course_id:null==M?void 0:M.course_id}),(0,ne.Nd)(y||"educoder",decodeURIComponent(g))};return(0,Z.jsxs)("div",{style:r()({},x||{}),className:"".concat(E&&h.bgBlack," ").concat(v?h.wrp:"hide"),children:[k&&(0,Z.jsxs)("div",{className:h.close,ref:K,children:[!!T&&(0,Z.jsx)(q.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return K.current},children:(0,Z.jsx)("span",{onClick:function(){S(),T()},children:(0,Z.jsx)("i",{className:"icon-yulanpizhu"})})}),!C&&(0,Z.jsx)(q.Z,{title:"点击下载此文件",getPopupContainer:function(){return K.current},children:(0,Z.jsx)("span",{onClick:H,children:(0,Z.jsx)("i",{className:"icon-quxiaozhiding"})})}),(0,Z.jsx)(q.Z,{title:"关闭",getPopupContainer:function(){return K.current},children:(0,Z.jsx)("span",{className:"",onClick:S,children:(0,Z.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,Z.jsx)("div",{className:"".concat(h[w]," ").concat(w," ").concat(h.monaco," ").concat("txt"===v?"show":"hide"),children:"txt"===v&&(0,Z.jsx)(Z.Fragment,{children:(0,Z.jsx)(te,r()({},_))})}),"audio"===v&&(0,Z.jsx)("audio",{src:"".concat((null===(n=g)||void 0===n?void 0:n.indexOf("http://"))>-1||(null===(i=g)||void 0===i?void 0:i.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(g),autoPlay:!0}),"video"===v&&(0,Z.jsx)(Z.Fragment,{children:(null===(a=g)||void 0===a?void 0:a.indexOf("http"))>-1?(0,Z.jsx)("video",{controls:!0,src:"".concat(g),autoPlay:!0}):(0,Z.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(g),autoPlay:!0})}),"office"===v&&B&&(0,Z.jsx)("iframe",{src:"".concat(F,"/office.html?key=").concat(B.key,"&url=").concat(btoa(B.url),"&callbackUrl=").concat(z+(B.callbackUrl||""),"&fileType=").concat(B.fileType,"&title=").concat(B.title||"","&model=").concat(m,"&officeServer=").concat(ae.Z.ONLYOFFICE,"&disabledDownload=").concat(!!C)}),"html"===v&&(0,Z.jsx)("iframe",{src:g+"&disposition=inline"}),"pdf"===v&&(0,Z.jsx)("iframe",{src:"".concat(F,"/js/pdfview/index.html?filename=").concat(y||"educoder.pdf","&url=").concat(encodeURIComponent(g),"&disabledDownload=").concat(!!C)}),"image"===v&&(0,Z.jsx)("img",{src:"".concat((null===(o=g)||void 0===o?void 0:o.indexOf("http://"))>-1||(null===(c=g)||void 0===c?void 0:c.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(g)}),("other"===v||"download"===v)&&(0,Z.jsx)(Z.Fragment,{children:A?(0,Z.jsx)(re.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,Z.jsx)(p.ZP,{icon:(0,Z.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:j,disabled:C,children:"下载"})}):(0,Z.jsxs)(p.ZP,{type:"primary",size:"middle",onClick:j,disabled:C,children:[(0,Z.jsx)(b,{}),"点击下载"]})})]})}},5627:function(e,t,n){"use strict";n.d(t,{Z:function(){return H}});var i=n(82242),r=n.n(i),a=n(37205),s=n.n(a),o=n(91232),l=n.n(o),c=n(79800),u=n.n(c),d=n(59301),h=(n(8944),n(32834)),p=n.n(h),f=n(11690),m=1;var g=[],v=["<ul>"],b=new(p().Renderer),y=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function _(){g.length=0,v=["<ul>"]}var w={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function x(e,t,n,i){if(t>=e.length||e[t].level<=n)return t;var r=e[t];i.push("<li><a href='#"+m+r.anchor+"'>"+r.text+"</a>");var a=[];return t=x(e,++t,r.level,a),a.length>0&&(i.push("<ul>"),a.forEach((function(e){i.push(e)})),i.push("</ul>")),i.push("</li>"),t=x(e,t,n,i)}function k(){return x(g,0,0,v),v.push("</ul>"),v.join("")}var S={heading:function(e){var t=y.exec(e);if(m+=1,t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}},fences:function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],i=function(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var i=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:u()(t,1)[0].length>=i.length?e.slice(i.length):e})).join("\n")}(n,t[3]||""),r=t[2]?t[2].trim():t[2];if(["latex","katex","math"].indexOf(r)>=0){var a=T(),s=i;i=a,A[a]={type:"block",expression:s}}return{type:"code",raw:n,lang:r,text:i}}}},E=/(?:\${2})([^\n`]+?)(?:\${2})/gi,C=0,T=function(){return"__special_katext_id_".concat(C++,"__")},A={};function M(){return A}function L(){C=0,A={}}function D(e){return e=e.replace(E,(function(e,t){var n=T();return A[n]={type:"inline",expression:t},n}))}var I=b.listitem;b.listitem=function(e){return I(D(e))};var R=b.paragraph;b.paragraph=function(e){return R(D(e))};var P=b.tablecell;b.tablecell=function(e,t){return P(D(e),t)},b.code=function(e,t,n){var i=(t||"").match(/\S*/)[0];return i?["latex","katex","math"].indexOf(i)>=0?"<p class='editormd-tex'>".concat(e,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(t,'">').concat(n?e:(0,f.escape)(e,!0),"</code></pre>\n"):'<pre class="prettyprint linenums"><code>'+(n?e:(0,f.escape)(e,!0))+"</code></pre>"},b.heading=function(e,t,n){var i=this.options.headerPrefix+n.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return g.push({anchor:i,level:t,text:e}),"<h"+t+' id="'+m+i+'">'+e+"</h"+t+">"},p().setOptions({silent:!0,gfm:!0,pedantic:!1}),p().use({tokenizer:S,renderer:b});var O=p(),N=(n(64018),n(15360)),B=n(67390),$=(n(1079),n(15342)),F=n(1012),z=n(97562),K=n(37712),U=function(e){var t=e.html,n=(0,d.useRef)(null),i=(0,d.useRef)(null);return(0,d.useEffect)((function(){var e=n.current.attachShadow({mode:"open"});i.current=document.createElement("div"),i.current.className="markdown-body",i.current.innerHTML=t,e.appendChild(i.current);var r=document.createElement("style");return r.textContent='.markdown-body p {\n margin: 0 0 16px 0 !important;\n line-height: 28px;\n white-space: pre-wrap;\n }\n\n ol,\n ul,\n li {\n list-style-type: none\n }\n\n ol,\n ul,\n dl {\n margin-bottom: 0px;\n }\n\n .markdown-body {\n -ms-text-size-adjust: 100%;\n -webkit-text-size-adjust: 100%;\n color: #333;\n overflow: hidden;\n font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif;\n word-break: break-word;\n font-size: 16px;\n line-height: 1.6;\n white-space: normal;\n word-wrap: break-word;\n position: relative;\n }\n\n .markdown-body ul>li {\n list-style-type: disc;\n }\n\n .markdown-body ol>li {\n list-style-type: decimal;\n }\n\n .markdown-body a {\n background: transparent;\n }\n\n .markdown-body a:active,\n .markdown-body a:hover {\n outline: 0;\n }\n\n .markdown-body strong {\n font-weight: bold;\n }\n\n .markdown-body h1 {\n font-size: 2em;\n margin: 0.67em 0;\n }\n\n .markdown-body img {\n border: 0;\n }\n\n .markdown-body hr {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n height: 0;\n }\n\n .markdown-body pre {\n overflow: auto;\n }\n\n .markdown-body code,\n .markdown-body kbd,\n .markdown-body pre {\n font-family: "Meiryo UI", "YaHei Consolas Hybrid", Consolas, "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace;\n font-size: 1em;\n }\n\n .markdown-body input {\n color: inherit;\n font: inherit;\n margin: 0;\n }\n\n .markdown-body html input[disabled] {\n cursor: default;\n }\n\n .markdown-body input {\n line-height: normal;\n }\n\n .markdown-body input[type="checkbox"] {\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n padding: 0;\n }\n\n .markdown-body table {\n border-collapse: collapse;\n border-spacing: 0;\n }\n\n .markdown-body td,\n .markdown-body th {\n padding: 0;\n }\n\n .markdown-body * {\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n .markdown-body input {\n font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";\n }\n\n .markdown-body a {\n color: #4183c4;\n text-decoration: none;\n }\n\n .markdown-body a:hover,\n .markdown-body a:active {\n text-decoration: underline;\n }\n\n .markdown-body hr {\n height: 0;\n margin: 15px 0;\n overflow: hidden;\n background: transparent;\n border: 0;\n border-bottom: 1px solid #ddd;\n }\n\n .markdown-body hr:before {\n display: table;\n content: "";\n }\n\n .markdown-body hr:after {\n display: table;\n clear: both;\n content: "";\n }\n\n .markdown-body h1,\n .markdown-body h2,\n .markdown-body h3,\n .markdown-body h4,\n .markdown-body h5,\n .markdown-body h6 {\n margin-top: 15px;\n margin-bottom: 15px;\n line-height: 1.1;\n }\n\n .markdown-body h1 {\n font-size: 30px;\n }\n\n .markdown-body h2 {\n font-size: 21px;\n }\n\n .markdown-body h3 {\n font-size: 16px;\n }\n\n .markdown-body h4 {\n font-size: 14px;\n }\n\n .markdown-body h5 {\n font-size: 12px;\n }\n\n .markdown-body h6 {\n font-size: 11px;\n }\n\n .markdown-body blockquote {\n margin: 0;\n }\n\n .markdown-body ul,\n .markdown-body ol {\n padding: 0;\n margin-top: 0;\n margin-bottom: 0;\n }\n\n ul.linenums,\n ol.linenums {\n padding: 16px 0 0 36px !important;\n }\n\n .markdown-body ul,\n .markdown-body ol {\n padding-left: 2em;\n }\n\n\n .markdown-body ol ol,\n .markdown-body ul ol {\n list-style-type: lower-roman;\n }\n\n .markdown-body ul ul ol,\n .markdown-body ul ol ol,\n .markdown-body ol ul ol,\n .markdown-body ol ol ol {\n list-style-type: lower-alpha;\n }\n\n .markdown-body dd {\n margin-left: 0;\n }\n\n .markdown-body code {\n font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;\n font-size: 12px;\n }\n\n .markdown-body pre {\n margin-top: 0;\n margin-bottom: 0;\n font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;\n }\n\n .markdown-body .octicon {\n font: normal normal 16px octicons-anchor;\n line-height: 1;\n display: inline-block;\n text-decoration: none;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n\n .markdown-body .octicon-link:before {\n content: \'\f05c\';\n }\n\n .markdown-body>*:first-child {\n margin-top: 0 !important;\n }\n\n .markdown-body>*:last-child {\n margin-bottom: 0 !important;\n }\n\n .markdown-body .anchor {\n position: absolute;\n top: 0;\n left: 0;\n display: block;\n padding-right: 6px;\n padding-left: 30px;\n margin-left: -30px;\n }\n\n .markdown-body .anchor:focus {\n outline: none;\n }\n\n .markdown-body h1,\n .markdown-body h2,\n .markdown-body h3,\n .markdown-body h4,\n .markdown-body h5,\n .markdown-body h6 {\n position: relative;\n margin-top: 1em;\n margin-bottom: 16px;\n font-weight: bold;\n line-height: 1.4;\n }\n\n .markdown-body h1 .octicon-link,\n .markdown-body h2 .octicon-link,\n .markdown-body h3 .octicon-link,\n .markdown-body h4 .octicon-link,\n .markdown-body h5 .octicon-link,\n .markdown-body h6 .octicon-link {\n display: none;\n color: #000;\n vertical-align: middle;\n }\n\n .markdown-body h1:hover .anchor,\n .markdown-body h2:hover .anchor,\n .markdown-body h3:hover .anchor,\n .markdown-body h4:hover .anchor,\n .markdown-body h5:hover .anchor,\n .markdown-body h6:hover .anchor {\n padding-left: 8px;\n margin-left: -30px;\n text-decoration: none;\n }\n\n .markdown-body h1:hover .anchor .octicon-link,\n .markdown-body h2:hover .anchor .octicon-link,\n .markdown-body h3:hover .anchor .octicon-link,\n .markdown-body h4:hover .anchor .octicon-link,\n .markdown-body h5:hover .anchor .octicon-link,\n .markdown-body h6:hover .anchor .octicon-link {\n display: inline-block;\n }\n\n .markdown-body h1 {\n padding-bottom: 0.3em;\n font-size: 2.25em;\n line-height: 1.2;\n border-bottom: 1px solid #eee;\n }\n\n .markdown-body h1 .anchor {\n line-height: 1;\n }\n\n .markdown-body h2 {\n padding-bottom: 0.3em;\n font-size: 1.75em;\n line-height: 1.225;\n border-bottom: 1px solid #eee;\n }\n\n .markdown-body h2 .anchor {\n line-height: 1;\n }\n\n .markdown-body h3 {\n font-size: 1.5em;\n line-height: 1.43;\n }\n\n .markdown-body h3 .anchor {\n line-height: 1.2;\n }\n\n .markdown-body h4 {\n font-size: 1.25em;\n }\n\n .markdown-body h4 .anchor {\n line-height: 1.2;\n }\n\n .markdown-body h5 {\n font-size: 1em;\n }\n\n .markdown-body h5 .anchor {\n line-height: 1.1;\n }\n\n .markdown-body h6 {\n font-size: 1em;\n color: #777;\n }\n\n .markdown-body h6 .anchor {\n line-height: 1.1;\n }\n\n .markdown-body p,\n .markdown-body blockquote,\n .markdown-body ul,\n .markdown-body ol,\n .markdown-body dl,\n .markdown-body table,\n .markdown-body pre {\n margin-top: 0;\n margin-bottom: 16px;\n }\n\n .markdown-body ul ul,\n .markdown-body ul ol,\n .markdown-body ol ol,\n .markdown-body ol ul {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n .markdown-body li>p {\n margin-top: 16px;\n }\n\n .markdown-body dl {\n padding: 0;\n }\n\n .markdown-body dl dt {\n padding: 0;\n margin-top: 16px;\n font-size: 1em;\n font-style: italic;\n font-weight: bold;\n }\n\n .markdown-body dl dd {\n padding: 0 16px;\n margin-bottom: 16px;\n }\n\n .markdown-body blockquote {\n padding: 0 15px;\n color: #777;\n border-left: 4px solid #ddd;\n }\n\n .markdown-body blockquote> :first-child {\n margin-top: 0;\n }\n\n .markdown-body blockquote> :last-child {\n margin-bottom: 0;\n }\n\n .markdown-body table {\n display: block;\n width: 100%;\n overflow: auto;\n word-break: normal;\n word-break: keep-all;\n }\n\n .markdown-body table th {\n font-weight: bold;\n text-align: revert;\n }\n\n .markdown-body table th,\n .markdown-body table td {\n padding: 6px 13px;\n border: 1px solid #ddd;\n }\n\n .markdown-body table tr {\n background-color: #fff;\n border-top: 1px solid #ccc;\n }\n\n .markdown-body table tr:nth-child(2n) {\n background-color: #f8f8f8;\n }\n\n .markdown-body img {\n max-width: 100%;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n .markdown-body code {\n padding: 0;\n padding-top: 0.2em;\n padding-bottom: 0.2em;\n margin: 0;\n font-size: 85%;\n background-color: rgba(0, 0, 0, 0.04);\n border-radius: 3px;\n }\n\n .markdown-body code:has(.katex) {\n background-color: transparent;\n }\n\n .markdown-body code:before,\n .markdown-body code:after {\n letter-spacing: -0.2em;\n content: "\\00a0";\n }\n\n .markdown-body pre>code {\n padding: 0;\n margin: 0;\n font-size: 100%;\n word-break: normal;\n white-space: pre;\n background: transparent;\n border: 0;\n }\n\n .markdown-body .highlight {\n margin-bottom: 16px;\n }\n\n .markdown-body .highlight pre,\n .markdown-body pre {\n padding: 16px;\n overflow: auto;\n font-size: 85%;\n line-height: 1.45;\n background-color: #f7f7f7;\n border-radius: 3px;\n }\n\n .markdown-body .highlight pre {\n margin-bottom: 0;\n word-break: normal;\n }\n\n .markdown-body pre {\n word-wrap: normal;\n }\n\n .markdown-body pre code {\n display: inline;\n max-width: initial;\n padding: 0;\n margin: 0;\n overflow: initial;\n line-height: inherit;\n word-wrap: normal;\n background-color: transparent;\n border: 0;\n }\n\n .markdown-body pre code:before,\n .markdown-body pre code:after {\n content: normal;\n }\n\n .markdown-body kbd {\n display: inline-block;\n padding: 3px 5px;\n font-size: 11px;\n line-height: 10px;\n color: #555;\n vertical-align: middle;\n background-color: #fcfcfc;\n border: solid 1px #ccc;\n border-bottom-color: #bbb;\n border-radius: 3px;\n box-shadow: inset 0 -1px 0 #bbb;\n }\n\n .markdown-body .pl-c {\n color: #969896;\n }\n\n .markdown-body .pl-c1,\n .markdown-body .pl-mdh,\n .markdown-body .pl-mm,\n .markdown-body .pl-mp,\n .markdown-body .pl-mr,\n .markdown-body .pl-s1 .pl-v,\n .markdown-body .pl-s3,\n .markdown-body .pl-sc,\n .markdown-body .pl-sv {\n color: #0086b3;\n }\n\n .markdown-body .pl-e,\n .markdown-body .pl-en {\n color: #795da3;\n }\n\n .markdown-body .pl-s1 .pl-s2,\n .markdown-body .pl-smi,\n .markdown-body .pl-smp,\n .markdown-body .pl-stj,\n .markdown-body .pl-vo,\n .markdown-body .pl-vpf {\n color: #333;\n }\n\n .markdown-body .pl-ent {\n color: #63a35c;\n }\n\n .markdown-body .pl-k,\n .markdown-body .pl-s,\n .markdown-body .pl-st {\n color: #a71d5d;\n }\n\n .markdown-body .pl-pds,\n .markdown-body .pl-s1,\n .markdown-body .pl-s1 .pl-pse .pl-s2,\n .markdown-body .pl-sr,\n .markdown-body .pl-sr .pl-cce,\n .markdown-body .pl-sr .pl-sra,\n .markdown-body .pl-sr .pl-sre,\n .markdown-body .pl-src {\n color: #df5000;\n }\n\n .markdown-body .pl-mo,\n .markdown-body .pl-v {\n color: #1d3e81;\n }\n\n .markdown-body .pl-id {\n color: #b52a1d;\n }\n\n .markdown-body .pl-ii {\n background-color: #b52a1d;\n color: #f8f8f8;\n }\n\n .markdown-body .pl-sr .pl-cce {\n color: #63a35c;\n font-weight: bold;\n }\n\n .markdown-body .pl-ml {\n color: #693a17;\n }\n\n .markdown-body .pl-mh,\n .markdown-body .pl-mh .pl-en,\n .markdown-body .pl-ms {\n color: #1d3e81;\n font-weight: bold;\n }\n\n .markdown-body .pl-mq {\n color: #008080;\n }\n\n .markdown-body .pl-mi {\n color: #333;\n font-style: italic;\n }\n\n .markdown-body .pl-mb {\n color: #333;\n font-weight: bold;\n }\n\n .markdown-body .pl-md,\n .markdown-body .pl-mdhf {\n background-color: #ffecec;\n color: #bd2c00;\n }\n\n .markdown-body .pl-mdht,\n .markdown-body .pl-mi1 {\n background-color: #eaffea;\n color: #55a532;\n }\n\n .markdown-body .pl-mdr {\n color: #795da3;\n font-weight: bold;\n }\n\n .markdown-body kbd {\n display: inline-block;\n padding: 3px 5px;\n font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;\n line-height: 10px;\n color: #555;\n vertical-align: middle;\n background-color: #fcfcfc;\n border: solid 1px #ccc;\n border-bottom-color: #bbb;\n border-radius: 3px;\n box-shadow: inset 0 -1px 0 #bbb;\n }\n\n .markdown-body .task-list-item {\n list-style-type: none;\n }\n\n .markdown-body .task-list-item+.task-list-item {\n margin-top: 3px;\n }\n\n .markdown-body .task-list-item input {\n float: left;\n margin: 0.3em 0 0.25em -1.6em;\n vertical-align: middle;\n }\n\n .markdown-body :checked+.radio-label {\n z-index: 1;\n position: relative;\n border-color: #4183c4;\n }\n\n\n /*! Pretty printing styles. Used with prettify.js. */\n /* SPAN elements with the classes below are added by prettyprint. */\n .pln {\n color: #000\n }\n\n /* plain text */\n\n @media screen {\n .str {\n color: #080\n }\n\n /* string content */\n .kwd {\n color: #008\n }\n\n /* a keyword */\n .com {\n color: #800\n }\n\n /* a comment */\n .typ {\n color: #606\n }\n\n /* a type name */\n .lit {\n color: #066\n }\n\n /* a literal value */\n /* punctuation, lisp open bracket, lisp close bracket */\n .pun,\n .opn,\n .clo {\n color: #660\n }\n\n .tag {\n color: #008\n }\n\n /* a markup tag name */\n .atn {\n color: #606\n }\n\n /* a markup attribute name */\n .atv {\n color: #080\n }\n\n /* a markup attribute value */\n .dec,\n .var {\n color: #606\n }\n\n /* a declaration; a variable name */\n .fun {\n color: red\n }\n\n /* a function name */\n }\n\n /* Use higher contrast and text-weight for printable form. */\n @media print,\n projection {\n .str {\n color: #060\n }\n\n .kwd {\n color: #006;\n font-weight: bold\n }\n\n .com {\n color: #600;\n font-style: italic\n }\n\n .typ {\n color: #404;\n font-weight: bold\n }\n\n .lit {\n color: #044\n }\n\n .pun,\n .opn,\n .clo {\n color: #440\n }\n\n .tag {\n color: #006;\n font-weight: bold\n }\n\n .atn {\n color: #404\n }\n\n .atv {\n color: #060\n }\n }\n\n /* Put a border around prettyprinted code snippets. */\n pre.prettyprint {\n padding: 2px;\n /* border: 1px solid #888 */\n }\n\n /* Specify class=linenums on a pre to get line numbering */\n ol.linenums {\n margin-top: 0;\n margin-bottom: 0\n }\n\n /* IE indents via margin-left */\n li.L0,\n li.L1,\n li.L2,\n li.L3,\n li.L5,\n li.L6,\n li.L7,\n li.L8 {\n list-style-type: none\n }\n\n /* Alternate shading for lines */\n li.L1,\n li.L3,\n li.L5,\n li.L7,\n li.L9 {\n background: #eee\n }\n\n .markdown-body p,\n .markdown-body blockquote,\n .markdown-body ul,\n .markdown-body ol,\n .markdown-body dl,\n .markdown-body table,\n .markdown-body pre {\n margin-top: 0;\n margin-bottom: 16px;\n }',e.appendChild(r),function(){e.innerHTML=""}}),[]),(0,d.useEffect)((function(){i.current&&(i.current.innerHTML=t)}),[t]),(0,K.jsx)("div",{ref:n})},j="@▁@",q=/<pre[^>]*>/g;var H=function(e){var t=e.value,n=void 0===t?"":t,i=e.className,a=e.showTextOnly,o=e.showLines,c=e.style,h=void 0===c?{}:c,p=e.stylesPrev,f=void 0===p?{}:p,m=e.highlightKeywords,g=e.showProgramFill,v=(e.isProgramFill,e.disabledFill),b=void 0!==v&&v,y=e.programFillValue,x=e.onFillChange,S=void 0===x?function(e){}:x,E=e.onFillBlur,C=void 0===E?function(){}:E,T=e.onFillFocus,A=void 0===T?function(){}:T,D=String(n),I=(0,d.useState)(""),R=u()(I,2),P=R[0],H=R[1],V=(0,d.useState)("office"),G=u()(V,2),Z=G[0],W=G[1],Y=(0,d.useState)([]),X=u()(Y,2),J=X[0],Q=X[1],ee=(0,d.useRef)("a"+(0,F.Z)()),te={};var ne=function(e){return e.replace(/<style.*?>([\s\S]+?)<\/style>/gim,(function(e,t){var n=t.replace(/(\n|\r)/g,"").split("}"),i=[];return n.map((function(e){""!=e&&i.push(".".concat(ee.current," ").concat(e))})),"<style>".concat(i.join("}"),"</style>")}))},ie=(0,d.useMemo)((function(){try{D=D.replace(/\(\/attachments\/download\//g,"("+B.Z.API_SERVER+"/attachments/download/").replace(/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,"("+B.Z.API_SERVER+"/api/attachments/").replace(/\"\/api\/attachments\/|\"\/attachments\/download\//g,'"'+B.Z.API_SERVER+"/api/attachments/").replace(/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,'"'+B.Z.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,"\n")}catch(e){}if(g){var e=-1;return D=D.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,(function(t,n,i){var r;return function(e,t,n){var i=document.createElement(e===j?"input":"textarea");i.style.width="100%",i.style.height=e===j?"40px":"151px",i.rows=5,i.spellcheck=!1,i.name="edu-program-fill",i.placeholder="请输入",i.dataset.id=t;var r=Object.keys(te).length;return te[r]=i,'<span class="edu-program-fill-wrap '.concat(e===j?"":"show",'" style="width:').concat(e===j?"400px":"100%",'" title=').concat(n||"","><span>").concat(i.outerHTML,'<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>')}(t,++e,null==y||null===(r=y[e])||void 0===r?void 0:r.value.replaceAll("<","<").replaceAll(">",">"))})),'<pre style="background:#fff;padding:4px">'.concat(ne(D||""),"</pre>")}var t=ne(D);t=O(t);var n=M();D.match(/\[TOC\]/)&&(t=t.replace("<p>[TOC]</p>",k()),_()),t=t.replace(/(__special_katext_id_\d+__)/g,(function(e,t){var i=n[t],r=i.type,a=i.expression;return(0,$.renderToString)(function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue}(a)||"",{displayMode:"block"===r,throwOnError:!1,output:"html"})})),t=t.replace(/▁/g,"▁▁▁▁▁"),L();var i=document.createElement("div");return i.innerHTML=t,a?i.innerText:m?(oe(i,m.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),i.innerHTML):(setTimeout((function(){return ue()}),500),i.innerHTML)}),[D,m]);(0,d.useEffect)((function(){le.current&&le.current.querySelectorAll(["input","textarea"]).forEach((function(e){e.oninput=re,e.onblur=ae,e.onfocus=se}))}),[J]),(0,d.useEffect)((function(){if(null!=y&&y.length)try{var e,t=le.current.querySelectorAll(".edu-program-fill-score"),n=le.current.querySelectorAll('[name="edu-program-fill"]'),i=l()(n.entries());try{for(i.s();!(e=i.n()).done;){var r,a,s,o=u()(e.value,2),c=o[0],d=o[1];d.value=(null==y||null===(r=y[c])||void 0===r?void 0:r.value)||"","warning"===(null==y||null===(a=y[c])||void 0===a?void 0:a.type)?d.className="program-fill-warning":"success"===(null==y||null===(s=y[c])||void 0===s?void 0:s.type)?d.className="program-fill-success":d.className=""}}catch(e){i.e(e)}finally{i.f()}var h,p=l()(t.entries());try{for(p.s();!(h=p.n()).done;){var f,m,g=u()(h.value,2),v=g[0];g[1].innerHTML=null!=y&&null!==(f=y[v])&&void 0!==f&&f.score?"".concat(null==y||null===(m=y[v])||void 0===m?void 0:m.score,"分"):""}}catch(e){p.e(e)}finally{p.f()}Q(y)}catch(e){console.log(e,"error")}}),[y]);var re=function(e){J[e.target.dataset.id]=J[e.target.dataset.id]||{},J[e.target.dataset.id].value=e.target.value,Q(s()(J)),S(J,e.target.dataset.id)},ae=function(e){J[e.target.dataset.id]=J[e.target.dataset.id]||{},J[e.target.dataset.id].value=e.target.value,Q(s()(J)),C(J,e.target.dataset.id)},se=function(e){J[e.target.dataset.id]=J[e.target.dataset.id]||{},J[e.target.dataset.id].value=e.target.value,Q(s()(J)),A(J,e.target.dataset.id)};function oe(e,t){return e.childNodes.forEach((function(e){if(e.childNodes.length>0)oe(e,t);else if("IMG"!==e.nodeName)if(e.innerHTML){var n;e.innerHTML=null===(n=e.innerHTML)||void 0===n?void 0:n.replace(new RegExp(t,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>')}else{var i=document.createElement("span");i.innerHTML=e.textContent.replace(new RegExp(t,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),e.replaceWith(i)}}))}var le=(0,d.useRef)();function ce(e){var t=e.target;if("A"===t.tagName.toUpperCase()){var n=t.getAttribute("href");if(n.indexOf("office")>-1)e.preventDefault(),H(n),W("office");else if(n.indexOf("application/pdf")>-1)e.preventDefault(),H(n),W("pdf");else if(n.indexOf("text/html")>-1)e.preventDefault(),H(n),W("html");else if(n.startsWith("#")){e.preventDefault();var i=document.getElementById(n.replace("#",""));i&&i.scrollIntoView(!0)}}}w.WebkitLineClamp=o,o&&(h=r()(r()({},h),w));var ue=function(){var e,t=null===(e=le.current)||void 0===e?void 0:e.querySelectorAll("video");null==t||t.forEach((function(e){if(e.oncontextmenu=function(){return!1},e.src.indexOf(".m3u8")>-1)if(e.canPlayType("application/vnd.apple.mpegurl"));else if(N.ZP.isSupported()){var t=new N.ZP;t.loadSource(e.src),t.attachMedia(e)}}))};(0,d.useEffect)((function(){if(le.current&&ie&&ie.match(q)&&window.PR.prettyPrint(),le.current)return le.current.addEventListener("click",ce),function(){var e;null===(e=le.current)||void 0===e||e.removeEventListener("click",ce),L(),_()}}),[ie,le.current,ce]),(0,d.useEffect)((function(){var e,t=function(e){e.preventDefault(),e.clipboardData.setData("text",window.getSelection().toString())};return null===(e=le.current)||void 0===e||e.addEventListener("copy",t),function(){var e;null===(e=le.current)||void 0===e||e.removeEventListener("copy",t)}}),[le.current]);var de=function(e){return/<style[\s\S]*?>/i.test(e||"")};return(0,K.jsxs)(K.Fragment,{children:[a&&(0,K.jsx)("div",{ref:le,children:ie}),!a&&!de(ie)&&(0,K.jsx)("div",{ref:le,style:r()({},h),className:"".concat(i||""," ").concat(b?"disabled-fill":""," markdown-body ").concat(ee.current),dangerouslySetInnerHTML:{__html:ie}}),!a&&de(ie)&&(0,K.jsx)(U,{html:ie}),(0,K.jsx)(z.Z,{close:!0,data:P,type:null!=P&&P.length?Z:"",style:r()({},f),onClose:function(){return H("")}})]})}},53302:function(e,t,n){"use strict";n.d(t,{Z:function(){return _},I:function(){return x}});var i=n(82242),r=n.n(i),a=n(79800),s=n.n(a),o=n(83447),l=n(8591),c=n(10249),u=n(81327),d=n(31060),h=n(5112),p=n(3113);var f=n(67390).Z.API_SERVER,m=n(59301),g=n(37712),v=o.Z.useForm,b={width:280,marginRight:10},y={labelCol:{span:5},wrapperCol:{span:19}},_=function(e){var t=e.callback,n=e.onCancel,i=v(),a=s()(i,1)[0],f=(0,m.useRef)();function _(e,t){-1!==e.status?a.setFieldsValue({src:"/api/attachments/".concat(e.id),type:t.type}):l.ZP.error(e.message)}return(0,g.jsxs)(o.Z,r()(r()({form:a},y),{},{className:"upload-image-panel",onFinish:function(e){f.current.width=a.getFieldValue("width"),f.current.align=a.getFieldValue("align"),t(e,f.current)},style:{width:470,overflow:"hidden"},children:[(0,g.jsx)(o.Z.Item,{label:"图片地址",required:!0,children:(0,g.jsxs)("div",{className:"flex-container",children:[(0,g.jsx)(o.Z.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入图片地址"}],children:(0,g.jsx)(c.Z,{style:b})}),(0,g.jsx)(w,{onFileChange:function(e){var t=e.target.files[0];f.current=t,x(t,_)}})]})}),(0,g.jsx)(o.Z.Item,{label:"图片描述",name:"alt",children:(0,g.jsx)(c.Z,{style:{width:264}})}),(0,g.jsx)(o.Z.Item,{label:"图片宽度",name:"width",children:(0,g.jsxs)(u.Z,{children:[(0,g.jsx)(o.Z.Item,{name:"width",style:{margin:0},children:(0,g.jsx)(d.Z,{style:{width:264}})}),(0,g.jsx)("span",{className:"ml8",children:"%"})]})}),(0,g.jsx)(o.Z.Item,{label:"对齐方式",name:"align",children:(0,g.jsx)(h.ZP.Group,{name:"align",defaultValue:1,options:[{value:"left",label:"左对齐"},{value:"center",label:"居中对齐"},{value:"right",label:"右对齐"}]})}),(0,g.jsx)("aside",{children:(0,g.jsxs)(o.Z.Item,{style:{textAlign:"right",position:"relative",right:-98},children:[(0,g.jsx)(p.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,g.jsx)(p.ZP,{type:"default",onClick:n,children:"取消"})]})})]}))};function w(e){var t=e.onFileChange;return(0,g.jsxs)("label",{className:"upload-button",style:{cursor:"pointer"},children:["本地上传",(0,g.jsx)("input",{type:"file",onChange:t})]})}function x(e,t){if(!e)throw new String("没有文件");var n=new FormData;n.append("editormd-image-file",e),n.append("file_param_name","editormd-image-file"),n.append("byxhr","true");var i=new window.XMLHttpRequest;i.withCredentials=!0,i.addEventListener("load",(function(n){t(JSON.parse(n.target.responseText),e)}),!1),i.addEventListener("error",(function(e){console.error(e)}),!1),i.open("POST","".concat(f,"/api/attachments.json")),i.send(n)}},99587:function(e,t){"use strict";t.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},24905:function(e,t,n){"use strict";n.d(t,{Z:function(){return S}});var i=n(92310),r=n.n(i),a=n(5630),s=n(59301),o=n(36355),l=n(1684),c=n(32441);var u=s.createContext(null),d=n(98447),h=n(14088),p=n(4572),f=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};const m=(e,t)=>{var n;const{prefixCls:i,className:m,rootClassName:g,children:v,indeterminate:b=!1,style:y,onMouseEnter:_,onMouseLeave:w,skipGroup:x=!1,disabled:k}=e,S=f(e,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]),{getPrefixCls:E,direction:C,checkbox:T}=s.useContext(o.E_),A=s.useContext(u),{isFormItemInput:M}=s.useContext(c.aM),L=s.useContext(l.Z),D=null!==(n=(null==A?void 0:A.disabled)||k)&&void 0!==n?n:L,I=s.useRef(S.value);s.useEffect((()=>{null==A||A.registerValue(S.value)}),[]),s.useEffect((()=>{if(!x)return S.value!==I.current&&(null==A||A.cancelValue(I.current),null==A||A.registerValue(S.value),I.current=S.value),()=>null==A?void 0:A.cancelValue(S.value)}),[S.value]);const R=E("checkbox",i),[P,O]=(0,d.ZP)(R),N=Object.assign({},S);A&&!x&&(N.onChange=function(){S.onChange&&S.onChange.apply(S,arguments),A.toggleOption&&A.toggleOption({label:v,value:S.value})},N.name=A.name,N.checked=A.value.includes(S.value));const B=r()(`${R}-wrapper`,{[`${R}-rtl`]:"rtl"===C,[`${R}-wrapper-checked`]:N.checked,[`${R}-wrapper-disabled`]:D,[`${R}-wrapper-in-form-item`]:M},null==T?void 0:T.className,m,g,O),$=r()({[`${R}-indeterminate`]:b},p.A,O),F=b?"mixed":void 0;return P(s.createElement(h.Z,{component:"Checkbox",disabled:D},s.createElement("label",{className:B,style:Object.assign(Object.assign({},null==T?void 0:T.style),y),onMouseEnter:_,onMouseLeave:w},s.createElement(a.Z,Object.assign({"aria-checked":F},N,{prefixCls:R,className:$,disabled:D,ref:t})),void 0!==v&&s.createElement("span",null,v))))};var g=s.forwardRef(m),v=n(95190),b=n(2738),y=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};const _=(e,t)=>{const{defaultValue:n,children:i,options:a=[],prefixCls:l,className:c,rootClassName:h,style:p,onChange:f}=e,m=y(e,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]),{getPrefixCls:_,direction:w}=s.useContext(o.E_),[x,k]=s.useState(m.value||n||[]),[S,E]=s.useState([]);s.useEffect((()=>{"value"in m&&k(m.value||[])}),[m.value]);const C=s.useMemo((()=>a.map((e=>"string"==typeof e||"number"==typeof e?{label:e,value:e}:e))),[a]),T=_("checkbox",l),A=`${T}-group`,[M,L]=(0,d.ZP)(T),D=(0,b.Z)(m,["value","disabled"]),I=a.length?C.map((e=>s.createElement(g,{prefixCls:T,key:e.value.toString(),disabled:"disabled"in e?e.disabled:m.disabled,value:e.value,checked:x.includes(e.value),onChange:e.onChange,className:`${A}-item`,style:e.style,title:e.title},e.label))):i,R={toggleOption:e=>{const t=x.indexOf(e.value),n=(0,v.Z)(x);-1===t?n.push(e.value):n.splice(t,1),"value"in m||k(n),null==f||f(n.filter((e=>S.includes(e))).sort(((e,t)=>C.findIndex((t=>t.value===e))-C.findIndex((e=>e.value===t)))))},value:x,disabled:m.disabled,name:m.name,registerValue:e=>{E((t=>[].concat((0,v.Z)(t),[e])))},cancelValue:e=>{E((t=>t.filter((t=>t!==e))))}},P=r()(A,{[`${A}-rtl`]:"rtl"===w},c,h,L);return M(s.createElement("div",Object.assign({className:P,style:p},D,{ref:t}),s.createElement(u.Provider,{value:R},I)))},w=s.forwardRef(_);var x=s.memo(w);const k=g;k.Group=x,k.__ANT_CHECKBOX=!0;var S=k},98447:function(e,t,n){"use strict";n.d(t,{C2:function(){return o}});var i=n(17313),r=n(37613),a=n(83116);const s=e=>{const{checkboxCls:t}=e,n=`${t}-wrapper`;return[{[`${t}-group`]:Object.assign(Object.assign({},(0,i.Wf)(e)),{display:"inline-flex",flexWrap:"wrap",columnGap:e.marginXS,[`> ${e.antCls}-row`]:{flex:1}}),[n]:Object.assign(Object.assign({},(0,i.Wf)(e)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${n}`]:{marginInlineStart:0},[`&${n}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[t]:Object.assign(Object.assign({},(0,i.Wf)(e)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:e.borderRadiusSM,alignSelf:"center",[`${t}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${t}-inner`]:Object.assign({},(0,i.oN)(e))},[`${t}-inner`]:{boxSizing:"border-box",position:"relative",top:0,insetInlineStart:0,display:"block",width:e.checkboxSize,height:e.checkboxSize,direction:"ltr",backgroundColor:e.colorBgContainer,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,borderCollapse:"separate",transition:`all ${e.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"21.5%",display:"table",width:e.checkboxSize/14*5,height:e.checkboxSize/14*8,border:`${e.lineWidthBold}px solid ${e.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${e.motionDurationFast} ${e.motionEaseInBack}, opacity ${e.motionDurationFast}`}},"& + span":{paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS}})},{[`\n ${n}:not(${n}-disabled),\n ${t}:not(${t}-disabled)\n `]:{[`&:hover ${t}-inner`]:{borderColor:e.colorPrimary}},[`${n}:not(${n}-disabled)`]:{[`&:hover ${t}-checked:not(${t}-disabled) ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${t}-checked:not(${t}-disabled):after`]:{borderColor:e.colorPrimaryHover}}},{[`${t}-checked`]:{[`${t}-inner`]:{backgroundColor:e.colorPrimary,borderColor:e.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack} ${e.motionDurationFast}`}}},[`\n ${n}-checked:not(${n}-disabled),\n ${t}-checked:not(${t}-disabled)\n `]:{[`&:hover ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"}}},{[t]:{"&-indeterminate":{[`${t}-inner`]:{backgroundColor:e.colorBgContainer,borderColor:e.colorBorder,"&:after":{top:"50%",insetInlineStart:"50%",width:e.fontSizeLG/2,height:e.fontSizeLG/2,backgroundColor:e.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}}}}},{[`${n}-disabled`]:{cursor:"not-allowed"},[`${t}-disabled`]:{[`&, ${t}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${t}-inner`]:{background:e.colorBgContainerDisabled,borderColor:e.colorBorder,"&:after":{borderColor:e.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:e.colorTextDisabled},[`&${t}-indeterminate ${t}-inner::after`]:{background:e.colorTextDisabled}}}]};function o(e,t){const n=(0,r.TS)(t,{checkboxCls:`.${e}`,checkboxSize:t.controlInteractiveSize});return[s(n)]}t.ZP=(0,a.Z)("Checkbox",((e,t)=>{let{prefixCls:n}=t;return[o(n,e)]}))},43604:function(e,t,n){"use strict";var i=n(37028);t.Z=i.Z},93891:function(e,t,n){"use strict";var i=n(59301),r=n(36355),a=n(64165);t.Z=e=>{const{componentName:t}=e,{getPrefixCls:n}=(0,i.useContext)(r.E_),s=n("empty");switch(t){case"Table":case"List":return i.createElement(a.Z,{image:a.Z.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return i.createElement(a.Z,{image:a.Z.PRESENTED_IMAGE_SIMPLE,className:`${s}-small`});default:return i.createElement(a.Z,null)}}},28103:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var i=n(92310),r=n.n(i),a=n(59301),s=n(36355),o=n(17313),l=n(83116),c=n(37613);const u=e=>{const{componentCls:t,sizePaddingEdgeHorizontal:n,colorSplit:i,lineWidth:r,textPaddingInline:a,orientationMargin:s,verticalMarginInline:l}=e;return{[t]:Object.assign(Object.assign({},(0,o.Wf)(e)),{borderBlockStart:`${r}px solid ${i}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:l,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${r}px solid ${i}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${e.dividerHorizontalGutterMargin}px 0`},[`&-horizontal${t}-with-text`]:{display:"flex",alignItems:"center",margin:`${e.dividerHorizontalWithTextGutterMargin}px 0`,color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${i}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${r}px solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${t}-with-text-left`]:{"&::before":{width:100*s+"%"},"&::after":{width:100-100*s+"%"}},[`&-horizontal${t}-with-text-right`]:{"&::before":{width:100-100*s+"%"},"&::after":{width:100*s+"%"}},[`${t}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:a},"&-dashed":{background:"none",borderColor:i,borderStyle:"dashed",borderWidth:`${r}px 0 0`},[`&-horizontal${t}-with-text${t}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${t}-dashed`]:{borderInlineStartWidth:r,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${t}-with-text`]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},[`&-horizontal${t}-with-text-left${t}-no-default-orientation-margin-left`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${t}-inner-text`]:{paddingInlineStart:n}},[`&-horizontal${t}-with-text-right${t}-no-default-orientation-margin-right`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${t}-inner-text`]:{paddingInlineEnd:n}}})}};var d=(0,l.Z)("Divider",(e=>{const t=(0,c.TS)(e,{dividerHorizontalWithTextGutterMargin:e.margin,dividerHorizontalGutterMargin:e.marginLG,sizePaddingEdgeHorizontal:0});return[u(t)]}),(e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}))),h=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};var p=e=>{const{getPrefixCls:t,direction:n,divider:i}=a.useContext(s.E_),{prefixCls:o,type:l="horizontal",orientation:c="center",orientationMargin:u,className:p,rootClassName:f,children:m,dashed:g,plain:v,style:b}=e,y=h(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),_=t("divider",o),[w,x]=d(_),k=c.length>0?`-${c}`:c,S=!!m,E="left"===c&&null!=u,C="right"===c&&null!=u,T=r()(_,null==i?void 0:i.className,x,`${_}-${l}`,{[`${_}-with-text`]:S,[`${_}-with-text${k}`]:S,[`${_}-dashed`]:!!g,[`${_}-plain`]:!!v,[`${_}-rtl`]:"rtl"===n,[`${_}-no-default-orientation-margin-left`]:E,[`${_}-no-default-orientation-margin-right`]:C},p,f),A=a.useMemo((()=>"number"==typeof u?u:/^\d+$/.test(u)?Number(u):u),[u]),M=Object.assign(Object.assign({},E&&{marginLeft:A}),C&&{marginRight:A});return w(a.createElement("div",Object.assign({className:T,style:Object.assign(Object.assign({},null==i?void 0:i.style),b)},y,{role:"separator"}),m&&"vertical"!==l&&a.createElement("span",{className:`${_}-inner-text`,style:M},m)))}},43428:function(e,t,n){"use strict";n.d(t,{Z:function(){return K}});var i=n(92310),r=n.n(i),a=n(20439),s=n(50298),o=n(43403),l=n(34280),c=n(59301),u=c.createContext(null),d=c.createContext({}),h=u,p=n(4635),f=n(14809),m=n(77900),g=n(10228),v=n(26112),b=n(70425);var y=function(e){var t=e.prefixCls,n=e.className,i=e.style,s=e.children,o=e.containerRef,l=e.id,u={onMouseEnter:e.onMouseEnter,onMouseOver:e.onMouseOver,onMouseLeave:e.onMouseLeave,onClick:e.onClick,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp},h=c.useContext(d).panel,p=(0,b.x1)(h,o);return c.createElement(c.Fragment,null,c.createElement("div",(0,f.Z)({id:l,className:r()("".concat(t,"-content"),n),style:(0,a.Z)({},i),"aria-modal":"true",role:"dialog",ref:p},u),s))},_=n(48736);function w(e){return"string"==typeof e&&String(Number(e))===e?((0,_.ZP)(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(e)):e}var x={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function k(e,t){var n,i,o,l,u=e.prefixCls,d=e.open,b=e.placement,_=e.inline,k=e.push,S=e.forceRender,E=e.autoFocus,C=e.keyboard,T=e.rootClassName,A=e.rootStyle,M=e.zIndex,L=e.className,D=e.id,I=e.style,R=e.motion,P=e.width,O=e.height,N=e.children,B=e.contentWrapperStyle,$=e.mask,F=e.maskClosable,z=e.maskMotion,K=e.maskClassName,U=e.maskStyle,j=e.afterOpenChange,q=e.onClose,H=e.onMouseEnter,V=e.onMouseOver,G=e.onMouseLeave,Z=e.onClick,W=e.onKeyDown,Y=e.onKeyUp,X=c.useRef(),J=c.useRef(),Q=c.useRef();c.useImperativeHandle(t,(function(){return X.current}));c.useEffect((function(){var e;d&&E&&(null===(e=X.current)||void 0===e||e.focus({preventScroll:!0}))}),[d]);var ee=c.useState(!1),te=(0,s.Z)(ee,2),ne=te[0],ie=te[1],re=c.useContext(h),ae=null!==(n=null!==(i=null===(o=!1===k?{distance:0}:!0===k?{}:k||{})||void 0===o?void 0:o.distance)&&void 0!==i?i:null==re?void 0:re.pushDistance)&&void 0!==n?n:180,se=c.useMemo((function(){return{pushDistance:ae,push:function(){ie(!0)},pull:function(){ie(!1)}}}),[ae]);c.useEffect((function(){var e,t;d?null==re||null===(e=re.push)||void 0===e||e.call(re):null==re||null===(t=re.pull)||void 0===t||t.call(re)}),[d]),c.useEffect((function(){return function(){var e;null==re||null===(e=re.pull)||void 0===e||e.call(re)}}),[]);var oe=$&&c.createElement(m.ZP,(0,f.Z)({key:"mask"},z,{visible:d}),(function(e,t){var n=e.className,i=e.style;return c.createElement("div",{className:r()("".concat(u,"-mask"),n,K),style:(0,a.Z)((0,a.Z)({},i),U),onClick:F&&d?q:void 0,ref:t})})),le="function"==typeof R?R(b):R,ce={};if(ne&&ae)switch(b){case"top":ce.transform="translateY(".concat(ae,"px)");break;case"bottom":ce.transform="translateY(".concat(-ae,"px)");break;case"left":ce.transform="translateX(".concat(ae,"px)");break;default:ce.transform="translateX(".concat(-ae,"px)")}"left"===b||"right"===b?ce.width=w(P):ce.height=w(O);var ue={onMouseEnter:H,onMouseOver:V,onMouseLeave:G,onClick:Z,onKeyDown:W,onKeyUp:Y},de=c.createElement(m.ZP,(0,f.Z)({key:"panel"},le,{visible:d,forceRender:S,onVisibleChanged:function(e){null==j||j(e)},removeOnLeave:!1,leavedClassName:"".concat(u,"-content-wrapper-hidden")}),(function(t,n){var i=t.className,s=t.style;return c.createElement("div",(0,f.Z)({className:r()("".concat(u,"-content-wrapper"),i),style:(0,a.Z)((0,a.Z)((0,a.Z)({},ce),s),B)},(0,v.Z)(e,{data:!0})),c.createElement(y,(0,f.Z)({id:D,containerRef:n,prefixCls:u,className:L,style:I},ue),N))})),he=(0,a.Z)({},A);return M&&(he.zIndex=M),c.createElement(h.Provider,{value:se},c.createElement("div",{className:r()(u,"".concat(u,"-").concat(b),T,(l={},(0,p.Z)(l,"".concat(u,"-open"),d),(0,p.Z)(l,"".concat(u,"-inline"),_),l)),style:he,tabIndex:-1,ref:X,onKeyDown:function(e){var t=e.keyCode,n=e.shiftKey;switch(t){case g.Z.TAB:var i;if(t===g.Z.TAB)if(n||document.activeElement!==Q.current){if(n&&document.activeElement===J.current){var r;null===(r=Q.current)||void 0===r||r.focus({preventScroll:!0})}}else null===(i=J.current)||void 0===i||i.focus({preventScroll:!0});break;case g.Z.ESC:q&&C&&(e.stopPropagation(),q(e))}}},oe,c.createElement("div",{tabIndex:0,ref:J,style:x,"aria-hidden":"true","data-sentinel":"start"}),de,c.createElement("div",{tabIndex:0,ref:Q,style:x,"aria-hidden":"true","data-sentinel":"end"})))}var S=c.forwardRef(k);var E=function(e){var t=e.open,n=void 0!==t&&t,i=e.prefixCls,r=void 0===i?"rc-drawer":i,u=e.placement,h=void 0===u?"right":u,p=e.autoFocus,f=void 0===p||p,m=e.keyboard,g=void 0===m||m,v=e.width,b=void 0===v?378:v,y=e.mask,_=void 0===y||y,w=e.maskClosable,x=void 0===w||w,k=e.getContainer,E=e.forceRender,C=e.afterOpenChange,T=e.destroyOnClose,A=e.onMouseEnter,M=e.onMouseOver,L=e.onMouseLeave,D=e.onClick,I=e.onKeyDown,R=e.onKeyUp,P=e.panelRef,O=c.useState(!1),N=(0,s.Z)(O,2),B=N[0],$=N[1];var F=c.useState(!1),z=(0,s.Z)(F,2),K=z[0],U=z[1];(0,l.Z)((function(){U(!0)}),[]);var j=!!K&&n,q=c.useRef(),H=c.useRef();(0,l.Z)((function(){j&&(H.current=document.activeElement)}),[j]);var V=c.useMemo((function(){return{panel:P}}),[P]);if(!E&&!B&&!j&&T)return null;var G={onMouseEnter:A,onMouseOver:M,onMouseLeave:L,onClick:D,onKeyDown:I,onKeyUp:R},Z=(0,a.Z)((0,a.Z)({},e),{},{open:j,prefixCls:r,placement:h,autoFocus:f,keyboard:g,width:b,mask:_,maskClosable:x,inline:!1===k,afterOpenChange:function(e){var t,n;($(e),null==C||C(e),e||!H.current||null!==(t=q.current)&&void 0!==t&&t.contains(H.current))||(null===(n=H.current)||void 0===n||n.focus({preventScroll:!0}))},ref:q},G);return c.createElement(d.Provider,{value:V},c.createElement(o.Z,{open:j||E||B,autoDestroy:!1,getContainer:k,autoLock:_&&(j||B)},c.createElement(S,Z)))},C=n(62892),T=n(36355),A=n(32441),M=n(47729);var L=e=>{const{prefixCls:t,title:n,footer:i,extra:a,closeIcon:s,closable:o,onClose:l,headerStyle:u,drawerStyle:d,bodyStyle:h,footerStyle:p,children:f}=e,m=c.useCallback((e=>c.createElement("button",{type:"button",onClick:l,"aria-label":"Close",className:`${t}-close`},e)),[l]),[g,v]=(0,M.Z)(o,s,m,void 0,!0),b=c.useMemo((()=>n||g?c.createElement("div",{style:u,className:r()(`${t}-header`,{[`${t}-header-close-only`]:g&&!n&&!a})},c.createElement("div",{className:`${t}-header-title`},v,n&&c.createElement("div",{className:`${t}-title`},n)),a&&c.createElement("div",{className:`${t}-extra`},a)):null),[g,v,a,u,t,n]),y=c.useMemo((()=>{if(!i)return null;const e=`${t}-footer`;return c.createElement("div",{className:e,style:p},i)}),[i,p,t]);return c.createElement("div",{className:`${t}-wrapper-body`,style:d},b,c.createElement("div",{className:`${t}-body`,style:h},f),y)},D=n(33234),I=n(83116),R=n(37613);var P=e=>{const{componentCls:t,motionDurationSlow:n}=e,i={"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${n}`}}};return{[t]:{[`${t}-mask-motion`]:{"&-enter, &-appear, &-leave":{"&-active":{transition:`all ${n}`}},"&-enter, &-appear":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}}},[`${t}-panel-motion`]:{"&-left":[i,{"&-enter, &-appear":{"&-start":{transform:"translateX(-100%) !important"},"&-active":{transform:"translateX(0)"}},"&-leave":{transform:"translateX(0)","&-active":{transform:"translateX(-100%)"}}}],"&-right":[i,{"&-enter, &-appear":{"&-start":{transform:"translateX(100%) !important"},"&-active":{transform:"translateX(0)"}},"&-leave":{transform:"translateX(0)","&-active":{transform:"translateX(100%)"}}}],"&-top":[i,{"&-enter, &-appear":{"&-start":{transform:"translateY(-100%) !important"},"&-active":{transform:"translateY(0)"}},"&-leave":{transform:"translateY(0)","&-active":{transform:"translateY(-100%)"}}}],"&-bottom":[i,{"&-enter, &-appear":{"&-start":{transform:"translateY(100%) !important"},"&-active":{transform:"translateY(0)"}},"&-leave":{transform:"translateY(0)","&-active":{transform:"translateY(100%)"}}}]}}}};const O=e=>{const{componentCls:t,zIndexPopup:n,colorBgMask:i,colorBgElevated:r,motionDurationSlow:a,motionDurationMid:s,padding:o,paddingLG:l,fontSizeLG:c,lineHeightLG:u,lineWidth:d,lineType:h,colorSplit:p,marginSM:f,colorIcon:m,colorIconHover:g,colorText:v,fontWeightStrong:b,footerPaddingBlock:y,footerPaddingInline:_}=e,w=`${t}-content-wrapper`;return{[t]:{position:"fixed",inset:0,zIndex:n,pointerEvents:"none","&-pure":{position:"relative",background:r,[`&${t}-left`]:{boxShadow:e.boxShadowDrawerLeft},[`&${t}-right`]:{boxShadow:e.boxShadowDrawerRight},[`&${t}-top`]:{boxShadow:e.boxShadowDrawerUp},[`&${t}-bottom`]:{boxShadow:e.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${t}-mask`]:{position:"absolute",inset:0,zIndex:n,background:i,pointerEvents:"auto"},[w]:{position:"absolute",zIndex:n,maxWidth:"100vw",transition:`all ${a}`,"&-hidden":{display:"none"}},[`&-left > ${w}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowDrawerLeft},[`&-right > ${w}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:e.boxShadowDrawerRight},[`&-top > ${w}`]:{top:0,insetInline:0,boxShadow:e.boxShadowDrawerUp},[`&-bottom > ${w}`]:{bottom:0,insetInline:0,boxShadow:e.boxShadowDrawerDown},[`${t}-content`]:{width:"100%",height:"100%",overflow:"auto",background:r,pointerEvents:"auto"},[`${t}-wrapper-body`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%"},[`${t}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${o}px ${l}px`,fontSize:c,lineHeight:u,borderBottom:`${d}px ${h} ${p}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${t}-extra`]:{flex:"none"},[`${t}-close`]:{display:"inline-block",marginInlineEnd:f,color:m,fontWeight:b,fontSize:c,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,outline:0,cursor:"pointer",transition:`color ${s}`,textRendering:"auto","&:focus, &:hover":{color:g,textDecoration:"none"}},[`${t}-title`]:{flex:1,margin:0,color:v,fontWeight:e.fontWeightStrong,fontSize:c,lineHeight:u},[`${t}-body`]:{flex:1,minWidth:0,minHeight:0,padding:l,overflow:"auto"},[`${t}-footer`]:{flexShrink:0,padding:`${y}px ${_}px`,borderTop:`${d}px ${h} ${p}`},"&-rtl":{direction:"rtl"}}}};var N=(0,I.Z)("Drawer",(e=>{const t=(0,R.TS)(e,{});return[O(t),P(t)]}),(e=>({zIndexPopup:e.zIndexPopupBase,footerPaddingBlock:e.paddingXS,footerPaddingInline:e.padding}))),B=n(11575),$=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};const F={distance:180},z=e=>{const{rootClassName:t,width:n,height:i,size:a="default",mask:s=!0,push:o=F,open:l,afterOpenChange:u,onClose:d,prefixCls:h,getContainer:p,style:f,className:m,visible:g,afterVisibleChange:v}=e,b=$(e,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","style","className","visible","afterVisibleChange"]),{getPopupContainer:y,getPrefixCls:_,direction:w,drawer:x}=c.useContext(T.E_),k=_("drawer",h),[S,M]=N(k),I=void 0===p&&y?()=>y(document.body):p,R=r()({"no-mask":!s,[`${k}-rtl`]:"rtl"===w},t,M);const P=c.useMemo((()=>null!=n?n:"large"===a?736:378),[n,a]),O=c.useMemo((()=>null!=i?i:"large"===a?736:378),[i,a]),z={motionName:(0,C.m)(k,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},K=(0,B.H)();return S(c.createElement(D.BR,null,c.createElement(A.Ux,{status:!0,override:!0},c.createElement(E,Object.assign({prefixCls:k,onClose:d,maskMotion:z,motion:e=>({motionName:(0,C.m)(k,`panel-motion-${e}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500})},b,{open:null!=l?l:g,mask:s,push:o,width:P,height:O,style:Object.assign(Object.assign({},null==x?void 0:x.style),f),className:r()(null==x?void 0:x.className,m),rootClassName:R,getContainer:I,afterOpenChange:null!=u?u:v,panelRef:K}),c.createElement(L,Object.assign({prefixCls:k},b,{onClose:d}))))))};z._InternalPanelDoNotUseOrYouWillBeFired=e=>{const{prefixCls:t,style:n,className:i,placement:a="right"}=e,s=$(e,["prefixCls","style","className","placement"]),{getPrefixCls:o}=c.useContext(T.E_),l=o("drawer",t),[u,d]=N(l),h=r()(l,`${l}-pure`,`${l}-${a}`,d,i);return u(c.createElement("div",{className:h,style:n},c.createElement(L,Object.assign({prefixCls:l},s))))};var K=z},64165:function(e,t,n){"use strict";n.d(t,{Z:function(){return _}});var i=n(92310),r=n.n(i),a=n(59301),s=n(36355),o=n(9763),l=n(60654),c=n(88088);var u=()=>{const[,e]=(0,c.Z)(),t=new l.C(e.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return a.createElement("svg",{style:t,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},a.createElement("g",{fill:"none",fillRule:"evenodd"},a.createElement("g",{transform:"translate(24 31.67)"},a.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),a.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),a.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),a.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),a.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),a.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),a.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},a.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),a.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))};var d=()=>{const[,e]=(0,c.Z)(),{colorFill:t,colorFillTertiary:n,colorFillQuaternary:i,colorBgContainer:r}=e,{borderColor:s,shadowColor:o,contentColor:u}=(0,a.useMemo)((()=>({borderColor:new l.C(t).onBackground(r).toHexShortString(),shadowColor:new l.C(n).onBackground(r).toHexShortString(),contentColor:new l.C(i).onBackground(r).toHexShortString()})),[t,n,i,r]);return a.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},a.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},a.createElement("ellipse",{fill:o,cx:"32",cy:"33",rx:"32",ry:"7"}),a.createElement("g",{fillRule:"nonzero",stroke:s},a.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),a.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:u}))))},h=n(83116),p=n(37613);const f=e=>{const{componentCls:t,margin:n,marginXS:i,marginXL:r,fontSize:a,lineHeight:s}=e;return{[t]:{marginInline:i,fontSize:a,lineHeight:s,textAlign:"center",[`${t}-image`]:{height:e.emptyImgHeight,marginBottom:i,opacity:e.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${t}-description`]:{color:e.colorText},[`${t}-footer`]:{marginTop:n},"&-normal":{marginBlock:r,color:e.colorTextDisabled,[`${t}-description`]:{color:e.colorTextDisabled},[`${t}-image`]:{height:e.emptyImgHeightMD}},"&-small":{marginBlock:i,color:e.colorTextDisabled,[`${t}-image`]:{height:e.emptyImgHeightSM}}}}};var m=(0,h.Z)("Empty",(e=>{const{componentCls:t,controlHeightLG:n}=e,i=(0,p.TS)(e,{emptyImgCls:`${t}-img`,emptyImgHeight:2.5*n,emptyImgHeightMD:n,emptyImgHeightSM:.875*n});return[f(i)]})),g=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};const v=a.createElement(u,null),b=a.createElement(d,null),y=e=>{var{className:t,rootClassName:n,prefixCls:i,image:l=v,description:c,children:u,imageStyle:d,style:h}=e,p=g(e,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:f,direction:y,empty:_}=a.useContext(s.E_),w=f("empty",i),[x,k]=m(w),[S]=(0,o.Z)("Empty"),E=void 0!==c?c:null==S?void 0:S.description,C="string"==typeof E?E:"empty";let T=null;return T="string"==typeof l?a.createElement("img",{alt:C,src:l}):l,x(a.createElement("div",Object.assign({className:r()(k,w,null==_?void 0:_.className,{[`${w}-normal`]:l===b,[`${w}-rtl`]:"rtl"===y},t,n),style:Object.assign(Object.assign({},null==_?void 0:_.style),h)},p),a.createElement("div",{className:`${w}-image`,style:d},T),E&&a.createElement("div",{className:`${w}-description`},E),u&&a.createElement("div",{className:`${w}-footer`},u)))};y.PRESENTED_IMAGE_DEFAULT=v,y.PRESENTED_IMAGE_SIMPLE=b;var _=y},83447:function(e,t,n){"use strict";n.d(t,{Z:function(){return $e}});var i=n(95190),r=n(92310),a=n.n(r),s=n(77900),o=n(59301),l=n(62892),c=n(32441);function u(e){const[t,n]=o.useState(e);return o.useEffect((()=>{const t=setTimeout((()=>{n(e)}),e.length?0:10);return()=>{clearTimeout(t)}}),[e]),t}var d=n(17313),h=n(29878),p=n(8378),f=n(37613),m=n(83116);var g=e=>{const{componentCls:t}=e,n=`${t}-show-help-item`;return{[`${t}-show-help`]:{transition:`opacity ${e.motionDurationSlow} ${e.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[n]:{overflow:"hidden",transition:`height ${e.motionDurationSlow} ${e.motionEaseInOut},\n opacity ${e.motionDurationSlow} ${e.motionEaseInOut},\n transform ${e.motionDurationSlow} ${e.motionEaseInOut} !important`,[`&${n}-appear, &${n}-enter`]:{transform:"translateY(-5px)",opacity:0,"&-active":{transform:"translateY(0)",opacity:1}},[`&${n}-leave-active`]:{transform:"translateY(-5px)"}}}}};const v=e=>({legend:{display:"block",width:"100%",marginBottom:e.marginLG,padding:0,color:e.colorTextDescription,fontSize:e.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`},label:{fontSize:e.fontSize},'input[type="search"]':{boxSizing:"border-box"},'input[type="radio"], input[type="checkbox"]':{lineHeight:"normal"},'input[type="file"]':{display:"block"},'input[type="range"]':{display:"block",width:"100%"},"select[multiple], select[size]":{height:"auto"},"input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus":{outline:0,boxShadow:`0 0 0 ${e.controlOutlineWidth}px ${e.controlOutline}`},output:{display:"block",paddingTop:15,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight}}),b=(e,t)=>{const{formItemCls:n}=e;return{[n]:{[`${n}-label > label`]:{height:t},[`${n}-control-input`]:{minHeight:t}}}},y=e=>{const{componentCls:t}=e;return{[e.componentCls]:Object.assign(Object.assign(Object.assign({},(0,d.Wf)(e)),v(e)),{[`${t}-text`]:{display:"inline-block",paddingInlineEnd:e.paddingSM},"&-small":Object.assign({},b(e,e.controlHeightSM)),"&-large":Object.assign({},b(e,e.controlHeightLG))})}},_=e=>{const{formItemCls:t,iconCls:n,componentCls:i,rootPrefixCls:r,labelRequiredMarkColor:a,labelColor:s,labelFontSize:o,labelHeight:l,labelColonMarginInlineStart:c,labelColonMarginInlineEnd:u,itemMarginBottom:p}=e;return{[t]:Object.assign(Object.assign({},(0,d.Wf)(e)),{marginBottom:p,verticalAlign:"top","&-with-help":{transition:"none"},[`&-hidden,\n &-hidden.${r}-row`]:{display:"none"},"&-has-warning":{[`${t}-split`]:{color:e.colorError}},"&-has-error":{[`${t}-split`]:{color:e.colorWarning}},[`${t}-label`]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:`${e.lineHeight} - 0.25em`,whiteSpace:"unset"},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:l,color:s,fontSize:o,[`> ${n}`]:{fontSize:e.fontSize,verticalAlign:"top"},[`&${t}-required:not(${t}-required-mark-optional)::before`]:{display:"inline-block",marginInlineEnd:e.marginXXS,color:a,fontSize:e.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"',[`${i}-hide-required-mark &`]:{display:"none"}},[`${t}-optional`]:{display:"inline-block",marginInlineStart:e.marginXXS,color:e.colorTextDescription,[`${i}-hide-required-mark &`]:{display:"none"}},[`${t}-tooltip`]:{color:e.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:e.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:c,marginInlineEnd:u},[`&${t}-no-colon::after`]:{content:'"\\a0"'}}},[`${t}-control`]:{"--ant-display":"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${r}-col-'"]):not([class*="' ${r}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:e.controlHeight,"&-content":{flex:"auto",maxWidth:"100%"}}},[t]:{"&-explain, &-extra":{clear:"both",color:e.colorTextDescription,fontSize:e.fontSize,lineHeight:e.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:e.controlHeightSM,transition:`color ${e.motionDurationMid} ${e.motionEaseOut}`},"&-explain":{"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning}}},[`&-with-help ${t}-explain`]:{height:"auto",opacity:1},[`${t}-feedback-icon`]:{fontSize:e.fontSize,textAlign:"center",visibility:"visible",animationName:h.kr,animationDuration:e.motionDurationMid,animationTimingFunction:e.motionEaseOutBack,pointerEvents:"none","&-success":{color:e.colorSuccess},"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning},"&-validating":{color:e.colorPrimary}}})}},w=e=>{const{componentCls:t,formItemCls:n}=e;return{[`${t}-horizontal`]:{[`${n}-label`]:{flexGrow:0},[`${n}-control`]:{flex:"1 1 0",minWidth:0},[`${n}-label[class$='-24'], ${n}-label[class*='-24 ']`]:{[`& + ${n}-control`]:{minWidth:"unset"}}}}},x=e=>{const{componentCls:t,formItemCls:n}=e;return{[`${t}-inline`]:{display:"flex",flexWrap:"wrap",[n]:{flex:"none",marginInlineEnd:e.margin,marginBottom:0,"&-row":{flexWrap:"nowrap"},[`> ${n}-label,\n > ${n}-control`]:{display:"inline-block",verticalAlign:"top"},[`> ${n}-label`]:{flex:"none"},[`${t}-text`]:{display:"inline-block"},[`${n}-has-feedback`]:{display:"inline-block"}}}}},k=e=>({padding:e.verticalLabelPadding,margin:e.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),S=e=>{const{componentCls:t,formItemCls:n,rootPrefixCls:i}=e;return{[`${n} ${n}-label`]:k(e),[t]:{[n]:{flexWrap:"wrap",[`${n}-label, ${n}-control`]:{[`&:not([class*=" ${i}-col-xs"])`]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},E=e=>{const{componentCls:t,formItemCls:n,rootPrefixCls:i}=e;return{[`${t}-vertical`]:{[n]:{"&-row":{flexDirection:"column"},"&-label > label":{height:"auto"},[`${t}-item-control`]:{width:"100%"}}},[`${t}-vertical ${n}-label,\n .${i}-col-24${n}-label,\n .${i}-col-xl-24${n}-label`]:k(e),[`@media (max-width: ${e.screenXSMax}px)`]:[S(e),{[t]:{[`.${i}-col-xs-24${n}-label`]:k(e)}}],[`@media (max-width: ${e.screenSMMax}px)`]:{[t]:{[`.${i}-col-sm-24${n}-label`]:k(e)}},[`@media (max-width: ${e.screenMDMax}px)`]:{[t]:{[`.${i}-col-md-24${n}-label`]:k(e)}},[`@media (max-width: ${e.screenLGMax}px)`]:{[t]:{[`.${i}-col-lg-24${n}-label`]:k(e)}}}},C=(e,t)=>(0,f.TS)(e,{formItemCls:`${e.componentCls}-item`,rootPrefixCls:t});var T=(0,m.Z)("Form",((e,t)=>{let{rootPrefixCls:n}=t;const i=C(e,n);return[y(i),_(i),g(i),w(i),x(i),E(i),(0,p.Z)(i),h.kr]}),(e=>({labelRequiredMarkColor:e.colorError,labelColor:e.colorTextHeading,labelFontSize:e.fontSize,labelHeight:e.controlHeight,labelColonMarginInlineStart:e.marginXXS/2,labelColonMarginInlineEnd:e.marginXS,itemMarginBottom:e.marginLG,verticalLabelPadding:`0 0 ${e.paddingXS}px`,verticalLabelMargin:0})),{order:-1e3});const A=[];function M(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{key:"string"==typeof e?e:`${t}-${i}`,error:e,errorStatus:n}}var L=e=>{let{help:t,helpStatus:n,errors:r=A,warnings:d=A,className:h,fieldId:p,onVisibleChanged:f}=e;const{prefixCls:m}=o.useContext(c.Rk),g=`${m}-item-explain`,[,v]=T(m),b=(0,o.useMemo)((()=>(0,l.Z)(m)),[m]),y=u(r),_=u(d),w=o.useMemo((()=>null!=t?[M(t,"help",n)]:[].concat((0,i.Z)(y.map(((e,t)=>M(e,"error","error",t)))),(0,i.Z)(_.map(((e,t)=>M(e,"warning","warning",t)))))),[t,n,y,_]),x={};return p&&(x.id=`${p}_help`),o.createElement(s.ZP,{motionDeadline:b.motionDeadline,motionName:`${m}-show-help`,visible:!!w.length,onVisibleChanged:f},(e=>{const{className:t,style:n}=e;return o.createElement("div",Object.assign({},x,{className:a()(g,t,h,v),style:n,role:"alert"}),o.createElement(s.V4,Object.assign({keys:w},(0,l.Z)(m),{motionName:`${m}-show-help-item`,component:!1}),(e=>{const{key:t,error:n,errorStatus:i,className:r,style:s}=e;return o.createElement("div",{key:t,className:a()(r,{[`${g}-${i}`]:i}),style:s},n)})))}))},D=n(95013),I=n(36355),R=n(1684),P=n(52946),O=n(19716);const N=e=>"object"==typeof e&&null!=e&&1===e.nodeType,B=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,$=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return B(n.overflowY,t)||B(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},F=(e,t,n,i,r,a,s,o)=>a<e&&s>t||a>e&&s<t?0:a<=e&&o<=n||s>=t&&o>=n?a-e-i:s>t&&o<n||a<e&&o>n?s-t+r:0,z=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t},K=(e,t)=>{var n,i,r,a;if("undefined"==typeof document)return[];const{scrollMode:s,block:o,inline:l,boundary:c,skipOverflowHiddenElements:u}=t,d="function"==typeof c?c:e=>e!==c;if(!N(e))throw new TypeError("Invalid target");const h=document.scrollingElement||document.documentElement,p=[];let f=e;for(;N(f)&&d(f);){if(f=z(f),f===h){p.push(f);break}null!=f&&f===document.body&&$(f)&&!$(document.documentElement)||null!=f&&$(f,u)&&p.push(f)}const m=null!=(i=null==(n=window.visualViewport)?void 0:n.width)?i:innerWidth,g=null!=(a=null==(r=window.visualViewport)?void 0:r.height)?a:innerHeight,{scrollX:v,scrollY:b}=window,{height:y,width:_,top:w,right:x,bottom:k,left:S}=e.getBoundingClientRect(),{top:E,right:C,bottom:T,left:A}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let M="start"===o||"nearest"===o?w-E:"end"===o?k+T:w+y/2-E+T,L="center"===l?S+_/2-A+C:"end"===l?x+C:S-A;const D=[];for(let e=0;e<p.length;e++){const t=p[e],{height:n,width:i,top:r,right:a,bottom:c,left:u}=t.getBoundingClientRect();if("if-needed"===s&&w>=0&&S>=0&&k<=g&&x<=m&&(t===h&&!$(t)||w>=r&&k<=c&&S>=u&&x<=a))return D;const d=getComputedStyle(t),f=parseInt(d.borderLeftWidth,10),E=parseInt(d.borderTopWidth,10),C=parseInt(d.borderRightWidth,10),T=parseInt(d.borderBottomWidth,10);let A=0,I=0;const R="offsetWidth"in t?t.offsetWidth-t.clientWidth-f-C:0,P="offsetHeight"in t?t.offsetHeight-t.clientHeight-E-T:0,O="offsetWidth"in t?0===t.offsetWidth?0:i/t.offsetWidth:0,N="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(h===t)A="start"===o?M:"end"===o?M-g:"nearest"===o?F(b,b+g,g,E,T,b+M,b+M+y,y):M-g/2,I="start"===l?L:"center"===l?L-m/2:"end"===l?L-m:F(v,v+m,m,f,C,v+L,v+L+_,_),A=Math.max(0,A+b),I=Math.max(0,I+v);else{A="start"===o?M-r-E:"end"===o?M-c+T+P:"nearest"===o?F(r,c,n,E,T+P,M,M+y,y):M-(r+n/2)+P/2,I="start"===l?L-u-f:"center"===l?L-(u+i/2)+R/2:"end"===l?L-a+C+R:F(u,a,i,f,C+R,L,L+_,_);const{scrollLeft:e,scrollTop:s}=t;A=0===N?0:Math.max(0,Math.min(s+A/N,t.scrollHeight-n/N+P)),I=0===O?0:Math.max(0,Math.min(e+I/O,t.scrollWidth-i/O+R)),M+=s-A,L+=e-I}D.push({el:t,top:A,left:I})}return D};function U(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;const n=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>"object"==typeof e&&"function"==typeof e.behavior)(t))return t.behavior(K(e,t));const i="boolean"==typeof t||null==t?void 0:t.behavior;for(const{el:r,top:a,left:s}of K(e,(e=>!1===e?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&0!==Object.keys(e).length)(e)?e:{block:"start",inline:"nearest"})(t))){const e=a-n.top+n.bottom,t=s-n.left+n.right;r.scroll({top:e,left:t,behavior:i})}}const j=["parentNode"];function q(e){return void 0===e||!1===e?[]:Array.isArray(e)?e:[e]}function H(e,t){if(!e.length)return;const n=e.join("_");if(t)return`${t}_${n}`;return j.includes(n)?`form_item_${n}`:n}function V(e,t,n,i,r,a){let s=i;return void 0!==a?s=a:n.validating?s="validating":e.length?s="error":t.length?s="warning":(n.touched||r&&n.validated)&&(s="success"),s}function G(e){return q(e).join("_")}function Z(e){const[t]=(0,D.cI)(),n=o.useRef({}),i=o.useMemo((()=>null!=e?e:Object.assign(Object.assign({},t),{__INTERNAL__:{itemRef:e=>t=>{const i=G(e);t?n.current[i]=t:delete n.current[i]}},scrollToField:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=q(e),r=H(n,i.__INTERNAL__.name),a=r?document.getElementById(r):null;a&&U(a,Object.assign({scrollMode:"if-needed",block:"nearest"},t))},getFieldInstance:e=>{const t=G(e);return n.current[t]}})),[e,t]);return[i]}var W=n(28726),Y=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};const X=(e,t)=>{const n=o.useContext(R.Z),{getPrefixCls:i,direction:r,form:s}=o.useContext(I.E_),{prefixCls:l,className:u,rootClassName:d,size:h,disabled:p=n,form:f,colon:m,labelAlign:g,labelWrap:v,labelCol:b,wrapperCol:y,hideRequiredMark:_,layout:w="horizontal",scrollToFirstError:x,requiredMark:k,onFinishFailed:S,name:E,style:C,feedbackIcons:A}=e,M=Y(e,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons"]),L=(0,O.Z)(h),N=o.useContext(W.Z);const B=(0,o.useMemo)((()=>void 0!==k?k:s&&void 0!==s.requiredMark?s.requiredMark:!_),[_,k,s]),$=null!=m?m:null==s?void 0:s.colon,F=i("form",l),[z,K]=T(F),U=a()(F,`${F}-${w}`,{[`${F}-hide-required-mark`]:!1===B,[`${F}-rtl`]:"rtl"===r,[`${F}-${L}`]:L},K,null==s?void 0:s.className,u,d),[j]=Z(f),{__INTERNAL__:q}=j;q.name=E;const H=(0,o.useMemo)((()=>({name:E,labelAlign:g,labelCol:b,labelWrap:v,wrapperCol:y,vertical:"vertical"===w,colon:$,requiredMark:B,itemRef:q.itemRef,form:j,feedbackIcons:A})),[E,g,b,y,w,$,B,j,A]);o.useImperativeHandle(t,(()=>j));const V=(e,t)=>{if(e){let n={block:"nearest"};"object"==typeof e&&(n=e),j.scrollToField(t,n)}};return z(o.createElement(R.n,{disabled:p},o.createElement(P.q,{size:L},o.createElement(c.RV,Object.assign({},{validateMessages:N}),o.createElement(c.q3.Provider,{value:H},o.createElement(D.ZP,Object.assign({id:E},M,{name:E,onFinishFailed:e=>{if(null==S||S(e),e.errorFields.length){const t=e.errorFields[0].name;if(void 0!==x)return void V(x,t);s&&void 0!==s.scrollToFirstError&&V(s.scrollToFirstError,t)}},form:j,style:Object.assign(Object.assign({},null==s?void 0:s.style),C),className:U})))))))};var J=o.forwardRef(X),Q=n(41799),ee=n(8654),te=n(92343),ne=n(11592);const ie=()=>{const{status:e,errors:t=[],warnings:n=[]}=(0,o.useContext)(c.aM);return{status:e,errors:t,warnings:n}};ie.Context=c.aM;var re=ie,ae=n(16089);var se=n(29194),oe=n(34280),le=n(2738),ce=n(27382),ue=n(37028);const de=e=>{const{formItemCls:t}=e;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${t}-control`]:{display:"flex"}}}};var he=(0,m.b)(["Form","item-item"],((e,t)=>{let{rootPrefixCls:n}=t;const i=C(e,n);return[de(i)]}));var pe=e=>{const{prefixCls:t,status:n,wrapperCol:i,children:r,errors:s,warnings:l,_internalItemRender:u,extra:d,help:h,fieldId:p,marginBottom:f,onErrorVisibleChanged:m}=e,g=`${t}-item`,v=o.useContext(c.q3),b=i||v.wrapperCol||{},y=a()(`${g}-control`,b.className),_=o.useMemo((()=>Object.assign({},v)),[v]);delete _.labelCol,delete _.wrapperCol;const w=o.createElement("div",{className:`${g}-control-input`},o.createElement("div",{className:`${g}-control-input-content`},r)),x=o.useMemo((()=>({prefixCls:t,status:n})),[t,n]),k=null!==f||s.length||l.length?o.createElement("div",{style:{display:"flex",flexWrap:"nowrap"}},o.createElement(c.Rk.Provider,{value:x},o.createElement(L,{fieldId:p,errors:s,warnings:l,help:h,helpStatus:n,className:`${g}-explain-connected`,onVisibleChanged:m})),!!f&&o.createElement("div",{style:{width:0,height:f}})):null,S={};p&&(S.id=`${p}_extra`);const E=d?o.createElement("div",Object.assign({},S,{className:`${g}-extra`}),d):null,C=u&&"pro_table_render"===u.mark&&u.render?u.render(e,{input:w,errorList:k,extra:E}):o.createElement(o.Fragment,null,w,k,E);return o.createElement(c.q3.Provider,{value:_},o.createElement(ue.Z,Object.assign({},b,{className:y}),C),o.createElement(he,{prefixCls:t}))},fe=n(14809),me={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},ge=n(7657),ve=function(e,t){return o.createElement(ge.Z,(0,fe.Z)({},e,{ref:t,icon:me}))};var be=o.forwardRef(ve),ye=n(41412),_e=n(9763),we=n(6848),xe=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};var ke=e=>{let{prefixCls:t,label:n,htmlFor:i,labelCol:r,labelAlign:s,colon:l,required:u,requiredMark:d,tooltip:h}=e;var p;const[f]=(0,_e.Z)("Form"),{vertical:m,labelAlign:g,labelCol:v,labelWrap:b,colon:y}=o.useContext(c.q3);if(!n)return null;const _=r||v||{},w=s||g,x=`${t}-item-label`,k=a()(x,"left"===w&&`${x}-left`,_.className,{[`${x}-wrap`]:!!b});let S=n;const E=!0===l||!1!==y&&!1!==l;E&&!m&&"string"==typeof n&&""!==n.trim()&&(S=n.replace(/[:|:]\s*$/,""));const C=function(e){return e?"object"!=typeof e||o.isValidElement(e)?{title:e}:e:null}(h);if(C){const{icon:e=o.createElement(be,null)}=C,n=xe(C,["icon"]),i=o.createElement(we.Z,Object.assign({},n),o.cloneElement(e,{className:`${t}-item-tooltip`,title:""}));S=o.createElement(o.Fragment,null,S,i)}const T="optional"===d,A="function"==typeof d;A?S=d(S,{required:!!u}):T&&!u&&(S=o.createElement(o.Fragment,null,S,o.createElement("span",{className:`${t}-item-optional`,title:""},(null==f?void 0:f.optional)||(null===(p=ye.Z.Form)||void 0===p?void 0:p.optional))));const M=a()({[`${t}-item-required`]:u,[`${t}-item-required-mark-optional`]:T||A,[`${t}-item-no-colon`]:!E});return o.createElement(ue.Z,Object.assign({},_,{className:k}),o.createElement("label",{htmlFor:i,className:M,title:"string"==typeof n?n:""},S))},Se=n(29679),Ee=n(19248),Ce=n(96512),Te=n(58617);const Ae={success:Se.Z,warning:Ce.Z,error:Ee.Z,validating:Te.Z};function Me(e){let{children:t,errors:n,warnings:i,hasFeedback:r,validateStatus:s,prefixCls:l,meta:u,noStyle:d}=e;const h=`${l}-item`,{feedbackIcons:p}=o.useContext(c.q3),f=V(n,i,u,null,!!r,s),{isFormItemInput:m,status:g}=o.useContext(c.aM),v=o.useMemo((()=>{var e;let t;if(r){const s=!0!==r&&r.icons||p,l=f&&(null===(e=null==s?void 0:s({status:f,errors:n,warnings:i}))||void 0===e?void 0:e[f]),c=f&&Ae[f];t=!1!==l&&c?o.createElement("span",{className:a()(`${h}-feedback-icon`,`${h}-feedback-icon-${f}`)},l||o.createElement(c,null)):null}let s=!0,l=f||"";return d&&(s=m,l=(null!=f?f:g)||""),{status:l,errors:n,warnings:i,hasFeedback:!!r,feedbackIcon:t,isFormItemInput:s}}),[f,r,d,m,g]);return o.createElement(c.aM.Provider,{value:v},t)}var Le=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function De(e){const{prefixCls:t,className:n,rootClassName:i,style:r,help:s,errors:l,warnings:d,validateStatus:h,meta:p,hasFeedback:f,hidden:m,children:g,fieldId:v,required:b,isRequired:y,onSubItemMetaChange:_}=e,w=Le(e,["prefixCls","className","rootClassName","style","help","errors","warnings","validateStatus","meta","hasFeedback","hidden","children","fieldId","required","isRequired","onSubItemMetaChange"]),x=`${t}-item`,{requiredMark:k}=o.useContext(c.q3),S=o.useRef(null),E=u(l),C=u(d),T=null!=s,A=!!(T||l.length||d.length),M=!!S.current&&(0,se.Z)(S.current),[L,D]=o.useState(null);(0,oe.Z)((()=>{if(A&&S.current){const e=getComputedStyle(S.current);D(parseInt(e.marginBottom,10))}}),[A,M]);const I=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=e?E:p.errors,n=e?C:p.warnings;return V(t,n,p,"",!!f,h)}(),R=a()(x,n,i,{[`${x}-with-help`]:T||E.length||C.length,[`${x}-has-feedback`]:I&&f,[`${x}-has-success`]:"success"===I,[`${x}-has-warning`]:"warning"===I,[`${x}-has-error`]:"error"===I,[`${x}-is-validating`]:"validating"===I,[`${x}-hidden`]:m});return o.createElement("div",{className:R,style:r,ref:S},o.createElement(ce.Z,Object.assign({className:`${x}-row`},(0,le.Z)(w,["_internalItemRender","colon","dependencies","extra","fieldKey","getValueFromEvent","getValueProps","htmlFor","id","initialValue","isListField","label","labelAlign","labelCol","labelWrap","messageVariables","name","normalize","noStyle","preserve","requiredMark","rules","shouldUpdate","trigger","tooltip","validateFirst","validateTrigger","valuePropName","wrapperCol","validateDebounce"])),o.createElement(ke,Object.assign({htmlFor:v},e,{requiredMark:k,required:null!=b?b:y,prefixCls:t})),o.createElement(pe,Object.assign({},e,p,{errors:E,warnings:C,prefixCls:t,status:I,help:s,marginBottom:L,onErrorVisibleChanged:e=>{e||D(null)}}),o.createElement(c.qI.Provider,{value:_},o.createElement(Me,{prefixCls:t,meta:p,errors:p.errors,warnings:p.warnings,hasFeedback:f,validateStatus:I},g)))),!!L&&o.createElement("div",{className:`${x}-margin-offset`,style:{marginBottom:-L}}))}const Ie=o.memo((e=>{let{children:t}=e;return t}),((e,t)=>e.value===t.value&&e.update===t.update&&e.childProps.length===t.childProps.length&&e.childProps.every(((e,n)=>e===t.childProps[n]))));const Re=function(e){const{name:t,noStyle:n,className:r,dependencies:s,prefixCls:l,shouldUpdate:u,rules:d,children:h,required:p,label:f,messageVariables:m,trigger:g="onChange",validateTrigger:v,hidden:b,help:y}=e,{getPrefixCls:_}=o.useContext(I.E_),{name:w}=o.useContext(c.q3),x=function(e){if("function"==typeof e)return e;const t=(0,ne.Z)(e);return t.length<=1?t[0]:t}(h),k="function"==typeof x,S=o.useContext(c.qI),{validateTrigger:E}=o.useContext(D.zb),C=void 0!==v?v:E,A=function(e){return!(null==e)}(t),M=_("form",l),[L,R]=T(M),P=o.useContext(D.ZM),O=o.useRef(),[N,B]=function(e){const[t,n]=o.useState(e),i=(0,o.useRef)(null),r=(0,o.useRef)([]),a=(0,o.useRef)(!1);return o.useEffect((()=>(a.current=!1,()=>{a.current=!0,ae.Z.cancel(i.current),i.current=null})),[]),[t,function(e){a.current||(null===i.current&&(r.current=[],i.current=(0,ae.Z)((()=>{i.current=null,n((e=>{let t=e;return r.current.forEach((e=>{t=e(t)})),t}))}))),r.current.push(e))}]}({}),[$,F]=(0,Q.Z)((()=>({errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}))),z=(e,t)=>{B((n=>{const r=Object.assign({},n),a=[].concat((0,i.Z)(e.name.slice(0,-1)),(0,i.Z)(t)).join("__SPLIT__");return e.destroy?delete r[a]:r[a]=e,r}))},[K,U]=o.useMemo((()=>{const e=(0,i.Z)($.errors),t=(0,i.Z)($.warnings);return Object.values(N).forEach((n=>{e.push.apply(e,(0,i.Z)(n.errors||[])),t.push.apply(t,(0,i.Z)(n.warnings||[]))})),[e,t]}),[N,$.errors,$.warnings]),j=function(){const{itemRef:e}=o.useContext(c.q3),t=o.useRef({});return function(n,i){const r=i&&"object"==typeof i&&i.ref,a=n.join("_");return t.current.name===a&&t.current.originRef===r||(t.current.name=a,t.current.originRef=r,t.current.ref=(0,ee.sQ)(e(n),r)),t.current.ref}}();function V(t,i,s){return n&&!b?o.createElement(Me,{prefixCls:M,hasFeedback:e.hasFeedback,validateStatus:e.validateStatus,meta:$,errors:K,warnings:U,noStyle:!0},t):o.createElement(De,Object.assign({key:"row"},e,{className:a()(r,R),prefixCls:M,fieldId:i,isRequired:s,errors:K,warnings:U,meta:$,onSubItemMetaChange:z}),t)}if(!A&&!k&&!s)return L(V(x));let G={};return"string"==typeof f?G.label=f:t&&(G.label=String(t)),m&&(G=Object.assign(Object.assign({},G),m)),L(o.createElement(D.gN,Object.assign({},e,{messageVariables:G,trigger:g,validateTrigger:C,onMetaChange:e=>{const t=null==P?void 0:P.getKey(e.name);if(F(e.destroy?{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}:e,!0),n&&!1!==y&&S){let n=e.name;if(e.destroy)n=O.current||n;else if(void 0!==t){const[e,r]=t;n=[e].concat((0,i.Z)(r)),O.current=n}S(e,n)}}}),((n,r,a)=>{const l=q(t).length&&r?r.name:[],c=H(l,w),h=void 0!==p?p:!(!d||!d.some((e=>{if(e&&"object"==typeof e&&e.required&&!e.warningOnly)return!0;if("function"==typeof e){const t=e(a);return t&&t.required&&!t.warningOnly}return!1}))),f=Object.assign({},n);let m=null;if(Array.isArray(x)&&A)m=x;else if(k&&(!u&&!s||A));else if(!s||k||A)if((0,te.l$)(x)){const t=Object.assign(Object.assign({},x.props),f);if(t.id||(t.id=c),y||K.length>0||U.length>0||e.extra){const n=[];(y||K.length>0)&&n.push(`${c}_help`),e.extra&&n.push(`${c}_extra`),t["aria-describedby"]=n.join(" ")}K.length>0&&(t["aria-invalid"]="true"),h&&(t["aria-required"]="true"),(0,ee.Yr)(x)&&(t.ref=j(l,x));new Set([].concat((0,i.Z)(q(g)),(0,i.Z)(q(C)))).forEach((e=>{t[e]=function(){for(var t,n,i,r,a,s=arguments.length,o=new Array(s),l=0;l<s;l++)o[l]=arguments[l];null===(i=f[e])||void 0===i||(t=i).call.apply(t,[f].concat(o)),null===(a=(r=x.props)[e])||void 0===a||(n=a).call.apply(n,[r].concat(o))}}));const n=[t["aria-required"],t["aria-invalid"],t["aria-describedby"]];m=o.createElement(Ie,{value:f[e.valuePropName||"value"],update:x,childProps:n},(0,te.Tm)(x,t))}else m=k&&(u||s)&&!A?x(a):x;else;return V(m,c,h)})))};Re.useStatus=re;var Pe=Re,Oe=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};var Ne=e=>{var{prefixCls:t,children:n}=e,i=Oe(e,["prefixCls","children"]);const{getPrefixCls:r}=o.useContext(I.E_),a=r("form",t),s=o.useMemo((()=>({prefixCls:a,status:"error"})),[a]);return o.createElement(D.aV,Object.assign({},i),((e,t,i)=>o.createElement(c.Rk.Provider,{value:s},n(e.map((e=>Object.assign(Object.assign({},e),{fieldKey:e.key}))),t,{errors:i.errors,warnings:i.warnings}))))};const Be=J;Be.Item=Pe,Be.List=Ne,Be.ErrorList=L,Be.useForm=Z,Be.useFormInstance=function(){const{form:e}=(0,o.useContext)(c.q3);return e},Be.useWatch=D.qo,Be.Provider=c.RV,Be.create=()=>{};var $e=Be},6700:function(e,t,n){"use strict";const i=(0,n(59301).createContext)({});t.Z=i},37028:function(e,t,n){"use strict";var i=n(59301),r=n(92310),a=n.n(r),s=n(36355),o=n(6700),l=n(98242),c=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};const u=["xs","sm","md","lg","xl","xxl"],d=i.forwardRef(((e,t)=>{const{getPrefixCls:n,direction:r}=i.useContext(s.E_),{gutter:d,wrap:h}=i.useContext(o.Z),{prefixCls:p,span:f,order:m,offset:g,push:v,pull:b,className:y,children:_,flex:w,style:x}=e,k=c(e,["prefixCls","span","order","offset","push","pull","className","children","flex","style"]),S=n("col",p),[E,C]=(0,l.c)(S);let T={};u.forEach((t=>{let n={};const i=e[t];"number"==typeof i?n.span=i:"object"==typeof i&&(n=i||{}),delete k[t],T=Object.assign(Object.assign({},T),{[`${S}-${t}-${n.span}`]:void 0!==n.span,[`${S}-${t}-order-${n.order}`]:n.order||0===n.order,[`${S}-${t}-offset-${n.offset}`]:n.offset||0===n.offset,[`${S}-${t}-push-${n.push}`]:n.push||0===n.push,[`${S}-${t}-pull-${n.pull}`]:n.pull||0===n.pull,[`${S}-${t}-flex-${n.flex}`]:n.flex||"auto"===n.flex,[`${S}-rtl`]:"rtl"===r})}));const A=a()(S,{[`${S}-${f}`]:void 0!==f,[`${S}-order-${m}`]:m,[`${S}-offset-${g}`]:g,[`${S}-push-${v}`]:v,[`${S}-pull-${b}`]:b},y,T,C),M={};if(d&&d[0]>0){const e=d[0]/2;M.paddingLeft=e,M.paddingRight=e}return w&&(M.flex=function(e){return"number"==typeof e?`${e} ${e} auto`:/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?`0 0 ${e}`:e}(w),!1!==h||M.minWidth||(M.minWidth=0)),E(i.createElement("div",Object.assign({},k,{style:Object.assign(Object.assign({},M),x),className:A,ref:t}),_))}));t.Z=d},8628:function(e,t,n){"use strict";var i=n(59301),r=n(34280),a=n(56762),s=n(69507);t.Z=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=(0,i.useRef)({}),n=(0,a.Z)(),o=(0,s.ZP)();return(0,r.Z)((()=>{const i=o.subscribe((i=>{t.current=i,e&&n()}));return()=>o.unsubscribe(i)}),[]),t.current}},27382:function(e,t,n){"use strict";var i=n(59301),r=n(92310),a=n.n(r),s=n(69507),o=n(36355),l=n(6700),c=n(98242),u=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function d(e,t){const[n,r]=i.useState("string"==typeof e?e:"");return i.useEffect((()=>{(()=>{if("string"==typeof e&&r(e),"object"==typeof e)for(let n=0;n<s.c4.length;n++){const i=s.c4[n];if(!t[i])continue;const a=e[i];if(void 0!==a)return void r(a)}})()}),[JSON.stringify(e),t]),n}const h=i.forwardRef(((e,t)=>{const{prefixCls:n,justify:r,align:h,className:p,style:f,children:m,gutter:g=0,wrap:v}=e,b=u(e,["prefixCls","justify","align","className","style","children","gutter","wrap"]),{getPrefixCls:y,direction:_}=i.useContext(o.E_),[w,x]=i.useState({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),[k,S]=i.useState({xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}),E=d(h,k),C=d(r,k),T=i.useRef(g),A=(0,s.ZP)();i.useEffect((()=>{const e=A.subscribe((e=>{S(e);const t=T.current||0;(!Array.isArray(t)&&"object"==typeof t||Array.isArray(t)&&("object"==typeof t[0]||"object"==typeof t[1]))&&x(e)}));return()=>A.unsubscribe(e)}),[]);const M=y("row",n),[L,D]=(0,c.V)(M),I=(()=>{const e=[void 0,void 0];return(Array.isArray(g)?g:[g,void 0]).forEach(((t,n)=>{if("object"==typeof t)for(let i=0;i<s.c4.length;i++){const r=s.c4[i];if(w[r]&&void 0!==t[r]){e[n]=t[r];break}}else e[n]=t})),e})(),R=a()(M,{[`${M}-no-wrap`]:!1===v,[`${M}-${C}`]:C,[`${M}-${E}`]:E,[`${M}-rtl`]:"rtl"===_},p,D),P={},O=null!=I[0]&&I[0]>0?I[0]/-2:void 0;O&&(P.marginLeft=O,P.marginRight=O),[,P.rowGap]=I;const[N,B]=I,$=i.useMemo((()=>({gutter:[N,B],wrap:v})),[N,B,v]);return L(i.createElement(l.Z.Provider,{value:$},i.createElement("div",Object.assign({},b,{className:R,style:Object.assign(Object.assign({},P),f),ref:t}),m)))}));t.Z=h},98242:function(e,t,n){"use strict";n.d(t,{V:function(){return l},c:function(){return c}});var i=n(83116),r=n(37613);const a=e=>{const{componentCls:t}=e;return{[t]:{display:"flex",flexFlow:"row wrap",minWidth:0,"&::before, &::after":{display:"flex"},"&-no-wrap":{flexWrap:"nowrap"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"},"&-space-between":{justifyContent:"space-between"},"&-space-around":{justifyContent:"space-around"},"&-space-evenly":{justifyContent:"space-evenly"},"&-top":{alignItems:"flex-start"},"&-middle":{alignItems:"center"},"&-bottom":{alignItems:"flex-end"}}}},s=e=>{const{componentCls:t}=e;return{[t]:{position:"relative",maxWidth:"100%",minHeight:1}}},o=(e,t)=>((e,t)=>{const{componentCls:n,gridColumns:i}=e,r={};for(let e=i;e>=0;e--)0===e?(r[`${n}${t}-${e}`]={display:"none"},r[`${n}-push-${e}`]={insetInlineStart:"auto"},r[`${n}-pull-${e}`]={insetInlineEnd:"auto"},r[`${n}${t}-push-${e}`]={insetInlineStart:"auto"},r[`${n}${t}-pull-${e}`]={insetInlineEnd:"auto"},r[`${n}${t}-offset-${e}`]={marginInlineStart:0},r[`${n}${t}-order-${e}`]={order:0}):(r[`${n}${t}-${e}`]=[{"--ant-display":"block",display:"block"},{display:"var(--ant-display)",flex:`0 0 ${e/i*100}%`,maxWidth:e/i*100+"%"}],r[`${n}${t}-push-${e}`]={insetInlineStart:e/i*100+"%"},r[`${n}${t}-pull-${e}`]={insetInlineEnd:e/i*100+"%"},r[`${n}${t}-offset-${e}`]={marginInlineStart:e/i*100+"%"},r[`${n}${t}-order-${e}`]={order:e});return r})(e,t),l=(0,i.Z)("Grid",(e=>[a(e)])),c=(0,i.Z)("Grid",(e=>{const t=(0,r.TS)(e,{gridColumns:24}),n={"-sm":t.screenSMMin,"-md":t.screenMDMin,"-lg":t.screenLGMin,"-xl":t.screenXLMin,"-xxl":t.screenXXLMin};return[s(t),o(t,""),o(t,"-xs"),Object.keys(n).map((e=>((e,t,n)=>({[`@media (min-width: ${t}px)`]:Object.assign({},o(e,n))}))(t,n[e],e))).reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{})]}))},31060:function(e,t,n){"use strict";n.d(t,{Z:function(){return he}});var i=n(84105),r=n(14809),a=n(59301),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},o=n(7657),l=function(e,t){return a.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:s}))};var c=a.forwardRef(l),u=n(92310),d=n.n(u),h=n(4635),p=n(93664),f=n(50298),m=n(62646),g=n(99153),v=n(84851);function b(){return"function"==typeof BigInt}function y(e){return!e&&0!==e&&!Number.isNaN(e)||!String(e).trim()}function _(e){var t=e.trim(),n=t.startsWith("-");n&&(t=t.slice(1)),(t=t.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,"")).startsWith(".")&&(t="0".concat(t));var i=t||"0",r=i.split("."),a=r[0]||"0",s=r[1]||"0";"0"===a&&"0"===s&&(n=!1);var o=n?"-":"";return{negative:n,negativeStr:o,trimStr:i,integerStr:a,decimalStr:s,fullStr:"".concat(o).concat(i)}}function w(e){var t=String(e);return!Number.isNaN(Number(t))&&t.includes("e")}function x(e){var t=String(e);if(w(e)){var n=Number(t.slice(t.indexOf("e-")+2)),i=t.match(/\.(\d+)/);return null!=i&&i[1]&&(n+=i[1].length),n}return t.includes(".")&&S(t)?t.length-t.indexOf(".")-1:0}function k(e){var t=String(e);if(w(e)){if(e>Number.MAX_SAFE_INTEGER)return String(b()?BigInt(e).toString():Number.MAX_SAFE_INTEGER);if(e<Number.MIN_SAFE_INTEGER)return String(b()?BigInt(e).toString():Number.MIN_SAFE_INTEGER);t=e.toFixed(x(t))}return _(t).fullStr}function S(e){return"number"==typeof e?!Number.isNaN(e):!!e&&(/^\s*-?\d+(\.\d+)?\s*$/.test(e)||/^\s*-?\d+\.\s*$/.test(e)||/^\s*-?\.\d+\s*$/.test(e))}var E=function(){function e(t){if((0,g.Z)(this,e),(0,h.Z)(this,"origin",""),(0,h.Z)(this,"negative",void 0),(0,h.Z)(this,"integer",void 0),(0,h.Z)(this,"decimal",void 0),(0,h.Z)(this,"decimalLen",void 0),(0,h.Z)(this,"empty",void 0),(0,h.Z)(this,"nan",void 0),y(t))this.empty=!0;else if(this.origin=String(t),"-"===t||Number.isNaN(t))this.nan=!0;else{var n=t;if(w(n)&&(n=Number(n)),S(n="string"==typeof n?n:k(n))){var i=_(n);this.negative=i.negative;var r=i.trimStr.split(".");this.integer=BigInt(r[0]);var a=r[1]||"0";this.decimal=BigInt(a),this.decimalLen=a.length}else this.nan=!0}}return(0,v.Z)(e,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(e){var t="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(e,"0"));return BigInt(t)}},{key:"negate",value:function(){var t=new e(this.toString());return t.negative=!t.negative,t}},{key:"cal",value:function(t,n,i){var r=Math.max(this.getDecimalStr().length,t.getDecimalStr().length),a=n(this.alignDecimal(r),t.alignDecimal(r)).toString(),s=i(r),o=_(a),l=o.negativeStr,c=o.trimStr,u="".concat(l).concat(c.padStart(s+1,"0"));return new e("".concat(u.slice(0,-s),".").concat(u.slice(-s)))}},{key:"add",value:function(t){if(this.isInvalidate())return new e(t);var n=new e(t);return n.isInvalidate()?this:this.cal(n,(function(e,t){return e+t}),(function(e){return e}))}},{key:"multi",value:function(t){var n=new e(t);return this.isInvalidate()||n.isInvalidate()?new e(NaN):this.cal(n,(function(e,t){return e*t}),(function(e){return 2*e}))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(e){return this.toString()===(null==e?void 0:e.toString())}},{key:"lessEquals",value:function(e){return this.add(e.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return e?this.isInvalidate()?"":_("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),e}(),C=function(){function e(t){(0,g.Z)(this,e),(0,h.Z)(this,"origin",""),(0,h.Z)(this,"number",void 0),(0,h.Z)(this,"empty",void 0),y(t)?this.empty=!0:(this.origin=String(t),this.number=Number(t))}return(0,v.Z)(e,[{key:"negate",value:function(){return new e(-this.toNumber())}},{key:"add",value:function(t){if(this.isInvalidate())return new e(t);var n=Number(t);if(Number.isNaN(n))return this;var i=this.number+n;if(i>Number.MAX_SAFE_INTEGER)return new e(Number.MAX_SAFE_INTEGER);if(i<Number.MIN_SAFE_INTEGER)return new e(Number.MIN_SAFE_INTEGER);var r=Math.max(x(this.number),x(n));return new e(i.toFixed(r))}},{key:"multi",value:function(t){var n=Number(t);if(this.isInvalidate()||Number.isNaN(n))return new e(NaN);var i=this.number*n;if(i>Number.MAX_SAFE_INTEGER)return new e(Number.MAX_SAFE_INTEGER);if(i<Number.MIN_SAFE_INTEGER)return new e(Number.MIN_SAFE_INTEGER);var r=Math.max(x(this.number),x(n));return new e(i.toFixed(r))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return Number.isNaN(this.number)}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(e){return this.toNumber()===(null==e?void 0:e.toNumber())}},{key:"lessEquals",value:function(e){return this.add(e.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return e?this.isInvalidate()?"":k(this.number):this.origin}}]),e}();function T(e){return b()?new E(e):new C(e)}function A(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(""===e)return"";var r=_(e),a=r.negativeStr,s=r.integerStr,o=r.decimalStr,l="".concat(t).concat(o),c="".concat(a).concat(s);if(n>=0){var u=Number(o[n]);if(u>=5&&!i){var d=T(e).add("".concat(a,"0.").concat("0".repeat(n)).concat(10-u));return A(d.toString(),t,n,i)}return 0===n?c:"".concat(c).concat(t).concat(o.padEnd(n,"0").slice(0,n))}return".0"===l?c:"".concat(c).concat(l)}var M=T,L=n(93681),D=n(34280),I=n(8654),R=n(48736);var P=n(49658),O=function(){var e=(0,a.useState)(!1),t=(0,f.Z)(e,2),n=t[0],i=t[1];return(0,D.Z)((function(){i((0,P.Z)())}),[]),n},N=n(16089);function B(e){var t=e.prefixCls,n=e.upNode,i=e.downNode,s=e.upDisabled,o=e.downDisabled,l=e.onStep,c=a.useRef(),u=a.useRef([]),p=a.useRef();p.current=l;var f=function(){clearTimeout(c.current)},m=function(e,t){e.preventDefault(),f(),p.current(t),c.current=setTimeout((function e(){p.current(t),c.current=setTimeout(e,200)}),600)};if(a.useEffect((function(){return function(){f(),u.current.forEach((function(e){return N.Z.cancel(e)}))}}),[]),O())return null;var g="".concat(t,"-handler"),v=d()(g,"".concat(g,"-up"),(0,h.Z)({},"".concat(g,"-up-disabled"),s)),b=d()(g,"".concat(g,"-down"),(0,h.Z)({},"".concat(g,"-down-disabled"),o)),y=function(){return u.current.push((0,N.Z)(f))},_={unselectable:"on",role:"button",onMouseUp:y,onMouseLeave:y};return a.createElement("div",{className:"".concat(g,"-wrap")},a.createElement("span",(0,r.Z)({},_,{onMouseDown:function(e){m(e,!0)},"aria-label":"Increase Value","aria-disabled":s,className:v}),n||a.createElement("span",{unselectable:"on",className:"".concat(t,"-handler-up-inner")})),a.createElement("span",(0,r.Z)({},_,{onMouseDown:function(e){m(e,!1)},"aria-label":"Decrease Value","aria-disabled":o,className:b}),i||a.createElement("span",{unselectable:"on",className:"".concat(t,"-handler-down-inner")})))}function $(e){var t="number"==typeof e?k(e):_(e).fullStr;return t.includes(".")?_(t.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:e+"0"}var F=n(5643),z=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],K=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","classes","className","classNames"],U=function(e,t){return e||t.isEmpty()?t.toString():t.toNumber()},j=function(e){var t=M(e);return t.isInvalidate()?null:t},q=a.forwardRef((function(e,t){var n,i=e.prefixCls,s=void 0===i?"rc-input-number":i,o=e.className,l=e.style,c=e.min,u=e.max,g=e.step,v=void 0===g?1:g,b=e.defaultValue,y=e.value,_=e.disabled,w=e.readOnly,E=e.upHandler,C=e.downHandler,T=e.keyboard,L=e.controls,P=void 0===L||L,O=e.classNames,F=e.stringMode,K=e.parser,q=e.formatter,H=e.precision,V=e.decimalSeparator,G=e.onChange,Z=e.onInput,W=e.onPressEnter,Y=e.onStep,X=(0,m.Z)(e,z),J="".concat(s,"-input"),Q=a.useRef(null),ee=a.useState(!1),te=(0,f.Z)(ee,2),ne=te[0],ie=te[1],re=a.useRef(!1),ae=a.useRef(!1),se=a.useRef(!1),oe=a.useState((function(){return M(null!=y?y:b)})),le=(0,f.Z)(oe,2),ce=le[0],ue=le[1];var de=a.useCallback((function(e,t){if(!t)return H>=0?H:Math.max(x(e),x(v))}),[H,v]),he=a.useCallback((function(e){var t=String(e);if(K)return K(t);var n=t;return V&&(n=n.replace(V,".")),n.replace(/[^\w.-]+/g,"")}),[K,V]),pe=a.useRef(""),fe=a.useCallback((function(e,t){if(q)return q(e,{userTyping:t,input:String(pe.current)});var n="number"==typeof e?k(e):e;if(!t){var i=de(n,t);if(S(n)&&(V||i>=0))n=A(n,V||".",i)}return n}),[q,de,V]),me=a.useState((function(){var e=null!=b?b:y;return ce.isInvalidate()&&["string","number"].includes((0,p.Z)(e))?Number.isNaN(e)?"":e:fe(ce.toString(),!1)})),ge=(0,f.Z)(me,2),ve=ge[0],be=ge[1];function ye(e,t){be(fe(e.isInvalidate()?e.toString(!1):e.toString(!t),t))}pe.current=ve;var _e,we,xe,ke,Se,Ee=a.useMemo((function(){return j(u)}),[u,H]),Ce=a.useMemo((function(){return j(c)}),[c,H]),Te=a.useMemo((function(){return!(!Ee||!ce||ce.isInvalidate())&&Ee.lessEquals(ce)}),[Ee,ce]),Ae=a.useMemo((function(){return!(!Ce||!ce||ce.isInvalidate())&&ce.lessEquals(Ce)}),[Ce,ce]),Me=(_e=Q.current,we=ne,xe=(0,a.useRef)(null),[function(){try{var e=_e.selectionStart,t=_e.selectionEnd,n=_e.value,i=n.substring(0,e),r=n.substring(t);xe.current={start:e,end:t,value:n,beforeTxt:i,afterTxt:r}}catch(e){}},function(){if(_e&&xe.current&&we)try{var e=_e.value,t=xe.current,n=t.beforeTxt,i=t.afterTxt,r=t.start,a=e.length;if(e.endsWith(i))a=e.length-xe.current.afterTxt.length;else if(e.startsWith(n))a=n.length;else{var s=n[r-1],o=e.indexOf(s,r-1);-1!==o&&(a=o+1)}_e.setSelectionRange(a,a)}catch(e){(0,R.ZP)(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(e.message))}}]),Le=(0,f.Z)(Me,2),De=Le[0],Ie=Le[1],Re=function(e){return Ee&&!e.lessEquals(Ee)?Ee:Ce&&!Ce.lessEquals(e)?Ce:null},Pe=function(e){return!Re(e)},Oe=function(e,t){var n,i=e,r=Pe(i)||i.isEmpty();if(i.isEmpty()||t||(i=Re(i)||i,r=!0),!w&&!_&&r){var a=i.toString(),s=de(a,t);return s>=0&&(i=M(A(a,".",s)),Pe(i)||(i=M(A(a,".",s,!0)))),i.equals(ce)||(n=i,void 0===y&&ue(n),null==G||G(i.isEmpty()?null:U(F,i)),void 0===y&&ye(i,t)),i}return ce},Ne=(ke=(0,a.useRef)(0),Se=function(){N.Z.cancel(ke.current)},(0,a.useEffect)((function(){return Se}),[]),function(e){Se(),ke.current=(0,N.Z)((function(){e()}))}),Be=function e(t){if(De(),pe.current=t,be(t),!ae.current){var n=he(t),i=M(n);i.isNaN()||Oe(i,!0)}null==Z||Z(t),Ne((function(){var n=t;K||(n=t.replace(/。/g,".")),n!==t&&e(n)}))},$e=function(e){var t;if(!(e&&Te||!e&&Ae)){re.current=!1;var n=M(se.current?$(v):v);e||(n=n.negate());var i=(ce||M(0)).add(n.toString()),r=Oe(i,!1);null==Y||Y(U(F,r),{offset:se.current?$(v):v,type:e?"up":"down"}),null===(t=Q.current)||void 0===t||t.focus()}},Fe=function(e){var t=M(he(ve)),n=t;n=t.isNaN()?Oe(ce,e):Oe(t,e),void 0!==y?ye(ce,!1):n.isNaN()||ye(n,!1)};return(0,D.o)((function(){ce.isInvalidate()||ye(ce,!1)}),[H]),(0,D.o)((function(){var e=M(y);ue(e);var t=M(he(ve));e.equals(t)&&re.current&&!q||ye(e,re.current)}),[y]),(0,D.o)((function(){q&&Ie()}),[ve]),a.createElement("div",{className:d()(s,null==O?void 0:O.input,o,(n={},(0,h.Z)(n,"".concat(s,"-focused"),ne),(0,h.Z)(n,"".concat(s,"-disabled"),_),(0,h.Z)(n,"".concat(s,"-readonly"),w),(0,h.Z)(n,"".concat(s,"-not-a-number"),ce.isNaN()),(0,h.Z)(n,"".concat(s,"-out-of-range"),!ce.isInvalidate()&&!Pe(ce)),n)),style:l,onFocus:function(){ie(!0)},onBlur:function(){Fe(!1),ie(!1),re.current=!1},onKeyDown:function(e){var t=e.key,n=e.shiftKey;re.current=!0,se.current=n,"Enter"===t&&(ae.current||(re.current=!1),Fe(!1),null==W||W(e)),!1!==T&&!ae.current&&["Up","ArrowUp","Down","ArrowDown"].includes(t)&&($e("Up"===t||"ArrowUp"===t),e.preventDefault())},onKeyUp:function(){re.current=!1,se.current=!1},onCompositionStart:function(){ae.current=!0},onCompositionEnd:function(){ae.current=!1,Be(Q.current.value)},onBeforeInput:function(){re.current=!0}},P&&a.createElement(B,{prefixCls:s,upNode:E,downNode:C,upDisabled:Te,downDisabled:Ae,onStep:$e}),a.createElement("div",{className:"".concat(J,"-wrap")},a.createElement("input",(0,r.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":c,"aria-valuemax":u,"aria-valuenow":ce.isInvalidate()?null:ce.toString(),step:v},X,{ref:(0,I.sQ)(Q,t),className:J,value:ve,onChange:function(e){Be(e.target.value)},disabled:_,readOnly:w}))))})),H=a.forwardRef((function(e,t){var n=e.disabled,i=e.style,s=e.prefixCls,o=e.value,l=e.prefix,c=e.suffix,u=e.addonBefore,d=e.addonAfter,h=e.classes,p=e.className,f=e.classNames,g=(0,m.Z)(e,K),v=a.useRef(null);return a.createElement(L.Q,{inputElement:a.createElement(q,(0,r.Z)({prefixCls:s,disabled:n,classNames:f,ref:(0,I.sQ)(v,t)},g)),className:p,triggerFocus:function(e){v.current&&(0,F.nH)(v.current,e)},prefixCls:s,value:o,disabled:n,style:i,prefix:l,suffix:c,addonAfter:d,addonBefore:u,classes:h,classNames:f,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}})}));H.displayName="InputNumber";var V=H,G=n(19080),Z=n(36355),W=n(92736),Y=n(1684),X=n(19716),J=n(32441),Q=n(33234),ee=n(9937),te=n(17313),ne=n(74207),ie=n(83116),re=n(37613);const ae=(e,t)=>{let{componentCls:n,borderRadiusSM:i,borderRadiusLG:r}=e;const a="lg"===t?r:i;return{[`&-${t}`]:{[`${n}-handler-wrap`]:{borderStartEndRadius:a,borderEndEndRadius:a},[`${n}-handler-up`]:{borderStartEndRadius:a},[`${n}-handler-down`]:{borderEndEndRadius:a}}}},se=e=>{const{componentCls:t,lineWidth:n,lineType:i,colorBorder:r,borderRadius:a,fontSizeLG:s,controlHeightLG:o,controlHeightSM:l,colorError:c,paddingInlineSM:u,colorTextDescription:d,motionDurationMid:h,handleHoverColor:p,paddingInline:f,paddingBlock:m,handleBg:g,handleActiveBg:v,colorTextDisabled:b,borderRadiusSM:y,borderRadiusLG:_,controlWidth:w,handleVisible:x,handleBorderColor:k}=e;return[{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,te.Wf)(e)),(0,ee.ik)(e)),(0,ee.bi)(e,t)),{display:"inline-block",width:w,margin:0,padding:0,border:`${n}px ${i} ${r}`,borderRadius:a,"&-rtl":{direction:"rtl",[`${t}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:s,borderRadius:_,[`input${t}-input`]:{height:o-2*n}},"&-sm":{padding:0,borderRadius:y,[`input${t}-input`]:{height:l-2*n,padding:`0 ${u}px`}},"&:hover":Object.assign({},(0,ee.pU)(e)),"&-focused":Object.assign({},(0,ee.M1)(e)),"&-out-of-range":{[`${t}-input-wrap`]:{input:{color:c}}},"&-group":Object.assign(Object.assign(Object.assign({},(0,te.Wf)(e)),(0,ee.s7)(e)),{"&-wrapper":{display:"inline-block",textAlign:"start",verticalAlign:"top",[`${t}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${t}-group-addon`]:{borderRadius:_,fontSize:e.fontSizeLG}},"&-sm":{[`${t}-group-addon`]:{borderRadius:y}},[`${t}-wrapper-disabled > ${t}-group-addon`]:Object.assign({},(0,ee.Xy)(e))}}),[`&-disabled ${t}-input`]:{cursor:"not-allowed"},[t]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},(0,te.Wf)(e)),{width:"100%",padding:`${m}px ${f}px`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:a,outline:0,transition:`all ${h} linear`,appearance:"textfield",fontSize:"inherit"}),(0,ee.nz)(e.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[t]:Object.assign(Object.assign(Object.assign({[`&:hover ${t}-handler-wrap, &-focused ${t}-handler-wrap`]:{opacity:1},[`${t}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:e.handleWidth,height:"100%",background:g,borderStartStartRadius:0,borderStartEndRadius:a,borderEndEndRadius:a,borderEndStartRadius:0,opacity:!0===x?1:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${h} linear ${h}`,[`${t}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[`\n ${t}-handler-up-inner,\n ${t}-handler-down-inner\n `]:{marginInlineEnd:0,fontSize:e.handleFontSize}}},[`${t}-handler`]:{height:"50%",overflow:"hidden",color:d,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:`${n}px ${i} ${k}`,transition:`all ${h} linear`,"&:active":{background:v},"&:hover":{height:"60%",[`\n ${t}-handler-up-inner,\n ${t}-handler-down-inner\n `]:{color:p}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},(0,te.Ro)()),{color:d,transition:`all ${h} linear`,userSelect:"none"})},[`${t}-handler-up`]:{borderStartEndRadius:a},[`${t}-handler-down`]:{borderBlockStart:`${n}px ${i} ${k}`,borderEndEndRadius:a}},ae(e,"lg")),ae(e,"sm")),{"&-disabled, &-readonly":{[`${t}-handler-wrap`]:{display:"none"},[`${t}-input`]:{color:"inherit"}},[`\n ${t}-handler-up-disabled,\n ${t}-handler-down-disabled\n `]:{cursor:"not-allowed"},[`\n ${t}-handler-up-disabled:hover &-handler-up-inner,\n ${t}-handler-down-disabled:hover &-handler-down-inner\n `]:{color:b}})},{[`${t}-borderless`]:{borderColor:"transparent",boxShadow:"none",[`${t}-handler-down`]:{borderBlockStartWidth:0}}}]},oe=e=>{const{componentCls:t,paddingBlock:n,paddingInline:i,inputAffixPadding:r,controlWidth:a,borderRadiusLG:s,borderRadiusSM:o}=e;return{[`${t}-affix-wrapper`]:Object.assign(Object.assign(Object.assign({},(0,ee.ik)(e)),(0,ee.bi)(e,`${t}-affix-wrapper`)),{position:"relative",display:"inline-flex",width:a,padding:0,paddingInlineStart:i,"&-lg":{borderRadius:s},"&-sm":{borderRadius:o},[`&:not(${t}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},(0,ee.pU)(e)),{zIndex:1}),"&-focused, &:focus":{zIndex:1},[`&-disabled > ${t}-disabled`]:{background:"transparent"},[`> div${t}`]:{width:"100%",border:"none",outline:"none",[`&${t}-focused`]:{boxShadow:"none !important"}},[`input${t}-input`]:{padding:`${n}px 0`},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${t}-handler-wrap`]:{zIndex:2},[t]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:r},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:i,marginInlineStart:r}}})}};var le=(0,ie.Z)("InputNumber",(e=>{const t=(0,re.TS)(e,(0,ee.e5)(e));return[se(t),oe(t),(0,ne.c)(t)]}),(e=>Object.assign(Object.assign({},(0,ee.TM)(e)),{controlWidth:90,handleWidth:e.controlHeightSM-2*e.lineWidth,handleFontSize:e.fontSize/2,handleVisible:"auto",handleActiveBg:e.colorFillAlter,handleBg:e.colorBgContainer,handleHoverColor:e.colorPrimary,handleBorderColor:e.colorBorder}))),ce=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};const ue=a.forwardRef(((e,t)=>{const{getPrefixCls:n,direction:r}=a.useContext(Z.E_),s=a.useRef(null);a.useImperativeHandle(t,(()=>s.current));const{className:o,rootClassName:l,size:u,disabled:h,prefixCls:p,addonBefore:f,addonAfter:m,prefix:g,bordered:v=!0,readOnly:b,status:y,controls:_}=e,w=ce(e,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls"]),x=n("input-number",p),[k,S]=le(x),{compactSize:E,compactItemClassnames:C}=(0,Q.ri)(x,r);let T=a.createElement(c,{className:`${x}-handler-up-inner`}),A=a.createElement(i.Z,{className:`${x}-handler-down-inner`});const M="boolean"==typeof _?_:void 0;"object"==typeof _&&(T=void 0===_.upIcon?T:a.createElement("span",{className:`${x}-handler-up-inner`},_.upIcon),A=void 0===_.downIcon?A:a.createElement("span",{className:`${x}-handler-down-inner`},_.downIcon));const{hasFeedback:L,status:D,isFormItemInput:I,feedbackIcon:R}=a.useContext(J.aM),P=(0,G.F)(D,y),O=(0,X.Z)((e=>{var t;return null!==(t=null!=u?u:E)&&void 0!==t?t:e})),N=a.useContext(Y.Z),B=null!=h?h:N,$=d()({[`${x}-lg`]:"large"===O,[`${x}-sm`]:"small"===O,[`${x}-rtl`]:"rtl"===r,[`${x}-borderless`]:!v,[`${x}-in-form-item`]:I},(0,G.Z)(x,P),C,S),F=`${x}-group`;return k(a.createElement(V,Object.assign({ref:s,disabled:B,className:d()(o,l),upHandler:T,downHandler:A,prefixCls:x,readOnly:b,controls:M,prefix:g,suffix:L&&R,addonAfter:m&&a.createElement(Q.BR,null,a.createElement(J.Ux,{override:!0,status:!0},m)),addonBefore:f&&a.createElement(Q.BR,null,a.createElement(J.Ux,{override:!0,status:!0},f)),classNames:{input:$},classes:{affixWrapper:d()((0,G.Z)(`${x}-affix-wrapper`,P,L),{[`${x}-affix-wrapper-sm`]:"small"===O,[`${x}-affix-wrapper-lg`]:"large"===O,[`${x}-affix-wrapper-rtl`]:"rtl"===r,[`${x}-affix-wrapper-borderless`]:!v},S),wrapper:d()({[`${F}-rtl`]:"rtl"===r,[`${x}-wrapper-disabled`]:B},S),group:d()({[`${x}-group-wrapper-sm`]:"small"===O,[`${x}-group-wrapper-lg`]:"large"===O,[`${x}-group-wrapper-rtl`]:"rtl"===r},(0,G.Z)(`${x}-group-wrapper`,P,L),S)}},w)))})),de=ue;de._InternalPanelDoNotUseOrYouWillBeFired=e=>a.createElement(W.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},a.createElement(ue,Object.assign({},e)));var he=de},58421:function(e,t,n){"use strict";n.d(t,{Z:function(){return ee}});var i=n(14809),r=n(59301),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"},s=n(7657),o=function(e,t){return r.createElement(s.Z,(0,i.Z)({},e,{ref:t,icon:a}))};var l=r.forwardRef(o),c=n(49198),u=n(33853),d=n(38819),h=n(92310),p=n.n(h),f=n(4635),m=n(20439),g=n(99153),v=n(84851),b=n(19257),y=n(54941),_=n(26112),w={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},x=n(91735),k=function(e){(0,b.Z)(n,e);var t=(0,y.Z)(n);function n(){var e;(0,g.Z)(this,n);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return(e=t.call.apply(t,[this].concat(r))).state={goInputText:""},e.getValidValue=function(){var t=e.state.goInputText;return!t||Number.isNaN(t)?void 0:Number(t)},e.buildOptionText=function(t){return"".concat(t," ").concat(e.props.locale.items_per_page)},e.changeSize=function(t){e.props.changeSize(Number(t))},e.handleChange=function(t){e.setState({goInputText:t.target.value})},e.handleBlur=function(t){var n=e.props,i=n.goButton,r=n.quickGo,a=n.rootPrefixCls,s=e.state.goInputText;i||""===s||(e.setState({goInputText:""}),t.relatedTarget&&(t.relatedTarget.className.indexOf("".concat(a,"-item-link"))>=0||t.relatedTarget.className.indexOf("".concat(a,"-item"))>=0)||r(e.getValidValue()))},e.go=function(t){""!==e.state.goInputText&&(t.keyCode!==w.ENTER&&"click"!==t.type||(e.setState({goInputText:""}),e.props.quickGo(e.getValidValue())))},e}return(0,v.Z)(n,[{key:"getPageSizeOptions",value:function(){var e=this.props,t=e.pageSize,n=e.pageSizeOptions;return n.some((function(e){return e.toString()===t.toString()}))?n:n.concat([t.toString()]).sort((function(e,t){return(Number.isNaN(Number(e))?0:Number(e))-(Number.isNaN(Number(t))?0:Number(t))}))}},{key:"render",value:function(){var e=this,t=this.props,n=t.pageSize,i=t.locale,a=t.rootPrefixCls,s=t.changeSize,o=t.quickGo,l=t.goButton,c=t.selectComponentClass,u=t.buildOptionText,d=t.selectPrefixCls,h=t.disabled,p=this.state.goInputText,f="".concat(a,"-options"),m=c,g=null,v=null,b=null;if(!s&&!o)return null;var y=this.getPageSizeOptions();if(s&&m){var _=y.map((function(t,n){return r.createElement(m.Option,{key:n,value:t.toString()},(u||e.buildOptionText)(t))}));g=r.createElement(m,{disabled:h,prefixCls:d,showSearch:!1,className:"".concat(f,"-size-changer"),optionLabelProp:"children",popupMatchSelectWidth:!1,value:(n||y[0]).toString(),onChange:this.changeSize,getPopupContainer:function(e){return e.parentNode},"aria-label":i.page_size,defaultOpen:!1},_)}return o&&(l&&(b="boolean"==typeof l?r.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:h,className:"".concat(f,"-quick-jumper-button")},i.jump_to_confirm):r.createElement("span",{onClick:this.go,onKeyUp:this.go},l)),v=r.createElement("div",{className:"".concat(f,"-quick-jumper")},i.jump_to,r.createElement("input",{disabled:h,type:"text",value:p,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur,"aria-label":i.page}),i.page,b)),r.createElement("li",{className:"".concat(f)},g,v)}}]),n}(r.Component);k.defaultProps={pageSizeOptions:["10","20","50","100"]};var S=k,E=function(e){var t,n=e.rootPrefixCls,i=e.page,a=e.active,s=e.className,o=e.showTitle,l=e.onClick,c=e.onKeyPress,u=e.itemRender,d="".concat(n,"-item"),h=p()(d,"".concat(d,"-").concat(i),(t={},(0,f.Z)(t,"".concat(d,"-active"),a),(0,f.Z)(t,"".concat(d,"-disabled"),!i),(0,f.Z)(t,e.className,s),t)),m=u(i,"page",r.createElement("a",{rel:"nofollow"},i));return m?r.createElement("li",{title:o?i.toString():null,className:h,onClick:function(){l(i)},onKeyPress:function(e){c(e,l,i)},tabIndex:0},m):null};function C(){}function T(e){var t=Number(e);return"number"==typeof t&&!Number.isNaN(t)&&isFinite(t)&&Math.floor(t)===t}function A(e,t,n){var i=void 0===e?t.pageSize:e;return Math.floor((n.total-1)/i)+1}var M=function(e){(0,b.Z)(n,e);var t=(0,y.Z)(n);function n(e){var i;(0,g.Z)(this,n),(i=t.call(this,e)).paginationNode=r.createRef(),i.getJumpPrevPage=function(){return Math.max(1,i.state.current-(i.props.showLessItems?3:5))},i.getJumpNextPage=function(){return Math.min(A(void 0,i.state,i.props),i.state.current+(i.props.showLessItems?3:5))},i.getItemIcon=function(e,t){var n=i.props.prefixCls,a=e||r.createElement("button",{type:"button","aria-label":t,className:"".concat(n,"-item-link")});return"function"==typeof e&&(a=r.createElement(e,(0,m.Z)({},i.props))),a},i.isValid=function(e){var t=i.props.total;return T(e)&&e!==i.state.current&&T(t)&&t>0},i.shouldDisplayQuickJumper=function(){var e=i.props,t=e.showQuickJumper;return!(e.total<=i.state.pageSize)&&t},i.handleKeyDown=function(e){e.keyCode!==w.ARROW_UP&&e.keyCode!==w.ARROW_DOWN||e.preventDefault()},i.handleKeyUp=function(e){var t=i.getValidValue(e);t!==i.state.currentInputValue&&i.setState({currentInputValue:t}),e.keyCode===w.ENTER?i.handleChange(t):e.keyCode===w.ARROW_UP?i.handleChange(t-1):e.keyCode===w.ARROW_DOWN&&i.handleChange(t+1)},i.handleBlur=function(e){var t=i.getValidValue(e);i.handleChange(t)},i.changePageSize=function(e){var t=i.state.current,n=A(e,i.state,i.props);t=t>n?n:t,0===n&&(t=i.state.current),"number"==typeof e&&("pageSize"in i.props||i.setState({pageSize:e}),"current"in i.props||i.setState({current:t,currentInputValue:t})),i.props.onShowSizeChange(t,e),"onChange"in i.props&&i.props.onChange&&i.props.onChange(t,e)},i.handleChange=function(e){var t=i.props,n=t.disabled,r=t.onChange,a=i.state,s=a.pageSize,o=a.current,l=a.currentInputValue;if(i.isValid(e)&&!n){var c=A(void 0,i.state,i.props),u=e;return e>c?u=c:e<1&&(u=1),"current"in i.props||i.setState({current:u}),u!==l&&i.setState({currentInputValue:u}),r(u,s),u}return o},i.prev=function(){i.hasPrev()&&i.handleChange(i.state.current-1)},i.next=function(){i.hasNext()&&i.handleChange(i.state.current+1)},i.jumpPrev=function(){i.handleChange(i.getJumpPrevPage())},i.jumpNext=function(){i.handleChange(i.getJumpNextPage())},i.hasPrev=function(){return i.state.current>1},i.hasNext=function(){return i.state.current<A(void 0,i.state,i.props)},i.runIfEnter=function(e,t){if("Enter"===e.key||13===e.charCode){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];t.apply(void 0,i)}},i.runIfEnterPrev=function(e){i.runIfEnter(e,i.prev)},i.runIfEnterNext=function(e){i.runIfEnter(e,i.next)},i.runIfEnterJumpPrev=function(e){i.runIfEnter(e,i.jumpPrev)},i.runIfEnterJumpNext=function(e){i.runIfEnter(e,i.jumpNext)},i.handleGoTO=function(e){e.keyCode!==w.ENTER&&"click"!==e.type||i.handleChange(i.state.currentInputValue)},i.renderPrev=function(e){var t=i.props,n=t.prevIcon,a=(0,t.itemRender)(e,"prev",i.getItemIcon(n,"prev page")),s=!i.hasPrev();return(0,r.isValidElement)(a)?(0,r.cloneElement)(a,{disabled:s}):a},i.renderNext=function(e){var t=i.props,n=t.nextIcon,a=(0,t.itemRender)(e,"next",i.getItemIcon(n,"next page")),s=!i.hasNext();return(0,r.isValidElement)(a)?(0,r.cloneElement)(a,{disabled:s}):a};var a=e.onChange!==C;"current"in e&&!a&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var s=e.defaultCurrent;"current"in e&&(s=e.current);var o=e.defaultPageSize;return"pageSize"in e&&(o=e.pageSize),s=Math.min(s,A(o,void 0,e)),i.state={current:s,currentInputValue:s,pageSize:o},i}return(0,v.Z)(n,[{key:"componentDidUpdate",value:function(e,t){var n=this.props.prefixCls;if(t.current!==this.state.current&&this.paginationNode.current){var i,r=this.paginationNode.current.querySelector(".".concat(n,"-item-").concat(t.current));if(r&&document.activeElement===r)null==r||null===(i=r.blur)||void 0===i||i.call(r)}}},{key:"getValidValue",value:function(e){var t=e.target.value,n=A(void 0,this.state,this.props),i=this.state.currentInputValue;return""===t?t:Number.isNaN(Number(t))?i:t>=n?n:Number(t)}},{key:"getShowSizeChanger",value:function(){var e=this.props,t=e.showSizeChanger,n=e.total,i=e.totalBoundaryShowSizeChanger;return void 0!==t?t:n>i}},{key:"render",value:function(){var e=this.props,t=e.prefixCls,n=e.className,a=e.style,s=e.disabled,o=e.hideOnSinglePage,l=e.total,c=e.locale,u=e.showQuickJumper,d=e.showLessItems,h=e.showTitle,m=e.showTotal,g=e.simple,v=e.itemRender,b=e.showPrevNextJumpers,y=e.jumpPrevIcon,w=e.jumpNextIcon,x=e.selectComponentClass,k=e.selectPrefixCls,C=e.pageSizeOptions,T=this.state,M=T.current,L=T.pageSize,D=T.currentInputValue;if(!0===o&&l<=L)return null;var I=A(void 0,this.state,this.props),R=[],P=null,O=null,N=null,B=null,$=null,F=u&&u.goButton,z=d?1:2,K=M-1>0?M-1:0,U=M+1<I?M+1:I,j=(0,_.Z)(this.props,{aria:!0,data:!0}),q=m&&r.createElement("li",{className:"".concat(t,"-total-text")},m(l,[0===l?0:(M-1)*L+1,M*L>l?l:M*L]));if(g){F&&($="boolean"==typeof F?r.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},c.jump_to_confirm):r.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},F),$=r.createElement("li",{title:h?"".concat(c.jump_to).concat(M,"/").concat(I):null,className:"".concat(t,"-simple-pager")},$));var H=this.renderPrev(K);return r.createElement("ul",(0,i.Z)({className:p()(t,"".concat(t,"-simple"),(0,f.Z)({},"".concat(t,"-disabled"),s),n),style:a,ref:this.paginationNode},j),q,H?r.createElement("li",{title:h?c.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:p()("".concat(t,"-prev"),(0,f.Z)({},"".concat(t,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},H):null,r.createElement("li",{title:h?"".concat(M,"/").concat(I):null,className:"".concat(t,"-simple-pager")},r.createElement("input",{type:"text",value:D,disabled:s,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,onBlur:this.handleBlur,size:3}),r.createElement("span",{className:"".concat(t,"-slash")},"/"),I),r.createElement("li",{title:h?c.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:p()("".concat(t,"-next"),(0,f.Z)({},"".concat(t,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(U)),$)}if(I<=3+2*z){var V={locale:c,rootPrefixCls:t,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:h,itemRender:v};I||R.push(r.createElement(E,(0,i.Z)({},V,{key:"noPager",page:1,className:"".concat(t,"-item-disabled")})));for(var G=1;G<=I;G+=1){var Z=M===G;R.push(r.createElement(E,(0,i.Z)({},V,{key:G,page:G,active:Z})))}}else{var W=d?c.prev_3:c.prev_5,Y=d?c.next_3:c.next_5,X=v(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(y,"prev page")),J=v(this.getJumpNextPage(),"jump-next",this.getItemIcon(w,"next page"));b&&(P=X?r.createElement("li",{title:h?W:null,key:"prev",onClick:this.jumpPrev,tabIndex:0,onKeyPress:this.runIfEnterJumpPrev,className:p()("".concat(t,"-jump-prev"),(0,f.Z)({},"".concat(t,"-jump-prev-custom-icon"),!!y))},X):null,O=J?r.createElement("li",{title:h?Y:null,key:"next",tabIndex:0,onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:p()("".concat(t,"-jump-next"),(0,f.Z)({},"".concat(t,"-jump-next-custom-icon"),!!w))},J):null),B=r.createElement(E,{locale:c,last:!0,rootPrefixCls:t,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:I,page:I,active:!1,showTitle:h,itemRender:v}),N=r.createElement(E,{locale:c,rootPrefixCls:t,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:h,itemRender:v});var Q=Math.max(1,M-z),ee=Math.min(M+z,I);M-1<=z&&(ee=1+2*z),I-M<=z&&(Q=I-2*z);for(var te=Q;te<=ee;te+=1){var ne=M===te;R.push(r.createElement(E,{locale:c,rootPrefixCls:t,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:te,page:te,active:ne,showTitle:h,itemRender:v}))}M-1>=2*z&&3!==M&&(R[0]=(0,r.cloneElement)(R[0],{className:"".concat(t,"-item-after-jump-prev")}),R.unshift(P)),I-M>=2*z&&M!==I-2&&(R[R.length-1]=(0,r.cloneElement)(R[R.length-1],{className:"".concat(t,"-item-before-jump-next")}),R.push(O)),1!==Q&&R.unshift(N),ee!==I&&R.push(B)}var ie=!this.hasPrev()||!I,re=!this.hasNext()||!I,ae=this.renderPrev(K),se=this.renderNext(U);return r.createElement("ul",(0,i.Z)({className:p()(t,n,(0,f.Z)({},"".concat(t,"-disabled"),s)),style:a,ref:this.paginationNode},j),q,ae?r.createElement("li",{title:h?c.prev_page:null,onClick:this.prev,tabIndex:ie?null:0,onKeyPress:this.runIfEnterPrev,className:p()("".concat(t,"-prev"),(0,f.Z)({},"".concat(t,"-disabled"),ie)),"aria-disabled":ie},ae):null,R,se?r.createElement("li",{title:h?c.next_page:null,onClick:this.next,tabIndex:re?null:0,onKeyPress:this.runIfEnterNext,className:p()("".concat(t,"-next"),(0,f.Z)({},"".concat(t,"-disabled"),re)),"aria-disabled":re},se):null,r.createElement(S,{disabled:s,locale:c,rootPrefixCls:t,selectComponentClass:x,selectPrefixCls:k,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:M,pageSize:L,pageSizeOptions:C,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:F}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n={};if("current"in e&&(n.current=e.current,e.current!==t.current&&(n.currentInputValue=n.current)),"pageSize"in e&&e.pageSize!==t.pageSize){var i=t.current,r=A(e.pageSize,t,e);i=i>r?r:i,"current"in e||(n.current=i,n.currentInputValue=i),n.pageSize=e.pageSize}return n}}]),n}(r.Component);M.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:C,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:C,locale:x.Z,style:{},itemRender:function(e,t,n){return n},totalBoundaryShowSizeChanger:50};var L=M,D=n(22075),I=n(36355),R=n(19716),P=n(8628),O=n(9763),N=n(57809);const B=e=>r.createElement(N.default,Object.assign({},e,{showSearch:!0,size:"small"})),$=e=>r.createElement(N.default,Object.assign({},e,{showSearch:!0,size:"middle"}));B.Option=N.default.Option,$.Option=N.default.Option;var F=n(9937),z=n(17313),K=n(83116),U=n(37613);const j=e=>{const{componentCls:t}=e;return{[`${t}-disabled`]:{"&, &:hover":{cursor:"not-allowed",[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed"}},"&:focus-visible":{cursor:"not-allowed",[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed"}}},[`&${t}-disabled`]:{cursor:"not-allowed",[`${t}-item`]:{cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},a:{color:e.colorTextDisabled,backgroundColor:"transparent",border:"none",cursor:"not-allowed"},"&-active":{borderColor:e.colorBorder,backgroundColor:e.itemActiveBgDisabled,"&:hover, &:active":{backgroundColor:e.itemActiveBgDisabled},a:{color:e.itemActiveColorDisabled}}},[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},[`${t}-simple&`]:{backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"}}},[`${t}-simple-pager`]:{color:e.colorTextDisabled},[`${t}-jump-prev, ${t}-jump-next`]:{[`${t}-item-link-icon`]:{opacity:0},[`${t}-item-ellipsis`]:{opacity:1}}},[`&${t}-simple`]:{[`${t}-prev, ${t}-next`]:{[`&${t}-disabled ${t}-item-link`]:{"&:hover, &:active":{backgroundColor:"transparent"}}}}}},q=e=>{const{componentCls:t}=e;return{[`&${t}-mini ${t}-total-text, &${t}-mini ${t}-simple-pager`]:{height:e.itemSizeSM,lineHeight:`${e.itemSizeSM}px`},[`&${t}-mini ${t}-item`]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:e.itemSizeSM-2+"px"},[`&${t}-mini:not(${t}-disabled) ${t}-item:not(${t}-item-active)`]:{backgroundColor:"transparent",borderColor:"transparent","&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},[`&${t}-mini ${t}-prev, &${t}-mini ${t}-next`]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:`${e.itemSizeSM}px`},[`&${t}-mini:not(${t}-disabled)`]:{[`${t}-prev, ${t}-next`]:{[`&:hover ${t}-item-link`]:{backgroundColor:e.colorBgTextHover},[`&:active ${t}-item-link`]:{backgroundColor:e.colorBgTextActive},[`&${t}-disabled:hover ${t}-item-link`]:{backgroundColor:"transparent"}}},[`\n &${t}-mini ${t}-prev ${t}-item-link,\n &${t}-mini ${t}-next ${t}-item-link\n `]:{backgroundColor:"transparent",borderColor:"transparent","&::after":{height:e.itemSizeSM,lineHeight:`${e.itemSizeSM}px`}},[`&${t}-mini ${t}-jump-prev, &${t}-mini ${t}-jump-next`]:{height:e.itemSizeSM,marginInlineEnd:0,lineHeight:`${e.itemSizeSM}px`},[`&${t}-mini ${t}-options`]:{marginInlineStart:e.paginationMiniOptionsMarginInlineStart,"&-size-changer":{top:e.miniOptionsSizeChangerTop},"&-quick-jumper":{height:e.itemSizeSM,lineHeight:`${e.itemSizeSM}px`,input:Object.assign(Object.assign({},(0,F.x0)(e)),{width:e.paginationMiniQuickJumperInputWidth,height:e.controlHeightSM})}}}},H=e=>{const{componentCls:t}=e;return{[`\n &${t}-simple ${t}-prev,\n &${t}-simple ${t}-next\n `]:{height:e.itemSizeSM,lineHeight:`${e.itemSizeSM}px`,verticalAlign:"top",[`${t}-item-link`]:{height:e.itemSizeSM,backgroundColor:"transparent",border:0,"&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive},"&::after":{height:e.itemSizeSM,lineHeight:`${e.itemSizeSM}px`}}},[`&${t}-simple ${t}-simple-pager`]:{display:"inline-block",height:e.itemSizeSM,marginInlineEnd:e.marginXS,input:{boxSizing:"border-box",height:"100%",marginInlineEnd:e.marginXS,padding:`0 ${e.paginationItemPaddingInline}px`,textAlign:"center",backgroundColor:e.itemInputBg,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadius,outline:"none",transition:`border-color ${e.motionDurationMid}`,color:"inherit","&:hover":{borderColor:e.colorPrimary},"&:focus":{borderColor:e.colorPrimaryHover,boxShadow:`${e.inputOutlineOffset}px 0 ${e.controlOutlineWidth}px ${e.controlOutline}`},"&[disabled]":{color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,cursor:"not-allowed"}}}}},V=e=>{const{componentCls:t}=e;return{[`${t}-jump-prev, ${t}-jump-next`]:{outline:0,[`${t}-item-container`]:{position:"relative",[`${t}-item-link-icon`]:{color:e.colorPrimary,fontSize:e.fontSizeSM,opacity:0,transition:`all ${e.motionDurationMid}`,"&-svg":{top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,margin:"auto"}},[`${t}-item-ellipsis`]:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,display:"block",margin:"auto",color:e.colorTextDisabled,fontFamily:"Arial, Helvetica, sans-serif",letterSpacing:e.paginationEllipsisLetterSpacing,textAlign:"center",textIndent:e.paginationEllipsisTextIndent,opacity:1,transition:`all ${e.motionDurationMid}`}},"&:hover":{[`${t}-item-link-icon`]:{opacity:1},[`${t}-item-ellipsis`]:{opacity:0}}},[`\n ${t}-prev,\n ${t}-jump-prev,\n ${t}-jump-next\n `]:{marginInlineEnd:e.marginXS},[`\n ${t}-prev,\n ${t}-next,\n ${t}-jump-prev,\n ${t}-jump-next\n `]:{display:"inline-block",minWidth:e.itemSize,height:e.itemSize,color:e.colorText,fontFamily:e.fontFamily,lineHeight:`${e.itemSize}px`,textAlign:"center",verticalAlign:"middle",listStyle:"none",borderRadius:e.borderRadius,cursor:"pointer",transition:`all ${e.motionDurationMid}`},[`${t}-prev, ${t}-next`]:{fontFamily:"Arial, Helvetica, sans-serif",outline:0,button:{color:e.colorText,cursor:"pointer",userSelect:"none"},[`${t}-item-link`]:{display:"block",width:"100%",height:"100%",padding:0,fontSize:e.fontSizeSM,textAlign:"center",backgroundColor:"transparent",border:`${e.lineWidth}px ${e.lineType} transparent`,borderRadius:e.borderRadius,outline:"none",transition:`all ${e.motionDurationMid}`},[`&:hover ${t}-item-link`]:{backgroundColor:e.colorBgTextHover},[`&:active ${t}-item-link`]:{backgroundColor:e.colorBgTextActive},[`&${t}-disabled:hover`]:{[`${t}-item-link`]:{backgroundColor:"transparent"}}},[`${t}-slash`]:{marginInlineEnd:e.paginationSlashMarginInlineEnd,marginInlineStart:e.paginationSlashMarginInlineStart},[`${t}-options`]:{display:"inline-block",marginInlineStart:e.margin,verticalAlign:"middle","&-size-changer.-select":{display:"inline-block",width:"auto"},"&-quick-jumper":{display:"inline-block",height:e.controlHeight,marginInlineStart:e.marginXS,lineHeight:`${e.controlHeight}px`,verticalAlign:"top",input:Object.assign(Object.assign({},(0,F.ik)(e)),{width:1.25*e.controlHeightLG,height:e.controlHeight,boxSizing:"border-box",margin:0,marginInlineStart:e.marginXS,marginInlineEnd:e.marginXS})}}}},G=e=>{const{componentCls:t}=e;return{[`${t}-item`]:{display:"inline-block",minWidth:e.itemSize,height:e.itemSize,marginInlineEnd:e.marginXS,fontFamily:e.fontFamily,lineHeight:e.itemSize-2+"px",textAlign:"center",verticalAlign:"middle",listStyle:"none",backgroundColor:"transparent",border:`${e.lineWidth}px ${e.lineType} transparent`,borderRadius:e.borderRadius,outline:0,cursor:"pointer",userSelect:"none",a:{display:"block",padding:`0 ${e.paginationItemPaddingInline}px`,color:e.colorText,"&:hover":{textDecoration:"none"}},[`&:not(${t}-item-active)`]:{"&:hover":{transition:`all ${e.motionDurationMid}`,backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},"&-active":{fontWeight:e.fontWeightStrong,backgroundColor:e.itemActiveBg,borderColor:e.colorPrimary,a:{color:e.colorPrimary},"&:hover":{borderColor:e.colorPrimaryHover},"&:hover a":{color:e.colorPrimaryHover}}}}},Z=e=>{const{componentCls:t}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,z.Wf)(e)),{"ul, ol":{margin:0,padding:0,listStyle:"none"},"&::after":{display:"block",clear:"both",height:0,overflow:"hidden",visibility:"hidden",content:'""'},[`${t}-total-text`]:{display:"inline-block",height:e.itemSize,marginInlineEnd:e.marginXS,lineHeight:e.itemSize-2+"px",verticalAlign:"middle"}}),G(e)),V(e)),H(e)),q(e)),j(e)),{[`@media only screen and (max-width: ${e.screenLG}px)`]:{[`${t}-item`]:{"&-after-jump-prev, &-before-jump-next":{display:"none"}}},[`@media only screen and (max-width: ${e.screenSM}px)`]:{[`${t}-options`]:{display:"none"}}}),[`&${e.componentCls}-rtl`]:{direction:"rtl"}}},W=e=>{const{componentCls:t}=e;return{[`${t}${t}-disabled:not(${t}-mini)`]:{"&, &:hover":{[`${t}-item-link`]:{borderColor:e.colorBorder}},"&:focus-visible":{[`${t}-item-link`]:{borderColor:e.colorBorder}},[`${t}-item, ${t}-item-link`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,[`&:hover:not(${t}-item-active)`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,a:{color:e.colorTextDisabled}},[`&${t}-item-active`]:{backgroundColor:e.itemActiveBgDisabled}},[`${t}-prev, ${t}-next`]:{"&:hover button":{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,color:e.colorTextDisabled},[`${t}-item-link`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder}}},[`${t}:not(${t}-mini)`]:{[`${t}-prev, ${t}-next`]:{"&:hover button":{borderColor:e.colorPrimaryHover,backgroundColor:e.itemBg},[`${t}-item-link`]:{backgroundColor:e.itemLinkBg,borderColor:e.colorBorder},[`&:hover ${t}-item-link`]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,color:e.colorPrimary},[`&${t}-disabled`]:{[`${t}-item-link`]:{borderColor:e.colorBorder,color:e.colorTextDisabled}}},[`${t}-item`]:{backgroundColor:e.itemBg,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,[`&:hover:not(${t}-item-active)`]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,a:{color:e.colorPrimary}},"&-active":{borderColor:e.colorPrimary}}}}},Y=e=>{const{componentCls:t}=e;return{[`${t}:not(${t}-disabled)`]:{[`${t}-item`]:Object.assign({},(0,z.Qy)(e)),[`${t}-jump-prev, ${t}-jump-next`]:{"&:focus-visible":Object.assign({[`${t}-item-link-icon`]:{opacity:1},[`${t}-item-ellipsis`]:{opacity:0}},(0,z.oN)(e))},[`${t}-prev, ${t}-next`]:{[`&:focus-visible ${t}-item-link`]:Object.assign({},(0,z.oN)(e))}}}};var X=(0,K.Z)("Pagination",(e=>{const t=(0,U.TS)(e,{inputOutlineOffset:0,paginationMiniOptionsMarginInlineStart:e.marginXXS/2,paginationMiniQuickJumperInputWidth:1.1*e.controlHeightLG,paginationItemPaddingInline:1.5*e.marginXXS,paginationEllipsisLetterSpacing:e.marginXXS/2,paginationSlashMarginInlineStart:e.marginXXS,paginationSlashMarginInlineEnd:e.marginSM,paginationEllipsisTextIndent:"0.13em"},(0,F.e5)(e),(0,F.TM)(e));return[Z(t),Y(t),e.wireframe&&W(t)]}),(e=>({itemBg:e.colorBgContainer,itemSize:e.controlHeight,itemSizeSM:e.controlHeightSM,itemActiveBg:e.colorBgContainer,itemLinkBg:e.colorBgContainer,itemActiveColorDisabled:e.colorTextDisabled,itemActiveBgDisabled:e.controlItemBgActiveDisabled,itemInputBg:e.colorBgContainer,miniOptionsSizeChangerTop:0}))),J=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};var Q=e=>{const{prefixCls:t,selectPrefixCls:n,className:i,rootClassName:a,style:s,size:o,locale:h,selectComponentClass:f,responsive:m,showSizeChanger:g}=e,v=J(e,["prefixCls","selectPrefixCls","className","rootClassName","style","size","locale","selectComponentClass","responsive","showSizeChanger"]),{xs:b}=(0,P.Z)(m),{getPrefixCls:y,direction:_,pagination:w={}}=r.useContext(I.E_),x=y("pagination",t),[k,S]=X(x),E=null!=g?g:w.showSizeChanger,C=r.useMemo((()=>{const e=r.createElement("span",{className:`${x}-item-ellipsis`},"•••");return{prevIcon:r.createElement("button",{className:`${x}-item-link`,type:"button",tabIndex:-1},"rtl"===_?r.createElement(d.Z,null):r.createElement(u.Z,null)),nextIcon:r.createElement("button",{className:`${x}-item-link`,type:"button",tabIndex:-1},"rtl"===_?r.createElement(u.Z,null):r.createElement(d.Z,null)),jumpPrevIcon:r.createElement("a",{className:`${x}-item-link`},r.createElement("div",{className:`${x}-item-container`},"rtl"===_?r.createElement(c.Z,{className:`${x}-item-link-icon`}):r.createElement(l,{className:`${x}-item-link-icon`}),e)),jumpNextIcon:r.createElement("a",{className:`${x}-item-link`},r.createElement("div",{className:`${x}-item-container`},"rtl"===_?r.createElement(l,{className:`${x}-item-link-icon`}):r.createElement(c.Z,{className:`${x}-item-link-icon`}),e))}}),[_,x]),[T]=(0,O.Z)("Pagination",D.Z),A=Object.assign(Object.assign({},T),h),M=(0,R.Z)(o),N="small"===M||!(!b||M||!m),F=y("select",n),z=p()({[`${x}-mini`]:N,[`${x}-rtl`]:"rtl"===_},null==w?void 0:w.className,i,a,S),K=Object.assign(Object.assign({},null==w?void 0:w.style),s);return k(r.createElement(L,Object.assign({},C,v,{style:K,prefixCls:x,selectPrefixCls:F,className:z,selectComponentClass:f||(N?B:$),locale:A,showSizeChanger:E})))},ee=Q},5112:function(e,t,n){"use strict";n.d(t,{ZP:function(){return $}});var i=n(92310),r=n.n(i),a=n(18929),s=n(26112),o=n(59301),l=n(36355),c=n(19716);const u=o.createContext(null),d=u.Provider;var h=u;const p=o.createContext(null),f=p.Provider;var m=n(5630),g=n(8654),v=n(1684),b=n(32441),y=n(17313),_=n(83116),w=n(37613);const x=e=>{const{componentCls:t,antCls:n}=e,i=`${t}-group`;return{[i]:Object.assign(Object.assign({},(0,y.Wf)(e)),{display:"inline-block",fontSize:0,[`&${i}-rtl`]:{direction:"rtl"},[`${n}-badge ${n}-badge-count`]:{zIndex:1},[`> ${n}-badge:not(:first-child) > ${n}-button-wrapper`]:{borderInlineStart:"none"}})}},k=e=>{const{componentCls:t,wrapperMarginInlineEnd:n,colorPrimary:i,radioSize:r,motionDurationSlow:a,motionDurationMid:s,motionEaseInOutCirc:o,colorBgContainer:l,colorBorder:c,lineWidth:u,dotSize:d,colorBgContainerDisabled:h,colorTextDisabled:p,paddingXS:f,dotColorDisabled:m,lineType:g,radioDotDisabledSize:v,wireframe:b,colorWhite:_}=e,w=`${t}-inner`;return{[`${t}-wrapper`]:Object.assign(Object.assign({},(0,y.Wf)(e)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:n,cursor:"pointer",[`&${t}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:e.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},[`${t}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${u}px ${g} ${i}`,borderRadius:"50%",visibility:"hidden",content:'""'},[t]:Object.assign(Object.assign({},(0,y.Wf)(e)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${t}-wrapper:hover &,\n &:hover ${w}`]:{borderColor:i},[`${t}-input:focus-visible + ${w}`]:Object.assign({},(0,y.oN)(e)),[`${t}:hover::after, ${t}-wrapper:hover &::after`]:{visibility:"visible"},[`${t}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:r,height:r,marginBlockStart:r/-2,marginInlineStart:r/-2,backgroundColor:b?i:_,borderBlockStart:0,borderInlineStart:0,borderRadius:r,transform:"scale(0)",opacity:0,transition:`all ${a} ${o}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:r,height:r,backgroundColor:l,borderColor:c,borderStyle:"solid",borderWidth:u,borderRadius:"50%",transition:`all ${s}`},[`${t}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${t}-checked`]:{[w]:{borderColor:i,backgroundColor:b?l:i,"&::after":{transform:`scale(${d/r})`,opacity:1,transition:`all ${a} ${o}`}}},[`${t}-disabled`]:{cursor:"not-allowed",[w]:{backgroundColor:h,borderColor:c,cursor:"not-allowed","&::after":{backgroundColor:m}},[`${t}-input`]:{cursor:"not-allowed"},[`${t}-disabled + span`]:{color:p,cursor:"not-allowed"},[`&${t}-checked`]:{[w]:{"&::after":{transform:`scale(${v/r})`}}}},[`span${t} + *`]:{paddingInlineStart:f,paddingInlineEnd:f}})}},S=e=>{const{buttonColor:t,controlHeight:n,componentCls:i,lineWidth:r,lineType:a,colorBorder:s,motionDurationSlow:o,motionDurationMid:l,buttonPaddingInline:c,fontSize:u,buttonBg:d,fontSizeLG:h,controlHeightLG:p,controlHeightSM:f,paddingXS:m,borderRadius:g,borderRadiusSM:v,borderRadiusLG:b,buttonCheckedBg:_,buttonSolidCheckedColor:w,colorTextDisabled:x,colorBgContainerDisabled:k,buttonCheckedBgDisabled:S,buttonCheckedColorDisabled:E,colorPrimary:C,colorPrimaryHover:T,colorPrimaryActive:A,buttonSolidCheckedBg:M,buttonSolidCheckedHoverBg:L,buttonSolidCheckedActiveBg:D}=e;return{[`${i}-button-wrapper`]:{position:"relative",display:"inline-block",height:n,margin:0,paddingInline:c,paddingBlock:0,color:t,fontSize:u,lineHeight:n-2*r+"px",background:d,border:`${r}px ${a} ${s}`,borderBlockStartWidth:r+.02,borderInlineStartWidth:0,borderInlineEndWidth:r,cursor:"pointer",transition:[`color ${l}`,`background ${l}`,`box-shadow ${l}`].join(","),a:{color:t},[`> ${i}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:-r,insetInlineStart:-r,display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:r,paddingInline:0,backgroundColor:s,transition:`background-color ${o}`,content:'""'}},"&:first-child":{borderInlineStart:`${r}px ${a} ${s}`,borderStartStartRadius:g,borderEndStartRadius:g},"&:last-child":{borderStartEndRadius:g,borderEndEndRadius:g},"&:first-child:last-child":{borderRadius:g},[`${i}-group-large &`]:{height:p,fontSize:h,lineHeight:p-2*r+"px","&:first-child":{borderStartStartRadius:b,borderEndStartRadius:b},"&:last-child":{borderStartEndRadius:b,borderEndEndRadius:b}},[`${i}-group-small &`]:{height:f,paddingInline:m-r,paddingBlock:0,lineHeight:f-2*r+"px","&:first-child":{borderStartStartRadius:v,borderEndStartRadius:v},"&:last-child":{borderStartEndRadius:v,borderEndEndRadius:v}},"&:hover":{position:"relative",color:C},"&:has(:focus-visible)":Object.assign({},(0,y.oN)(e)),[`${i}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${i}-button-wrapper-disabled)`]:{zIndex:1,color:C,background:_,borderColor:C,"&::before":{backgroundColor:C},"&:first-child":{borderColor:C},"&:hover":{color:T,borderColor:T,"&::before":{backgroundColor:T}},"&:active":{color:A,borderColor:A,"&::before":{backgroundColor:A}}},[`${i}-group-solid &-checked:not(${i}-button-wrapper-disabled)`]:{color:w,background:M,borderColor:M,"&:hover":{color:w,background:L,borderColor:L},"&:active":{color:w,background:D,borderColor:D}},"&-disabled":{color:x,backgroundColor:k,borderColor:s,cursor:"not-allowed","&:first-child, &:hover":{color:x,backgroundColor:k,borderColor:s}},[`&-disabled${i}-button-wrapper-checked`]:{color:E,backgroundColor:S,borderColor:s,boxShadow:"none"}}}},E=e=>e-8;var C=(0,_.Z)("Radio",(e=>{const{controlOutline:t,controlOutlineWidth:n,radioSize:i}=e,r=`0 0 0 ${n}px ${t}`,a=r,s=E(i),o=(0,w.TS)(e,{radioDotDisabledSize:s,radioFocusShadow:r,radioButtonFocusShadow:a});return[x(o),k(o),S(o)]}),(e=>{const{wireframe:t,padding:n,marginXS:i,lineWidth:r,fontSizeLG:a,colorText:s,colorBgContainer:o,colorTextDisabled:l,controlItemBgActiveDisabled:c,colorTextLightSolid:u,colorPrimary:d,colorPrimaryHover:h,colorPrimaryActive:p}=e,f=a;return{radioSize:f,dotSize:t?E(f):f-2*(4+r),dotColorDisabled:l,buttonSolidCheckedColor:u,buttonSolidCheckedBg:d,buttonSolidCheckedHoverBg:h,buttonSolidCheckedActiveBg:p,buttonBg:o,buttonCheckedBg:o,buttonColor:s,buttonCheckedBgDisabled:c,buttonCheckedColorDisabled:l,buttonPaddingInline:n-r,wrapperMarginInlineEnd:i}})),T=n(14088),A=n(4572),M=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};const L=(e,t)=>{var n,i;const a=o.useContext(h),s=o.useContext(p),{getPrefixCls:c,direction:u,radio:d}=o.useContext(l.E_),f=o.useRef(null),y=(0,g.sQ)(t,f),{isFormItemInput:_}=o.useContext(b.aM),w=t=>{var n,i;null===(n=e.onChange)||void 0===n||n.call(e,t),null===(i=null==a?void 0:a.onChange)||void 0===i||i.call(a,t)},{prefixCls:x,className:k,rootClassName:S,children:E,style:L}=e,D=M(e,["prefixCls","className","rootClassName","children","style"]),I=c("radio",x),R="button"===((null==a?void 0:a.optionType)||s),P=R?`${I}-button`:I,[O,N]=C(I),B=Object.assign({},D),$=o.useContext(v.Z);a&&(B.name=a.name,B.onChange=w,B.checked=e.value===a.value,B.disabled=null!==(n=B.disabled)&&void 0!==n?n:a.disabled),B.disabled=null!==(i=B.disabled)&&void 0!==i?i:$;const F=r()(`${P}-wrapper`,{[`${P}-wrapper-checked`]:B.checked,[`${P}-wrapper-disabled`]:B.disabled,[`${P}-wrapper-rtl`]:"rtl"===u,[`${P}-wrapper-in-form-item`]:_},null==d?void 0:d.className,k,S,N);return O(o.createElement(T.Z,{component:"Radio",disabled:B.disabled},o.createElement("label",{className:F,style:Object.assign(Object.assign({},null==d?void 0:d.style),L),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave},o.createElement(m.Z,Object.assign({},B,{className:r()(B.className,!R&&A.A),type:"radio",prefixCls:P,ref:y})),void 0!==E?o.createElement("span",null,E):null)))};var D=o.forwardRef(L);const I=o.forwardRef(((e,t)=>{const{getPrefixCls:n,direction:i}=o.useContext(l.E_),[u,h]=(0,a.Z)(e.defaultValue,{value:e.value}),{prefixCls:p,className:f,rootClassName:m,options:g,buttonStyle:v="outline",disabled:b,children:y,size:_,style:w,id:x,onMouseEnter:k,onMouseLeave:S,onFocus:E,onBlur:T}=e,A=n("radio",p),M=`${A}-group`,[L,I]=C(A);let R=y;g&&g.length>0&&(R=g.map((e=>"string"==typeof e||"number"==typeof e?o.createElement(D,{key:e.toString(),prefixCls:A,disabled:b,value:e,checked:u===e},e):o.createElement(D,{key:`radio-group-value-options-${e.value}`,prefixCls:A,disabled:e.disabled||b,value:e.value,checked:u===e.value,title:e.title,style:e.style},e.label))));const P=(0,c.Z)(_),O=r()(M,`${M}-${v}`,{[`${M}-${P}`]:P,[`${M}-rtl`]:"rtl"===i},f,m,I);return L(o.createElement("div",Object.assign({},(0,s.Z)(e,{aria:!0,data:!0}),{className:O,style:w,onMouseEnter:k,onMouseLeave:S,onFocus:E,onBlur:T,id:x,ref:t}),o.createElement(d,{value:{onChange:t=>{const n=u,i=t.target.value;"value"in e||h(i);const{onChange:r}=e;r&&i!==n&&r(t)},value:u,disabled:e.disabled,name:e.name,optionType:e.optionType}},R)))}));var R=o.memo(I),P=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};const O=(e,t)=>{const{getPrefixCls:n}=o.useContext(l.E_),{prefixCls:i}=e,r=P(e,["prefixCls"]),a=n("radio",i);return o.createElement(f,{value:"button"},o.createElement(D,Object.assign({prefixCls:a},r,{type:"radio",ref:t})))};var N=o.forwardRef(O);const B=D;B.Button=N,B.Group=R,B.__ANT_RADIO=!0;var $=B},95237:function(e,t,n){"use strict";var i=n(27382);t.Z=i.Z},57809:function(e,t,n){"use strict";var i=n(92310),r=n.n(i),a=n(77861),s=n(2738),o=n(59301),l=n(53487),c=n(62892),u=n(19080),d=n(36355),h=n(1684),p=n(93891),f=n(19716),m=n(32441),g=n(33234),v=n(14154),b=n(58582),y=n(84443),_=n(66339),w=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};const x="SECRET_COMBOBOX_MODE_DO_NOT_USE",k=(e,t)=>{var n,{prefixCls:i,bordered:l=!0,className:k,rootClassName:S,getPopupContainer:E,popupClassName:C,dropdownClassName:T,listHeight:A=256,placement:M,listItemHeight:L=24,size:D,disabled:I,notFoundContent:R,status:P,builtinPlacements:O,dropdownMatchSelectWidth:N,popupMatchSelectWidth:B,direction:$,style:F,allowClear:z}=e,K=w(e,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:U,getPrefixCls:j,renderEmpty:q,direction:H,virtual:V,popupMatchSelectWidth:G,popupOverflow:Z,select:W}=o.useContext(d.E_),Y=j("select",i),X=j(),J=null!=$?$:H,{compactSize:Q,compactItemClassnames:ee}=(0,g.ri)(Y,J),[te,ne]=(0,v.Z)(Y),ie=o.useMemo((()=>{const{mode:e}=K;if("combobox"!==e)return e===x?"combobox":e}),[K.mode]),re="multiple"===ie||"tags"===ie,ae=(0,y.Z)(K.suffixIcon,K.showArrow),se=null!==(n=null!=B?B:N)&&void 0!==n?n:G,{status:oe,hasFeedback:le,isFormItemInput:ce,feedbackIcon:ue}=o.useContext(m.aM),de=(0,u.F)(oe,P);let he;he=void 0!==R?R:"combobox"===ie?null:(null==q?void 0:q("Select"))||o.createElement(p.Z,{componentName:"Select"});const{suffixIcon:pe,itemIcon:fe,removeIcon:me,clearIcon:ge}=(0,_.Z)(Object.assign(Object.assign({},K),{multiple:re,hasFeedback:le,feedbackIcon:ue,showSuffixIcon:ae,prefixCls:Y,showArrow:K.showArrow,componentName:"Select"})),ve=!0===z?{clearIcon:ge}:z,be=(0,s.Z)(K,["suffixIcon","itemIcon"]),ye=r()(C||T,{[`${Y}-dropdown-${J}`]:"rtl"===J},S,ne),_e=(0,f.Z)((e=>{var t;return null!==(t=null!=D?D:Q)&&void 0!==t?t:e})),we=o.useContext(h.Z),xe=null!=I?I:we,ke=r()({[`${Y}-lg`]:"large"===_e,[`${Y}-sm`]:"small"===_e,[`${Y}-rtl`]:"rtl"===J,[`${Y}-borderless`]:!l,[`${Y}-in-form-item`]:ce},(0,u.Z)(Y,de,le),ee,null==W?void 0:W.className,k,S,ne),Se=o.useMemo((()=>void 0!==M?M:"rtl"===J?"bottomRight":"bottomLeft"),[M,J]),Ee=(0,b.Z)(O,Z);return te(o.createElement(a.ZP,Object.assign({ref:t,virtual:V,showSearch:null==W?void 0:W.showSearch},be,{style:Object.assign(Object.assign({},null==W?void 0:W.style),F),dropdownMatchSelectWidth:se,builtinPlacements:Ee,transitionName:(0,c.m)(X,"slide-up",K.transitionName),listHeight:A,listItemHeight:L,mode:ie,prefixCls:Y,placement:Se,direction:J,suffixIcon:pe,menuItemSelectedIcon:fe,removeIcon:me,allowClear:ve,notFoundContent:he,className:ke,getPopupContainer:E||U,dropdownClassName:ye,disabled:xe})))};const S=o.forwardRef(k),E=(0,l.Z)(S);S.SECRET_COMBOBOX_MODE_DO_NOT_USE=x,S.Option=a.Wx,S.OptGroup=a.Xo,S._InternalPanelDoNotUseOrYouWillBeFired=E,t.default=S},14154:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var i=n(17313),r=n(74207),a=n(37613),s=n(83116),o=n(13826),l=n(92899);const c=e=>{const{optionHeight:t,optionFontSize:n,optionLineHeight:i,optionPadding:r}=e;return{position:"relative",display:"block",minHeight:t,padding:r,color:e.colorText,fontWeight:"normal",fontSize:n,lineHeight:i,boxSizing:"border-box"}};var u=e=>{const{antCls:t,componentCls:n}=e,r=`${n}-item`,a=`&${t}-slide-up-enter${t}-slide-up-enter-active`,s=`&${t}-slide-up-appear${t}-slide-up-appear-active`,u=`&${t}-slide-up-leave${t}-slide-up-leave-active`,d=`${n}-dropdown-placement-`;return[{[`${n}-dropdown`]:Object.assign(Object.assign({},(0,i.Wf)(e)),{position:"absolute",top:-9999,zIndex:e.zIndexPopup,boxSizing:"border-box",padding:e.paddingXXS,overflow:"hidden",fontSize:e.fontSize,fontVariant:"initial",backgroundColor:e.colorBgElevated,borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,[`\n ${a}${d}bottomLeft,\n ${s}${d}bottomLeft\n `]:{animationName:o.fJ},[`\n ${a}${d}topLeft,\n ${s}${d}topLeft,\n ${a}${d}topRight,\n ${s}${d}topRight\n `]:{animationName:o.Qt},[`${u}${d}bottomLeft`]:{animationName:o.Uw},[`\n ${u}${d}topLeft,\n ${u}${d}topRight\n `]:{animationName:o.ly},"&-hidden":{display:"none"},[`${r}`]:Object.assign(Object.assign({},c(e)),{cursor:"pointer",transition:`background ${e.motionDurationSlow} ease`,borderRadius:e.borderRadiusSM,"&-group":{color:e.colorTextDescription,fontSize:e.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},i.vS),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${r}-option-disabled)`]:{backgroundColor:e.optionActiveBg},[`&-selected:not(${r}-option-disabled)`]:{color:e.optionSelectedColor,fontWeight:e.optionSelectedFontWeight,backgroundColor:e.optionSelectedBg,[`${r}-option-state`]:{color:e.colorPrimary}},"&-disabled":{[`&${r}-option-selected`]:{backgroundColor:e.colorBgContainerDisabled},color:e.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:2*e.controlPaddingHorizontal}}}),"&-rtl":{direction:"rtl"}})},(0,o.oN)(e,"slide-up"),(0,o.oN)(e,"slide-down"),(0,l.Fm)(e,"move-up"),(0,l.Fm)(e,"move-down")]};const d=e=>{let{controlHeightSM:t,controlHeight:n,lineWidth:i}=e;const r=(n-t)/2-i;return[r,Math.ceil(r/2)]};function h(e,t){const{componentCls:n,iconCls:r}=e,a=`${n}-selection-overflow`,s=e.multipleSelectItemHeight,[o]=d(e);return{[`${n}-multiple${t?`${n}-${t}`:""}`]:{fontSize:e.fontSize,[a]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},[`${n}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",padding:o-2+"px 4px",borderRadius:e.borderRadius,[`${n}-show-search&`]:{cursor:"text"},[`${n}-disabled&`]:{background:e.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:"2px 0",lineHeight:`${s}px`,visibility:"hidden",content:'"\\a0"'}},[`\n &${n}-show-arrow ${n}-selector,\n &${n}-allow-clear ${n}-selector\n `]:{paddingInlineEnd:e.fontSizeIcon+e.controlPaddingHorizontal},[`${n}-selection-item`]:{position:"relative",display:"flex",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:s,marginTop:2,marginBottom:2,lineHeight:s-2*e.lineWidth+"px",background:e.multipleItemBg,border:`${e.lineWidth}px ${e.lineType} ${e.multipleItemBorderColor}`,borderRadius:e.borderRadiusSM,cursor:"default",transition:`font-size ${e.motionDurationSlow}, line-height ${e.motionDurationSlow}, height ${e.motionDurationSlow}`,userSelect:"none",marginInlineEnd:4,paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS/2,[`${n}-disabled&`]:{color:e.multipleItemColorDisabled,borderColor:e.multipleItemBorderColorDisabled,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:e.paddingXS/2,overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},(0,i.Ro)()),{display:"inline-flex",alignItems:"center",color:e.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${r}`]:{verticalAlign:"-0.2em"},"&:hover":{color:e.colorIconHover}})},[`${a}-item + ${a}-item`]:{[`${n}-selection-search`]:{marginInlineStart:0}},[`${n}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:e.inputPaddingHorizontalBase-o,"\n &-input,\n &-mirror\n ":{height:s,fontFamily:e.fontFamily,lineHeight:`${s}px`,transition:`all ${e.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${n}-selection-placeholder `]:{position:"absolute",top:"50%",insetInlineStart:e.inputPaddingHorizontalBase,insetInlineEnd:e.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${e.motionDurationSlow}`}}}}var p=e=>{const{componentCls:t}=e,n=(0,a.TS)(e,{controlHeight:e.controlHeightSM,multipleSelectItemHeight:e.controlHeightXS,borderRadius:e.borderRadiusSM,borderRadiusSM:e.borderRadiusXS}),i=(0,a.TS)(e,{fontSize:e.fontSizeLG,controlHeight:e.controlHeightLG,multipleSelectItemHeight:e.multipleItemHeightLG,borderRadius:e.borderRadiusLG,borderRadiusSM:e.borderRadius}),[,r]=d(e);return[h(e),h(n,"sm"),{[`${t}-multiple${t}-sm`]:{[`${t}-selection-placeholder`]:{insetInline:e.controlPaddingHorizontalSM-e.lineWidth},[`${t}-selection-search`]:{marginInlineStart:r}}},h(i,"lg")]};function f(e,t){const{componentCls:n,inputPaddingHorizontalBase:r,borderRadius:a}=e,s=e.controlHeight-2*e.lineWidth,o=Math.ceil(1.25*e.fontSize);return{[`${n}-single${t?`${n}-${t}`:""}`]:{fontSize:e.fontSize,[`${n}-selector`]:Object.assign(Object.assign({},(0,i.Wf)(e)),{display:"flex",borderRadius:a,[`${n}-selection-search`]:{position:"absolute",top:0,insetInlineStart:r,insetInlineEnd:r,bottom:0,"&-input":{width:"100%"}},[`\n ${n}-selection-item,\n ${n}-selection-placeholder\n `]:{padding:0,lineHeight:`${s}px`,transition:`all ${e.motionDurationSlow}, visibility 0s`,"@supports (-moz-appearance: meterbar)":{lineHeight:`${s}px`}},[`${n}-selection-item`]:{position:"relative",userSelect:"none"},[`${n}-selection-placeholder`]:{transition:"none",pointerEvents:"none"},[["&:after",`${n}-selection-item:after`,`${n}-selection-placeholder:after`].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),[`\n &${n}-show-arrow ${n}-selection-item,\n &${n}-show-arrow ${n}-selection-placeholder\n `]:{paddingInlineEnd:o},[`&${n}-open ${n}-selection-item`]:{color:e.colorTextPlaceholder},[`&:not(${n}-customize-input)`]:{[`${n}-selector`]:{width:"100%",height:e.controlHeight,padding:`0 ${r}px`,[`${n}-selection-search-input`]:{height:s},"&:after":{lineHeight:`${s}px`}}},[`&${n}-customize-input`]:{[`${n}-selector`]:{"&:after":{display:"none"},[`${n}-selection-search`]:{position:"static",width:"100%"},[`${n}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${r}px`,"&:after":{display:"none"}}}}}}}function m(e){const{componentCls:t}=e,n=e.controlPaddingHorizontalSM-e.lineWidth;return[f(e),f((0,a.TS)(e,{controlHeight:e.controlHeightSM,borderRadius:e.borderRadiusSM}),"sm"),{[`${t}-single${t}-sm`]:{[`&:not(${t}-customize-input)`]:{[`${t}-selection-search`]:{insetInlineStart:n,insetInlineEnd:n},[`${t}-selector`]:{padding:`0 ${n}px`},[`&${t}-show-arrow ${t}-selection-search`]:{insetInlineEnd:n+1.5*e.fontSize},[`\n &${t}-show-arrow ${t}-selection-item,\n &${t}-show-arrow ${t}-selection-placeholder\n `]:{paddingInlineEnd:1.5*e.fontSize}}}},f((0,a.TS)(e,{controlHeight:e.singleItemHeightLG,fontSize:e.fontSizeLG,borderRadius:e.borderRadiusLG}),"lg")]}const g=e=>{const{componentCls:t,selectorBg:n}=e;return{position:"relative",backgroundColor:n,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,input:{cursor:"pointer"},[`${t}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit"}},[`${t}-disabled&`]:{color:e.colorTextDisabled,background:e.colorBgContainerDisabled,cursor:"not-allowed",[`${t}-multiple&`]:{background:e.multipleSelectorBgDisabled},input:{cursor:"not-allowed"}}}},v=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const{componentCls:i,borderHoverColor:r,outlineColor:a,antCls:s}=t,o=n?{[`${i}-selector`]:{borderColor:r}}:{};return{[e]:{[`&:not(${i}-disabled):not(${i}-customize-input):not(${s}-pagination-size-changer)`]:Object.assign(Object.assign({},o),{[`${i}-focused& ${i}-selector`]:{borderColor:r,boxShadow:`0 0 0 ${t.controlOutlineWidth}px ${a}`,outline:0},[`&:hover ${i}-selector`]:{borderColor:r}})}}},b=e=>{const{componentCls:t}=e;return{[`${t}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},y=e=>{const{componentCls:t,inputPaddingHorizontalBase:n,iconCls:r}=e;return{[t]:Object.assign(Object.assign({},(0,i.Wf)(e)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${t}-customize-input) ${t}-selector`]:Object.assign(Object.assign({},g(e)),b(e)),[`${t}-selection-item`]:Object.assign({flex:1,fontWeight:"normal"},i.vS),[`${t}-selection-placeholder`]:Object.assign(Object.assign({},i.vS),{flex:1,color:e.colorTextPlaceholder,pointerEvents:"none"}),[`${t}-arrow`]:Object.assign(Object.assign({},(0,i.Ro)()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:n,height:e.fontSizeIcon,marginTop:-e.fontSizeIcon/2,color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",[r]:{verticalAlign:"top",transition:`transform ${e.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${t}-suffix)`]:{pointerEvents:"auto"}},[`${t}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${t}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:n,zIndex:1,display:"inline-block",width:e.fontSizeIcon,height:e.fontSizeIcon,marginTop:-e.fontSizeIcon/2,color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",background:e.clearBg,cursor:"pointer",opacity:0,transition:`color ${e.motionDurationMid} ease, opacity ${e.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:e.colorTextTertiary}},"&:hover":{[`${t}-clear`]:{opacity:1}}}),[`${t}-has-feedback`]:{[`${t}-clear`]:{insetInlineEnd:n+e.fontSize+e.paddingXS}}}},_=e=>{const{componentCls:t}=e;return[{[t]:{[`&-borderless ${t}-selector`]:{backgroundColor:"transparent !important",borderColor:"transparent !important",boxShadow:"none !important"},[`&${t}-in-form-item`]:{width:"100%"}}},y(e),m(e),p(e),u(e),{[`${t}-rtl`]:{direction:"rtl"}},v(t,(0,a.TS)(e,{borderHoverColor:e.colorPrimaryHover,outlineColor:e.controlOutline})),v(`${t}-status-error`,(0,a.TS)(e,{borderHoverColor:e.colorErrorHover,outlineColor:e.colorErrorOutline}),!0),v(`${t}-status-warning`,(0,a.TS)(e,{borderHoverColor:e.colorWarningHover,outlineColor:e.colorWarningOutline}),!0),(0,r.c)(e,{borderElCls:`${t}-selector`,focusElCls:`${t}-focused`})]};var w=(0,s.Z)("Select",((e,t)=>{let{rootPrefixCls:n}=t;const i=(0,a.TS)(e,{rootPrefixCls:n,inputPaddingHorizontalBase:e.paddingSM-1,multipleSelectItemHeight:e.multipleItemHeight});return[_(i)]}),(e=>{const{fontSize:t,lineHeight:n,controlHeight:i,controlPaddingHorizontal:r,zIndexPopupBase:a,colorText:s,fontWeightStrong:o,controlItemBgActive:l,controlItemBgHover:c,colorBgContainer:u,colorFillSecondary:d,controlHeightLG:h,controlHeightSM:p,colorBgContainerDisabled:f,colorTextDisabled:m}=e;return{zIndexPopup:a+50,optionSelectedColor:s,optionSelectedFontWeight:o,optionSelectedBg:l,optionActiveBg:c,optionPadding:`${(i-t*n)/2}px ${r}px`,optionFontSize:t,optionLineHeight:n,optionHeight:i,selectorBg:u,clearBg:u,singleItemHeightLG:h,multipleItemBg:d,multipleItemBorderColor:"transparent",multipleItemHeight:p,multipleItemHeightLG:i,multipleSelectorBgDisabled:f,multipleItemColorDisabled:m,multipleItemBorderColorDisabled:"transparent"}}))},58582:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});function i(e,t){return e||(e=>{const t={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:"scroll"===e?"scroll":"visible",_experimental:{dynamicInset:!0}};return{bottomLeft:Object.assign(Object.assign({},t),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},t),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},t),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},t),{points:["br","tr"],offset:[0,-4]})}})(t)}},84443:function(e,t,n){"use strict";function i(e,t){return void 0!==t?t:null!==e}n.d(t,{Z:function(){return i}})},66339:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var i=n(40001),r=n(19248),a=n(99267),s=n(84105),o=n(58617),l=n(47472),c=n(59301);function u(e){let{suffixIcon:t,clearIcon:n,menuItemSelectedIcon:u,removeIcon:d,loading:h,multiple:p,hasFeedback:f,prefixCls:m,showSuffixIcon:g,feedbackIcon:v,showArrow:b,componentName:y}=e;const _=null!=n?n:c.createElement(r.Z,null),w=e=>null!==t||f||b?c.createElement(c.Fragment,null,!1!==g&&e,f&&v):null;let x=null;if(void 0!==t)x=w(t);else if(h)x=w(c.createElement(o.Z,{spin:!0}));else{const e=`${m}-suffix`;x=t=>{let{open:n,showSearch:i}=t;return w(n&&i?c.createElement(l.Z,{className:e}):c.createElement(s.Z,{className:e}))}}let k=null;k=void 0!==u?u:p?c.createElement(i.Z,null):null;let S=null;return S=void 0!==d?d:c.createElement(a.Z,null),{clearIcon:_,suffixIcon:x,itemIcon:k,removeIcon:S}}},61621:function(e,t,n){"use strict";n.d(t,{Z:function(){return K}});var i=n(92310),r=n.n(i),a=n(59301),s=n(36355),o=n(2738);var l=e=>{const{prefixCls:t,className:n,style:i,size:s,shape:o}=e,l=r()({[`${t}-lg`]:"large"===s,[`${t}-sm`]:"small"===s}),c=r()({[`${t}-circle`]:"circle"===o,[`${t}-square`]:"square"===o,[`${t}-round`]:"round"===o}),u=a.useMemo((()=>"number"==typeof s?{width:s,height:s,lineHeight:`${s}px`}:{}),[s]);return a.createElement("span",{className:r()(t,l,c,n),style:Object.assign(Object.assign({},u),i)})},c=n(66604),u=n(83116),d=n(37613);const h=new c.E4("ant-skeleton-loading",{"0%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),p=e=>({height:e,lineHeight:`${e}px`}),f=e=>Object.assign({width:e},p(e)),m=e=>({background:e.skeletonLoadingBackground,backgroundSize:"400% 100%",animationName:h,animationDuration:e.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite"}),g=e=>Object.assign({width:5*e,minWidth:5*e},p(e)),v=e=>{const{skeletonAvatarCls:t,gradientFromColor:n,controlHeight:i,controlHeightLG:r,controlHeightSM:a}=e;return{[`${t}`]:Object.assign({display:"inline-block",verticalAlign:"top",background:n},f(i)),[`${t}${t}-circle`]:{borderRadius:"50%"},[`${t}${t}-lg`]:Object.assign({},f(r)),[`${t}${t}-sm`]:Object.assign({},f(a))}},b=e=>{const{controlHeight:t,borderRadiusSM:n,skeletonInputCls:i,controlHeightLG:r,controlHeightSM:a,gradientFromColor:s}=e;return{[`${i}`]:Object.assign({display:"inline-block",verticalAlign:"top",background:s,borderRadius:n},g(t)),[`${i}-lg`]:Object.assign({},g(r)),[`${i}-sm`]:Object.assign({},g(a))}},y=e=>Object.assign({width:e},p(e)),_=e=>{const{skeletonImageCls:t,imageSizeBase:n,gradientFromColor:i,borderRadiusSM:r}=e;return{[`${t}`]:Object.assign(Object.assign({display:"flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",background:i,borderRadius:r},y(2*n)),{[`${t}-path`]:{fill:"#bfbfbf"},[`${t}-svg`]:Object.assign(Object.assign({},y(n)),{maxWidth:4*n,maxHeight:4*n}),[`${t}-svg${t}-svg-circle`]:{borderRadius:"50%"}}),[`${t}${t}-circle`]:{borderRadius:"50%"}}},w=(e,t,n)=>{const{skeletonButtonCls:i}=e;return{[`${n}${i}-circle`]:{width:t,minWidth:t,borderRadius:"50%"},[`${n}${i}-round`]:{borderRadius:t}}},x=e=>Object.assign({width:2*e,minWidth:2*e},p(e)),k=e=>{const{borderRadiusSM:t,skeletonButtonCls:n,controlHeight:i,controlHeightLG:r,controlHeightSM:a,gradientFromColor:s}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[`${n}`]:Object.assign({display:"inline-block",verticalAlign:"top",background:s,borderRadius:t,width:2*i,minWidth:2*i},x(i))},w(e,i,n)),{[`${n}-lg`]:Object.assign({},x(r))}),w(e,r,`${n}-lg`)),{[`${n}-sm`]:Object.assign({},x(a))}),w(e,a,`${n}-sm`))},S=e=>{const{componentCls:t,skeletonAvatarCls:n,skeletonTitleCls:i,skeletonParagraphCls:r,skeletonButtonCls:a,skeletonInputCls:s,skeletonImageCls:o,controlHeight:l,controlHeightLG:c,controlHeightSM:u,gradientFromColor:d,padding:h,marginSM:p,borderRadius:g,titleHeight:y,blockRadius:w,paragraphLiHeight:x,controlHeightXS:S,paragraphMarginTop:E}=e;return{[`${t}`]:{display:"table",width:"100%",[`${t}-header`]:{display:"table-cell",paddingInlineEnd:h,verticalAlign:"top",[`${n}`]:Object.assign({display:"inline-block",verticalAlign:"top",background:d},f(l)),[`${n}-circle`]:{borderRadius:"50%"},[`${n}-lg`]:Object.assign({},f(c)),[`${n}-sm`]:Object.assign({},f(u))},[`${t}-content`]:{display:"table-cell",width:"100%",verticalAlign:"top",[`${i}`]:{width:"100%",height:y,background:d,borderRadius:w,[`+ ${r}`]:{marginBlockStart:u}},[`${r}`]:{padding:0,"> li":{width:"100%",height:x,listStyle:"none",background:d,borderRadius:w,"+ li":{marginBlockStart:S}}},[`${r}> li:last-child:not(:first-child):not(:nth-child(2))`]:{width:"61%"}},[`&-round ${t}-content`]:{[`${i}, ${r} > li`]:{borderRadius:g}}},[`${t}-with-avatar ${t}-content`]:{[`${i}`]:{marginBlockStart:p,[`+ ${r}`]:{marginBlockStart:E}}},[`${t}${t}-element`]:Object.assign(Object.assign(Object.assign(Object.assign({display:"inline-block",width:"auto"},k(e)),v(e)),b(e)),_(e)),[`${t}${t}-block`]:{width:"100%",[`${a}`]:{width:"100%"},[`${s}`]:{width:"100%"}},[`${t}${t}-active`]:{[`\n ${i},\n ${r} > li,\n ${n},\n ${a},\n ${s},\n ${o}\n `]:Object.assign({},m(e))}}};var E=(0,u.Z)("Skeleton",(e=>{const{componentCls:t}=e,n=(0,d.TS)(e,{skeletonAvatarCls:`${t}-avatar`,skeletonTitleCls:`${t}-title`,skeletonParagraphCls:`${t}-paragraph`,skeletonButtonCls:`${t}-button`,skeletonInputCls:`${t}-input`,skeletonImageCls:`${t}-image`,imageSizeBase:1.5*e.controlHeight,borderRadius:100,skeletonLoadingBackground:`linear-gradient(90deg, ${e.gradientFromColor} 25%, ${e.gradientToColor} 37%, ${e.gradientFromColor} 63%)`,skeletonLoadingMotionDuration:"1.4s"});return[S(n)]}),(e=>{const{colorFillContent:t,colorFill:n}=e;return{color:t,colorGradientEnd:n,gradientFromColor:t,gradientToColor:n,titleHeight:e.controlHeight/2,blockRadius:e.borderRadiusSM,paragraphMarginTop:e.marginLG+e.marginXXS,paragraphLiHeight:e.controlHeight/2}}),{deprecatedTokens:[["color","gradientFromColor"],["colorGradientEnd","gradientToColor"]]});var C=e=>{const{prefixCls:t,className:n,rootClassName:i,active:c,shape:u="circle",size:d="default"}=e,{getPrefixCls:h}=a.useContext(s.E_),p=h("skeleton",t),[f,m]=E(p),g=(0,o.Z)(e,["prefixCls","className"]),v=r()(p,`${p}-element`,{[`${p}-active`]:c},n,i,m);return f(a.createElement("div",{className:v},a.createElement(l,Object.assign({prefixCls:`${p}-avatar`,shape:u,size:d},g))))};var T=e=>{const{prefixCls:t,className:n,rootClassName:i,active:c,block:u=!1,size:d="default"}=e,{getPrefixCls:h}=a.useContext(s.E_),p=h("skeleton",t),[f,m]=E(p),g=(0,o.Z)(e,["prefixCls"]),v=r()(p,`${p}-element`,{[`${p}-active`]:c,[`${p}-block`]:u},n,i,m);return f(a.createElement("div",{className:v},a.createElement(l,Object.assign({prefixCls:`${p}-button`,size:d},g))))};var A=e=>{const{prefixCls:t,className:n,rootClassName:i,style:o,active:l}=e,{getPrefixCls:c}=a.useContext(s.E_),u=c("skeleton",t),[d,h]=E(u),p=r()(u,`${u}-element`,{[`${u}-active`]:l},n,i,h);return d(a.createElement("div",{className:p},a.createElement("div",{className:r()(`${u}-image`,n),style:o},a.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:`${u}-image-svg`},a.createElement("path",{d:"M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",className:`${u}-image-path`})))))};var M=e=>{const{prefixCls:t,className:n,rootClassName:i,active:c,block:u,size:d="default"}=e,{getPrefixCls:h}=a.useContext(s.E_),p=h("skeleton",t),[f,m]=E(p),g=(0,o.Z)(e,["prefixCls"]),v=r()(p,`${p}-element`,{[`${p}-active`]:c,[`${p}-block`]:u},n,i,m);return f(a.createElement("div",{className:v},a.createElement(l,Object.assign({prefixCls:`${p}-input`,size:d},g))))},L=n(14809),D={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM288 604a64 64 0 10128 0 64 64 0 10-128 0zm118-224a48 48 0 1096 0 48 48 0 10-96 0zm158 228a96 96 0 10192 0 96 96 0 10-192 0zm148-314a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"dot-chart",theme:"outlined"},I=n(7657),R=function(e,t){return a.createElement(I.Z,(0,L.Z)({},e,{ref:t,icon:D}))};var P=a.forwardRef(R);var O=e=>{const{prefixCls:t,className:n,rootClassName:i,style:o,active:l,children:c}=e,{getPrefixCls:u}=a.useContext(s.E_),d=u("skeleton",t),[h,p]=E(d),f=r()(d,`${d}-element`,{[`${d}-active`]:l},p,n,i),m=null!=c?c:a.createElement(P,null);return h(a.createElement("div",{className:f},a.createElement("div",{className:r()(`${d}-image`,n),style:o},m)))},N=n(95190);var B=e=>{const t=t=>{const{width:n,rows:i=2}=e;return Array.isArray(n)?n[t]:i-1===t?n:void 0},{prefixCls:n,className:i,style:s,rows:o}=e,l=(0,N.Z)(Array(o)).map(((e,n)=>a.createElement("li",{key:n,style:{width:t(n)}})));return a.createElement("ul",{className:r()(n,i),style:s},l)};var $=e=>{let{prefixCls:t,className:n,width:i,style:s}=e;return a.createElement("h3",{className:r()(t,n),style:Object.assign({width:i},s)})};function F(e){return e&&"object"==typeof e?e:{}}const z=e=>{const{prefixCls:t,loading:n,className:i,rootClassName:o,style:c,children:u,avatar:d=!1,title:h=!0,paragraph:p=!0,active:f,round:m}=e,{getPrefixCls:g,direction:v,skeleton:b}=a.useContext(s.E_),y=g("skeleton",t),[_,w]=E(y);if(n||!("loading"in e)){const e=!!d,t=!!h,n=!!p;let s,u;if(e){const e=Object.assign(Object.assign({prefixCls:`${y}-avatar`},function(e,t){return e&&!t?{size:"large",shape:"square"}:{size:"large",shape:"circle"}}(t,n)),F(d));s=a.createElement("div",{className:`${y}-header`},a.createElement(l,Object.assign({},e)))}if(t||n){let i,r;if(t){const t=Object.assign(Object.assign({prefixCls:`${y}-title`},function(e,t){return!e&&t?{width:"38%"}:e&&t?{width:"50%"}:{}}(e,n)),F(h));i=a.createElement($,Object.assign({},t))}if(n){const n=Object.assign(Object.assign({prefixCls:`${y}-paragraph`},function(e,t){const n={};return e&&t||(n.width="61%"),n.rows=!e&&t?3:2,n}(e,t)),F(p));r=a.createElement(B,Object.assign({},n))}u=a.createElement("div",{className:`${y}-content`},i,r)}const g=r()(y,{[`${y}-with-avatar`]:e,[`${y}-active`]:f,[`${y}-rtl`]:"rtl"===v,[`${y}-round`]:m},null==b?void 0:b.className,i,o,w);return _(a.createElement("div",{className:g,style:Object.assign(Object.assign({},null==b?void 0:b.style),c)},s,u))}return void 0!==u?u:null};z.Button=T,z.Avatar=C,z.Input=M,z.Image=A,z.Node=O;var K=z},99313:function(e,t,n){"use strict";n.d(t,{Z:function(){return Ce}});var i=n(99267),r=n(18785),a=n(62772),s=n(92310),o=n.n(s),l=n(14809),c=n(4635),u=n(20439),d=n(50298),h=n(93664),p=n(62646),f=n(59301),m=n(49658),g=n(18929),v=n(77900),b=(0,f.createContext)(null),y=f.forwardRef((function(e,t){var n=e.prefixCls,i=e.className,r=e.style,a=e.id,s=e.active,l=e.tabKey,c=e.children;return f.createElement("div",{id:a&&"".concat(a,"-panel-").concat(l),role:"tabpanel",tabIndex:s?0:-1,"aria-labelledby":a&&"".concat(a,"-tab-").concat(l),"aria-hidden":!s,style:r,className:o()(n,s&&"".concat(n,"-active"),i),ref:t},c)}));var _=y,w=["key","forceRender","style","className"];function x(e){var t=e.id,n=e.activeKey,i=e.animated,r=e.tabPosition,a=e.destroyInactiveTabPane,s=f.useContext(b),d=s.prefixCls,h=s.tabs,m=i.tabPane,g="".concat(d,"-tabpane");return f.createElement("div",{className:o()("".concat(d,"-content-holder"))},f.createElement("div",{className:o()("".concat(d,"-content"),"".concat(d,"-content-").concat(r),(0,c.Z)({},"".concat(d,"-content-animated"),m))},h.map((function(e){var r=e.key,s=e.forceRender,c=e.style,d=e.className,h=(0,p.Z)(e,w),b=r===n;return f.createElement(v.ZP,(0,l.Z)({key:r,visible:b,forceRender:s,removeOnLeave:!!a,leavedClassName:"".concat(g,"-hidden")},i.tabPaneMotion),(function(e,n){var i=e.style,a=e.className;return f.createElement(_,(0,l.Z)({},h,{prefixCls:g,id:t,tabKey:r,animated:m,active:b,style:(0,u.Z)((0,u.Z)({},c),i),className:o()(d,a),ref:n}))}))}))))}var k=n(95190),S=n(29301),E=n(6089),C=n(8654),T={width:0,height:0,left:0,top:0};function A(e,t){var n=f.useRef(e),i=f.useState({}),r=(0,d.Z)(i,2)[1];return[n.current,function(e){var i="function"==typeof e?e(n.current):e;i!==n.current&&t(i,n.current),n.current=i,r({})}]}var M=Math.pow(.995,20);var L=n(34280);function D(e){var t=(0,f.useState)(0),n=(0,d.Z)(t,2),i=n[0],r=n[1],a=(0,f.useRef)(0),s=(0,f.useRef)();return s.current=e,(0,L.o)((function(){var e;null===(e=s.current)||void 0===e||e.call(s)}),[i]),function(){a.current===i&&(a.current+=1,r(a.current))}}var I={width:0,height:0,left:0,top:0,right:0};function R(e){var t;return e instanceof Map?(t={},e.forEach((function(e,n){t[n]=e}))):t=e,JSON.stringify(t)}function P(e){return String(e).replace(/"/g,"TABS_DQ")}function O(e,t,n,i){return!(!n||i||!1===e||void 0===e&&(!1===t||null===t))}function N(e,t){var n=e.prefixCls,i=e.editable,r=e.locale,a=e.style;return i&&!1!==i.showAdd?f.createElement("button",{ref:t,type:"button",className:"".concat(n,"-nav-add"),style:a,"aria-label":(null==r?void 0:r.addAriaLabel)||"Add tab",onClick:function(e){i.onEdit("add",{event:e})}},i.addIcon||"+"):null}var B=f.forwardRef(N);var $=f.forwardRef((function(e,t){var n,i=e.position,r=e.prefixCls,a=e.extra;if(!a)return null;var s={};return"object"!==(0,h.Z)(a)||f.isValidElement(a)?s.right=a:s=a,"right"===i&&(n=s.right),"left"===i&&(n=s.left),n?f.createElement("div",{className:"".concat(r,"-extra-content"),ref:t},n):null})),F=n(31561),z=n(15285),K=n(10228);function U(e,t){var n=e.prefixCls,i=e.id,r=e.tabs,a=e.locale,s=e.mobile,l=e.moreIcon,u=void 0===l?"More":l,h=e.moreTransitionName,p=e.style,m=e.className,g=e.editable,v=e.tabBarGutter,b=e.rtl,y=e.removeAriaLabel,_=e.onTabClick,w=e.getPopupContainer,x=e.popupClassName,k=(0,f.useState)(!1),S=(0,d.Z)(k,2),E=S[0],C=S[1],T=(0,f.useState)(null),A=(0,d.Z)(T,2),M=A[0],L=A[1],D="".concat(i,"-more-popup"),I="".concat(n,"-dropdown"),R=null!==M?"".concat(D,"-").concat(M):null,P=null==a?void 0:a.dropdownAriaLabel;var N=f.createElement(z.ZP,{onClick:function(e){var t=e.key,n=e.domEvent;_(t,n),C(!1)},prefixCls:"".concat(I,"-menu"),id:D,tabIndex:-1,role:"listbox","aria-activedescendant":R,selectedKeys:[M],"aria-label":void 0!==P?P:"expanded dropdown"},r.map((function(e){var t=e.closable,n=e.disabled,r=e.closeIcon,a=e.key,s=e.label,o=O(t,r,g,n);return f.createElement(z.sN,{key:a,id:"".concat(D,"-").concat(a),role:"option","aria-controls":i&&"".concat(i,"-panel-").concat(a),disabled:n},f.createElement("span",null,s),o&&f.createElement("button",{type:"button","aria-label":y||"remove",tabIndex:0,className:"".concat(I,"-menu-item-remove"),onClick:function(e){e.stopPropagation(),function(e,t){e.preventDefault(),e.stopPropagation(),g.onEdit("remove",{key:t,event:e})}(e,a)}},r||g.removeIcon||"×"))})));function $(e){for(var t=r.filter((function(e){return!e.disabled})),n=t.findIndex((function(e){return e.key===M}))||0,i=t.length,a=0;a<i;a+=1){var s=t[n=(n+e+i)%i];if(!s.disabled)return void L(s.key)}}(0,f.useEffect)((function(){var e=document.getElementById(R);e&&e.scrollIntoView&&e.scrollIntoView(!1)}),[M]),(0,f.useEffect)((function(){E||L(null)}),[E]);var U=(0,c.Z)({},b?"marginRight":"marginLeft",v);r.length||(U.visibility="hidden",U.order=1);var j=o()((0,c.Z)({},"".concat(I,"-rtl"),b)),q=s?null:f.createElement(F.Z,{prefixCls:I,overlay:N,trigger:["hover"],visible:!!r.length&&E,transitionName:h,onVisibleChange:C,overlayClassName:o()(j,x),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:w},f.createElement("button",{type:"button",className:"".concat(n,"-nav-more"),style:U,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":D,id:"".concat(i,"-more"),"aria-expanded":E,onKeyDown:function(e){var t=e.which;if(E)switch(t){case K.Z.UP:$(-1),e.preventDefault();break;case K.Z.DOWN:$(1),e.preventDefault();break;case K.Z.ESC:C(!1);break;case K.Z.SPACE:case K.Z.ENTER:null!==M&&_(M,e)}else[K.Z.DOWN,K.Z.SPACE,K.Z.ENTER].includes(t)&&(C(!0),e.preventDefault())}},u));return f.createElement("div",{className:o()("".concat(n,"-nav-operations"),m),style:p,ref:t},q,f.createElement(B,{prefixCls:n,locale:a,editable:g}))}var j=f.memo(f.forwardRef(U),(function(e,t){return t.tabMoving}));var q=function(e){var t,n=e.prefixCls,i=e.id,r=e.active,a=e.tab,s=a.key,l=a.label,u=a.disabled,d=a.closeIcon,h=e.closable,p=e.renderWrapper,m=e.removeAriaLabel,g=e.editable,v=e.onClick,b=e.onFocus,y=e.style,_="".concat(n,"-tab"),w=O(h,d,g,u);function x(e){u||v(e)}var k=f.createElement("div",{key:s,"data-node-key":P(s),className:o()(_,(t={},(0,c.Z)(t,"".concat(_,"-with-remove"),w),(0,c.Z)(t,"".concat(_,"-active"),r),(0,c.Z)(t,"".concat(_,"-disabled"),u),t)),style:y,onClick:x},f.createElement("div",{role:"tab","aria-selected":r,id:i&&"".concat(i,"-tab-").concat(s),className:"".concat(_,"-btn"),"aria-controls":i&&"".concat(i,"-panel-").concat(s),"aria-disabled":u,tabIndex:u?null:0,onClick:function(e){e.stopPropagation(),x(e)},onKeyDown:function(e){[K.Z.SPACE,K.Z.ENTER].includes(e.which)&&(e.preventDefault(),x(e))},onFocus:b},l),w&&f.createElement("button",{type:"button","aria-label":m||"remove",tabIndex:0,className:"".concat(_,"-remove"),onClick:function(e){var t;e.stopPropagation(),(t=e).preventDefault(),t.stopPropagation(),g.onEdit("remove",{key:s,event:t})}},d||g.removeIcon||"×"));return p?p(k):k},H=n(16089),V=function(e){var t=e.activeTabOffset,n=e.horizontal,i=e.rtl,r=e.indicatorSize,a=(0,f.useState)(),s=(0,d.Z)(a,2),o=s[0],l=s[1],c=(0,f.useRef)(),u=function(e){return"function"==typeof r?r(e):"number"==typeof r?r:e};function h(){H.Z.cancel(c.current)}return(0,f.useEffect)((function(){var e={};return t&&(n?(i?(e.right=t.right+t.width/2,e.transform="translateX(50%)"):(e.left=t.left+t.width/2,e.transform="translateX(-50%)"),e.width=u(t.width)):(e.top=t.top+t.height/2,e.transform="translateY(-50%)",e.height=u(t.height))),h(),c.current=(0,H.Z)((function(){l(e)})),h}),[t,n,i,r]),{style:o}},G=function(e){var t=e.current||{},n=t.offsetWidth,i=void 0===n?0:n,r=t.offsetHeight;return[i,void 0===r?0:r]},Z=function(e,t){return e[t?0:1]};function W(e,t){var n,i=f.useContext(b),r=i.prefixCls,a=i.tabs,s=e.className,h=e.style,p=e.id,m=e.animated,g=e.activeKey,v=e.rtl,y=e.extra,_=e.editable,w=e.locale,x=e.tabPosition,L=e.tabBarGutter,O=e.children,N=e.onTabClick,F=e.onTabScroll,z=e.indicatorSize,K=(0,f.useRef)(),U=(0,f.useRef)(),H=(0,f.useRef)(),W=(0,f.useRef)(),Y=(0,f.useRef)(),X=(0,f.useRef)(),J=(0,f.useRef)(),Q="top"===x||"bottom"===x,ee=A(0,(function(e,t){Q&&F&&F({direction:e>t?"left":"right"})})),te=(0,d.Z)(ee,2),ne=te[0],ie=te[1],re=A(0,(function(e,t){!Q&&F&&F({direction:e>t?"top":"bottom"})})),ae=(0,d.Z)(re,2),se=ae[0],oe=ae[1],le=(0,f.useState)([0,0]),ce=(0,d.Z)(le,2),ue=ce[0],de=ce[1],he=(0,f.useState)([0,0]),pe=(0,d.Z)(he,2),fe=pe[0],me=pe[1],ge=(0,f.useState)([0,0]),ve=(0,d.Z)(ge,2),be=ve[0],ye=ve[1],_e=(0,f.useState)([0,0]),we=(0,d.Z)(_e,2),xe=we[0],ke=we[1],Se=function(e){var t=(0,f.useRef)([]),n=(0,f.useState)({}),i=(0,d.Z)(n,2)[1],r=(0,f.useRef)("function"==typeof e?e():e),a=D((function(){var e=r.current;t.current.forEach((function(t){e=t(e)})),t.current=[],r.current=e,i({})}));return[r.current,function(e){t.current.push(e),a()}]}(new Map),Ee=(0,d.Z)(Se,2),Ce=Ee[0],Te=Ee[1],Ae=function(e,t,n){return(0,f.useMemo)((function(){for(var n,i=new Map,r=t.get(null===(n=e[0])||void 0===n?void 0:n.key)||T,a=r.left+r.width,s=0;s<e.length;s+=1){var o,l=e[s].key,c=t.get(l);c||(c=t.get(null===(o=e[s-1])||void 0===o?void 0:o.key)||T);var d=i.get(l)||(0,u.Z)({},c);d.right=a-d.left-d.width,i.set(l,d)}return i}),[e.map((function(e){return e.key})).join("_"),t,n])}(a,Ce,fe[0]),Me=Z(ue,Q),Le=Z(fe,Q),De=Z(be,Q),Ie=Z(xe,Q),Re=Me<Le+De,Pe=Re?Me-Ie:Me-De,Oe="".concat(r,"-nav-operations-hidden"),Ne=0,Be=0;function $e(e){return e<Ne?Ne:e>Be?Be:e}Q&&v?(Ne=0,Be=Math.max(0,Le-Pe)):(Ne=Math.min(0,Pe-Le),Be=0);var Fe=(0,f.useRef)(),ze=(0,f.useState)(),Ke=(0,d.Z)(ze,2),Ue=Ke[0],je=Ke[1];function qe(){je(Date.now())}function He(){window.clearTimeout(Fe.current)}!function(e,t){var n=(0,f.useState)(),i=(0,d.Z)(n,2),r=i[0],a=i[1],s=(0,f.useState)(0),o=(0,d.Z)(s,2),l=o[0],c=o[1],u=(0,f.useState)(0),h=(0,d.Z)(u,2),p=h[0],m=h[1],g=(0,f.useState)(),v=(0,d.Z)(g,2),b=v[0],y=v[1],_=(0,f.useRef)(),w=(0,f.useRef)(),x=(0,f.useRef)(null);x.current={onTouchStart:function(e){var t=e.touches[0],n=t.screenX,i=t.screenY;a({x:n,y:i}),window.clearInterval(_.current)},onTouchMove:function(e){if(r){e.preventDefault();var n=e.touches[0],i=n.screenX,s=n.screenY;a({x:i,y:s});var o=i-r.x,u=s-r.y;t(o,u);var d=Date.now();c(d),m(d-l),y({x:o,y:u})}},onTouchEnd:function(){if(r&&(a(null),y(null),b)){var e=b.x/p,n=b.y/p,i=Math.abs(e),s=Math.abs(n);if(Math.max(i,s)<.1)return;var o=e,l=n;_.current=window.setInterval((function(){Math.abs(o)<.01&&Math.abs(l)<.01?window.clearInterval(_.current):t(20*(o*=M),20*(l*=M))}),20)}},onWheel:function(e){var n=e.deltaX,i=e.deltaY,r=0,a=Math.abs(n),s=Math.abs(i);a===s?r="x"===w.current?n:i:a>s?(r=n,w.current="x"):(r=i,w.current="y"),t(-r,-r)&&e.preventDefault()}},f.useEffect((function(){function t(e){x.current.onTouchMove(e)}function n(e){x.current.onTouchEnd(e)}return document.addEventListener("touchmove",t,{passive:!1}),document.addEventListener("touchend",n,{passive:!1}),e.current.addEventListener("touchstart",(function(e){x.current.onTouchStart(e)}),{passive:!1}),e.current.addEventListener("wheel",(function(e){x.current.onWheel(e)})),function(){document.removeEventListener("touchmove",t),document.removeEventListener("touchend",n)}}),[])}(W,(function(e,t){function n(e,t){e((function(e){return $e(e+t)}))}return!!Re&&(Q?n(ie,e):n(oe,t),He(),qe(),!0)})),(0,f.useEffect)((function(){return He(),Ue&&(Fe.current=window.setTimeout((function(){je(0)}),100)),He}),[Ue]);var Ve=function(e,t,n,i,r,a,s){var o,l,c,u=s.tabs,d=s.tabPosition,h=s.rtl;return["top","bottom"].includes(d)?(o="width",l=h?"right":"left",c=Math.abs(n)):(o="height",l="top",c=-n),(0,f.useMemo)((function(){if(!u.length)return[0,0];for(var n=u.length,i=n,r=0;r<n;r+=1){var a=e.get(u[r].key)||I;if(a[l]+a[o]>c+t){i=r-1;break}}for(var s=0,d=n-1;d>=0;d-=1)if((e.get(u[d].key)||I)[l]<c){s=d+1;break}return s>=i?[0,0]:[s,i]}),[e,t,i,r,a,c,d,u.map((function(e){return e.key})).join("_"),h])}(Ae,Pe,Q?ne:se,Le,De,Ie,(0,u.Z)((0,u.Z)({},e),{},{tabs:a})),Ge=(0,d.Z)(Ve,2),Ze=Ge[0],We=Ge[1],Ye=(0,E.Z)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g,t=Ae.get(e)||{width:0,height:0,left:0,right:0,top:0};if(Q){var n=ne;v?t.right<ne?n=t.right:t.right+t.width>ne+Pe&&(n=t.right+t.width-Pe):t.left<-ne?n=-t.left:t.left+t.width>-ne+Pe&&(n=-(t.left+t.width-Pe)),oe(0),ie($e(n))}else{var i=se;t.top<-se?i=-t.top:t.top+t.height>-se+Pe&&(i=-(t.top+t.height-Pe)),ie(0),oe($e(i))}})),Xe={};"top"===x||"bottom"===x?Xe[v?"marginRight":"marginLeft"]=L:Xe.marginTop=L;var Je=a.map((function(e,t){var n=e.key;return f.createElement(q,{id:p,prefixCls:r,key:n,tab:e,style:0===t?void 0:Xe,closable:e.closable,editable:_,active:n===g,renderWrapper:O,removeAriaLabel:null==w?void 0:w.removeAriaLabel,onClick:function(e){N(n,e)},onFocus:function(){Ye(n),qe(),W.current&&(v||(W.current.scrollLeft=0),W.current.scrollTop=0)}})})),Qe=function(){return Te((function(){var e=new Map;return a.forEach((function(t){var n,i=t.key,r=null===(n=Y.current)||void 0===n?void 0:n.querySelector('[data-node-key="'.concat(P(i),'"]'));r&&e.set(i,{width:r.offsetWidth,height:r.offsetHeight,left:r.offsetLeft,top:r.offsetTop})})),e}))};(0,f.useEffect)((function(){Qe()}),[a.map((function(e){return e.key})).join("_")]);var et=D((function(){var e=G(K),t=G(U),n=G(H);de([e[0]-t[0]-n[0],e[1]-t[1]-n[1]]);var i=G(J);ye(i);var r=G(X);ke(r);var a=G(Y);me([a[0]-i[0],a[1]-i[1]]),Qe()})),tt=a.slice(0,Ze),nt=a.slice(We+1),it=[].concat((0,k.Z)(tt),(0,k.Z)(nt)),rt=Ae.get(g),at=V({activeTabOffset:rt,horizontal:Q,rtl:v,indicatorSize:z}).style;(0,f.useEffect)((function(){Ye()}),[g,Ne,Be,R(rt),R(Ae),Q]),(0,f.useEffect)((function(){et()}),[v]);var st,ot,lt,ct,ut=!!it.length,dt="".concat(r,"-nav-wrap");return Q?v?(ot=ne>0,st=ne!==Be):(st=ne<0,ot=ne!==Ne):(lt=se<0,ct=se!==Ne),f.createElement(S.Z,{onResize:et},f.createElement("div",{ref:(0,C.x1)(t,K),role:"tablist",className:o()("".concat(r,"-nav"),s),style:h,onKeyDown:function(){qe()}},f.createElement($,{ref:U,position:"left",extra:y,prefixCls:r}),f.createElement(S.Z,{onResize:et},f.createElement("div",{className:o()(dt,(n={},(0,c.Z)(n,"".concat(dt,"-ping-left"),st),(0,c.Z)(n,"".concat(dt,"-ping-right"),ot),(0,c.Z)(n,"".concat(dt,"-ping-top"),lt),(0,c.Z)(n,"".concat(dt,"-ping-bottom"),ct),n)),ref:W},f.createElement(S.Z,{onResize:et},f.createElement("div",{ref:Y,className:"".concat(r,"-nav-list"),style:{transform:"translate(".concat(ne,"px, ").concat(se,"px)"),transition:Ue?"none":void 0}},Je,f.createElement(B,{ref:J,prefixCls:r,locale:w,editable:_,style:(0,u.Z)((0,u.Z)({},0===Je.length?void 0:Xe),{},{visibility:ut?"hidden":null})}),f.createElement("div",{className:o()("".concat(r,"-ink-bar"),(0,c.Z)({},"".concat(r,"-ink-bar-animated"),m.inkBar)),style:at}))))),f.createElement(j,(0,l.Z)({},e,{removeAriaLabel:null==w?void 0:w.removeAriaLabel,ref:X,prefixCls:r,tabs:it,className:!ut&&Oe,tabMoving:!!Ue})),f.createElement($,{ref:H,position:"right",extra:y,prefixCls:r})))}var Y=f.forwardRef(W),X=["renderTabBar"],J=["label","key"];function Q(e){var t=e.renderTabBar,n=(0,p.Z)(e,X),i=f.useContext(b).tabs;return t?t((0,u.Z)((0,u.Z)({},n),{},{panes:i.map((function(e){var t=e.label,n=e.key,i=(0,p.Z)(e,J);return f.createElement(_,(0,l.Z)({tab:t,key:n,tabKey:n},i))}))}),Y):f.createElement(Y,n)}n(48736);var ee=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicatorSize"],te=0;function ne(e,t){var n,i=e.id,r=e.prefixCls,a=void 0===r?"rc-tabs":r,s=e.className,v=e.items,y=e.direction,_=e.activeKey,w=e.defaultActiveKey,k=e.editable,S=e.animated,E=e.tabPosition,C=void 0===E?"top":E,T=e.tabBarGutter,A=e.tabBarStyle,M=e.tabBarExtraContent,L=e.locale,D=e.moreIcon,I=e.moreTransitionName,R=e.destroyInactiveTabPane,P=e.renderTabBar,O=e.onChange,N=e.onTabClick,B=e.onTabScroll,$=e.getPopupContainer,F=e.popupClassName,z=e.indicatorSize,K=(0,p.Z)(e,ee),U=f.useMemo((function(){return(v||[]).filter((function(e){return e&&"object"===(0,h.Z)(e)&&"key"in e}))}),[v]),j="rtl"===y,q=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{inkBar:!0,tabPane:!1};return(e=!1===t?{inkBar:!1,tabPane:!1}:!0===t?{inkBar:!0,tabPane:!1}:(0,u.Z)({inkBar:!0},"object"===(0,h.Z)(t)?t:{})).tabPaneMotion&&void 0===e.tabPane&&(e.tabPane=!0),!e.tabPaneMotion&&e.tabPane&&(e.tabPane=!1),e}(S),H=(0,f.useState)(!1),V=(0,d.Z)(H,2),G=V[0],Z=V[1];(0,f.useEffect)((function(){Z((0,m.Z)())}),[]);var W=(0,g.Z)((function(){var e;return null===(e=U[0])||void 0===e?void 0:e.key}),{value:_,defaultValue:w}),Y=(0,d.Z)(W,2),X=Y[0],J=Y[1],ne=(0,f.useState)((function(){return U.findIndex((function(e){return e.key===X}))})),ie=(0,d.Z)(ne,2),re=ie[0],ae=ie[1];(0,f.useEffect)((function(){var e,t=U.findIndex((function(e){return e.key===X}));-1===t&&(t=Math.max(0,Math.min(re,U.length-1)),J(null===(e=U[t])||void 0===e?void 0:e.key));ae(t)}),[U.map((function(e){return e.key})).join("_"),X,re]);var se=(0,g.Z)(null,{value:i}),oe=(0,d.Z)(se,2),le=oe[0],ce=oe[1];(0,f.useEffect)((function(){i||(ce("rc-tabs-".concat(te)),te+=1)}),[]);var ue={id:le,activeKey:X,animated:q,tabPosition:C,rtl:j,mobile:G},de=(0,u.Z)((0,u.Z)({},ue),{},{editable:k,locale:L,moreIcon:D,moreTransitionName:I,tabBarGutter:T,onTabClick:function(e,t){null==N||N(e,t);var n=e!==X;J(e),n&&(null==O||O(e))},onTabScroll:B,extra:M,style:A,panes:null,getPopupContainer:$,popupClassName:F,indicatorSize:z});return f.createElement(b.Provider,{value:{tabs:U,prefixCls:a}},f.createElement("div",(0,l.Z)({ref:t,id:i,className:o()(a,"".concat(a,"-").concat(C),(n={},(0,c.Z)(n,"".concat(a,"-mobile"),G),(0,c.Z)(n,"".concat(a,"-editable"),k),(0,c.Z)(n,"".concat(a,"-rtl"),j),n),s)},K),f.createElement(Q,(0,l.Z)({},de,{renderTabBar:P})),f.createElement(x,(0,l.Z)({destroyInactiveTabPane:R},ue,{animated:q}))))}var ie=f.forwardRef(ne),re=n(36355),ae=n(19716);var se=()=>null,oe=n(62892);const le={motionAppear:!1,motionEnter:!0,motionLeave:!0};var ce=n(11592),ue=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};var de=n(17313),he=n(83116),pe=n(37613),fe=n(13826);var me=e=>{const{componentCls:t,motionDurationSlow:n}=e;return[{[t]:{[`${t}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${n}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${n}`}}}}},[(0,fe.oN)(e,"slide-up"),(0,fe.oN)(e,"slide-down")]]};const ge=e=>{const{componentCls:t,tabsCardPadding:n,cardBg:i,cardGutter:r,colorBorderSecondary:a,itemSelectedColor:s}=e;return{[`${t}-card`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{margin:0,padding:n,background:i,border:`${e.lineWidth}px ${e.lineType} ${a}`,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOut}`},[`${t}-tab-active`]:{color:s,background:e.colorBgContainer},[`${t}-ink-bar`]:{visibility:"hidden"}},[`&${t}-top, &${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginLeft:{_skip_check_:!0,value:`${r}px`}}}},[`&${t}-top`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`},[`${t}-tab-active`]:{borderBottomColor:e.colorBgContainer}}},[`&${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`},[`${t}-tab-active`]:{borderTopColor:e.colorBgContainer}}},[`&${t}-left, &${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginTop:`${r}px`}}},[`&${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${e.borderRadiusLG}px 0 0 ${e.borderRadiusLG}px`}},[`${t}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:e.colorBgContainer}}}},[`&${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px 0`}},[`${t}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:e.colorBgContainer}}}}}}},ve=e=>{const{componentCls:t,itemHoverColor:n,dropdownEdgeChildVerticalPadding:i}=e;return{[`${t}-dropdown`]:Object.assign(Object.assign({},(0,de.Wf)(e)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:e.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${t}-dropdown-menu`]:{maxHeight:e.tabsDropdownHeight,margin:0,padding:`${i}px 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:e.colorBgContainer,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,"&-item":Object.assign(Object.assign({},de.vS),{display:"flex",alignItems:"center",minWidth:e.tabsDropdownWidth,margin:0,padding:`${e.paddingXXS}px ${e.paddingSM}px`,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer",transition:`all ${e.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:e.marginSM},color:e.colorTextDescription,fontSize:e.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:n}},"&:hover":{background:e.controlItemBgHover},"&-disabled":{"&, &:hover":{color:e.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},be=e=>{const{componentCls:t,margin:n,colorBorderSecondary:i,horizontalMargin:r,verticalItemPadding:a,verticalItemMargin:s}=e;return{[`${t}-top, ${t}-bottom`]:{flexDirection:"column",[`> ${t}-nav, > div > ${t}-nav`]:{margin:r,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${e.lineWidth}px ${e.lineType} ${i}`,content:"''"},[`${t}-ink-bar`]:{height:e.lineWidthBold,"&-animated":{transition:`width ${e.motionDurationSlow}, left ${e.motionDurationSlow},\n right ${e.motionDurationSlow}`}},[`${t}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:e.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowRight},[`&${t}-nav-wrap-ping-left::before`]:{opacity:1},[`&${t}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${t}-top`]:{[`> ${t}-nav,\n > div > ${t}-nav`]:{"&::before":{bottom:0},[`${t}-ink-bar`]:{bottom:0}}},[`${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{order:1,marginTop:`${n}px`,marginBottom:0,"&::before":{top:0},[`${t}-ink-bar`]:{top:0}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{order:0}},[`${t}-left, ${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{flexDirection:"column",minWidth:1.25*e.controlHeight,[`${t}-tab`]:{padding:a,textAlign:"center"},[`${t}-tab + ${t}-tab`]:{margin:s},[`${t}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:e.controlHeight},"&::before":{top:0,boxShadow:e.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:e.boxShadowTabsOverflowBottom},[`&${t}-nav-wrap-ping-top::before`]:{opacity:1},[`&${t}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${t}-ink-bar`]:{width:e.lineWidthBold,"&-animated":{transition:`height ${e.motionDurationSlow}, top ${e.motionDurationSlow}`}},[`${t}-nav-list, ${t}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{marginLeft:{_skip_check_:!0,value:`-${e.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`},[`> ${t}-content > ${t}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:e.paddingLG}}}},[`${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{order:1,[`${t}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:-e.lineWidth},borderRight:{_skip_check_:!0,value:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`},[`> ${t}-content > ${t}-tabpane`]:{paddingRight:{_skip_check_:!0,value:e.paddingLG}}}}}},ye=e=>{const{componentCls:t,cardPaddingSM:n,cardPaddingLG:i,horizontalItemPaddingSM:r,horizontalItemPaddingLG:a}=e;return{[t]:{"&-small":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:r,fontSize:e.titleFontSizeSM}}},"&-large":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:a,fontSize:e.titleFontSizeLG}}}},[`${t}-card`]:{[`&${t}-small`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:n}},[`&${t}-bottom`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`0 0 ${e.borderRadius}px ${e.borderRadius}px`}},[`&${t}-top`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`${e.borderRadius}px ${e.borderRadius}px 0 0`}},[`&${t}-right`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${e.borderRadius}px ${e.borderRadius}px 0`}}},[`&${t}-left`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${e.borderRadius}px 0 0 ${e.borderRadius}px`}}}},[`&${t}-large`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:i}}}}}},_e=e=>{const{componentCls:t,itemActiveColor:n,itemHoverColor:i,iconCls:r,tabsHorizontalItemMargin:a,horizontalItemPadding:s,itemSelectedColor:o,itemColor:l}=e,c=`${t}-tab`;return{[c]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:s,fontSize:e.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:l,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:n}},(0,de.Qy)(e)),"&-btn":{outline:"none",transition:"all 0.3s"},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:-e.marginXXS},marginLeft:{_skip_check_:!0,value:e.marginXS},color:e.colorTextDescription,fontSize:e.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${e.motionDurationSlow}`,"&:hover":{color:e.colorTextHeading}},"&:hover":{color:i},[`&${c}-active ${c}-btn`]:{color:o,textShadow:e.tabsActiveTextShadow},[`&${c}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed"},[`&${c}-disabled ${c}-btn, &${c}-disabled ${t}-remove`]:{"&:focus, &:active":{color:e.colorTextDisabled}},[`& ${c}-remove ${r}`]:{margin:0},[r]:{marginRight:{_skip_check_:!0,value:e.marginSM}}},[`${c} + ${c}`]:{margin:{_skip_check_:!0,value:a}}}},we=e=>{const{componentCls:t,tabsHorizontalItemMarginRTL:n,iconCls:i,cardGutter:r}=e;return{[`${t}-rtl`]:{direction:"rtl",[`${t}-nav`]:{[`${t}-tab`]:{margin:{_skip_check_:!0,value:n},[`${t}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[i]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:`${e.marginSM}px`}},[`${t}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${e.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${e.marginXXS}px`},[i]:{margin:0}}}},[`&${t}-left`]:{[`> ${t}-nav`]:{order:1},[`> ${t}-content-holder`]:{order:0}},[`&${t}-right`]:{[`> ${t}-nav`]:{order:0},[`> ${t}-content-holder`]:{order:1}},[`&${t}-card${t}-top, &${t}-card${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginRight:{_skip_check_:!0,value:r},marginLeft:{_skip_check_:!0,value:0}}}}},[`${t}-dropdown-rtl`]:{direction:"rtl"},[`${t}-menu-item`]:{[`${t}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},xe=e=>{const{componentCls:t,tabsCardPadding:n,cardHeight:i,cardGutter:r,itemHoverColor:a,itemActiveColor:s,colorBorderSecondary:o}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,de.Wf)(e)),{display:"flex",[`> ${t}-nav, > div > ${t}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${t}-nav-wrap`]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:`opacity ${e.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${t}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${e.motionDurationSlow}`},[`${t}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${t}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${t}-nav-more`]:{position:"relative",padding:n,background:"transparent",border:0,color:e.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:e.controlHeightLG/8,transform:"translateY(100%)",content:"''"}},[`${t}-nav-add`]:Object.assign({minWidth:i,marginLeft:{_skip_check_:!0,value:r},padding:`0 ${e.paddingXS}px`,background:"transparent",border:`${e.lineWidth}px ${e.lineType} ${o}`,borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`,outline:"none",cursor:"pointer",color:e.colorText,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOut}`,"&:hover":{color:a},"&:active, &:focus:not(:focus-visible)":{color:s}},(0,de.Qy)(e))},[`${t}-extra-content`]:{flex:"none"},[`${t}-ink-bar`]:{position:"absolute",background:e.inkBarColor,pointerEvents:"none"}}),_e(e)),{[`${t}-content`]:{position:"relative",width:"100%"},[`${t}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${t}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${t}-centered`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-nav-wrap`]:{[`&:not([class*='${t}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}};var ke=(0,he.Z)("Tabs",(e=>{const t=(0,pe.TS)(e,{tabsCardPadding:e.cardPadding||`${(e.cardHeight-Math.round(e.fontSize*e.lineHeight))/2-e.lineWidth}px ${e.padding}px`,dropdownEdgeChildVerticalPadding:e.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${e.horizontalItemGutter}px`,tabsHorizontalItemMarginRTL:`0 0 0 ${e.horizontalItemGutter}px`});return[ye(t),we(t),be(t),ve(t),ge(t),xe(t),me(t)]}),(e=>{const t=e.controlHeightLG;return{zIndexPopup:e.zIndexPopupBase+50,cardBg:e.colorFillAlter,cardHeight:t,cardPadding:"",cardPaddingSM:`${1.5*e.paddingXXS}px ${e.padding}px`,cardPaddingLG:`${e.paddingXS}px ${e.padding}px ${1.5*e.paddingXXS}px`,titleFontSize:e.fontSize,titleFontSizeLG:e.fontSizeLG,titleFontSizeSM:e.fontSize,inkBarColor:e.colorPrimary,horizontalMargin:`0 0 ${e.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${e.paddingSM}px 0`,horizontalItemPaddingSM:`${e.paddingXS}px 0`,horizontalItemPaddingLG:`${e.padding}px 0`,verticalItemPadding:`${e.paddingXS}px ${e.paddingLG}px`,verticalItemMargin:`${e.margin}px 0 0 0`,itemColor:e.colorText,itemSelectedColor:e.colorPrimary,itemHoverColor:e.colorPrimaryHover,itemActiveColor:e.colorPrimaryActive,cardGutter:e.marginXXS/2}})),Se=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};const Ee=e=>{const{type:t,className:n,rootClassName:s,size:l,onEdit:c,hideAdd:u,centered:d,addIcon:h,popupClassName:p,children:m,items:g,animated:v,style:b,indicatorSize:y}=e,_=Se(e,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize"]),{prefixCls:w,moreIcon:x=f.createElement(r.Z,null)}=_,{direction:k,tabs:S,getPrefixCls:E,getPopupContainer:C}=f.useContext(re.E_),T=E("tabs",w),[A,M]=ke(T);let L;"editable-card"===t&&(L={onEdit:(e,t)=>{let{key:n,event:i}=t;null==c||c("add"===e?i:n,e)},removeIcon:f.createElement(i.Z,null),addIcon:h||f.createElement(a.Z,null),showAdd:!0!==u});const D=E(),I=function(e,t){return e||function(e){return e.filter((e=>e))}((0,ce.Z)(t).map((e=>{if(f.isValidElement(e)){const{key:t,props:n}=e,i=n||{},{tab:r}=i,a=ue(i,["tab"]);return Object.assign(Object.assign({key:String(t)},a),{label:r})}return null})))}(g,m),R=function(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{inkBar:!0,tabPane:!1};return t=!1===n?{inkBar:!1,tabPane:!1}:!0===n?{inkBar:!0,tabPane:!0}:Object.assign({inkBar:!0},"object"==typeof n?n:{}),t.tabPane&&(t.tabPaneMotion=Object.assign(Object.assign({},le),{motionName:(0,oe.m)(e,"switch")})),t}(T,v),P=(0,ae.Z)(l),O=Object.assign(Object.assign({},null==S?void 0:S.style),b);return A(f.createElement(ie,Object.assign({direction:k,getPopupContainer:C,moreTransitionName:`${D}-slide-up`},_,{items:I,className:o()({[`${T}-${P}`]:P,[`${T}-card`]:["card","editable-card"].includes(t),[`${T}-editable-card`]:"editable-card"===t,[`${T}-centered`]:d},null==S?void 0:S.className,n,s,M),popupClassName:o()(p,M),style:O,editable:L,moreIcon:x,prefixCls:T,animated:R,indicatorSize:null!=y?y:null==S?void 0:S.indicatorSize})))};Ee.TabPane=se;var Ce=Ee},177:function(e,t,n){"use strict";n.d(t,{Z:function(){return Ge}});var i=n(14809),r=n(4635),a=n(93664),s=n(20439),o=n(95190),l=n(99153),c=n(84851),u=n(13028),d=n(19257),h=n(54941),p=n(92310),f=n.n(p),m=n(10228),g=n(26112),v=n(48736),b=n(59301),y=n(39378);function _(e){if(null==e)throw new TypeError("Cannot destructure "+e)}var w=n(50298),x=n(62646),k=n(34280),S=n(65283),E=n(77900),C=n(39417);var T=n(71430),A=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],M=function(e,t){var n=e.className,r=e.style,a=e.motion,s=e.motionNodes,o=e.motionType,l=e.onMotionStart,c=e.onMotionEnd,u=e.active,d=e.treeNodeRequiredProps,h=(0,x.Z)(e,A),p=b.useState(!0),m=(0,w.Z)(p,2),g=m[0],v=m[1],S=b.useContext(y.k).prefixCls,M=s&&"hide"!==o;(0,k.Z)((function(){s&&M!==g&&v(M)}),[s]);var L=b.useRef(!1),D=function(){s&&!L.current&&(L.current=!0,c())};!function(e,t){var n=b.useState(!1),i=(0,w.Z)(n,2),r=i[0],a=i[1];b.useLayoutEffect((function(){if(r)return e(),function(){t()}}),[r]),b.useLayoutEffect((function(){return a(!0),function(){a(!1)}}),[])}((function(){s&&l()}),D);return s?b.createElement(E.ZP,(0,i.Z)({ref:t,visible:g},a,{motionAppear:"show"===o,onVisibleChanged:function(e){M===e&&D()}}),(function(e,t){var n=e.className,r=e.style;return b.createElement("div",{ref:t,className:f()("".concat(S,"-treenode-motion"),n),style:r},s.map((function(e){var t=(0,i.Z)({},(_(e.data),e.data)),n=e.title,r=e.key,a=e.isStart,s=e.isEnd;delete t.children;var o=(0,T.H8)(r,d);return b.createElement(C.Z,(0,i.Z)({},t,o,{title:n,active:u,data:e.data,key:r,isStart:a,isEnd:s}))})))})):b.createElement(C.Z,(0,i.Z)({domRef:t,className:n,style:r},h,{active:u}))};M.displayName="MotionTreeNode";var L=b.forwardRef(M);function D(e,t,n){var i=e.findIndex((function(e){return e.key===n})),r=e[i+1],a=t.findIndex((function(e){return e.key===n}));if(r){var s=t.findIndex((function(e){return e.key===r.key}));return t.slice(a+1,s)}return t.slice(a+1)}var I=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],R={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},P=function(){},O="RC_TREE_MOTION_".concat(Math.random()),N={key:O},B={key:O,level:0,index:0,pos:"0",node:N,nodes:[N]},$={parent:null,children:[],pos:B.pos,data:N,title:null,key:O,isStart:[],isEnd:[]};function F(e,t,n,i){return!1!==t&&n?e.slice(0,Math.ceil(n/i)+1):e}function z(e){var t=e.key,n=e.pos;return(0,T.km)(t,n)}var K=b.forwardRef((function(e,t){var n=e.prefixCls,r=e.data,a=(e.selectable,e.checkable,e.expandedKeys),s=e.selectedKeys,o=e.checkedKeys,l=e.loadedKeys,c=e.loadingKeys,u=e.halfCheckedKeys,d=e.keyEntities,h=e.disabled,p=e.dragging,f=e.dragOverNodeKey,m=e.dropPosition,g=e.motion,v=e.height,y=e.itemHeight,E=e.virtual,C=e.focusable,A=e.activeItem,M=e.focused,N=e.tabIndex,B=e.onKeyDown,K=e.onFocus,U=e.onBlur,j=e.onActiveChange,q=e.onListChangeStart,H=e.onListChangeEnd,V=(0,x.Z)(e,I),G=b.useRef(null),Z=b.useRef(null);b.useImperativeHandle(t,(function(){return{scrollTo:function(e){G.current.scrollTo(e)},getIndentWidth:function(){return Z.current.offsetWidth}}}));var W=b.useState(a),Y=(0,w.Z)(W,2),X=Y[0],J=Y[1],Q=b.useState(r),ee=(0,w.Z)(Q,2),te=ee[0],ne=ee[1],ie=b.useState(r),re=(0,w.Z)(ie,2),ae=re[0],se=re[1],oe=b.useState([]),le=(0,w.Z)(oe,2),ce=le[0],ue=le[1],de=b.useState(null),he=(0,w.Z)(de,2),pe=he[0],fe=he[1],me=b.useRef(r);function ge(){var e=me.current;ne(e),se(e),ue([]),fe(null),H()}me.current=r,(0,k.Z)((function(){J(a);var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.length,i=t.length;if(1!==Math.abs(n-i))return{add:!1,key:null};function r(e,t){var n=new Map;e.forEach((function(e){n.set(e,!0)}));var i=t.filter((function(e){return!n.has(e)}));return 1===i.length?i[0]:null}return n<i?{add:!0,key:r(e,t)}:{add:!1,key:r(t,e)}}(X,a);if(null!==e.key)if(e.add){var t=te.findIndex((function(t){return t.key===e.key})),n=F(D(te,r,e.key),E,v,y),i=te.slice();i.splice(t+1,0,$),se(i),ue(n),fe("show")}else{var s=r.findIndex((function(t){return t.key===e.key})),o=F(D(r,te,e.key),E,v,y),l=r.slice();l.splice(s+1,0,$),se(l),ue(o),fe("hide")}else te!==r&&(ne(r),se(r))}),[a,r]),b.useEffect((function(){p||ge()}),[p]);var ve=g?ae:r,be={expandedKeys:a,selectedKeys:s,loadedKeys:l,loadingKeys:c,checkedKeys:o,halfCheckedKeys:u,dragOverNodeKey:f,dropPosition:m,keyEntities:d};return b.createElement(b.Fragment,null,M&&A&&b.createElement("span",{style:R,"aria-live":"assertive"},function(e){for(var t=String(e.data.key),n=e;n.parent;)n=n.parent,t="".concat(n.data.key," > ").concat(t);return t}(A)),b.createElement("div",null,b.createElement("input",{style:R,disabled:!1===C||h,tabIndex:!1!==C?N:null,onKeyDown:B,onFocus:K,onBlur:U,value:"",onChange:P,"aria-label":"for screen reader"})),b.createElement("div",{className:"".concat(n,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},b.createElement("div",{className:"".concat(n,"-indent")},b.createElement("div",{ref:Z,className:"".concat(n,"-indent-unit")}))),b.createElement(S.Z,(0,i.Z)({},V,{data:ve,itemKey:z,height:v,fullHeight:!1,virtual:E,itemHeight:y,prefixCls:"".concat(n,"-list"),ref:G,onVisibleChange:function(e,t){var n=new Set(e);t.filter((function(e){return!n.has(e)})).some((function(e){return z(e)===O}))&&ge()}}),(function(e){var t=e.pos,n=(0,i.Z)({},(_(e.data),e.data)),r=e.title,a=e.key,s=e.isStart,o=e.isEnd,l=(0,T.km)(a,t);delete n.key,delete n.children;var c=(0,T.H8)(l,be);return b.createElement(L,(0,i.Z)({},n,c,{title:r,active:!!A&&a===A.key,pos:t,data:e.data,isStart:s,isEnd:o,motion:g,motionNodes:a===O?ce:null,motionType:pe,onMotionStart:q,onMotionEnd:ge,treeNodeRequiredProps:be,onMouseMove:function(){j(null)}}))})))}));K.displayName="NodeList";var U=K,j=n(35654),q=n(90782),H=n(67841),V=function(e){(0,d.Z)(n,e);var t=(0,h.Z)(n);function n(){var e;(0,l.Z)(this,n);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return(e=t.call.apply(t,[this].concat(r))).destroyed=!1,e.delayedDragEnterLogic=void 0,e.loadingRetryTimes={},e.state={keyEntities:{},indent:null,selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null,fieldNames:(0,T.w$)()},e.dragStartMousePosition=null,e.dragNode=void 0,e.currentMouseOverDroppableNodeKey=null,e.listRef=b.createRef(),e.onNodeDragStart=function(t,n){var i=e.state,r=i.expandedKeys,a=i.keyEntities,s=e.props.onDragStart,o=n.props.eventKey;e.dragNode=n,e.dragStartMousePosition={x:t.clientX,y:t.clientY};var l=(0,j._5)(r,o);e.setState({draggingNodeKey:o,dragChildrenKeys:(0,j.wA)(o,a),indent:e.listRef.current.getIndentWidth()}),e.setExpandedKeys(l),window.addEventListener("dragend",e.onWindowDragEnd),null==s||s({event:t,node:(0,T.F)(n.props)})},e.onNodeDragEnter=function(t,n){var i=e.state,r=i.expandedKeys,a=i.keyEntities,s=i.dragChildrenKeys,l=i.flattenNodes,c=i.indent,d=e.props,h=d.onDragEnter,p=d.onExpand,f=d.allowDrop,m=d.direction,g=n.props,v=g.pos,b=g.eventKey,y=(0,u.Z)(e).dragNode;if(e.currentMouseOverDroppableNodeKey!==b&&(e.currentMouseOverDroppableNodeKey=b),y){var _=(0,j.OM)(t,y,n,c,e.dragStartMousePosition,f,l,a,r,m),w=_.dropPosition,x=_.dropLevelOffset,k=_.dropTargetKey,S=_.dropContainerKey,E=_.dropTargetPos,C=_.dropAllowed,A=_.dragOverNodeKey;-1===s.indexOf(k)&&C?(e.delayedDragEnterLogic||(e.delayedDragEnterLogic={}),Object.keys(e.delayedDragEnterLogic).forEach((function(t){clearTimeout(e.delayedDragEnterLogic[t])})),y.props.eventKey!==n.props.eventKey&&(t.persist(),e.delayedDragEnterLogic[v]=window.setTimeout((function(){if(null!==e.state.draggingNodeKey){var i=(0,o.Z)(r),s=(0,H.Z)(a,n.props.eventKey);s&&(s.children||[]).length&&(i=(0,j.L0)(r,n.props.eventKey)),"expandedKeys"in e.props||e.setExpandedKeys(i),null==p||p(i,{node:(0,T.F)(n.props),expanded:!0,nativeEvent:t.nativeEvent})}}),800)),y.props.eventKey!==k||0!==x?(e.setState({dragOverNodeKey:A,dropPosition:w,dropLevelOffset:x,dropTargetKey:k,dropContainerKey:S,dropTargetPos:E,dropAllowed:C}),null==h||h({event:t,node:(0,T.F)(n.props),expandedKeys:r})):e.resetDragState()):e.resetDragState()}else e.resetDragState()},e.onNodeDragOver=function(t,n){var i=e.state,r=i.dragChildrenKeys,a=i.flattenNodes,s=i.keyEntities,o=i.expandedKeys,l=i.indent,c=e.props,d=c.onDragOver,h=c.allowDrop,p=c.direction,f=(0,u.Z)(e).dragNode;if(f){var m=(0,j.OM)(t,f,n,l,e.dragStartMousePosition,h,a,s,o,p),g=m.dropPosition,v=m.dropLevelOffset,b=m.dropTargetKey,y=m.dropContainerKey,_=m.dropAllowed,w=m.dropTargetPos,x=m.dragOverNodeKey;-1===r.indexOf(b)&&_&&(f.props.eventKey===b&&0===v?null===e.state.dropPosition&&null===e.state.dropLevelOffset&&null===e.state.dropTargetKey&&null===e.state.dropContainerKey&&null===e.state.dropTargetPos&&!1===e.state.dropAllowed&&null===e.state.dragOverNodeKey||e.resetDragState():g===e.state.dropPosition&&v===e.state.dropLevelOffset&&b===e.state.dropTargetKey&&y===e.state.dropContainerKey&&w===e.state.dropTargetPos&&_===e.state.dropAllowed&&x===e.state.dragOverNodeKey||e.setState({dropPosition:g,dropLevelOffset:v,dropTargetKey:b,dropContainerKey:y,dropTargetPos:w,dropAllowed:_,dragOverNodeKey:x}),null==d||d({event:t,node:(0,T.F)(n.props)}))}},e.onNodeDragLeave=function(t,n){e.currentMouseOverDroppableNodeKey!==n.props.eventKey||t.currentTarget.contains(t.relatedTarget)||(e.resetDragState(),e.currentMouseOverDroppableNodeKey=null);var i=e.props.onDragLeave;null==i||i({event:t,node:(0,T.F)(n.props)})},e.onWindowDragEnd=function(t){e.onNodeDragEnd(t,null,!0),window.removeEventListener("dragend",e.onWindowDragEnd)},e.onNodeDragEnd=function(t,n){var i=e.props.onDragEnd;e.setState({dragOverNodeKey:null}),e.cleanDragState(),null==i||i({event:t,node:(0,T.F)(n.props)}),e.dragNode=null,window.removeEventListener("dragend",e.onWindowDragEnd)},e.onNodeDrop=function(t,n){var i,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=e.state,o=a.dragChildrenKeys,l=a.dropPosition,c=a.dropTargetKey,u=a.dropTargetPos,d=a.dropAllowed;if(d){var h=e.props.onDrop;if(e.setState({dragOverNodeKey:null}),e.cleanDragState(),null!==c){var p=(0,s.Z)((0,s.Z)({},(0,T.H8)(c,e.getTreeNodeRequiredProps())),{},{active:(null===(i=e.getActiveItem())||void 0===i?void 0:i.key)===c,data:(0,H.Z)(e.state.keyEntities,c).node}),f=-1!==o.indexOf(c);(0,v.ZP)(!f,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var m=(0,j.yx)(u),g={event:t,node:(0,T.F)(p),dragNode:e.dragNode?(0,T.F)(e.dragNode.props):null,dragNodesKeys:[e.dragNode.props.eventKey].concat(o),dropToGap:0!==l,dropPosition:l+Number(m[m.length-1])};r||null==h||h(g),e.dragNode=null}}},e.cleanDragState=function(){null!==e.state.draggingNodeKey&&e.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),e.dragStartMousePosition=null,e.currentMouseOverDroppableNodeKey=null},e.triggerExpandActionExpand=function(t,n){var i=e.state,r=i.expandedKeys,a=i.flattenNodes,o=n.expanded,l=n.key;if(!(n.isLeaf||t.shiftKey||t.metaKey||t.ctrlKey)){var c=a.filter((function(e){return e.key===l}))[0],u=(0,T.F)((0,s.Z)((0,s.Z)({},(0,T.H8)(l,e.getTreeNodeRequiredProps())),{},{data:c.data}));e.setExpandedKeys(o?(0,j._5)(r,l):(0,j.L0)(r,l)),e.onNodeExpand(t,u)}},e.onNodeClick=function(t,n){var i=e.props,r=i.onClick;"click"===i.expandAction&&e.triggerExpandActionExpand(t,n),null==r||r(t,n)},e.onNodeDoubleClick=function(t,n){var i=e.props,r=i.onDoubleClick;"doubleClick"===i.expandAction&&e.triggerExpandActionExpand(t,n),null==r||r(t,n)},e.onNodeSelect=function(t,n){var i=e.state.selectedKeys,r=e.state,a=r.keyEntities,s=r.fieldNames,o=e.props,l=o.onSelect,c=o.multiple,u=n.selected,d=n[s.key],h=!u,p=(i=h?c?(0,j.L0)(i,d):[d]:(0,j._5)(i,d)).map((function(e){var t=(0,H.Z)(a,e);return t?t.node:null})).filter((function(e){return e}));e.setUncontrolledState({selectedKeys:i}),null==l||l(i,{event:"select",selected:h,node:n,selectedNodes:p,nativeEvent:t.nativeEvent})},e.onNodeCheck=function(t,n,i){var r,a=e.state,s=a.keyEntities,l=a.checkedKeys,c=a.halfCheckedKeys,u=e.props,d=u.checkStrictly,h=u.onCheck,p=n.key,f={event:"check",node:n,checked:i,nativeEvent:t.nativeEvent};if(d){var m=i?(0,j.L0)(l,p):(0,j._5)(l,p);r={checked:m,halfChecked:(0,j._5)(c,p)},f.checkedNodes=m.map((function(e){return(0,H.Z)(s,e)})).filter((function(e){return e})).map((function(e){return e.node})),e.setUncontrolledState({checkedKeys:m})}else{var g=(0,q.S)([].concat((0,o.Z)(l),[p]),!0,s),v=g.checkedKeys,b=g.halfCheckedKeys;if(!i){var y=new Set(v);y.delete(p);var _=(0,q.S)(Array.from(y),{checked:!1,halfCheckedKeys:b},s);v=_.checkedKeys,b=_.halfCheckedKeys}r=v,f.checkedNodes=[],f.checkedNodesPositions=[],f.halfCheckedKeys=b,v.forEach((function(e){var t=(0,H.Z)(s,e);if(t){var n=t.node,i=t.pos;f.checkedNodes.push(n),f.checkedNodesPositions.push({node:n,pos:i})}})),e.setUncontrolledState({checkedKeys:v},!1,{halfCheckedKeys:b})}null==h||h(r,f)},e.onNodeLoad=function(t){var n=t.key,i=new Promise((function(i,r){e.setState((function(a){var s=a.loadedKeys,o=void 0===s?[]:s,l=a.loadingKeys,c=void 0===l?[]:l,u=e.props,d=u.loadData,h=u.onLoad;return d&&-1===o.indexOf(n)&&-1===c.indexOf(n)?(d(t).then((function(){var r=e.state.loadedKeys,a=(0,j.L0)(r,n);null==h||h(a,{event:"load",node:t}),e.setUncontrolledState({loadedKeys:a}),e.setState((function(e){return{loadingKeys:(0,j._5)(e.loadingKeys,n)}})),i()})).catch((function(t){if(e.setState((function(e){return{loadingKeys:(0,j._5)(e.loadingKeys,n)}})),e.loadingRetryTimes[n]=(e.loadingRetryTimes[n]||0)+1,e.loadingRetryTimes[n]>=10){var a=e.state.loadedKeys;(0,v.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),e.setUncontrolledState({loadedKeys:(0,j.L0)(a,n)}),i()}r(t)})),{loadingKeys:(0,j.L0)(c,n)}):null}))}));return i.catch((function(){})),i},e.onNodeMouseEnter=function(t,n){var i=e.props.onMouseEnter;null==i||i({event:t,node:n})},e.onNodeMouseLeave=function(t,n){var i=e.props.onMouseLeave;null==i||i({event:t,node:n})},e.onNodeContextMenu=function(t,n){var i=e.props.onRightClick;i&&(t.preventDefault(),i({event:t,node:n}))},e.onFocus=function(){var t=e.props.onFocus;e.setState({focused:!0});for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];null==t||t.apply(void 0,i)},e.onBlur=function(){var t=e.props.onBlur;e.setState({focused:!1}),e.onActiveChange(null);for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];null==t||t.apply(void 0,i)},e.getTreeNodeRequiredProps=function(){var t=e.state;return{expandedKeys:t.expandedKeys||[],selectedKeys:t.selectedKeys||[],loadedKeys:t.loadedKeys||[],loadingKeys:t.loadingKeys||[],checkedKeys:t.checkedKeys||[],halfCheckedKeys:t.halfCheckedKeys||[],dragOverNodeKey:t.dragOverNodeKey,dropPosition:t.dropPosition,keyEntities:t.keyEntities}},e.setExpandedKeys=function(t){var n=e.state,i=n.treeData,r=n.fieldNames,a=(0,T.oH)(i,t,r);e.setUncontrolledState({expandedKeys:t,flattenNodes:a},!0)},e.onNodeExpand=function(t,n){var i=e.state.expandedKeys,r=e.state,a=r.listChanging,s=r.fieldNames,o=e.props,l=o.onExpand,c=o.loadData,u=n.expanded,d=n[s.key];if(!a){var h=i.indexOf(d),p=!u;if((0,v.ZP)(u&&-1!==h||!u&&-1===h,"Expand state not sync with index check"),i=p?(0,j.L0)(i,d):(0,j._5)(i,d),e.setExpandedKeys(i),null==l||l(i,{node:n,expanded:p,nativeEvent:t.nativeEvent}),p&&c){var f=e.onNodeLoad(n);f&&f.then((function(){var t=(0,T.oH)(e.state.treeData,i,s);e.setUncontrolledState({flattenNodes:t})})).catch((function(){var t=e.state.expandedKeys,n=(0,j._5)(t,d);e.setExpandedKeys(n)}))}}},e.onListChangeStart=function(){e.setUncontrolledState({listChanging:!0})},e.onListChangeEnd=function(){setTimeout((function(){e.setUncontrolledState({listChanging:!1})}))},e.onActiveChange=function(t){var n=e.state.activeKey,i=e.props.onActiveChange;n!==t&&(e.setState({activeKey:t}),null!==t&&e.scrollTo({key:t}),null==i||i(t))},e.getActiveItem=function(){var t=e.state,n=t.activeKey,i=t.flattenNodes;return null===n?null:i.find((function(e){return e.key===n}))||null},e.offsetActiveKey=function(t){var n=e.state,i=n.flattenNodes,r=n.activeKey,a=i.findIndex((function(e){return e.key===r}));-1===a&&t<0&&(a=i.length);var s=i[a=(a+t+i.length)%i.length];if(s){var o=s.key;e.onActiveChange(o)}else e.onActiveChange(null)},e.onKeyDown=function(t){var n=e.state,i=n.activeKey,r=n.expandedKeys,a=n.checkedKeys,o=n.fieldNames,l=e.props,c=l.onKeyDown,u=l.checkable,d=l.selectable;switch(t.which){case m.Z.UP:e.offsetActiveKey(-1),t.preventDefault();break;case m.Z.DOWN:e.offsetActiveKey(1),t.preventDefault()}var h=e.getActiveItem();if(h&&h.data){var p=e.getTreeNodeRequiredProps(),f=!1===h.data.isLeaf||!!(h.data[o.children]||[]).length,g=(0,T.F)((0,s.Z)((0,s.Z)({},(0,T.H8)(i,p)),{},{data:h.data,active:!0}));switch(t.which){case m.Z.LEFT:f&&r.includes(i)?e.onNodeExpand({},g):h.parent&&e.onActiveChange(h.parent.key),t.preventDefault();break;case m.Z.RIGHT:f&&!r.includes(i)?e.onNodeExpand({},g):h.children&&h.children.length&&e.onActiveChange(h.children[0].key),t.preventDefault();break;case m.Z.ENTER:case m.Z.SPACE:!u||g.disabled||!1===g.checkable||g.disableCheckbox?u||!d||g.disabled||!1===g.selectable||e.onNodeSelect({},g):e.onNodeCheck({},g,!a.includes(i))}}null==c||c(t)},e.setUncontrolledState=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e.destroyed){var r=!1,a=!0,o={};Object.keys(t).forEach((function(n){n in e.props?a=!1:(r=!0,o[n]=t[n])})),!r||n&&!a||e.setState((0,s.Z)((0,s.Z)({},o),i))}},e.scrollTo=function(t){e.listRef.current.scrollTo(t)},e}return(0,c.Z)(n,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var e=this.props.activeKey;void 0!==e&&e!==this.state.activeKey&&(this.setState({activeKey:e}),null!==e&&this.scrollTo({key:e}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var e,t,n=this.state,s=n.focused,o=n.flattenNodes,l=n.keyEntities,c=n.draggingNodeKey,u=n.activeKey,d=n.dropLevelOffset,h=n.dropContainerKey,p=n.dropTargetKey,m=n.dropPosition,v=n.dragOverNodeKey,_=n.indent,w=this.props,x=w.prefixCls,k=w.className,S=w.style,E=w.showLine,C=w.focusable,T=w.tabIndex,A=void 0===T?0:T,M=w.selectable,L=w.showIcon,D=w.icon,I=w.switcherIcon,R=w.draggable,P=w.checkable,O=w.checkStrictly,N=w.disabled,B=w.motion,$=w.loadData,F=w.filterTreeNode,z=w.height,K=w.itemHeight,j=w.virtual,q=w.titleRender,H=w.dropIndicatorRender,V=w.onContextMenu,G=w.onScroll,Z=w.direction,W=w.rootClassName,Y=w.rootStyle,X=(0,g.Z)(this.props,{aria:!0,data:!0});return R&&(t="object"===(0,a.Z)(R)?R:"function"==typeof R?{nodeDraggable:R}:{}),b.createElement(y.k.Provider,{value:{prefixCls:x,selectable:M,showIcon:L,icon:D,switcherIcon:I,draggable:t,draggingNodeKey:c,checkable:P,checkStrictly:O,disabled:N,keyEntities:l,dropLevelOffset:d,dropContainerKey:h,dropTargetKey:p,dropPosition:m,dragOverNodeKey:v,indent:_,direction:Z,dropIndicatorRender:H,loadData:$,filterTreeNode:F,titleRender:q,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},b.createElement("div",{role:"tree",className:f()(x,k,W,(e={},(0,r.Z)(e,"".concat(x,"-show-line"),E),(0,r.Z)(e,"".concat(x,"-focused"),s),(0,r.Z)(e,"".concat(x,"-active-focused"),null!==u),e)),style:Y},b.createElement(U,(0,i.Z)({ref:this.listRef,prefixCls:x,style:S,data:o,disabled:N,selectable:M,checkable:!!P,motion:B,dragging:null!==c,height:z,itemHeight:K,virtual:j,focusable:C,focused:s,tabIndex:A,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:V,onScroll:G},this.getTreeNodeRequiredProps(),X))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n,i=t.prevProps,a={prevProps:e};function o(t){return!i&&t in e||i&&i[t]!==e[t]}var l=t.fieldNames;if(o("fieldNames")&&(l=(0,T.w$)(e.fieldNames),a.fieldNames=l),o("treeData")?n=e.treeData:o("children")&&((0,v.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),n=(0,T.zn)(e.children)),n){a.treeData=n;var c=(0,T.I8)(n,{fieldNames:l});a.keyEntities=(0,s.Z)((0,r.Z)({},O,B),c.keyEntities)}var u,d=a.keyEntities||t.keyEntities;if(o("expandedKeys")||i&&o("autoExpandParent"))a.expandedKeys=e.autoExpandParent||!i&&e.defaultExpandParent?(0,j.r7)(e.expandedKeys,d):e.expandedKeys;else if(!i&&e.defaultExpandAll){var h=(0,s.Z)({},d);delete h[O],a.expandedKeys=Object.keys(h).map((function(e){return h[e].key}))}else!i&&e.defaultExpandedKeys&&(a.expandedKeys=e.autoExpandParent||e.defaultExpandParent?(0,j.r7)(e.defaultExpandedKeys,d):e.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,n||a.expandedKeys){var p=(0,T.oH)(n||t.treeData,a.expandedKeys||t.expandedKeys,l);a.flattenNodes=p}if((e.selectable&&(o("selectedKeys")?a.selectedKeys=(0,j.BT)(e.selectedKeys,e):!i&&e.defaultSelectedKeys&&(a.selectedKeys=(0,j.BT)(e.defaultSelectedKeys,e))),e.checkable)&&(o("checkedKeys")?u=(0,j.E6)(e.checkedKeys)||{}:!i&&e.defaultCheckedKeys?u=(0,j.E6)(e.defaultCheckedKeys)||{}:n&&(u=(0,j.E6)(e.checkedKeys)||{checkedKeys:t.checkedKeys,halfCheckedKeys:t.halfCheckedKeys}),u)){var f=u,m=f.checkedKeys,g=void 0===m?[]:m,b=f.halfCheckedKeys,y=void 0===b?[]:b;if(!e.checkStrictly){var _=(0,q.S)(g,!0,d);g=_.checkedKeys,y=_.halfCheckedKeys}a.checkedKeys=g,a.halfCheckedKeys=y}return o("loadedKeys")&&(a.loadedKeys=e.loadedKeys),a}}]),n}(b.Component);V.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:function(e){var t=e.dropPosition,n=e.dropLevelOffset,i=e.indent,r={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(t){case-1:r.top=0,r.left=-n*i;break;case 1:r.bottom=0,r.left=-n*i;break;case 0:r.bottom=0,r.left=i}return b.createElement("div",{style:r})},allowDrop:function(){return!0},expandAction:!1},V.TreeNode=C.Z;var G=V,Z={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},W=n(7657),Y=function(e,t){return b.createElement(W.Z,(0,i.Z)({},e,{ref:t,icon:Z}))};var X=b.forwardRef(Y),J={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},Q=function(e,t){return b.createElement(W.Z,(0,i.Z)({},e,{ref:t,icon:J}))};var ee=b.forwardRef(Q),te={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},ne=function(e,t){return b.createElement(W.Z,(0,i.Z)({},e,{ref:t,icon:te}))};var ie=b.forwardRef(ne),re=n(36355),ae={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},se=function(e,t){return b.createElement(W.Z,(0,i.Z)({},e,{ref:t,icon:ae}))};var oe=b.forwardRef(se),le=n(62892),ce=n(66604),ue=n(98447),de=n(17313),he=n(8378),pe=n(37613),fe=n(83116);const me=new ce.E4("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),ge=(e,t)=>({[`.${e}-switcher-icon`]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:`transform ${t.motionDurationSlow}`}}}),ve=(e,t)=>({[`.${e}-drop-indicator`]:{position:"absolute",zIndex:1,height:2,backgroundColor:t.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:`${t.lineWidthBold}px solid ${t.colorPrimary}`,borderRadius:"50%",content:'""'}}}),be=(e,t)=>{const{treeCls:n,treeNodeCls:i,treeNodePadding:r,titleHeight:a,nodeSelectedBg:s,nodeHoverBg:o}=t,l=t.paddingXS;return{[n]:Object.assign(Object.assign({},(0,de.Wf)(t)),{background:t.colorBgContainer,borderRadius:t.borderRadius,transition:`background-color ${t.motionDurationSlow}`,[`&${n}-rtl`]:{[`${n}-switcher`]:{"&_close":{[`${n}-switcher-icon`]:{svg:{transform:"rotate(90deg)"}}}}},[`&-focused:not(:hover):not(${n}-active-focused)`]:Object.assign({},(0,de.oN)(t)),[`${n}-list-holder-inner`]:{alignItems:"flex-start"},[`&${n}-block-node`]:{[`${n}-list-holder-inner`]:{alignItems:"stretch",[`${n}-node-content-wrapper`]:{flex:"auto"},[`${i}.dragging`]:{position:"relative","&:after":{position:"absolute",top:0,insetInlineEnd:0,bottom:r,insetInlineStart:0,border:`1px solid ${t.colorPrimary}`,opacity:0,animationName:me,animationDuration:t.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none"}}}},[`${i}`]:{display:"flex",alignItems:"flex-start",padding:`0 0 ${r}px 0`,outline:"none","&-rtl":{direction:"rtl"},"&-disabled":{[`${n}-node-content-wrapper`]:{color:t.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}}},[`&-active ${n}-node-content-wrapper`]:Object.assign({},(0,de.oN)(t)),[`&:not(${i}-disabled).filter-node ${n}-title`]:{color:"inherit",fontWeight:500},"&-draggable":{[`${n}-draggable-icon`]:{flexShrink:0,width:a,lineHeight:`${a}px`,textAlign:"center",visibility:"visible",opacity:.2,transition:`opacity ${t.motionDurationSlow}`,[`${i}:hover &`]:{opacity:.45}},[`&${i}-disabled`]:{[`${n}-draggable-icon`]:{visibility:"hidden"}}}},[`${n}-indent`]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:a}},[`${n}-draggable-icon`]:{visibility:"hidden"},[`${n}-switcher`]:Object.assign(Object.assign({},ge(e,t)),{position:"relative",flex:"none",alignSelf:"stretch",width:a,margin:0,lineHeight:`${a}px`,textAlign:"center",cursor:"pointer",userSelect:"none","&-noop":{cursor:"default"},"&_close":{[`${n}-switcher-icon`]:{svg:{transform:"rotate(-90deg)"}}},"&-loading-icon":{color:t.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:a/2,bottom:-r,marginInlineStart:-1,borderInlineEnd:`1px solid ${t.colorBorder}`,content:'""'},"&:after":{position:"absolute",width:a/2*.8,height:a/2,borderBottom:`1px solid ${t.colorBorder}`,content:'""'}}}),[`${n}-checkbox`]:{top:"initial",marginInlineEnd:l},[`${n}-node-content-wrapper, ${n}-checkbox + span`]:{position:"relative",zIndex:"auto",minHeight:a,margin:0,padding:`0 ${t.paddingXS/2}px`,color:"inherit",lineHeight:`${a}px`,background:"transparent",borderRadius:t.borderRadius,cursor:"pointer",transition:`all ${t.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`,"&:hover":{backgroundColor:o},[`&${n}-node-selected`]:{backgroundColor:s},[`${n}-iconEle`]:{display:"inline-block",width:a,height:a,lineHeight:`${a}px`,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},[`${n}-unselectable ${n}-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${n}-node-content-wrapper`]:Object.assign({lineHeight:`${a}px`,userSelect:"none"},ve(e,t)),[`${i}.drop-container`]:{"> [draggable]":{boxShadow:`0 0 0 2px ${t.colorPrimary}`}},"&-show-line":{[`${n}-indent`]:{"&-unit":{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:a/2,bottom:-r,borderInlineEnd:`1px solid ${t.colorBorder}`,content:'""'},"&-end":{"&:before":{display:"none"}}}},[`${n}-switcher`]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},[`${i}-leaf-last`]:{[`${n}-switcher`]:{"&-leaf-line":{"&:before":{top:"auto !important",bottom:"auto !important",height:a/2+"px !important"}}}}})}},ye=e=>{const{treeCls:t,treeNodeCls:n,treeNodePadding:i,directoryNodeSelectedBg:r,directoryNodeSelectedColor:a}=e;return{[`${t}${t}-directory`]:{[n]:{position:"relative","&:before":{position:"absolute",top:0,insetInlineEnd:0,bottom:i,insetInlineStart:0,transition:`background-color ${e.motionDurationMid}`,content:'""',pointerEvents:"none"},"&:hover":{"&:before":{background:e.controlItemBgHover}},"> *":{zIndex:1},[`${t}-switcher`]:{transition:`color ${e.motionDurationMid}`},[`${t}-node-content-wrapper`]:{borderRadius:0,userSelect:"none","&:hover":{background:"transparent"},[`&${t}-node-selected`]:{color:a,background:"transparent"}},"&-selected":{"\n &:hover::before,\n &::before\n ":{background:r},[`${t}-switcher`]:{color:a},[`${t}-node-content-wrapper`]:{color:a,background:"transparent"}}}}}},_e=(e,t)=>{const n=`.${e}`,i=`${n}-treenode`,r=t.paddingXS/2,a=(0,pe.TS)(t,{treeCls:n,treeNodeCls:i,treeNodePadding:r});return[be(e,a),ye(a)]};var we=(0,fe.Z)("Tree",((e,t)=>{let{prefixCls:n}=t;return[{[e.componentCls]:(0,ue.C2)(`${n}-checkbox`,e)},_e(n,e),(0,he.Z)(e)]}),(e=>{const{colorTextLightSolid:t,colorPrimary:n}=e;return Object.assign(Object.assign({},(e=>{const{controlHeightSM:t}=e;return{titleHeight:t,nodeHoverBg:e.controlItemBgHover,nodeSelectedBg:e.controlItemBgActive}})(e)),{directoryNodeSelectedColor:t,directoryNodeSelectedBg:n})}));function xe(e){const{dropPosition:t,dropLevelOffset:n,prefixCls:i,indent:r,direction:a="ltr"}=e,s="ltr"===a?"left":"right",o={[s]:-n*r+4,["ltr"===a?"right":"left"]:0};switch(t){case-1:o.top=-3;break;case 1:o.bottom=-3;break;default:o.bottom=-3,o[s]=r+4}return b.createElement("div",{style:o,className:`${i}-drop-indicator`})}var ke={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"},Se=function(e,t){return b.createElement(W.Z,(0,i.Z)({},e,{ref:t,icon:ke}))};var Ee=b.forwardRef(Se),Ce=n(58617),Te={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"},Ae=function(e,t){return b.createElement(W.Z,(0,i.Z)({},e,{ref:t,icon:Te}))};var Me=b.forwardRef(Ae),Le={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},De=function(e,t){return b.createElement(W.Z,(0,i.Z)({},e,{ref:t,icon:Le}))};var Ie=b.forwardRef(De),Re=n(92343);var Pe=e=>{const{prefixCls:t,switcherIcon:n,treeNodeProps:i,showLine:r}=e,{isLeaf:a,expanded:s,loading:o}=i;if(o)return b.createElement(Ce.Z,{className:`${t}-switcher-loading-icon`});let l;if(r&&"object"==typeof r&&(l=r.showLeafIcon),a){if(!r)return null;if("boolean"!=typeof l&&l){const e="function"==typeof l?l(i):l,n=`${t}-switcher-line-custom-icon`;return(0,Re.l$)(e)?(0,Re.Tm)(e,{className:f()(e.props.className||"",n)}):e}return l?b.createElement(X,{className:`${t}-switcher-line-icon`}):b.createElement("span",{className:`${t}-switcher-leaf-line`})}const c=`${t}-switcher-icon`,u="function"==typeof n?n(i):n;return(0,Re.l$)(u)?(0,Re.Tm)(u,{className:f()(u.props.className||"",c)}):void 0!==u?u:r?s?b.createElement(Me,{className:`${t}-switcher-line-icon`}):b.createElement(Ie,{className:`${t}-switcher-line-icon`}):b.createElement(Ee,{className:c})};const Oe=b.forwardRef(((e,t)=>{const{getPrefixCls:n,direction:i,virtual:r,tree:a}=b.useContext(re.E_),{prefixCls:s,className:o,showIcon:l=!1,showLine:c,switcherIcon:u,blockNode:d=!1,children:h,checkable:p=!1,selectable:m=!0,draggable:g,motion:v,style:y}=e,_=n("tree",s),w=n(),x=null!=v?v:Object.assign(Object.assign({},(0,le.Z)(w)),{motionAppear:!1}),k=Object.assign(Object.assign({},e),{checkable:p,selectable:m,showIcon:l,motion:x,blockNode:d,showLine:Boolean(c),dropIndicatorRender:xe}),[S,E]=we(_),C=b.useMemo((()=>{if(!g)return!1;let e={};switch(typeof g){case"function":e.nodeDraggable=g;break;case"object":e=Object.assign({},g)}return!1!==e.icon&&(e.icon=e.icon||b.createElement(oe,null)),e}),[g]);return S(b.createElement(G,Object.assign({itemHeight:20,ref:t,virtual:r},k,{style:Object.assign(Object.assign({},null==a?void 0:a.style),y),prefixCls:_,className:f()({[`${_}-icon-hide`]:!l,[`${_}-block-node`]:d,[`${_}-unselectable`]:!m,[`${_}-rtl`]:"rtl"===i},null==a?void 0:a.className,o,E),direction:i,checkable:p?b.createElement("span",{className:`${_}-checkbox-inner`}):p,selectable:m,switcherIcon:e=>b.createElement(Pe,{prefixCls:_,switcherIcon:u,treeNodeProps:e,showLine:c}),draggable:C}),h))}));var Ne,Be=Oe;function $e(e,t){e.forEach((function(e){const{key:n,children:i}=e;!1!==t(n,e)&&$e(i||[],t)}))}function Fe(e){let{treeData:t,expandedKeys:n,startKey:i,endKey:r}=e;const a=[];let s=Ne.None;if(i&&i===r)return[i];if(!i||!r)return[];return $e(t,(e=>{if(s===Ne.End)return!1;if(function(e){return e===i||e===r}(e)){if(a.push(e),s===Ne.None)s=Ne.Start;else if(s===Ne.Start)return s=Ne.End,!1}else s===Ne.Start&&a.push(e);return n.includes(e)})),a}function ze(e,t){const n=(0,o.Z)(t),i=[];return $e(e,((e,t)=>{const r=n.indexOf(e);return-1!==r&&(i.push(t),n.splice(r,1)),!!n.length})),i}!function(e){e[e.None=0]="None",e[e.Start=1]="Start",e[e.End=2]="End"}(Ne||(Ne={}));var Ke=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function Ue(e){const{isLeaf:t,expanded:n}=e;return t?b.createElement(X,null):n?b.createElement(ee,null):b.createElement(ie,null)}function je(e){let{treeData:t,children:n}=e;return t||(0,T.zn)(n)}const qe=(e,t)=>{var{defaultExpandAll:n,defaultExpandParent:i,defaultExpandedKeys:r}=e,a=Ke(e,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);const s=b.useRef(),l=b.useRef(),[c,u]=b.useState(a.selectedKeys||a.defaultSelectedKeys||[]),[d,h]=b.useState((()=>(()=>{const{keyEntities:e}=(0,T.I8)(je(a));let t;return t=n?Object.keys(e):i?(0,j.r7)(a.expandedKeys||r||[],e):a.expandedKeys||r,t})()));b.useEffect((()=>{"selectedKeys"in a&&u(a.selectedKeys)}),[a.selectedKeys]),b.useEffect((()=>{"expandedKeys"in a&&h(a.expandedKeys)}),[a.expandedKeys]);const{getPrefixCls:p,direction:m}=b.useContext(re.E_),{prefixCls:g,className:v,showIcon:y=!0,expandAction:_="click"}=a,w=Ke(a,["prefixCls","className","showIcon","expandAction"]),x=p("tree",g),k=f()(`${x}-directory`,{[`${x}-directory-rtl`]:"rtl"===m},v);return b.createElement(Be,Object.assign({icon:Ue,ref:t,blockNode:!0},w,{showIcon:y,expandAction:_,prefixCls:x,className:k,expandedKeys:d,selectedKeys:c,onSelect:(e,t)=>{var n;const{multiple:i}=a,{node:r,nativeEvent:c}=t,{key:h=""}=r,p=je(a),f=Object.assign(Object.assign({},t),{selected:!0}),m=(null==c?void 0:c.ctrlKey)||(null==c?void 0:c.metaKey),g=null==c?void 0:c.shiftKey;let v;i&&m?(v=e,s.current=h,l.current=v,f.selectedNodes=ze(p,v)):i&&g?(v=Array.from(new Set([].concat((0,o.Z)(l.current||[]),(0,o.Z)(Fe({treeData:p,expandedKeys:d,startKey:h,endKey:s.current}))))),f.selectedNodes=ze(p,v)):(v=[h],s.current=h,l.current=v,f.selectedNodes=ze(p,v)),null===(n=a.onSelect)||void 0===n||n.call(a,v,f),"selectedKeys"in a||u(v)},onExpand:(e,t)=>{var n;return"expandedKeys"in a||h(e),null===(n=a.onExpand)||void 0===n?void 0:n.call(a,e,t)}}))};var He=b.forwardRef(qe);const Ve=Be;Ve.DirectoryTree=He,Ve.TreeNode=C.Z;var Ge=Ve},64018:function(){window.PR_SHOULD_USE_CONTINUATION=!0,function(){var e=window,t=["break,continue,do,else,for,if,return,while"],n=[[t,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],i=[n,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],r=[n,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],a=[n,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],s=[n,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],o="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",l=[t,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],c=[t,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],u=[t,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],d=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,h="str",p="com",f="typ",m="lit",g="pun",v="pln",b="atv";function y(e,t,n,i,r){if(n){var a={sourceNode:e,pre:1,langExtension:null,numberLines:null,sourceCode:n,spans:null,basePos:t,decorations:null};i(a),r.push.apply(r,a.decorations)}}var _=/\S/;function w(e){for(var t=void 0,n=e.firstChild;n;n=n.nextSibling){var i=n.nodeType;t=1===i?t?e:n:3===i&&_.test(n.nodeValue)?e:t}return t===e?void 0:t}function x(e,t){var n,i={};!function(){for(var r=e.concat(t),a=[],s={},o=0,l=r.length;o<l;++o){var c=r[o],u=c[3];if(u)for(var d=u.length;--d>=0;)i[u.charAt(d)]=c;var h=c[1],p=""+h;s.hasOwnProperty(p)||(a.push(h),s[p]=null)}a.push(/[\0-\uffff]/),n=function(e){for(var t=0,n=!1,i=!1,r=0,a=e.length;r<a;++r)if((h=e[r]).ignoreCase)i=!0;else if(/[a-z]/i.test(h.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){n=!0,i=!1;break}var s={b:8,t:9,n:10,v:11,f:12,r:13};function o(e){var t=e.charCodeAt(0);if(92!==t)return t;var n=e.charAt(1);return(t=s[n])||("0"<=n&&n<="7"?parseInt(e.substring(1),8):"u"===n||"x"===n?parseInt(e.substring(2),16):e.charCodeAt(1))}function l(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);var t=String.fromCharCode(e);return"\\"===t||"-"===t||"]"===t||"^"===t?"\\"+t:t}function c(e){var t=e.substring(1,e.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),n=[],i="^"===t[0],r=["["];i&&r.push("^");for(var a=i?1:0,s=t.length;a<s;++a){var c=t[a];if(/\\[bdsw]/i.test(c))r.push(c);else{var u,d=o(c);a+2<s&&"-"===t[a+1]?(u=o(t[a+2]),a+=2):u=d,n.push([d,u]),u<65||d>122||(u<65||d>90||n.push([32|Math.max(65,d),32|Math.min(u,90)]),u<97||d>122||n.push([-33&Math.max(97,d),-33&Math.min(u,122)]))}}n.sort((function(e,t){return e[0]-t[0]||t[1]-e[1]}));var h=[],p=[];for(a=0;a<n.length;++a)(f=n[a])[0]<=p[1]+1?p[1]=Math.max(p[1],f[1]):h.push(p=f);for(a=0;a<h.length;++a){var f=h[a];r.push(l(f[0])),f[1]>f[0]&&(f[1]+1>f[0]&&r.push("-"),r.push(l(f[1])))}return r.push("]"),r.join("")}function u(e){for(var i=e.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),r=i.length,a=[],s=0,o=0;s<r;++s)"("===(d=i[s])?++o:"\\"===d.charAt(0)&&(u=+d.substring(1))&&(u<=o?a[u]=-1:i[s]=l(u));for(s=1;s<a.length;++s)-1===a[s]&&(a[s]=++t);for(s=0,o=0;s<r;++s)if("("===(d=i[s]))a[++o]||(i[s]="(?:");else if("\\"===d.charAt(0)){var u;(u=+d.substring(1))&&u<=o&&(i[s]="\\"+a[u])}for(s=0;s<r;++s)"^"===i[s]&&"^"!==i[s+1]&&(i[s]="");if(e.ignoreCase&&n)for(s=0;s<r;++s){var d,h=(d=i[s]).charAt(0);d.length>=2&&"["===h?i[s]=c(d):"\\"!==h&&(i[s]=d.replace(/[a-zA-Z]/g,(function(e){var t=e.charCodeAt(0);return"["+String.fromCharCode(-33&t,32|t)+"]"})))}return i.join("")}var d=[];for(r=0,a=e.length;r<a;++r){var h;if((h=e[r]).global||h.multiline)throw new Error(""+h);d.push("(?:"+u(h)+")")}return new RegExp(d.join("|"),i?"gi":"g")}(a)}();var r=t.length,a=function(e){for(var s=e.sourceCode,o=e.basePos,l=e.sourceNode,c=[o,v],u=0,d=s.match(n)||[],h={},p=0,f=d.length;p<f;++p){var m,g=d[p],b=h[g],_=void 0;if("string"==typeof b)m=!1;else{var w=i[g.charAt(0)];if(w)_=g.match(w[1]),b=w[0];else{for(var x=0;x<r;++x)if(w=t[x],_=g.match(w[1])){b=w[0];break}_||(b=v)}!(m=b.length>=5&&"lang-"===b.substring(0,5))||_&&"string"==typeof _[1]||(m=!1,b="src"),m||(h[g]=b)}var k=u;if(u+=g.length,m){var S=_[1],E=g.indexOf(S),C=E+S.length;_[2]&&(E=(C=g.length-_[2].length)-S.length);var T=b.substring(5);y(l,o+k,g.substring(0,E),a,c),y(l,o+k+E,S,A(T,S),c),y(l,o+k+C,g.substring(C),a,c)}else c.push(o+k,b)}e.decorations=c};return a}function k(e){var t=[],n=[];e.tripleQuotedStrings?t.push([h,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""]):e.multiLineStrings?t.push([h,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):t.push([h,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"]),e.verbatimStrings&&n.push([h,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var i=e.hashComments;i&&(e.cStyleComments?(i>1?t.push([p,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):t.push([p,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),n.push([h,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):t.push([p,/^#[^\r\n]*/,null,"#"])),e.cStyleComments&&(n.push([p,/^\/\/[^\r\n]*/,null]),n.push([p,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var r=e.regexLiterals;if(r){var a=r>1?"":"\n\r",s=a?".":"[\\S\\s]",o="/(?=[^/*"+a+"])(?:[^/\\x5B\\x5C"+a+"]|\\x5C"+s+"|\\x5B(?:[^\\x5C\\x5D"+a+"]|\\x5C"+s+")*(?:\\x5D|$))+/";n.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+o+")")])}var l=e.types;l&&n.push([f,l]);var c=(""+e.keywords).replace(/^ | $/g,"");c.length&&n.push(["kwd",new RegExp("^(?:"+c.replace(/[\s,]+/g,"|")+")\\b"),null]),t.push([v,/^\s+/,null," \r\n\t "]);var u="^.[^\\s\\w.$@'\"`/\\\\]*";return e.regexLiterals&&(u+="(?!s*/)"),n.push([m,/^@[a-z_$][a-z_$@0-9]*/i,null],[f,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[v,/^[a-z_$][a-z_$@0-9]*/i,null],[m,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[v,/^\\[\s\S]?/,null],[g,new RegExp(u),null]),x(t,n)}var S=k({keywords:[i,a,r,s,o,l,c,u],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function E(e,t,n){for(var i=/(?:^|\s)nocode(?:\s|$)/,r=/\r\n?|\n/,a=e.ownerDocument,s=a.createElement("li");e.firstChild;)s.appendChild(e.firstChild);var o=[s];function l(e){var t=e.nodeType;if(1!=t||i.test(e.className)){if((3==t||4==t)&&n){var s=e.nodeValue,o=s.match(r);if(o){var u=s.substring(0,o.index);e.nodeValue=u;var d=s.substring(o.index+o[0].length);if(d)e.parentNode.insertBefore(a.createTextNode(d),e.nextSibling);c(e),u||e.parentNode.removeChild(e)}}}else if("br"===e.nodeName)c(e),e.parentNode&&e.parentNode.removeChild(e);else for(var h=e.firstChild;h;h=h.nextSibling)l(h)}function c(e){for(;!e.nextSibling;)if(!(e=e.parentNode))return;for(var t,n=function e(t,n){var i=n?t.cloneNode(!1):t,r=t.parentNode;if(r){var a=e(r,1),s=t.nextSibling;a.appendChild(i);for(var o=s;o;o=s)s=o.nextSibling,a.appendChild(o)}return i}(e.nextSibling,0);(t=n.parentNode)&&1===t.nodeType;)n=t;o.push(n)}for(var u=0;u<o.length;++u)l(o[u]);t===(0|t)&&o[0].setAttribute("value",t);var d=a.createElement("ol");d.className="linenums";for(var h=Math.max(0,t-1|0)||0,p=(u=0,o.length);u<p;++u)(s=o[u]).className="L"+(u+h)%10,s.firstChild||s.appendChild(a.createTextNode(" ")),d.appendChild(s);e.appendChild(d)}var C={};function T(t,n){for(var i=n.length;--i>=0;){var r=n[i];C.hasOwnProperty(r)?e.console&&console.warn("cannot override language handler %s",r):C[r]=t}}function A(e,t){return e&&C.hasOwnProperty(e)||(e=/^\s*</.test(t)?"default-markup":"default-code"),C[e]}function M(t){var n,i,r,a,s,o,l,c=t.langExtension;try{var u=(n=t.sourceNode,i=t.pre,r=/(?:^|\s)nocode(?:\s|$)/,a=[],s=0,o=[],l=0,function e(t){var n=t.nodeType;if(1==n){if(r.test(t.className))return;for(var c=t.firstChild;c;c=c.nextSibling)e(c);var u=t.nodeName.toLowerCase();"br"!==u&&"li"!==u||(a[l]="\n",o[l<<1]=s++,o[l++<<1|1]=t)}else if(3==n||4==n){var d=t.nodeValue;d.length&&(d=i?d.replace(/\r\n?/g,"\n"):d.replace(/[ \t\r\n]+/g," "),a[l]=d,o[l<<1]=s,s+=d.length,o[l++<<1|1]=t)}}(n),{sourceCode:a.join("").replace(/\n$/,""),spans:o}),d=u.sourceCode;t.sourceCode=d,t.spans=u.spans,t.basePos=0,A(c,d)(t),function(e){var t=/\bMSIE\s(\d+)/.exec(navigator.userAgent);t=t&&+t[1]<=8;var n,i,r=/\n/g,a=e.sourceCode,s=a.length,o=0,l=e.spans,c=l.length,u=0,d=e.decorations,h=d.length,p=0;for(d[h]=s,i=n=0;i<h;)d[i]!==d[i+2]?(d[n++]=d[i++],d[n++]=d[i++]):i+=2;for(h=n,i=n=0;i<h;){for(var f=d[i],m=d[i+1],g=i+2;g+2<=h&&d[g+1]===m;)g+=2;d[n++]=f,d[n++]=m,i=g}h=d.length=n;var v=e.sourceNode,b="";v&&(b=v.style.display,v.style.display="none");try{for(;u<c;){l[u];var y,_=l[u+2]||s,w=d[p+2]||s,x=(g=Math.min(_,w),l[u+1]);if(1!==x.nodeType&&(y=a.substring(o,g))){t&&(y=y.replace(r,"\r")),x.nodeValue=y;var k=x.ownerDocument,S=k.createElement("span");S.className=d[p+1];var E=x.parentNode;E.replaceChild(S,x),S.appendChild(x),o<_&&(l[u+1]=x=k.createTextNode(a.substring(g,_)),E.insertBefore(x,S.nextSibling))}(o=g)>=_&&(u+=2),o>=w&&(p+=2)}}finally{v&&(v.style.display=b)}}(t)}catch(t){e.console&&console.log(t&&t.stack||t)}}function L(e,t,n){var i=n||!1,r=t||null,a=document.createElement("div");return a.innerHTML="<pre>"+e+"</pre>",a=a.firstChild,i&&E(a,i,!0),M({langExtension:r,numberLines:i,sourceNode:a,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null}),a.innerHTML}function D(t,n){var i=n||document.body,r=i.ownerDocument||document;function a(e){return i.getElementsByTagName(e)}for(var s=[a("pre"),a("code"),a("xmp")],o=[],l=0;l<s.length;++l)for(var c=0,u=s[l].length;c<u;++c)o.push(s[l][c]);s=null;var d=Date;d.now||(d={now:function(){return+new Date}});var h=0,p=/\blang(?:uage)?-([\w.]+)(?!\S)/,f=/\bprettyprint\b/,m=/\bprettyprinted\b/,g=/pre|xmp/i,v=/^code$/i,b=/^(?:pre|code|xmp)$/i,y={};!function n(){for(var i=e.PR_SHOULD_USE_CONTINUATION?d.now()+250:1/0;h<o.length&&d.now()<i;h++){for(var a=o[h],s=y,l=a;l=l.previousSibling;){var c=l.nodeType,u=(7===c||8===c)&&l.nodeValue;if(u?!/^\??prettify\b/.test(u):3!==c||/\S/.test(l.nodeValue))break;if(u){s={},u.replace(/\b(\w+)=([\w:.%+-]+)/g,(function(e,t,n){s[t]=n}));break}}var _=a.className;if((s!==y||f.test(_))&&!m.test(_)){for(var x=!1,k=a.parentNode;k;k=k.parentNode){var S=k.tagName;if(b.test(S)&&k.className&&f.test(k.className)){x=!0;break}}if(!x){a.className+=" prettyprinted";var C,T,A=s.lang;if(!A)!(A=_.match(p))&&(C=w(a))&&v.test(C.tagName)&&(A=C.className.match(p)),A&&(A=A[1]);if(g.test(a.tagName))T=1;else{var L=a.currentStyle,D=r.defaultView,I=L?L.whiteSpace:D&&D.getComputedStyle?D.getComputedStyle(a,null).getPropertyValue("white-space"):0;T=I&&"pre"===I.substring(0,3)}var R=s.linenums;(R="true"===R||+R)||(R=!!(R=_.match(/\blinenums\b(?::(\d+))?/))&&(!R[1]||!R[1].length||+R[1])),R&&E(a,R,T),M({langExtension:A,sourceNode:a,numberLines:R,pre:T,sourceCode:null,basePos:null,spans:null,decorations:null})}}}h<o.length?e.setTimeout(n,250):"function"==typeof t&&t()}()}T(S,["default-code"]),T(x([],[[v,/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],[p,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[g,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),T(x([[v,/^[\s]+/,null," \t\r\n"],[b,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[g,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),T(x([],[[b,/^[\s\S]+/]]),["uq.val"]),T(k({keywords:i,hashComments:!0,cStyleComments:!0,types:d}),["c","cc","cpp","cxx","cyc","m"]),T(k({keywords:"null,true,false"}),["json"]),T(k({keywords:a,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:d}),["cs"]),T(k({keywords:r,cStyleComments:!0}),["java"]),T(k({keywords:u,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),T(k({keywords:l,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),T(k({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),T(k({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),T(k({keywords:s,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),T(k({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),T(x([],[[h,/^[\s\S]+/]]),["regex"]);var I=e.PR={createSimpleLexer:x,registerLangHandler:T,sourceDecorator:k,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:b,PR_COMMENT:p,PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:m,PR_NOCODE:"nocode",PR_PLAIN:v,PR_PUNCTUATION:g,PR_SOURCE:"src",PR_STRING:h,PR_TAG:"tag",PR_TYPE:f,prettyPrintOne:L,prettyPrint:D},R=e.define;"function"==typeof R&&R.amd&&R("google-code-prettify",[],(function(){return I}))}()},53184:function(e,t,n){"use strict";var i,r;i=[n(58553),n(87804),n(40998)],void 0===(r=function(e,t,n){return function(e,t,n){var i=function(t,n){return e.js_beautify(t,n)};return i.js=e.js_beautify,i.css=t.css_beautify,i.html=n.html_beautify,i.js_beautify=e.js_beautify,i.css_beautify=t.css_beautify,i.html_beautify=n.html_beautify,i}(e,t,n)}.apply(t,i))||(e.exports=r)},87804:function(e,t){var n;!function(){var i;!function(){"use strict";var e=[,,function(e){function t(e){this.__parent=e,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function n(e,t){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),t=t||"",e.indent_level>0&&(t=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}function i(e,i){this.__indent_cache=new n(e,i),this.raw=!1,this._end_with_newline=e.end_with_newline,this.indent_size=e.indent_size,this.wrap_line_length=e.wrap_line_length,this.indent_empty_lines=e.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new t(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}t.prototype.clone_empty=function(){var e=new t(this.__parent);return e.set_indent(this.__indent_count,this.__alignment_count),e},t.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},t.prototype.has_match=function(e){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(e))return!0;return!1},t.prototype.set_indent=function(e,t){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},t.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},t.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},t.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===e.__items[0]&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},t.prototype.is_empty=function(){return 0===this.__items.length},t.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},t.prototype.push=function(e){this.__items.push(e);var t=e.lastIndexOf("\n");-1!==t?this.__character_count=e.length-t:this.__character_count+=e.length},t.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},t.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},t.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},t.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},t.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e},n.prototype.get_indent_size=function(e,t){var n=this.__base_string_length;return t=t||0,e<0&&(n=0),n+=e*this.__indent_size,n+=t},n.prototype.get_indent_string=function(e,t){var n=this.__base_string;return t=t||0,e<0&&(e=0,n=""),t+=e*this.__indent_size,this.__ensure_cache(t),n+=this.__cache[t]},n.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},n.prototype.__add_column=function(){var e=this.__cache.length,t=0,n="";this.__indent_size&&e>=this.__indent_size&&(e-=(t=Math.floor(e/this.__indent_size))*this.__indent_size,n=new Array(t+1).join(this.__indent_string)),e&&(n+=new Array(e+1).join(" ")),this.__cache.push(n)},i.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},i.prototype.get_line_number=function(){return this.__lines.length},i.prototype.get_indent_string=function(e,t){return this.__indent_cache.get_indent_string(e,t)},i.prototype.get_indent_size=function(e,t){return this.__indent_cache.get_indent_size(e,t)},i.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},i.prototype.add_new_line=function(e){return!(this.is_empty()||!e&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},i.prototype.get_code=function(e){this.trim(!0);var t=this.current_line.pop();t&&("\n"===t[t.length-1]&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==e&&(n=n.replace(/[\n]/g,e)),n},i.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},i.prototype.set_indent=function(e,t){return e=e||0,t=t||0,this.next_line.set_indent(e,t),this.__lines.length>1?(this.current_line.set_indent(e,t),!0):(this.current_line.set_indent(),!1)},i.prototype.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},i.prototype.add_token=function(e){this.__add_space_before_token(),this.current_line.push(e),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},i.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},i.prototype.remove_indent=function(e){for(var t=this.__lines.length;e<t;)this.__lines[e]._remove_indent(),e++;this.current_line._remove_wrap_indent()},i.prototype.trim=function(e){for(e=void 0!==e&&e,this.current_line.trim();e&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},i.prototype.just_added_newline=function(){return this.current_line.is_empty()},i.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},i.prototype.ensure_empty_line_above=function(e,n){for(var i=this.__lines.length-2;i>=0;){var r=this.__lines[i];if(r.is_empty())break;if(0!==r.item(0).indexOf(e)&&r.item(-1)!==n){this.__lines.splice(i+1,0,new t(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},e.exports.Output=i},,,,function(e){function t(e,t){this.raw_options=n(e,t),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}function n(e,t){var n,r={};for(n in e=i(e))n!==t&&(r[n]=e[n]);if(t&&e[t])for(n in e[t])r[n]=e[t][n];return r}function i(e){var t,n={};for(t in e){n[t.replace(/-/g,"_")]=e[t]}return n}t.prototype._get_array=function(e,t){var n=this.raw_options[e],i=t||[];return"object"==typeof n?null!==n&&"function"==typeof n.concat&&(i=n.concat()):"string"==typeof n&&(i=n.split(/[^a-zA-Z0-9_\/\-]+/)),i},t.prototype._get_boolean=function(e,t){var n=this.raw_options[e];return void 0===n?!!t:!!n},t.prototype._get_characters=function(e,t){var n=this.raw_options[e],i=t||"";return"string"==typeof n&&(i=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),i},t.prototype._get_number=function(e,t){var n=this.raw_options[e];t=parseInt(t,10),isNaN(t)&&(t=0);var i=parseInt(n,10);return isNaN(i)&&(i=t),i},t.prototype._get_selection=function(e,t,n){var i=this._get_selection_list(e,t,n);if(1!==i.length)throw new Error("Invalid Option Value: The option '"+e+"' can only be one of the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return i[0]},t.prototype._get_selection_list=function(e,t,n){if(!t||0===t.length)throw new Error("Selection list cannot be empty.");if(n=n||[t[0]],!this._is_valid_selection(n,t))throw new Error("Invalid Default Value!");var i=this._get_array(e,n);if(!this._is_valid_selection(i,t))throw new Error("Invalid Option Value: The option '"+e+"' can contain only the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return i},t.prototype._is_valid_selection=function(e,t){return e.length&&t.length&&!e.some((function(e){return-1===t.indexOf(e)}))},e.exports.Options=t,e.exports.normalizeOpts=i,e.exports.mergeOpts=n},,function(e){var t=RegExp.prototype.hasOwnProperty("sticky");function n(e){this.__input=e||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position<this.__input_length},n.prototype.next=function(){var e=null;return this.hasNext()&&(e=this.__input.charAt(this.__position),this.__position+=1),e},n.prototype.peek=function(e){var t=null;return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&(t=this.__input.charAt(e)),t},n.prototype.__match=function(e,n){e.lastIndex=n;var i=e.exec(this.__input);return!i||t&&e.sticky||i.index!==n&&(i=null),i},n.prototype.test=function(e,t){return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&!!this.__match(e,t)},n.prototype.testChar=function(e,t){var n=this.peek(t);return e.lastIndex=0,null!==n&&e.test(n)},n.prototype.match=function(e){var t=this.__match(e,this.__position);return t?this.__position+=t[0].length:t=null,t},n.prototype.read=function(e,t,n){var i,r="";return e&&(i=this.match(e))&&(r+=i[0]),!t||!i&&e||(r+=this.readUntil(t,n)),r},n.prototype.readUntil=function(e,t){var n,i=this.__position;e.lastIndex=this.__position;var r=e.exec(this.__input);return r?(i=r.index,t&&(i+=r[0].length)):i=this.__input_length,n=this.__input.substring(this.__position,i),this.__position=i,n},n.prototype.readUntilAfter=function(e){return this.readUntil(e,!0)},n.prototype.get_regexp=function(e,n){var i=null,r="g";return n&&t&&(r="y"),"string"==typeof e&&""!==e?i=new RegExp(e,r):e&&(i=new RegExp(e.source,r)),i},n.prototype.get_literal_regexp=function(e){return RegExp(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},n.prototype.peekUntilAfter=function(e){var t=this.__position,n=this.readUntilAfter(e);return this.__position=t,n},n.prototype.lookBack=function(e){var t=this.__position-1;return t>=e.length&&this.__input.substring(t-e.length,t).toLowerCase()===e},e.exports.InputScanner=n},,,,,function(e){function t(e,t){e="string"==typeof e?e:e.source,t="string"==typeof t?t:t.source,this.__directives_block_pattern=new RegExp(e+/ beautify( \w+[:]\w+)+ /.source+t,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(e+/\sbeautify\signore:end\s/.source+t,"g")}t.prototype.get_directives=function(e){if(!e.match(this.__directives_block_pattern))return null;var t={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(e);n;)t[n[1]]=n[2],n=this.__directive_pattern.exec(e);return t},t.prototype.readIgnored=function(e){return e.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=t},,function(e,t,n){var i=n(16).Beautifier,r=n(17).Options;e.exports=function(e,t){return new i(e,t).beautify()},e.exports.defaultOptions=function(){return new r}},function(e,t,n){var i=n(17).Options,r=n(2).Output,a=n(8).InputScanner,s=new(0,n(13).Directives)(/\/\*/,/\*\//),o=/\r\n|[\r\n]/,l=/\r\n|[\r\n]/g,c=/\s/,u=/(?:\s|\n)+/g,d=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,h=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function p(e,t){this._source_text=e||"",this._options=new i(t),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}p.prototype.eatString=function(e){var t="";for(this._ch=this._input.next();this._ch;){if(t+=this._ch,"\\"===this._ch)t+=this._input.next();else if(-1!==e.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return t},p.prototype.eatWhitespace=function(e){for(var t=c.test(this._input.peek()),n=0;c.test(this._input.peek());)this._ch=this._input.next(),e&&"\n"===this._ch&&(0===n||n<this._options.max_preserve_newlines)&&(n++,this._output.add_new_line(!0));return t},p.prototype.foundNestedPseudoClass=function(){for(var e=0,t=1,n=this._input.peek(t);n;){if("{"===n)return!0;if("("===n)e+=1;else if(")"===n){if(0===e)return!1;e-=1}else if(";"===n||"}"===n)return!1;t++,n=this._input.peek(t)}return!1},p.prototype.print_string=function(e){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(e)},p.prototype.preserveSingleSpace=function(e){e&&(this._output.space_before_token=!0)},p.prototype.indent=function(){this._indentLevel++},p.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},p.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._source_text,t=this._options.eol;"auto"===t&&(t="\n",e&&o.test(e||"")&&(t=e.match(o)[0]));var n=(e=e.replace(l,"\n")).match(/^[\t ]*/)[0];this._output=new r(this._options,n),this._input=new a(e),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var i,p,f=0,m=!1,g=!1,v=!1,b=!1,y=!1,_=this._ch,w=!1;i=""!==this._input.read(u),p=_,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),_=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var x=this._input.read(d),k=s.get_directives(x);k&&"start"===k.ignore&&(x+=s.readIgnored(this._input)),this.print_string(x),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(h)),this.eatWhitespace(!0);else if("$"===this._ch){this.preserveSingleSpace(i),this.print_string(this._ch);var S=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);S.match(/[ :]$/)&&(S=this.eatString(": ").replace(/\s+$/,""),this.print_string(S),this._output.space_before_token=!0),0===f&&-1!==S.indexOf(":")&&(g=!0,this.indent())}else if("@"===this._ch)if(this.preserveSingleSpace(i),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var E=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);E.match(/[ :]$/)&&(E=this.eatString(": ").replace(/\s+$/,""),this.print_string(E),this._output.space_before_token=!0),0===f&&-1!==E.indexOf(":")?(g=!0,this.indent()):E in this.NESTED_AT_RULE?(this._nestedLevel+=1,E in this.CONDITIONAL_GROUP_RULE&&(v=!0)):0!==f||g||(b=!0)}else if("#"===this._ch&&"{"===this._input.peek())this.preserveSingleSpace(i),this.print_string(this._ch+this.eatString("}"));else if("{"===this._ch)g&&(g=!1,this.outdent()),b=!1,v?(v=!1,m=this._indentLevel>=this._nestedLevel):m=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&m&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):("("===p?this._output.space_before_token=!1:","!==p&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if("}"===this._ch)this.outdent(),this._output.add_new_line(),"{"===p&&this._output.trim(!0),g&&(this.outdent(),g=!1),this.print_string(this._ch),m=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0),")"===this._input.peek()&&(this._output.trim(!0),"expand"===this._options.brace_style&&this._output.add_new_line(!0));else if(":"===this._ch){for(var C=0;C<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;C++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[C])){w=!0;break}!m&&!v||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||b||0!==f?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),g||(g=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent()))}else if('"'===this._ch||"'"===this._ch){var T='"'===p||"'"===p;this.preserveSingleSpace(T||i),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(";"===this._ch)w=!1,0===f?(g&&(this.outdent(),g=!1),b=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if("("===this._ch)if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),f++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),f&&(f--,this.outdent()));else{var A=!1;this._input.lookBack("with")&&(A=!0),this.preserveSingleSpace(i||A),this.print_string(this._ch),g&&"$"===p&&this._options.selector_separator_newline?(this._output.add_new_line(),y=!0):(this.eatWhitespace(),f++,this.indent())}else if(")"===this._ch)f&&(f--,this.outdent()),y&&";"===this._input.peek()&&this._options.selector_separator_newline&&(y=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(","===this._ch)this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||g&&!y||0!==f||b?this._output.space_before_token=!0:this._output.add_new_line();else if(">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||g||0!==f)if("]"===this._ch)this.print_string(this._ch);else if("["===this._ch)this.preserveSingleSpace(i),this.print_string(this._ch);else if("="===this._ch)this.eatWhitespace(),this.print_string("="),c.test(this._ch)&&(this._ch="");else if("!"!==this._ch||this._input.lookBack("\\")){var M='"'===p||"'"===p;this.preserveSingleSpace(M||i),this.print_string(this._ch),!this._output.just_added_newline()&&"\n"===this._input.peek()&&w&&this._output.add_new_line()}else this._output.space_before_token=!0,this.print_string(this._ch);else this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&c.test(this._ch)&&(this._ch=""));return this._output.get_code(t)},e.exports.Beautifier=p},function(e,t,n){var i=n(6).Options;function r(e){i.call(this,e,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var t=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||t;var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var r=0;r<n.length;r++)"expand"!==n[r]?this.brace_style="collapse":this.brace_style=n[r]}r.prototype=new i,e.exports.Options=r}],t={};var n=function n(i){var r=t[i];if(void 0!==r)return r.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}(15);i=n}();var r=i;void 0===(n=function(){return{css_beautify:r}}.apply(t,[]))||(e.exports=n)}()},40998:function(e,t,n){var i,r;!function(){var a;!function(){"use strict";var e=[,,function(e){function t(e){this.__parent=e,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function n(e,t){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),t=t||"",e.indent_level>0&&(t=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}function i(e,i){this.__indent_cache=new n(e,i),this.raw=!1,this._end_with_newline=e.end_with_newline,this.indent_size=e.indent_size,this.wrap_line_length=e.wrap_line_length,this.indent_empty_lines=e.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new t(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}t.prototype.clone_empty=function(){var e=new t(this.__parent);return e.set_indent(this.__indent_count,this.__alignment_count),e},t.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},t.prototype.has_match=function(e){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(e))return!0;return!1},t.prototype.set_indent=function(e,t){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},t.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},t.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},t.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===e.__items[0]&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},t.prototype.is_empty=function(){return 0===this.__items.length},t.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},t.prototype.push=function(e){this.__items.push(e);var t=e.lastIndexOf("\n");-1!==t?this.__character_count=e.length-t:this.__character_count+=e.length},t.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},t.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},t.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},t.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},t.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e},n.prototype.get_indent_size=function(e,t){var n=this.__base_string_length;return t=t||0,e<0&&(n=0),n+=e*this.__indent_size,n+=t},n.prototype.get_indent_string=function(e,t){var n=this.__base_string;return t=t||0,e<0&&(e=0,n=""),t+=e*this.__indent_size,this.__ensure_cache(t),n+=this.__cache[t]},n.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},n.prototype.__add_column=function(){var e=this.__cache.length,t=0,n="";this.__indent_size&&e>=this.__indent_size&&(e-=(t=Math.floor(e/this.__indent_size))*this.__indent_size,n=new Array(t+1).join(this.__indent_string)),e&&(n+=new Array(e+1).join(" ")),this.__cache.push(n)},i.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},i.prototype.get_line_number=function(){return this.__lines.length},i.prototype.get_indent_string=function(e,t){return this.__indent_cache.get_indent_string(e,t)},i.prototype.get_indent_size=function(e,t){return this.__indent_cache.get_indent_size(e,t)},i.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},i.prototype.add_new_line=function(e){return!(this.is_empty()||!e&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},i.prototype.get_code=function(e){this.trim(!0);var t=this.current_line.pop();t&&("\n"===t[t.length-1]&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==e&&(n=n.replace(/[\n]/g,e)),n},i.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},i.prototype.set_indent=function(e,t){return e=e||0,t=t||0,this.next_line.set_indent(e,t),this.__lines.length>1?(this.current_line.set_indent(e,t),!0):(this.current_line.set_indent(),!1)},i.prototype.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},i.prototype.add_token=function(e){this.__add_space_before_token(),this.current_line.push(e),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},i.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},i.prototype.remove_indent=function(e){for(var t=this.__lines.length;e<t;)this.__lines[e]._remove_indent(),e++;this.current_line._remove_wrap_indent()},i.prototype.trim=function(e){for(e=void 0!==e&&e,this.current_line.trim();e&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},i.prototype.just_added_newline=function(){return this.current_line.is_empty()},i.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},i.prototype.ensure_empty_line_above=function(e,n){for(var i=this.__lines.length-2;i>=0;){var r=this.__lines[i];if(r.is_empty())break;if(0!==r.item(0).indexOf(e)&&r.item(-1)!==n){this.__lines.splice(i+1,0,new t(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},e.exports.Output=i},function(e){e.exports.Token=function(e,t,n,i){this.type=e,this.text=t,this.comments_before=null,this.newlines=n||0,this.whitespace_before=i||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}},,,function(e){function t(e,t){this.raw_options=n(e,t),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}function n(e,t){var n,r={};for(n in e=i(e))n!==t&&(r[n]=e[n]);if(t&&e[t])for(n in e[t])r[n]=e[t][n];return r}function i(e){var t,n={};for(t in e){n[t.replace(/-/g,"_")]=e[t]}return n}t.prototype._get_array=function(e,t){var n=this.raw_options[e],i=t||[];return"object"==typeof n?null!==n&&"function"==typeof n.concat&&(i=n.concat()):"string"==typeof n&&(i=n.split(/[^a-zA-Z0-9_\/\-]+/)),i},t.prototype._get_boolean=function(e,t){var n=this.raw_options[e];return void 0===n?!!t:!!n},t.prototype._get_characters=function(e,t){var n=this.raw_options[e],i=t||"";return"string"==typeof n&&(i=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),i},t.prototype._get_number=function(e,t){var n=this.raw_options[e];t=parseInt(t,10),isNaN(t)&&(t=0);var i=parseInt(n,10);return isNaN(i)&&(i=t),i},t.prototype._get_selection=function(e,t,n){var i=this._get_selection_list(e,t,n);if(1!==i.length)throw new Error("Invalid Option Value: The option '"+e+"' can only be one of the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return i[0]},t.prototype._get_selection_list=function(e,t,n){if(!t||0===t.length)throw new Error("Selection list cannot be empty.");if(n=n||[t[0]],!this._is_valid_selection(n,t))throw new Error("Invalid Default Value!");var i=this._get_array(e,n);if(!this._is_valid_selection(i,t))throw new Error("Invalid Option Value: The option '"+e+"' can contain only the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return i},t.prototype._is_valid_selection=function(e,t){return e.length&&t.length&&!e.some((function(e){return-1===t.indexOf(e)}))},e.exports.Options=t,e.exports.normalizeOpts=i,e.exports.mergeOpts=n},,function(e){var t=RegExp.prototype.hasOwnProperty("sticky");function n(e){this.__input=e||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position<this.__input_length},n.prototype.next=function(){var e=null;return this.hasNext()&&(e=this.__input.charAt(this.__position),this.__position+=1),e},n.prototype.peek=function(e){var t=null;return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&(t=this.__input.charAt(e)),t},n.prototype.__match=function(e,n){e.lastIndex=n;var i=e.exec(this.__input);return!i||t&&e.sticky||i.index!==n&&(i=null),i},n.prototype.test=function(e,t){return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&!!this.__match(e,t)},n.prototype.testChar=function(e,t){var n=this.peek(t);return e.lastIndex=0,null!==n&&e.test(n)},n.prototype.match=function(e){var t=this.__match(e,this.__position);return t?this.__position+=t[0].length:t=null,t},n.prototype.read=function(e,t,n){var i,r="";return e&&(i=this.match(e))&&(r+=i[0]),!t||!i&&e||(r+=this.readUntil(t,n)),r},n.prototype.readUntil=function(e,t){var n,i=this.__position;e.lastIndex=this.__position;var r=e.exec(this.__input);return r?(i=r.index,t&&(i+=r[0].length)):i=this.__input_length,n=this.__input.substring(this.__position,i),this.__position=i,n},n.prototype.readUntilAfter=function(e){return this.readUntil(e,!0)},n.prototype.get_regexp=function(e,n){var i=null,r="g";return n&&t&&(r="y"),"string"==typeof e&&""!==e?i=new RegExp(e,r):e&&(i=new RegExp(e.source,r)),i},n.prototype.get_literal_regexp=function(e){return RegExp(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},n.prototype.peekUntilAfter=function(e){var t=this.__position,n=this.readUntilAfter(e);return this.__position=t,n},n.prototype.lookBack=function(e){var t=this.__position-1;return t>=e.length&&this.__input.substring(t-e.length,t).toLowerCase()===e},e.exports.InputScanner=n},function(e,t,n){var i=n(8).InputScanner,r=n(3).Token,a=n(10).TokenStream,s=n(11).WhitespacePattern,o={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(e,t){this._input=new i(e),this._options=t||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};l.prototype.tokenize=function(){var e;this._input.restart(),this.__tokens=new a,this._reset();for(var t=new r(o.START,""),n=null,i=[],s=new a;t.type!==o.EOF;){for(e=this._get_next_token(t,n);this._is_comment(e);)s.add(e),e=this._get_next_token(t,n);s.isEmpty()||(e.comments_before=s,s=new a),e.parent=n,this._is_opening(e)?(i.push(n),n=e):n&&this._is_closing(e,n)&&(e.opened=n,n.closed=e,n=i.pop(),e.parent=n),e.previous=t,t.next=e,this.__tokens.add(e),t=e}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(e,t){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(o.RAW,n):this._create_token(o.EOF,"")},l.prototype._is_comment=function(e){return!1},l.prototype._is_opening=function(e){return!1},l.prototype._is_closing=function(e,t){return!1},l.prototype._create_token=function(e,t){return new r(e,t,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},e.exports.Tokenizer=l,e.exports.TOKEN=o},function(e){function t(e){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=e}t.prototype.restart=function(){this.__position=0},t.prototype.isEmpty=function(){return 0===this.__tokens_length},t.prototype.hasNext=function(){return this.__position<this.__tokens_length},t.prototype.next=function(){var e=null;return this.hasNext()&&(e=this.__tokens[this.__position],this.__position+=1),e},t.prototype.peek=function(e){var t=null;return e=e||0,(e+=this.__position)>=0&&e<this.__tokens_length&&(t=this.__tokens[e]),t},t.prototype.add=function(e){this.__parent_token&&(e.parent=this.__parent_token),this.__tokens.push(e),this.__tokens_length+=1},e.exports.TokenStream=t},function(e,t,n){var i=n(12).Pattern;function r(e,t){i.call(this,e,t),t?this._line_regexp=this._input.get_regexp(t._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}r.prototype=new i,r.prototype.__set_whitespace_patterns=function(e,t){e+="\\t ",t+="\\n\\r",this._match_pattern=this._input.get_regexp("["+e+t+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+t+"]")},r.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var e=this._input.read(this._match_pattern);if(" "===e)this.whitespace_before_token=" ";else if(e){var t=this.__split(this._newline_regexp,e);this.newline_count=t.length-1,this.whitespace_before_token=t[this.newline_count]}return e},r.prototype.matching=function(e,t){var n=this._create();return n.__set_whitespace_patterns(e,t),n._update(),n},r.prototype._create=function(){return new r(this._input,this)},r.prototype.__split=function(e,t){e.lastIndex=0;for(var n=0,i=[],r=e.exec(t);r;)i.push(t.substring(n,r.index)),n=r.index+r[0].length,r=e.exec(t);return n<t.length?i.push(t.substring(n,t.length)):i.push(""),i},e.exports.WhitespacePattern=r},function(e){function t(e,t){this._input=e,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,t&&(this._starting_pattern=this._input.get_regexp(t._starting_pattern,!0),this._match_pattern=this._input.get_regexp(t._match_pattern,!0),this._until_pattern=this._input.get_regexp(t._until_pattern),this._until_after=t._until_after)}t.prototype.read=function(){var e=this._input.read(this._starting_pattern);return this._starting_pattern&&!e||(e+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),e},t.prototype.read_match=function(){return this._input.match(this._match_pattern)},t.prototype.until_after=function(e){var t=this._create();return t._until_after=!0,t._until_pattern=this._input.get_regexp(e),t._update(),t},t.prototype.until=function(e){var t=this._create();return t._until_after=!1,t._until_pattern=this._input.get_regexp(e),t._update(),t},t.prototype.starting_with=function(e){var t=this._create();return t._starting_pattern=this._input.get_regexp(e,!0),t._update(),t},t.prototype.matching=function(e){var t=this._create();return t._match_pattern=this._input.get_regexp(e,!0),t._update(),t},t.prototype._create=function(){return new t(this._input,this)},t.prototype._update=function(){},e.exports.Pattern=t},function(e){function t(e,t){e="string"==typeof e?e:e.source,t="string"==typeof t?t:t.source,this.__directives_block_pattern=new RegExp(e+/ beautify( \w+[:]\w+)+ /.source+t,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(e+/\sbeautify\signore:end\s/.source+t,"g")}t.prototype.get_directives=function(e){if(!e.match(this.__directives_block_pattern))return null;var t={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(e);n;)t[n[1]]=n[2],n=this.__directive_pattern.exec(e);return t},t.prototype.readIgnored=function(e){return e.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=t},function(e,t,n){var i=n(12).Pattern,r={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function a(e,t){i.call(this,e,t),this.__template_pattern=null,this._disabled=Object.assign({},r),this._excluded=Object.assign({},r),t&&(this.__template_pattern=this._input.get_regexp(t.__template_pattern),this._excluded=Object.assign(this._excluded,t._excluded),this._disabled=Object.assign(this._disabled,t._disabled));var n=new i(e);this.__patterns={handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:n.starting_with(/{{{/).until_after(/}}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),php:n.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}a.prototype=new i,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(e){var t=this._create();return t._disabled[e]=!0,t._update(),t},a.prototype.read_options=function(e){var t=this._create();for(var n in r)t._disabled[n]=-1===e.templating.indexOf(n);return t._update(),t},a.prototype.exclude=function(e){var t=this._create();return t._excluded[e]=!0,t._update(),t},a.prototype.read=function(){var e="";e=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),e+=t,t=this._read_template();return this._until_after&&(e+=this._input.readUntilAfter(this._until_pattern)),e},a.prototype.__set_templated_pattern=function(){var e=[];this._disabled.php||e.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||e.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(e.push(this.__patterns.django._starting_pattern.source),e.push(this.__patterns.django_value._starting_pattern.source),e.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||e.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&e.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+e.join("|")+")")},a.prototype._read_template=function(){var e="",t=this._input.peek();if("<"===t){var n=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==n||(e=e||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==n||(e=e||this.__patterns.erb.read())}else"{"===t&&(this._disabled.handlebars||this._excluded.handlebars||(e=(e=(e=e||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(e=e||this.__patterns.django_value.read()),this._excluded.django||(e=(e=e||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(e=(e=(e=e||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return e},e.exports.TemplatablePattern=a},,,,function(e,t,n){var i=n(19).Beautifier,r=n(20).Options;e.exports=function(e,t,n,r){return new i(e,t,n,r).beautify()},e.exports.defaultOptions=function(){return new r}},function(e,t,n){var i=n(20).Options,r=n(2).Output,a=n(21).Tokenizer,s=n(21).TOKEN,o=/\r\n|[\r\n]/,l=/\r\n|[\r\n]/g,c=function(e,t){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=e.max_preserve_newlines,this.preserve_newlines=e.preserve_newlines,this._output=new r(e,t)};c.prototype.current_line_has_match=function(e){return this._output.current_line.has_match(e)},c.prototype.set_space_before_token=function(e,t){this._output.space_before_token=e,this._output.non_breaking_space=t},c.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},c.prototype.add_raw_token=function(e){this._output.add_raw_token(e)},c.prototype.print_preserved_newlines=function(e){var t=0;e.type!==s.TEXT&&e.previous.type!==s.TEXT&&(t=e.newlines?1:0),this.preserve_newlines&&(t=e.newlines<this.max_preserve_newlines+1?e.newlines:this.max_preserve_newlines+1);for(var n=0;n<t;n++)this.print_newline(n>0);return 0!==t},c.prototype.traverse_whitespace=function(e){return!(!e.whitespace_before&&!e.newlines)&&(this.print_preserved_newlines(e)||(this._output.space_before_token=!0),!0)},c.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},c.prototype.print_newline=function(e){this._output.add_new_line(e)},c.prototype.print_token=function(e){e.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(e.text))},c.prototype.indent=function(){this.indent_level++},c.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},c.prototype.get_full_indent=function(e){return(e=this.indent_level+(e||0))<1?"":this._output.get_indent_string(e)};var u=function(e,t){var n=null,i=null;return t.closed?("script"===e?n="text/javascript":"style"===e&&(n="text/css"),n=function(e){for(var t=null,n=e.next;n.type!==s.EOF&&e.closed!==n;){if(n.type===s.ATTRIBUTE&&"type"===n.text){n.next&&n.next.type===s.EQUALS&&n.next.next&&n.next.next.type===s.VALUE&&(t=n.next.next.text);break}n=n.next}return t}(t)||n,n.search("text/css")>-1?i="css":n.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?i="javascript":n.search(/(text|application|dojo)\/(x-)?(html)/)>-1?i="html":n.search(/test\/null/)>-1&&(i="null"),i):null};function d(e,t){return-1!==t.indexOf(e)}function h(e,t,n){this.parent=e||null,this.tag=t?t.tag_name:"",this.indent_level=n||0,this.parser_token=t||null}function p(e){this._printer=e,this._current_frame=null}function f(e,t,n,r){this._source_text=e||"",t=t||{},this._js_beautify=n,this._css_beautify=r,this._tag_stack=null;var a=new i(t,"html");this._options=a,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,"force".length),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,"preserve".length),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}p.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},p.prototype.record_tag=function(e){var t=new h(this._current_frame,e,this._printer.indent_level);this._current_frame=t},p.prototype._try_pop_frame=function(e){var t=null;return e&&(t=e.parser_token,this._printer.indent_level=e.indent_level,this._current_frame=e.parent),t},p.prototype._get_frame=function(e,t){for(var n=this._current_frame;n&&-1===e.indexOf(n.tag);){if(t&&-1!==t.indexOf(n.tag)){n=null;break}n=n.parent}return n},p.prototype.try_pop=function(e,t){var n=this._get_frame([e],t);return this._try_pop_frame(n)},p.prototype.indent_to_tag=function(e){var t=this._get_frame(e);t&&(this._printer.indent_level=t.indent_level)},f.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._source_text,t=this._options.eol;"auto"===this._options.eol&&(t="\n",e&&o.test(e)&&(t=e.match(o)[0]));var n=(e=e.replace(l,"\n")).match(/^[\t ]*/)[0],i={text:"",type:""},r=new m(this._options),u=new c(this._options,n),d=new a(e,this._options).tokenize();this._tag_stack=new p(u);for(var h=null,f=d.next();f.type!==s.EOF;)f.type===s.TAG_OPEN||f.type===s.COMMENT?r=h=this._handle_tag_open(u,f,r,i,d):f.type===s.ATTRIBUTE||f.type===s.EQUALS||f.type===s.VALUE||f.type===s.TEXT&&!r.tag_complete?h=this._handle_inside_tag(u,f,r,i):f.type===s.TAG_CLOSE?h=this._handle_tag_close(u,f,r):f.type===s.TEXT?h=this._handle_text(u,f,r):f.type===s.CONTROL_FLOW_OPEN?h=this._handle_control_flow_open(u,f):f.type===s.CONTROL_FLOW_CLOSE?h=this._handle_control_flow_close(u,f):u.add_raw_token(f),i=h,f=d.next();return u._output.get_code(t)},f.prototype._handle_control_flow_open=function(e,t){var n={text:t.text,type:t.type};return e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),t.newlines?e.print_preserved_newlines(t):e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),e.print_token(t),e.indent(),n},f.prototype._handle_control_flow_close=function(e,t){var n={text:t.text,type:t.type};return e.deindent(),t.newlines?e.print_preserved_newlines(t):e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),e.print_token(t),n},f.prototype._handle_tag_close=function(e,t,n){var i={text:t.text,type:t.type};return e.alignment_size=0,n.tag_complete=!0,e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),n.is_unformatted?e.add_raw_token(t):("<"===n.tag_start_char&&(e.set_space_before_token("/"===t.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&n.has_wrapped_attrs&&e.print_newline(!1)),e.print_token(t)),!n.indent_content||n.is_unformatted||n.is_content_unformatted||(e.indent(),n.indent_content=!1),n.is_inline_element||n.is_unformatted||n.is_content_unformatted||e.set_wrap_point(),i},f.prototype._handle_inside_tag=function(e,t,n,i){var r=n.has_wrapped_attrs,a={text:t.text,type:t.type};return e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),n.is_unformatted?e.add_raw_token(t):"{"===n.tag_start_char&&t.type===s.TEXT?e.print_preserved_newlines(t)?(t.newlines=0,e.add_raw_token(t)):e.print_token(t):(t.type===s.ATTRIBUTE?e.set_space_before_token(!0):(t.type===s.EQUALS||t.type===s.VALUE&&t.previous.type===s.EQUALS)&&e.set_space_before_token(!1),t.type===s.ATTRIBUTE&&"<"===n.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(e.traverse_whitespace(t),r=r||0!==t.newlines),this._is_wrap_attributes_force&&n.attr_count>=this._options.wrap_attributes_min_attrs&&(i.type!==s.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(e.print_newline(!1),r=!0)),e.print_token(t),r=r||e.previous_token_wrapped(),n.has_wrapped_attrs=r),a},f.prototype._handle_text=function(e,t,n){var i={text:t.text,type:"TK_CONTENT"};return n.custom_beautifier_name?this._print_custom_beatifier_text(e,t,n):n.is_unformatted||n.is_content_unformatted?e.add_raw_token(t):(e.traverse_whitespace(t),e.print_token(t)),i},f.prototype._print_custom_beatifier_text=function(e,t,n){var i=this;if(""!==t.text){var r,a=t.text,s=1,o="",l="";"javascript"===n.custom_beautifier_name&&"function"==typeof this._js_beautify?r=this._js_beautify:"css"===n.custom_beautifier_name&&"function"==typeof this._css_beautify?r=this._css_beautify:"html"===n.custom_beautifier_name&&(r=function(e,t){return new f(e,t,i._js_beautify,i._css_beautify).beautify()}),"keep"===this._options.indent_scripts?s=0:"separate"===this._options.indent_scripts&&(s=-e.indent_level);var c=e.get_full_indent(s);if(a=a.replace(/\n[ \t]*$/,""),"html"!==n.custom_beautifier_name&&"<"===a[0]&&a.match(/^(<!--|<!\[CDATA\[)/)){var u=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(a);if(!u)return void e.add_raw_token(t);o=c+u[1]+"\n",a=u[4],u[5]&&(l=c+u[5]),a=a.replace(/\n[ \t]*$/,""),(u[2]||-1!==u[3].indexOf("\n"))&&(u=u[3].match(/[ \t]+$/))&&(t.whitespace_before=u[0])}if(a)if(r){var d=function(){this.eol="\n"};d.prototype=this._options.raw_options,a=r(c+a,new d)}else{var h=t.whitespace_before;h&&(a=a.replace(new RegExp("\n("+h+")?","g"),"\n")),a=c+a.replace(/\n/g,"\n"+c)}o&&(a=a?o+a+"\n"+l:o+l),e.print_newline(!1),a&&(t.text=a,t.whitespace_before="",t.newlines=0,e.add_raw_token(t),e.print_newline(!0))}},f.prototype._handle_tag_open=function(e,t,n,i,r){var a=this._get_tag_open_token(t);if(!n.is_unformatted&&!n.is_content_unformatted||n.is_empty_element||t.type!==s.TAG_OPEN||a.is_start_tag?(e.traverse_whitespace(t),this._set_tag_position(e,t,a,n,i),a.is_inline_element||e.set_wrap_point(),e.print_token(t)):(e.add_raw_token(t),a.start_tag_token=this._tag_stack.try_pop(a.tag_name)),a.is_start_tag&&this._is_wrap_attributes_force){var o,l=0;do{(o=r.peek(l)).type===s.ATTRIBUTE&&(a.attr_count+=1),l+=1}while(o.type!==s.EOF&&o.type!==s.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(a.alignment_size=t.text.length+1),a.tag_complete||a.is_unformatted||(e.alignment_size=a.alignment_size),a};var m=function(e,t,n){if(this.parent=t||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",n){var i;this.tag_start_char=n.text[0],this.text=n.text,"<"===this.tag_start_char?(i=n.text.match(/^<([^\s>]*)/),this.tag_check=i?i[1]:""):(i=n.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=i?i[1]:"",(n.text.startsWith("{{#>")||n.text.startsWith("{{~#>"))&&">"===this.tag_check[0]&&(">"===this.tag_check&&null!==n.next?this.tag_check=n.next.text.split(" ")[0]:this.tag_check=n.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),n.type===s.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||n.closed&&"/>"===n.closed.text;var r=2;"{"===this.tag_start_char&&this.text.length>=3&&"~"===this.text.charAt(2)&&(r=3),this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(!e.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(r)))}else this.tag_complete=!0};f.prototype._get_tag_open_token=function(e){var t=new m(this._options,this._tag_stack.get_parser_token(),e);return t.alignment_size=this._options.wrap_attributes_indent_size,t.is_end_tag=t.is_end_tag||d(t.tag_check,this._options.void_elements),t.is_empty_element=t.tag_complete||t.is_start_tag&&t.is_end_tag,t.is_unformatted=!t.tag_complete&&d(t.tag_check,this._options.unformatted),t.is_content_unformatted=!t.is_empty_element&&d(t.tag_check,this._options.content_unformatted),t.is_inline_element=d(t.tag_name,this._options.inline)||this._options.inline_custom_elements&&t.tag_name.includes("-")||"{"===t.tag_start_char,t},f.prototype._set_tag_position=function(e,t,n,i,r){if(n.is_empty_element||(n.is_end_tag?n.start_tag_token=this._tag_stack.try_pop(n.tag_name):(this._do_optional_end_element(n)&&(n.is_inline_element||e.print_newline(!1)),this._tag_stack.record_tag(n),"script"!==n.tag_name&&"style"!==n.tag_name||n.is_unformatted||n.is_content_unformatted||(n.custom_beautifier_name=u(n.tag_check,t)))),d(n.tag_check,this._options.extra_liners)&&(e.print_newline(!1),e._output.just_added_blankline()||e.print_newline(!0)),n.is_empty_element){if("{"===n.tag_start_char&&"else"===n.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),n.indent_content=!0,e.current_line_has_match(/{{#if/)||e.print_newline(!1);"!--"===n.tag_name&&r.type===s.TAG_CLOSE&&i.is_end_tag&&-1===n.text.indexOf("\n")||(n.is_inline_element||n.is_unformatted||e.print_newline(!1),this._calcluate_parent_multiline(e,n))}else if(n.is_end_tag){var a=!1;a=(a=n.start_tag_token&&n.start_tag_token.multiline_content)||!n.is_inline_element&&!(i.is_inline_element||i.is_unformatted)&&!(r.type===s.TAG_CLOSE&&n.start_tag_token===i)&&"TK_CONTENT"!==r.type,(n.is_content_unformatted||n.is_unformatted)&&(a=!1),a&&e.print_newline(!1)}else n.indent_content=!n.custom_beautifier_name,"<"===n.tag_start_char&&("html"===n.tag_name?n.indent_content=this._options.indent_inner_html:"head"===n.tag_name?n.indent_content=this._options.indent_head_inner_html:"body"===n.tag_name&&(n.indent_content=this._options.indent_body_inner_html)),n.is_inline_element||n.is_unformatted||"TK_CONTENT"===r.type&&!n.is_content_unformatted||e.print_newline(!1),this._calcluate_parent_multiline(e,n)},f.prototype._calcluate_parent_multiline=function(e,t){!t.parent||!e._output.just_added_newline()||(t.is_inline_element||t.is_unformatted)&&t.parent.is_inline_element||(t.parent.multiline_content=!0)};var g=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],v=["a","audio","del","ins","map","noscript","video"];f.prototype._do_optional_end_element=function(e){var t=null;if(!e.is_empty_element&&e.is_start_tag&&e.parent){if("body"===e.tag_name)t=t||this._tag_stack.try_pop("head");else if("li"===e.tag_name)t=t||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if("dd"===e.tag_name||"dt"===e.tag_name)t=(t=t||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]);else if("p"===e.parent.tag_name&&-1!==g.indexOf(e.tag_name)){var n=e.parent.parent;n&&-1!==v.indexOf(n.tag_name)||(t=t||this._tag_stack.try_pop("p"))}else"rp"===e.tag_name||"rt"===e.tag_name?t=(t=t||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===e.tag_name?t=t||this._tag_stack.try_pop("optgroup",["select"]):"option"===e.tag_name?t=t||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===e.tag_name?t=t||this._tag_stack.try_pop("caption",["table"]):"thead"===e.tag_name?t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===e.tag_name||"tfoot"===e.tag_name?t=(t=(t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===e.tag_name?t=(t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==e.tag_name&&"td"!==e.tag_name||(t=(t=t||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return e.parent=this._tag_stack.get_parser_token(),t}},e.exports.Beautifier=f},function(e,t,n){var i=n(6).Options;function r(e){i.call(this,e,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}r.prototype=new i,e.exports.Options=r},function(e,t,n){var i=n(9).Tokenizer,r=n(9).TOKEN,a=n(13).Directives,s=n(14).TemplatablePattern,o=n(12).Pattern,l={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:r.START,RAW:r.RAW,EOF:r.EOF},c=new a(/<\!--/,/-->/),u=function(e,t){i.call(this,e,t),this._current_tag_name="";var n=new s(this._input).read_options(this._options),r=new o(this._input);if(this.__patterns={word:n.until(/[\n\r\t <]/),word_control_flow_close_excluded:n.until(/[\n\r\t <}]/),single_quote:n.until_after(/'/),double_quote:n.until_after(/"/),attribute:n.until(/[\n\r\t =>]|\/>/),element_name:n.until(/[\n\r\t >\/]/),angular_control_flow_start:r.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:r.starting_with(/{{!--/).until_after(/--}}/),handlebars:r.starting_with(/{{/).until_after(/}}/),handlebars_open:r.until(/[\n\r\t }]/),handlebars_raw_close:r.until(/}}/),comment:r.starting_with(/<!--/).until_after(/-->/),cdata:r.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:r.starting_with(/<!\[/).until_after(/]>/),processing:r.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars"),this.__patterns.word_control_flow_close_excluded=this.__patterns.word_control_flow_close_excluded.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var a=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=r.matching(a).until_after(a)}};(u.prototype=new i)._is_comment=function(e){return!1},u.prototype._is_opening=function(e){return e.type===l.TAG_OPEN||e.type===l.CONTROL_FLOW_OPEN},u.prototype._is_closing=function(e,t){return e.type===l.TAG_CLOSE&&t&&((">"===e.text||"/>"===e.text)&&"<"===t.text[0]||"}}"===e.text&&"{"===t.text[0]&&"{"===t.text[1])||e.type===l.CONTROL_FLOW_CLOSE&&"}"===e.text&&t.text.endsWith("{")},u.prototype._reset=function(){this._current_tag_name=""},u.prototype._get_next_token=function(e,t){var n=null;this._readWhitespace();var i=this._input.peek();return null===i?this._create_token(l.EOF,""):n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n||this._read_open_handlebars(i,t))||this._read_attribute(i,e,t))||this._read_close(i,t))||this._read_script_and_style(i,e))||this._read_control_flows(i,t))||this._read_raw_content(i,e,t))||this._read_content_word(i,t))||this._read_comment_or_cdata(i))||this._read_processing(i))||this._read_open(i,t))||this._create_token(l.UNKNOWN,this._input.next())},u.prototype._read_comment_or_cdata=function(e){var t=null,n=null,i=null;"<"===e&&("!"===this._input.peek(1)&&((n=this.__patterns.comment.read())?(i=c.get_directives(n))&&"start"===i.ignore&&(n+=c.readIgnored(this._input)):n=this.__patterns.cdata.read()),n&&((t=this._create_token(l.COMMENT,n)).directives=i));return t},u.prototype._read_processing=function(e){var t=null,n=null;if("<"===e){var i=this._input.peek(1);"!"!==i&&"?"!==i||(n=(n=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),n&&((t=this._create_token(l.COMMENT,n)).directives=null)}return t},u.prototype._read_open=function(e,t){var n=null,i=null;return t&&t.type!==l.CONTROL_FLOW_OPEN||"<"===e&&(n=this._input.next(),"/"===this._input.peek()&&(n+=this._input.next()),n+=this.__patterns.element_name.read(),i=this._create_token(l.TAG_OPEN,n)),i},u.prototype._read_open_handlebars=function(e,t){var n=null,i=null;return t&&t.type!==l.CONTROL_FLOW_OPEN||(this._options.templating.includes("angular")||this._options.indent_handlebars)&&"{"===e&&"{"===this._input.peek(1)&&(this._options.indent_handlebars&&"!"===this._input.peek(2)?(n=(n=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),i=this._create_token(l.COMMENT,n)):(n=this.__patterns.handlebars_open.read(),i=this._create_token(l.TAG_OPEN,n))),i},u.prototype._read_control_flows=function(e,t){var n="",i=null;if(!this._options.templating.includes("angular"))return i;if("@"===e){if(""===(n=this.__patterns.angular_control_flow_start.read()))return i;for(var r=n.endsWith("(")?1:0,a=0;!n.endsWith("{")||r!==a;){var s=this._input.next();if(null===s)break;"("===s?r++:")"===s&&a++,n+=s}i=this._create_token(l.CONTROL_FLOW_OPEN,n)}else"}"===e&&t&&t.type===l.CONTROL_FLOW_OPEN&&(n=this._input.next(),i=this._create_token(l.CONTROL_FLOW_CLOSE,n));return i},u.prototype._read_close=function(e,t){var n=null,i=null;return t&&t.type===l.TAG_OPEN&&("<"===t.text[0]&&(">"===e||"/"===e&&">"===this._input.peek(1))?(n=this._input.next(),"/"===e&&(n+=this._input.next()),i=this._create_token(l.TAG_CLOSE,n)):"{"===t.text[0]&&"}"===e&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),i=this._create_token(l.TAG_CLOSE,"}}"))),i},u.prototype._read_attribute=function(e,t,n){var i=null,r="";if(n&&"<"===n.text[0])if("="===e)i=this._create_token(l.EQUALS,this._input.next());else if('"'===e||"'"===e){var a=this._input.next();a+='"'===e?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),i=this._create_token(l.VALUE,a)}else(r=this.__patterns.attribute.read())&&(i=t.type===l.EQUALS?this._create_token(l.VALUE,r):this._create_token(l.ATTRIBUTE,r));return i},u.prototype._is_content_unformatted=function(e){return-1===this._options.void_elements.indexOf(e)&&(-1!==this._options.content_unformatted.indexOf(e)||-1!==this._options.unformatted.indexOf(e))},u.prototype._read_raw_content=function(e,t,n){var i="";if(n&&"{"===n.text[0])i=this.__patterns.handlebars_raw_close.read();else if(t.type===l.TAG_CLOSE&&"<"===t.opened.text[0]&&"/"!==t.text[0]){var r=t.opened.text.substr(1).toLowerCase();this._is_content_unformatted(r)&&(i=this._input.readUntil(new RegExp("</"+r+"[\\n\\r\\t ]*?>","ig")))}return i?this._create_token(l.TEXT,i):null},u.prototype._read_script_and_style=function(e,t){if(t.type===l.TAG_CLOSE&&"<"===t.opened.text[0]&&"/"!==t.text[0]){var n=t.opened.text.substr(1).toLowerCase();if("script"===n||"style"===n){var i=this._read_comment_or_cdata(e);if(i)return i.type=l.TEXT,i;var r=this._input.readUntil(new RegExp("</"+n+"[\\n\\r\\t ]*?>","ig"));if(r)return this._create_token(l.TEXT,r)}}return null},u.prototype._read_content_word=function(e,t){var n="";return this._options.unformatted_content_delimiter&&e===this._options.unformatted_content_delimiter[0]&&(n=this.__patterns.unformatted_content_delimiter.read()),n||(n=t&&t.type===l.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),n?this._create_token(l.TEXT,n):null},e.exports.Tokenizer=u,e.exports.TOKEN=l}],t={};var n=function n(i){var r=t[i];if(void 0!==r)return r.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}(18);a=n}();var s=a;i=[n,n(58553),n(87804)],r=function(e){var t=n(58553),i=n(87804);return{html_beautify:function(e,n){return s(e,n,t.js_beautify,i.css_beautify)}}}.apply(t,i),void 0===r||(e.exports=r)}()},58553:function(e,t){var n;!function(){var i;!function(){"use strict";var e=[function(e,t,n){var i=n(1).Beautifier,r=n(5).Options;e.exports=function(e,t){return new i(e,t).beautify()},e.exports.defaultOptions=function(){return new r}},function(e,t,n){var i=n(2).Output,r=n(3).Token,a=n(4),s=n(5).Options,o=n(7).Tokenizer,l=n(7).line_starters,c=n(7).positionable_operators,u=n(7).TOKEN;function d(e,t){return-1!==t.indexOf(e)}function h(e,t){return e&&e.type===u.RESERVED&&e.text===t}function p(e,t){return e&&e.type===u.RESERVED&&d(e.text,t)}var f=["case","return","do","if","throw","else","await","break","continue","async"],m=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].replace(/-/g,"_")]=e[n];return t}(["before-newline","after-newline","preserve-newline"]),g=[m.before_newline,m.preserve_newline],v="BlockStatement",b="Statement",y="ObjectLiteral",_="ArrayLiteral",w="ForInitializer",x="Conditional",k="Expression";function S(e,t){t.multiline_frame||t.mode===w||t.mode===x||e.remove_indent(t.start_line_index)}function E(e){return e===_}function C(e){return d(e,[k,w,x])}function T(e,t){t=t||{},this._source_text=e||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new s(t)}T.prototype.create_flags=function(e,t){var n=0;return e&&(n=e.indentation_level,!this._output.just_added_newline()&&e.line_indent_level>n&&(n=e.line_indent_level)),{mode:t,parent:e,last_token:e?e.last_token:new r(u.START_BLOCK,""),last_word:e?e.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:n,alignment:0,line_indent_level:e?e.line_indent_level:n,start_line_index:this._output.get_line_number(),ternary_depth:0}},T.prototype._reset=function(e){var t=e.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new i(this._options,t),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(v);var n=new o(e,this._options);return this._tokens=n.tokenize(),e},T.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._reset(this._source_text),t=this._options.eol;"auto"===this._options.eol&&(t="\n",e&&a.lineBreak.test(e||"")&&(t=e.match(a.lineBreak)[0]));for(var n=this._tokens.next();n;)this.handle_token(n),this._last_last_text=this._flags.last_token.text,this._flags.last_token=n,n=this._tokens.next();return this._output.get_code(t)},T.prototype.handle_token=function(e,t){e.type===u.START_EXPR?this.handle_start_expr(e):e.type===u.END_EXPR?this.handle_end_expr(e):e.type===u.START_BLOCK?this.handle_start_block(e):e.type===u.END_BLOCK?this.handle_end_block(e):e.type===u.WORD||e.type===u.RESERVED?this.handle_word(e):e.type===u.SEMICOLON?this.handle_semicolon(e):e.type===u.STRING?this.handle_string(e):e.type===u.EQUALS?this.handle_equals(e):e.type===u.OPERATOR?this.handle_operator(e):e.type===u.COMMA?this.handle_comma(e):e.type===u.BLOCK_COMMENT?this.handle_block_comment(e,t):e.type===u.COMMENT?this.handle_comment(e,t):e.type===u.DOT?this.handle_dot(e):e.type===u.EOF?this.handle_eof(e):(e.type,u.UNKNOWN,this.handle_unknown(e,t))},T.prototype.handle_whitespace_and_comments=function(e,t){var n=e.newlines,i=this._options.keep_array_indentation&&E(this._flags.mode);if(e.comments_before)for(var r=e.comments_before.next();r;)this.handle_whitespace_and_comments(r,t),this.handle_token(r,t),r=e.comments_before.next();if(i)for(var a=0;a<n;a+=1)this.print_newline(a>0,t);else if(this._options.max_preserve_newlines&&n>this._options.max_preserve_newlines&&(n=this._options.max_preserve_newlines),this._options.preserve_newlines&&n>1){this.print_newline(!1,t);for(var s=1;s<n;s+=1)this.print_newline(!0,t)}};var A=["async","break","continue","return","throw","yield"];T.prototype.allow_wrap_or_preserved_newline=function(e,t){if(t=void 0!==t&&t,!this._output.just_added_newline()){var n=this._options.preserve_newlines&&e.newlines||t;if(d(this._flags.last_token.text,c)||d(e.text,c)){var i=d(this._flags.last_token.text,c)&&d(this._options.operator_position,g)||d(e.text,c);n=n&&i}if(n)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(p(this._flags.last_token,A))return;this._output.set_wrap_point()}}},T.prototype.print_newline=function(e,t){if(!t&&";"!==this._flags.last_token.text&&","!==this._flags.last_token.text&&"="!==this._flags.last_token.text&&(this._flags.last_token.type!==u.OPERATOR||"--"===this._flags.last_token.text||"++"===this._flags.last_token.text))for(var n=this._tokens.peek();!(this._flags.mode!==b||this._flags.if_block&&h(n,"else")||this._flags.do_block);)this.restore_mode();this._output.add_new_line(e)&&(this._flags.multiline_frame=!0)},T.prototype.print_token_line_indentation=function(e){this._output.just_added_newline()&&(this._options.keep_array_indentation&&e.newlines&&("["===e.text||E(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(e.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},T.prototype.print_token=function(e){if(this._output.raw)this._output.add_raw_token(e);else{if(this._options.comma_first&&e.previous&&e.previous.type===u.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var t=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(t),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(e),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(e),this._output.non_breaking_space=!0,this._output.add_token(e.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)}},T.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},T.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},T.prototype.set_mode=function(e){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,e),this._flags=this.create_flags(this._previous_flags,e),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},T.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===b&&S(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},T.prototype.start_of_object_property=function(){return this._flags.parent.mode===y&&this._flags.mode===b&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||p(this._flags.last_token,["get","set"]))},T.prototype.start_of_statement=function(e){var t=!1;return!!(t=(t=(t=(t=(t=(t=(t=t||p(this._flags.last_token,["var","let","const"])&&e.type===u.WORD)||h(this._flags.last_token,"do"))||!(this._flags.parent.mode===y&&this._flags.mode===b)&&p(this._flags.last_token,A)&&!e.newlines)||h(this._flags.last_token,"else")&&!(h(e,"if")&&!e.comments_before))||this._flags.last_token.type===u.END_EXPR&&(this._previous_flags.mode===w||this._previous_flags.mode===x))||this._flags.last_token.type===u.WORD&&this._flags.mode===v&&!this._flags.in_case&&!("--"===e.text||"++"===e.text)&&"function"!==this._last_last_text&&e.type!==u.WORD&&e.type!==u.RESERVED)||this._flags.mode===y&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||p(this._flags.last_token,["get","set"])))&&(this.set_mode(b),this.indent(),this.handle_whitespace_and_comments(e,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e,p(e,["do","for","if","while"])),!0)},T.prototype.handle_start_expr=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e);var t=k;if("["===e.text){if(this._flags.last_token.type===u.WORD||")"===this._flags.last_token.text)return p(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(e),this.set_mode(t),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));t=_,E(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),d(this._flags.last_token.type,[u.START_EXPR,u.END_EXPR,u.WORD,u.OPERATOR,u.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===u.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,t=w):d(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,t=x):d(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===e.whitespace_before?this._output.space_before_token=!1:(d(this._flags.last_token.text,l)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e);else if(this._flags.last_token.type===u.WORD){this._output.space_before_token=!1;var n=this._tokens.peek(-3);if(this._options.space_after_named_function&&n){var i=this._tokens.peek(-4);p(n,["async","function"])||"*"===n.text&&p(i,["async","function"])?this._output.space_before_token=!0:this._flags.mode===y?"{"!==n.text&&","!==n.text&&("*"!==n.text||"{"!==i.text&&","!==i.text)||(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(e);(this._flags.last_token.type===u.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(d(this._last_last_text,["function","yield"])||this._flags.mode===y&&d(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}";"===this._flags.last_token.text||this._flags.last_token.type===u.START_BLOCK?this.print_newline():this._flags.last_token.type!==u.END_EXPR&&this._flags.last_token.type!==u.START_EXPR&&this._flags.last_token.type!==u.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==u.COMMA||this.allow_wrap_or_preserved_newline(e,e.newlines),this.print_token(e),this.set_mode(t),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},T.prototype.handle_end_expr=function(e){for(;this._flags.mode===b;)this.restore_mode();this.handle_whitespace_and_comments(e),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(e,"]"===e.text&&E(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==u.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(e),this.restore_mode(),S(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===x&&(this._previous_flags.mode=k,this._flags.do_block=!1,this._flags.do_while=!1)},T.prototype.handle_start_block=function(e){this.handle_whitespace_and_comments(e);var t=this._tokens.peek(),n=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===u.END_EXPR?(this.set_mode(v),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(v):n&&(d(n.text,[":",","])&&d(t.type,[u.STRING,u.WORD,u.RESERVED])||d(t.text,["get","set","..."])&&d(n.type,[u.WORD,u.RESERVED]))?d(this._last_last_text,["class","interface"])&&!d(n.text,[":",","])?this.set_mode(v):this.set_mode(y):this._flags.last_token.type===u.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(v):d(this._flags.last_token.type,[u.EQUALS,u.START_EXPR,u.COMMA,u.OPERATOR])||p(this._flags.last_token,["return","throw","import","default"])?this.set_mode(y):this.set_mode(v),this._flags.last_token&&p(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var i=!t.comments_before&&"}"===t.text,r=i&&"function"===this._flags.last_word&&this._flags.last_token.type===u.END_EXPR;if(this._options.brace_preserve_inline){var a=0,s=null;this._flags.inline_frame=!0;do{if(a+=1,(s=this._tokens.peek(a-1)).newlines){this._flags.inline_frame=!1;break}}while(s.type!==u.EOF&&(s.type!==u.END_BLOCK||s.opened!==e))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==u.OPERATOR&&(r||this._flags.last_token.type===u.EQUALS||p(this._flags.last_token,f)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!E(this._previous_flags.mode)||this._flags.last_token.type!==u.START_EXPR&&this._flags.last_token.type!==u.COMMA||((this._flags.last_token.type===u.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(e),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==u.OPERATOR&&this._flags.last_token.type!==u.START_EXPR&&(d(this._flags.last_token.type,[u.START_BLOCK,u.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(e),this.indent(),i||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},T.prototype.handle_end_block=function(e){for(this.handle_whitespace_and_comments(e);this._flags.mode===b;)this.restore_mode();var t=this._flags.last_token.type===u.START_BLOCK;this._flags.inline_frame&&!t?this._output.space_before_token=!0:"expand"===this._options.brace_style?t||this.print_newline():t||(E(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(e)},T.prototype.handle_word=function(e){if(e.type===u.RESERVED)if(d(e.text,["set","get"])&&this._flags.mode!==y)e.type=u.WORD;else if("import"===e.text&&d(this._tokens.peek().text,["(","."]))e.type=u.WORD;else if(d(e.text,["as","from"])&&!this._flags.import_block)e.type=u.WORD;else if(this._flags.mode===y){":"===this._tokens.peek().text&&(e.type=u.WORD)}if(this.start_of_statement(e)?p(this._flags.last_token,["var","let","const"])&&e.type===u.WORD&&(this._flags.declaration_statement=!0):!e.newlines||C(this._flags.mode)||this._flags.last_token.type===u.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===u.EQUALS||!this._options.preserve_newlines&&p(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(e):(this.handle_whitespace_and_comments(e),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(h(e,"while"))return this._output.space_before_token=!0,this.print_token(e),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&h(e,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===b;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&p(e,["case","default"]))return this.print_newline(),this._flags.case_block||!this._flags.case_body&&!this._options.jslint_happy||this.deindent(),this._flags.case_body=!1,this.print_token(e),void(this._flags.in_case=!0);if(this._flags.last_token.type!==u.COMMA&&this._flags.last_token.type!==u.START_EXPR&&this._flags.last_token.type!==u.EQUALS&&this._flags.last_token.type!==u.OPERATOR||this.start_of_object_property()||d(this._flags.last_token.text,["+","-"])&&":"===this._last_last_text&&this._flags.parent.mode===y||this.allow_wrap_or_preserved_newline(e),h(e,"function"))return(d(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!d(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==u.OPERATOR)&&(this._output.just_added_blankline()||e.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD?p(this._flags.last_token,["get","set","new","export"])||p(this._flags.last_token,A)||h(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===u.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!C(this._flags.mode)&&!E(this._flags.mode))&&this.print_newline(),this.print_token(e),void(this._flags.last_word=e.text);var t="NONE";(this._flags.last_token.type===u.END_BLOCK?this._previous_flags.inline_frame?t="SPACE":p(e,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines?t="NEWLINE":(t="SPACE",this._output.space_before_token=!0):t="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&this._flags.mode===v?t="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&C(this._flags.mode)?t="SPACE":this._flags.last_token.type===u.STRING?t="NEWLINE":this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD||"*"===this._flags.last_token.text&&(d(this._last_last_text,["function","yield"])||this._flags.mode===y&&d(this._last_last_text,["{",","]))?t="SPACE":this._flags.last_token.type===u.START_BLOCK?t=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===u.END_EXPR&&(this._output.space_before_token=!0,t="NEWLINE"),p(e,l)&&")"!==this._flags.last_token.text&&(t=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),p(e,["else","catch","finally"]))?(this._flags.last_token.type!==u.END_BLOCK||this._previous_flags.mode!==v||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===t?p(this._flags.last_token,f)||"declare"===this._flags.last_token.text&&p(e,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==u.END_EXPR?this._flags.last_token.type===u.START_EXPR&&p(e,["var","let","const"])||":"===this._flags.last_token.text||(h(e,"if")&&h(e.previous,"else")?this._output.space_before_token=!0:this.print_newline()):p(e,l)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&E(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===t&&(this._output.space_before_token=!0);!e.previous||e.previous.type!==u.WORD&&e.previous.type!==u.RESERVED||(this._output.space_before_token=!0),this.print_token(e),this._flags.last_word=e.text,e.type===u.RESERVED&&("do"===e.text?this._flags.do_block=!0:"if"===e.text?this._flags.if_block=!0:"import"===e.text?this._flags.import_block=!0:this._flags.import_block&&h(e,"from")&&(this._flags.import_block=!1))},T.prototype.handle_semicolon=function(e){this.start_of_statement(e)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(e);for(var t=this._tokens.peek();!(this._flags.mode!==b||this._flags.if_block&&h(t,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(e)},T.prototype.handle_string=function(e){(!e.text.startsWith("`")||0!==e.newlines||""!==e.whitespace_before||")"!==e.previous.text&&this._flags.last_token.type!==u.WORD)&&(this.start_of_statement(e)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(e),this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e):!e.text.startsWith("`")||this._flags.last_token.type!==u.END_EXPR||"]"!==e.previous.text&&")"!==e.previous.text||0!==e.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(e)},T.prototype.handle_equals=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(e),this._output.space_before_token=!0},T.prototype.handle_comma=function(e){this.handle_whitespace_and_comments(e,!0),this.print_token(e),this._output.space_before_token=!0,this._flags.declaration_statement?(C(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(e)):this._flags.mode===y||this._flags.mode===b&&this._flags.parent.mode===y?(this._flags.mode===b&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(e)},T.prototype.handle_operator=function(e){var t="*"===e.text&&(p(this._flags.last_token,["function","yield"])||d(this._flags.last_token.type,[u.START_BLOCK,u.COMMA,u.END_BLOCK,u.SEMICOLON])),n=d(e.text,["-","+"])&&(d(this._flags.last_token.type,[u.START_BLOCK,u.START_EXPR,u.EQUALS,u.OPERATOR])||d(this._flags.last_token.text,l)||","===this._flags.last_token.text);if(this.start_of_statement(e));else{var i=!t;this.handle_whitespace_and_comments(e,i)}if("*"!==e.text||this._flags.last_token.type!==u.DOT)if("::"!==e.text)if(d(e.text,["-","+"])&&this.start_of_object_property())this.print_token(e);else{if(this._flags.last_token.type===u.OPERATOR&&d(this._options.operator_position,g)&&this.allow_wrap_or_preserved_newline(e),":"===e.text&&this._flags.in_case)return this.print_token(e),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==u.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0));var r=!0,a=!0,s=!1;if(":"===e.text?0===this._flags.ternary_depth?r=!1:(this._flags.ternary_depth-=1,s=!0):"?"===e.text&&(this._flags.ternary_depth+=1),!n&&!t&&this._options.preserve_newlines&&d(e.text,c)){var o=":"===e.text,h=o&&s,y=o&&!s;switch(this._options.operator_position){case m.before_newline:return this._output.space_before_token=!y,this.print_token(e),o&&!h||this.allow_wrap_or_preserved_newline(e),void(this._output.space_before_token=!0);case m.after_newline:return this._output.space_before_token=!0,!o||h?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(e):this._output.space_before_token=!1,this.print_token(e),void(this._output.space_before_token=!0);case m.preserve_newline:return y||this.allow_wrap_or_preserved_newline(e),r=!(this._output.just_added_newline()||y),this._output.space_before_token=r,this.print_token(e),void(this._output.space_before_token=!0)}}if(t){this.allow_wrap_or_preserved_newline(e),r=!1;var _=this._tokens.peek();a=_&&d(_.type,[u.WORD,u.RESERVED])}else if("..."===e.text)this.allow_wrap_or_preserved_newline(e),r=this._flags.last_token.type===u.START_BLOCK,a=!1;else if(d(e.text,["--","++","!","~"])||n){if(this._flags.last_token.type!==u.COMMA&&this._flags.last_token.type!==u.START_EXPR||this.allow_wrap_or_preserved_newline(e),r=!1,a=!1,e.newlines&&("--"===e.text||"++"===e.text||"~"===e.text)){var w=p(this._flags.last_token,f)&&e.newlines;w&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(w,!0)}";"===this._flags.last_token.text&&C(this._flags.mode)&&(r=!0),this._flags.last_token.type===u.RESERVED?r=!0:this._flags.last_token.type===u.END_EXPR?r=!("]"===this._flags.last_token.text&&("--"===e.text||"++"===e.text)):this._flags.last_token.type===u.OPERATOR&&(r=d(e.text,["--","-","++","+"])&&d(this._flags.last_token.text,["--","-","++","+"]),d(e.text,["+","-"])&&d(this._flags.last_token.text,["--","++"])&&(a=!0)),(this._flags.mode!==v||this._flags.inline_frame)&&this._flags.mode!==b||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline()}this._output.space_before_token=this._output.space_before_token||r,this.print_token(e),this._output.space_before_token=a}else this.print_token(e);else this.print_token(e)},T.prototype.handle_block_comment=function(e,t){return this._output.raw?(this._output.add_raw_token(e),void(e.directives&&"end"===e.directives.preserve&&(this._output.raw=this._options.test_output_raw))):e.directives?(this.print_newline(!1,t),this.print_token(e),"start"===e.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):a.newline.test(e.text)||e.newlines?void this.print_block_commment(e,t):(this._output.space_before_token=!0,this.print_token(e),void(this._output.space_before_token=!0))},T.prototype.print_block_commment=function(e,t){var n,i=function(e){for(var t=[],n=(e=e.replace(a.allLineBreaks,"\n")).indexOf("\n");-1!==n;)t.push(e.substring(0,n)),n=(e=e.substring(n+1)).indexOf("\n");return e.length&&t.push(e),t}(e.text),r=!1,s=!1,o=e.whitespace_before,l=o.length;if(this.print_newline(!1,t),this.print_token_line_indentation(e),this._output.add_token(i[0]),this.print_newline(!1,t),i.length>1){for(r=function(e,t){for(var n=0;n<e.length;n++)if(e[n].trim().charAt(0)!==t)return!1;return!0}(i=i.slice(1),"*"),s=function(e,t){for(var n,i=0,r=e.length;i<r;i++)if((n=e[i])&&0!==n.indexOf(t))return!1;return!0}(i,o),r&&(this._flags.alignment=1),n=0;n<i.length;n++)r?(this.print_token_line_indentation(e),this._output.add_token(i[n].replace(/^\s+/g,""))):s&&i[n]?(this.print_token_line_indentation(e),this._output.add_token(i[n].substring(l))):(this._output.current_line.set_indent(-1),this._output.add_token(i[n])),this.print_newline(!1,t);this._flags.alignment=0}},T.prototype.handle_comment=function(e,t){e.newlines?this.print_newline(!1,t):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(e),this.print_newline(!1,t)},T.prototype.handle_dot=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),p(this._flags.last_token,f)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(e,")"===this._flags.last_token.text&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(e)},T.prototype.handle_unknown=function(e,t){this.print_token(e),"\n"===e.text[e.text.length-1]&&this.print_newline(!1,t)},T.prototype.handle_eof=function(e){for(;this._flags.mode===b;)this.restore_mode();this.handle_whitespace_and_comments(e)},e.exports.Beautifier=T},function(e){function t(e){this.__parent=e,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function n(e,t){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),t=t||"",e.indent_level>0&&(t=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}function i(e,i){this.__indent_cache=new n(e,i),this.raw=!1,this._end_with_newline=e.end_with_newline,this.indent_size=e.indent_size,this.wrap_line_length=e.wrap_line_length,this.indent_empty_lines=e.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new t(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}t.prototype.clone_empty=function(){var e=new t(this.__parent);return e.set_indent(this.__indent_count,this.__alignment_count),e},t.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},t.prototype.has_match=function(e){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(e))return!0;return!1},t.prototype.set_indent=function(e,t){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},t.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},t.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},t.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===e.__items[0]&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},t.prototype.is_empty=function(){return 0===this.__items.length},t.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},t.prototype.push=function(e){this.__items.push(e);var t=e.lastIndexOf("\n");-1!==t?this.__character_count=e.length-t:this.__character_count+=e.length},t.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},t.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},t.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},t.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},t.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e},n.prototype.get_indent_size=function(e,t){var n=this.__base_string_length;return t=t||0,e<0&&(n=0),n+=e*this.__indent_size,n+=t},n.prototype.get_indent_string=function(e,t){var n=this.__base_string;return t=t||0,e<0&&(e=0,n=""),t+=e*this.__indent_size,this.__ensure_cache(t),n+=this.__cache[t]},n.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},n.prototype.__add_column=function(){var e=this.__cache.length,t=0,n="";this.__indent_size&&e>=this.__indent_size&&(e-=(t=Math.floor(e/this.__indent_size))*this.__indent_size,n=new Array(t+1).join(this.__indent_string)),e&&(n+=new Array(e+1).join(" ")),this.__cache.push(n)},i.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},i.prototype.get_line_number=function(){return this.__lines.length},i.prototype.get_indent_string=function(e,t){return this.__indent_cache.get_indent_string(e,t)},i.prototype.get_indent_size=function(e,t){return this.__indent_cache.get_indent_size(e,t)},i.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},i.prototype.add_new_line=function(e){return!(this.is_empty()||!e&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},i.prototype.get_code=function(e){this.trim(!0);var t=this.current_line.pop();t&&("\n"===t[t.length-1]&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==e&&(n=n.replace(/[\n]/g,e)),n},i.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},i.prototype.set_indent=function(e,t){return e=e||0,t=t||0,this.next_line.set_indent(e,t),this.__lines.length>1?(this.current_line.set_indent(e,t),!0):(this.current_line.set_indent(),!1)},i.prototype.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},i.prototype.add_token=function(e){this.__add_space_before_token(),this.current_line.push(e),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},i.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},i.prototype.remove_indent=function(e){for(var t=this.__lines.length;e<t;)this.__lines[e]._remove_indent(),e++;this.current_line._remove_wrap_indent()},i.prototype.trim=function(e){for(e=void 0!==e&&e,this.current_line.trim();e&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},i.prototype.just_added_newline=function(){return this.current_line.is_empty()},i.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},i.prototype.ensure_empty_line_above=function(e,n){for(var i=this.__lines.length-2;i>=0;){var r=this.__lines[i];if(r.is_empty())break;if(0!==r.item(0).indexOf(e)&&r.item(-1)!==n){this.__lines.splice(i+1,0,new t(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},e.exports.Output=i},function(e){e.exports.Token=function(e,t,n,i){this.type=e,this.text=t,this.comments_before=null,this.newlines=n||0,this.whitespace_before=i||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}},function(e,t){var n="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",i="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",r="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",a="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",s="(?:"+a+"|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+i+"])",o="(?:"+a+"|["+n+i+r+"])*";t.identifier=new RegExp(s+o,"g"),t.identifierStart=new RegExp(s),t.identifierMatch=new RegExp("(?:"+a+"|["+n+i+r+"])+");t.newline=/[\n\r\u2028\u2029]/,t.lineBreak=new RegExp("\r\n|"+t.newline.source),t.allLineBreaks=new RegExp(t.lineBreak.source,"g")},function(e,t,n){var i=n(6).Options,r=["before-newline","after-newline","preserve-newline"];function a(e){i.call(this,e,"js");var t=this.raw_options.brace_style||null;"expand-strict"===t?this.raw_options.brace_style="expand":"collapse-preserve-inline"===t?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var a=0;a<n.length;a++)"preserve-inline"===n[a]?this.brace_preserve_inline=!0:this.brace_style=n[a];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",r),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}a.prototype=new i,e.exports.Options=a},function(e){function t(e,t){this.raw_options=n(e,t),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}function n(e,t){var n,r={};for(n in e=i(e))n!==t&&(r[n]=e[n]);if(t&&e[t])for(n in e[t])r[n]=e[t][n];return r}function i(e){var t,n={};for(t in e){n[t.replace(/-/g,"_")]=e[t]}return n}t.prototype._get_array=function(e,t){var n=this.raw_options[e],i=t||[];return"object"==typeof n?null!==n&&"function"==typeof n.concat&&(i=n.concat()):"string"==typeof n&&(i=n.split(/[^a-zA-Z0-9_\/\-]+/)),i},t.prototype._get_boolean=function(e,t){var n=this.raw_options[e];return void 0===n?!!t:!!n},t.prototype._get_characters=function(e,t){var n=this.raw_options[e],i=t||"";return"string"==typeof n&&(i=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),i},t.prototype._get_number=function(e,t){var n=this.raw_options[e];t=parseInt(t,10),isNaN(t)&&(t=0);var i=parseInt(n,10);return isNaN(i)&&(i=t),i},t.prototype._get_selection=function(e,t,n){var i=this._get_selection_list(e,t,n);if(1!==i.length)throw new Error("Invalid Option Value: The option '"+e+"' can only be one of the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return i[0]},t.prototype._get_selection_list=function(e,t,n){if(!t||0===t.length)throw new Error("Selection list cannot be empty.");if(n=n||[t[0]],!this._is_valid_selection(n,t))throw new Error("Invalid Default Value!");var i=this._get_array(e,n);if(!this._is_valid_selection(i,t))throw new Error("Invalid Option Value: The option '"+e+"' can contain only the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return i},t.prototype._is_valid_selection=function(e,t){return e.length&&t.length&&!e.some((function(e){return-1===t.indexOf(e)}))},e.exports.Options=t,e.exports.normalizeOpts=i,e.exports.mergeOpts=n},function(e,t,n){var i=n(8).InputScanner,r=n(9).Tokenizer,a=n(9).TOKEN,s=n(13).Directives,o=n(4),l=n(12).Pattern,c=n(14).TemplatablePattern;function u(e,t){return-1!==t.indexOf(e)}var d={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:a.START,RAW:a.RAW,EOF:a.EOF},h=new s(/\/\*/,/\*\//),p=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,f=/[0-9]/,m=/[^\d\.]/,g=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),v=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";v=(v="\\?\\.(?!\\d) "+(v=v.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var b,y=new RegExp(v),_="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),w=_.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),x=new RegExp("^(?:"+w.join("|")+")$"),k=function(e,t){r.call(this,e,t),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var n=new l(this._input),i=new c(this._input).read_options(this._options);this.__patterns={template:i,identifier:i.starting_with(o.identifier).matching(o.identifierMatch),number:n.matching(p),punct:n.matching(y),comment:n.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:n.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:n.matching(/<!--/),html_comment_end:n.matching(/-->/),include:n.starting_with(/#include/).until_after(o.lineBreak),shebang:n.starting_with(/#!/).until_after(o.lineBreak),xml:n.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:i.until(/['\\\n\r\u2028\u2029]/),double_quote:i.until(/["\\\n\r\u2028\u2029]/),template_text:i.until(/[`\\$]/),template_expression:i.until(/[`}\\]/)}};(k.prototype=new r)._is_comment=function(e){return e.type===d.COMMENT||e.type===d.BLOCK_COMMENT||e.type===d.UNKNOWN},k.prototype._is_opening=function(e){return e.type===d.START_BLOCK||e.type===d.START_EXPR},k.prototype._is_closing=function(e,t){return(e.type===d.END_BLOCK||e.type===d.END_EXPR)&&t&&("]"===e.text&&"["===t.text||")"===e.text&&"("===t.text||"}"===e.text&&"{"===t.text)},k.prototype._reset=function(){b=!1},k.prototype._get_next_token=function(e,t){var n=null;this._readWhitespace();var i=this._input.peek();return null===i?this._create_token(d.EOF,""):n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n||this._read_non_javascript(i))||this._read_string(i))||this._read_pair(i,this._input.peek(1)))||this._read_word(e))||this._read_singles(i))||this._read_comment(i))||this._read_regexp(i,e))||this._read_xml(i,e))||this._read_punctuation())||this._create_token(d.UNKNOWN,this._input.next())},k.prototype._read_word=function(e){var t;return""!==(t=this.__patterns.identifier.read())?(t=t.replace(o.allLineBreaks,"\n"),e.type!==d.DOT&&(e.type!==d.RESERVED||"set"!==e.text&&"get"!==e.text)&&x.test(t)?"in"!==t&&"of"!==t||e.type!==d.WORD&&e.type!==d.STRING?this._create_token(d.RESERVED,t):this._create_token(d.OPERATOR,t):this._create_token(d.WORD,t)):""!==(t=this.__patterns.number.read())?this._create_token(d.WORD,t):void 0},k.prototype._read_singles=function(e){var t=null;return"("===e||"["===e?t=this._create_token(d.START_EXPR,e):")"===e||"]"===e?t=this._create_token(d.END_EXPR,e):"{"===e?t=this._create_token(d.START_BLOCK,e):"}"===e?t=this._create_token(d.END_BLOCK,e):";"===e?t=this._create_token(d.SEMICOLON,e):"."===e&&m.test(this._input.peek(1))?t=this._create_token(d.DOT,e):","===e&&(t=this._create_token(d.COMMA,e)),t&&this._input.next(),t},k.prototype._read_pair=function(e,t){var n=null;return"#"===e&&"{"===t&&(n=this._create_token(d.START_BLOCK,e+t)),n&&(this._input.next(),this._input.next()),n},k.prototype._read_punctuation=function(){var e=this.__patterns.punct.read();if(""!==e)return"="===e?this._create_token(d.EQUALS,e):"?."===e?this._create_token(d.DOT,e):this._create_token(d.OPERATOR,e)},k.prototype._read_non_javascript=function(e){var t="";if("#"===e){if(this._is_first_token()&&(t=this.__patterns.shebang.read()))return this._create_token(d.UNKNOWN,t.trim()+"\n");if(t=this.__patterns.include.read())return this._create_token(d.UNKNOWN,t.trim()+"\n");e=this._input.next();var n="#";if(this._input.hasNext()&&this._input.testChar(f)){do{n+=e=this._input.next()}while(this._input.hasNext()&&"#"!==e&&"="!==e);return"#"===e||("["===this._input.peek()&&"]"===this._input.peek(1)?(n+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(n+="{}",this._input.next(),this._input.next())),this._create_token(d.WORD,n)}this._input.back()}else if("<"===e&&this._is_first_token()){if(t=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(o.newline);)t+=this._input.next();return b=!0,this._create_token(d.COMMENT,t)}}else if(b&&"-"===e&&(t=this.__patterns.html_comment_end.read()))return b=!1,this._create_token(d.COMMENT,t);return null},k.prototype._read_comment=function(e){var t=null;if("/"===e){var n="";if("*"===this._input.peek(1)){n=this.__patterns.block_comment.read();var i=h.get_directives(n);i&&"start"===i.ignore&&(n+=h.readIgnored(this._input)),n=n.replace(o.allLineBreaks,"\n"),(t=this._create_token(d.BLOCK_COMMENT,n)).directives=i}else"/"===this._input.peek(1)&&(n=this.__patterns.comment.read(),t=this._create_token(d.COMMENT,n))}return t},k.prototype._read_string=function(e){if("`"===e||"'"===e||'"'===e){var t=this._input.next();return this.has_char_escapes=!1,t+="`"===e?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(e),this.has_char_escapes&&this._options.unescape_strings&&(t=function(e){var t="",n=0,r=new i(e),a=null;for(;r.hasNext();)if((a=r.match(/([\s]|[^\\]|\\\\)+/g))&&(t+=a[0]),"\\"===r.peek()){if(r.next(),"x"===r.peek())a=r.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==r.peek()){t+="\\",r.hasNext()&&(t+=r.next());continue}(a=r.match(/u([0-9A-Fa-f]{4})/g))||(a=r.match(/u\{([0-9A-Fa-f]+)\}/g))}if(!a)return e;if((n=parseInt(a[1],16))>126&&n<=255&&0===a[0].indexOf("x"))return e;t+=n>=0&&n<32||n>1114111?"\\"+a[0]:34===n||39===n||92===n?"\\"+String.fromCharCode(n):String.fromCharCode(n)}return t}(t)),this._input.peek()===e&&(t+=this._input.next()),t=t.replace(o.allLineBreaks,"\n"),this._create_token(d.STRING,t)}return null},k.prototype._allow_regexp_or_xml=function(e){return e.type===d.RESERVED&&u(e.text,["return","case","throw","else","do","typeof","yield"])||e.type===d.END_EXPR&&")"===e.text&&e.opened.previous.type===d.RESERVED&&u(e.opened.previous.text,["if","while","for"])||u(e.type,[d.COMMENT,d.START_EXPR,d.START_BLOCK,d.START,d.END_BLOCK,d.OPERATOR,d.EQUALS,d.EOF,d.SEMICOLON,d.COMMA])},k.prototype._read_regexp=function(e,t){if("/"===e&&this._allow_regexp_or_xml(t)){for(var n=this._input.next(),i=!1,r=!1;this._input.hasNext()&&(i||r||this._input.peek()!==e)&&!this._input.testChar(o.newline);)n+=this._input.peek(),i?i=!1:(i="\\"===this._input.peek(),"["===this._input.peek()?r=!0:"]"===this._input.peek()&&(r=!1)),this._input.next();return this._input.peek()===e&&(n+=this._input.next(),n+=this._input.read(o.identifier)),this._create_token(d.STRING,n)}return null},k.prototype._read_xml=function(e,t){if(this._options.e4x&&"<"===e&&this._allow_regexp_or_xml(t)){var n="",i=this.__patterns.xml.read_match();if(i){for(var r=i[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),a=0===r.indexOf("{"),s=0;i;){var l=!!i[1],c=i[2];if(!(!!i[i.length-1]||"![CDATA["===c.slice(0,8))&&(c===r||a&&c.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(l?--s:++s),n+=i[0],s<=0)break;i=this.__patterns.xml.read_match()}return i||(n+=this._input.match(/[\s\S]*/g)[0]),n=n.replace(o.allLineBreaks,"\n"),this._create_token(d.STRING,n)}}return null},k.prototype._read_string_recursive=function(e,t,n){var i,r;"'"===e?r=this.__patterns.single_quote:'"'===e?r=this.__patterns.double_quote:"`"===e?r=this.__patterns.template_text:"}"===e&&(r=this.__patterns.template_expression);for(var a=r.read(),s="";this._input.hasNext();){if((s=this._input.next())===e||!t&&o.newline.test(s)){this._input.back();break}"\\"===s&&this._input.hasNext()?("x"===(i=this._input.peek())||"u"===i?this.has_char_escapes=!0:"\r"===i&&"\n"===this._input.peek(1)&&this._input.next(),s+=this._input.next()):n&&("${"===n&&"$"===s&&"{"===this._input.peek()&&(s+=this._input.next()),n===s&&(s+="`"===e?this._read_string_recursive("}",t,"`"):this._read_string_recursive("`",t,"${"),this._input.hasNext()&&(s+=this._input.next()))),a+=s+=r.read()}return a},e.exports.Tokenizer=k,e.exports.TOKEN=d,e.exports.positionable_operators=g.slice(),e.exports.line_starters=_.slice()},function(e){var t=RegExp.prototype.hasOwnProperty("sticky");function n(e){this.__input=e||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position<this.__input_length},n.prototype.next=function(){var e=null;return this.hasNext()&&(e=this.__input.charAt(this.__position),this.__position+=1),e},n.prototype.peek=function(e){var t=null;return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&(t=this.__input.charAt(e)),t},n.prototype.__match=function(e,n){e.lastIndex=n;var i=e.exec(this.__input);return!i||t&&e.sticky||i.index!==n&&(i=null),i},n.prototype.test=function(e,t){return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&!!this.__match(e,t)},n.prototype.testChar=function(e,t){var n=this.peek(t);return e.lastIndex=0,null!==n&&e.test(n)},n.prototype.match=function(e){var t=this.__match(e,this.__position);return t?this.__position+=t[0].length:t=null,t},n.prototype.read=function(e,t,n){var i,r="";return e&&(i=this.match(e))&&(r+=i[0]),!t||!i&&e||(r+=this.readUntil(t,n)),r},n.prototype.readUntil=function(e,t){var n,i=this.__position;e.lastIndex=this.__position;var r=e.exec(this.__input);return r?(i=r.index,t&&(i+=r[0].length)):i=this.__input_length,n=this.__input.substring(this.__position,i),this.__position=i,n},n.prototype.readUntilAfter=function(e){return this.readUntil(e,!0)},n.prototype.get_regexp=function(e,n){var i=null,r="g";return n&&t&&(r="y"),"string"==typeof e&&""!==e?i=new RegExp(e,r):e&&(i=new RegExp(e.source,r)),i},n.prototype.get_literal_regexp=function(e){return RegExp(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},n.prototype.peekUntilAfter=function(e){var t=this.__position,n=this.readUntilAfter(e);return this.__position=t,n},n.prototype.lookBack=function(e){var t=this.__position-1;return t>=e.length&&this.__input.substring(t-e.length,t).toLowerCase()===e},e.exports.InputScanner=n},function(e,t,n){var i=n(8).InputScanner,r=n(3).Token,a=n(10).TokenStream,s=n(11).WhitespacePattern,o={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(e,t){this._input=new i(e),this._options=t||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};l.prototype.tokenize=function(){var e;this._input.restart(),this.__tokens=new a,this._reset();for(var t=new r(o.START,""),n=null,i=[],s=new a;t.type!==o.EOF;){for(e=this._get_next_token(t,n);this._is_comment(e);)s.add(e),e=this._get_next_token(t,n);s.isEmpty()||(e.comments_before=s,s=new a),e.parent=n,this._is_opening(e)?(i.push(n),n=e):n&&this._is_closing(e,n)&&(e.opened=n,n.closed=e,n=i.pop(),e.parent=n),e.previous=t,t.next=e,this.__tokens.add(e),t=e}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(e,t){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(o.RAW,n):this._create_token(o.EOF,"")},l.prototype._is_comment=function(e){return!1},l.prototype._is_opening=function(e){return!1},l.prototype._is_closing=function(e,t){return!1},l.prototype._create_token=function(e,t){return new r(e,t,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},e.exports.Tokenizer=l,e.exports.TOKEN=o},function(e){function t(e){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=e}t.prototype.restart=function(){this.__position=0},t.prototype.isEmpty=function(){return 0===this.__tokens_length},t.prototype.hasNext=function(){return this.__position<this.__tokens_length},t.prototype.next=function(){var e=null;return this.hasNext()&&(e=this.__tokens[this.__position],this.__position+=1),e},t.prototype.peek=function(e){var t=null;return e=e||0,(e+=this.__position)>=0&&e<this.__tokens_length&&(t=this.__tokens[e]),t},t.prototype.add=function(e){this.__parent_token&&(e.parent=this.__parent_token),this.__tokens.push(e),this.__tokens_length+=1},e.exports.TokenStream=t},function(e,t,n){var i=n(12).Pattern;function r(e,t){i.call(this,e,t),t?this._line_regexp=this._input.get_regexp(t._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}r.prototype=new i,r.prototype.__set_whitespace_patterns=function(e,t){e+="\\t ",t+="\\n\\r",this._match_pattern=this._input.get_regexp("["+e+t+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+t+"]")},r.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var e=this._input.read(this._match_pattern);if(" "===e)this.whitespace_before_token=" ";else if(e){var t=this.__split(this._newline_regexp,e);this.newline_count=t.length-1,this.whitespace_before_token=t[this.newline_count]}return e},r.prototype.matching=function(e,t){var n=this._create();return n.__set_whitespace_patterns(e,t),n._update(),n},r.prototype._create=function(){return new r(this._input,this)},r.prototype.__split=function(e,t){e.lastIndex=0;for(var n=0,i=[],r=e.exec(t);r;)i.push(t.substring(n,r.index)),n=r.index+r[0].length,r=e.exec(t);return n<t.length?i.push(t.substring(n,t.length)):i.push(""),i},e.exports.WhitespacePattern=r},function(e){function t(e,t){this._input=e,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,t&&(this._starting_pattern=this._input.get_regexp(t._starting_pattern,!0),this._match_pattern=this._input.get_regexp(t._match_pattern,!0),this._until_pattern=this._input.get_regexp(t._until_pattern),this._until_after=t._until_after)}t.prototype.read=function(){var e=this._input.read(this._starting_pattern);return this._starting_pattern&&!e||(e+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),e},t.prototype.read_match=function(){return this._input.match(this._match_pattern)},t.prototype.until_after=function(e){var t=this._create();return t._until_after=!0,t._until_pattern=this._input.get_regexp(e),t._update(),t},t.prototype.until=function(e){var t=this._create();return t._until_after=!1,t._until_pattern=this._input.get_regexp(e),t._update(),t},t.prototype.starting_with=function(e){var t=this._create();return t._starting_pattern=this._input.get_regexp(e,!0),t._update(),t},t.prototype.matching=function(e){var t=this._create();return t._match_pattern=this._input.get_regexp(e,!0),t._update(),t},t.prototype._create=function(){return new t(this._input,this)},t.prototype._update=function(){},e.exports.Pattern=t},function(e){function t(e,t){e="string"==typeof e?e:e.source,t="string"==typeof t?t:t.source,this.__directives_block_pattern=new RegExp(e+/ beautify( \w+[:]\w+)+ /.source+t,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(e+/\sbeautify\signore:end\s/.source+t,"g")}t.prototype.get_directives=function(e){if(!e.match(this.__directives_block_pattern))return null;var t={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(e);n;)t[n[1]]=n[2],n=this.__directive_pattern.exec(e);return t},t.prototype.readIgnored=function(e){return e.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=t},function(e,t,n){var i=n(12).Pattern,r={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function a(e,t){i.call(this,e,t),this.__template_pattern=null,this._disabled=Object.assign({},r),this._excluded=Object.assign({},r),t&&(this.__template_pattern=this._input.get_regexp(t.__template_pattern),this._excluded=Object.assign(this._excluded,t._excluded),this._disabled=Object.assign(this._disabled,t._disabled));var n=new i(e);this.__patterns={handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:n.starting_with(/{{{/).until_after(/}}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),php:n.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}a.prototype=new i,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(e){var t=this._create();return t._disabled[e]=!0,t._update(),t},a.prototype.read_options=function(e){var t=this._create();for(var n in r)t._disabled[n]=-1===e.templating.indexOf(n);return t._update(),t},a.prototype.exclude=function(e){var t=this._create();return t._excluded[e]=!0,t._update(),t},a.prototype.read=function(){var e="";e=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),e+=t,t=this._read_template();return this._until_after&&(e+=this._input.readUntilAfter(this._until_pattern)),e},a.prototype.__set_templated_pattern=function(){var e=[];this._disabled.php||e.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||e.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(e.push(this.__patterns.django._starting_pattern.source),e.push(this.__patterns.django_value._starting_pattern.source),e.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||e.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&e.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+e.join("|")+")")},a.prototype._read_template=function(){var e="",t=this._input.peek();if("<"===t){var n=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==n||(e=e||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==n||(e=e||this.__patterns.erb.read())}else"{"===t&&(this._disabled.handlebars||this._excluded.handlebars||(e=(e=(e=e||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(e=e||this.__patterns.django_value.read()),this._excluded.django||(e=(e=e||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(e=(e=(e=e||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return e},e.exports.TemplatablePattern=a}],t={};var n=function n(i){var r=t[i];if(void 0!==r)return r.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}(0);i=n}();var r=i;void 0===(n=function(){return{js_beautify:r}}.apply(t,[]))||(e.exports=n)}()},15342:function(e){var t;"undefined"!=typeof self&&self,t=function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){},function(e,t,n){"use strict";n.r(t),n(0);var i=function(){function e(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}return e.range=function(t,n){return n?t&&t.loc&&n.loc&&t.loc.lexer===n.loc.lexer?new e(t.loc.lexer,t.loc.start,n.loc.end):null:t&&t.loc},e}(),r=function(){function e(e,t){this.text=void 0,this.loc=void 0,this.text=e,this.loc=t}return e.prototype.range=function(t,n){return new e(n,i.range(this,t))},e}(),a=function e(t,n){this.position=void 0;var i,r="KaTeX parse error: "+t,a=n&&n.loc;if(a&&a.start<=a.end){var s=a.lexer.input;i=a.start;var o=a.end;i===s.length?r+=" at end of input: ":r+=" at position "+(i+1)+": ";var l=s.slice(i,o).replace(/[^]/g,"$&̲");r+=(i>15?"…"+s.slice(i-15,i):s.slice(0,i))+l+(o+15<s.length?s.slice(o,o+15)+"…":s.slice(o))}var c=new Error(r);return c.name="ParseError",c.__proto__=e.prototype,c.position=i,c};a.prototype.__proto__=Error.prototype;var s=a,o=/([A-Z])/g,l={"&":"&",">":">","<":"<",'"':""","'":"'"},c=/[&><"']/g,u=function e(t){return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},d={contains:function(e,t){return-1!==e.indexOf(t)},deflt:function(e,t){return void 0===e?t:e},escape:function(e){return String(e).replace(c,(function(e){return l[e]}))},hyphenate:function(e){return e.replace(o,"-$1").toLowerCase()},getBaseElem:u,isCharacterBox:function(e){var t=u(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},protocolFromUrl:function(e){var t=/^\s*([^\\/#]*?)(?::|�*58|�*3a)/i.exec(e);return null!=t?t[1]:"_relative"}},h=function(){function e(e){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,e=e||{},this.displayMode=d.deflt(e.displayMode,!1),this.output=d.deflt(e.output,"htmlAndMathml"),this.leqno=d.deflt(e.leqno,!1),this.fleqn=d.deflt(e.fleqn,!1),this.throwOnError=d.deflt(e.throwOnError,!0),this.errorColor=d.deflt(e.errorColor,"#cc0000"),this.macros=e.macros||{},this.minRuleThickness=Math.max(0,d.deflt(e.minRuleThickness,0)),this.colorIsTextColor=d.deflt(e.colorIsTextColor,!1),this.strict=d.deflt(e.strict,"warn"),this.trust=d.deflt(e.trust,!1),this.maxSize=Math.max(0,d.deflt(e.maxSize,1/0)),this.maxExpand=Math.max(0,d.deflt(e.maxExpand,1e3))}var t=e.prototype;return t.reportNonstrict=function(e,t,n){var i=this.strict;if("function"==typeof i&&(i=i(e,t,n)),i&&"ignore"!==i){if(!0===i||"error"===i)throw new s("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n);"warn"===i?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+i+"': "+t+" ["+e+"]")}},t.useStrictBehavior=function(e,t,n){var i=this.strict;if("function"==typeof i)try{i=i(e,t,n)}catch(e){i="error"}return!(!i||"ignore"===i||!0!==i&&"error"!==i&&("warn"===i?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+i+"': "+t+" ["+e+"]"),1)))},t.isTrusted=function(e){e.url&&!e.protocol&&(e.protocol=d.protocolFromUrl(e.url));var t="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(t)},e}(),p=function(){function e(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}var t=e.prototype;return t.sup=function(){return f[m[this.id]]},t.sub=function(){return f[g[this.id]]},t.fracNum=function(){return f[v[this.id]]},t.fracDen=function(){return f[b[this.id]]},t.cramp=function(){return f[y[this.id]]},t.text=function(){return f[_[this.id]]},t.isTight=function(){return this.size>=2},e}(),f=[new p(0,0,!1),new p(1,0,!0),new p(2,1,!1),new p(3,1,!0),new p(4,2,!1),new p(5,2,!0),new p(6,3,!1),new p(7,3,!0)],m=[4,5,4,5,6,7,6,7],g=[5,5,5,5,7,7,7,7],v=[2,3,4,5,6,7,6,7],b=[3,3,5,5,7,7,7,7],y=[1,1,3,3,5,5,7,7],_=[0,1,2,3,2,3,2,3],w={DISPLAY:f[0],TEXT:f[2],SCRIPT:f[4],SCRIPTSCRIPT:f[6]},x=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}],k=[];function S(e){for(var t=0;t<k.length;t+=2)if(e>=k[t]&&e<=k[t+1])return!0;return!1}x.forEach((function(e){return e.blocks.forEach((function(e){return k.push.apply(k,e)}))}));var E=80,C={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"},T=function(){function e(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}var t=e.prototype;return t.hasClass=function(e){return d.contains(this.classes,e)},t.toNode=function(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e},t.toMarkup=function(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e},t.toText=function(){var e=function(e){return e.toText()};return this.children.map(e).join("")},e}(),A=function(e){return e.filter((function(e){return e})).join(" ")},M=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var i=t.getColor();i&&(this.style.color=i)}},L=function(e){var t=document.createElement(e);for(var n in t.className=A(this.classes),this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&t.setAttribute(i,this.attributes[i]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},D=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+d.escape(A(this.classes))+'"');var n="";for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=d.hyphenate(i)+":"+this.style[i]+";");for(var r in n&&(t+=' style="'+d.escape(n)+'"'),this.attributes)this.attributes.hasOwnProperty(r)&&(t+=" "+r+'="'+d.escape(this.attributes[r])+'"');t+=">";for(var a=0;a<this.children.length;a++)t+=this.children[a].toMarkup();return t+="</"+e+">"},I=function(){function e(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,M.call(this,e,n,i),this.children=t||[]}var t=e.prototype;return t.setAttribute=function(e,t){this.attributes[e]=t},t.hasClass=function(e){return d.contains(this.classes,e)},t.toNode=function(){return L.call(this,"span")},t.toMarkup=function(){return D.call(this,"span")},e}(),R=function(){function e(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,M.call(this,t,i),this.children=n||[],this.setAttribute("href",e)}var t=e.prototype;return t.setAttribute=function(e,t){this.attributes[e]=t},t.hasClass=function(e){return d.contains(this.classes,e)},t.toNode=function(){return L.call(this,"a")},t.toMarkup=function(){return D.call(this,"a")},e}(),P=function(){function e(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=n}var t=e.prototype;return t.hasClass=function(e){return d.contains(this.classes,e)},t.toNode=function(){var e=document.createElement("img");for(var t in e.src=this.src,e.alt=this.alt,e.className="mord",this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e},t.toMarkup=function(){var e="<img src='"+this.src+" 'alt='"+this.alt+"' ",t="";for(var n in this.style)this.style.hasOwnProperty(n)&&(t+=d.hyphenate(n)+":"+this.style[n]+";");return t&&(e+=' style="'+d.escape(t)+'"'),e+="'/>"},e}(),O={"î":"ı̂","ï":"ı̈","í":"ı́","ì":"ı̀"},N=function(){function e(e,t,n,i,r,a,s,o){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=i||0,this.skew=r||0,this.width=a||0,this.classes=s||[],this.style=o||{},this.maxFontSize=0;var l=function(e){for(var t=0;t<x.length;t++)for(var n=x[t],i=0;i<n.blocks.length;i++){var r=n.blocks[i];if(e>=r[0]&&e<=r[1])return n.name}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=O[this.text])}var t=e.prototype;return t.hasClass=function(e){return d.contains(this.classes,e)},t.toNode=function(){var e=document.createTextNode(this.text),t=null;for(var n in this.italic>0&&((t=document.createElement("span")).style.marginRight=this.italic+"em"),this.classes.length>0&&((t=t||document.createElement("span")).className=A(this.classes)),this.style)this.style.hasOwnProperty(n)&&((t=t||document.createElement("span")).style[n]=this.style[n]);return t?(t.appendChild(e),t):e},t.toMarkup=function(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=d.escape(A(this.classes)),t+='"');var n="";for(var i in this.italic>0&&(n+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(i)&&(n+=d.hyphenate(i)+":"+this.style[i]+";");n&&(e=!0,t+=' style="'+d.escape(n)+'"');var r=d.escape(this.text);return e?(t+=">",t+=r,t+="</span>"):r},e}(),B=function(){function e(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}var t=e.prototype;return t.toNode=function(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e},t.toMarkup=function(){var e="<svg";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+"='"+this.attributes[t]+"'");e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</svg>"},e}(),$=function(){function e(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}var t=e.prototype;return t.toNode=function(){var e=document.createElementNS("http://www.w3.org/2000/svg","path");return this.alternate?e.setAttribute("d",this.alternate):e.setAttribute("d",C[this.pathName]),e},t.toMarkup=function(){return this.alternate?"<path d='"+this.alternate+"'/>":"<path d='"+C[this.pathName]+"'/>"},e}(),F=function(){function e(e){this.attributes=void 0,this.attributes=e||{}}var t=e.prototype;return t.toNode=function(){var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e},t.toMarkup=function(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+"='"+this.attributes[t]+"'");return e+="/>"},e}();function z(e){if(e instanceof N)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}var K={"AMS-Regular":{65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473]},"Fraktur-Regular":{33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],163:[0,.69444,0,0,.86853],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],163:[0,.69444,0,0,.76909],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],305:[0,.43056,0,.02778,.32246],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],567:[.19444,.43056,0,.08334,.38403],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,1],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.67,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.9,0,0,.278],8943:[-.19,.31,0,0,1.172],8945:[-.1,.82,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.744,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.744,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333]},"Math-Italic":{65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059]},"Math-Regular":{65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059]},"SansSerif-Bold":{33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212]},"Size1-Regular":{40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},U={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},j={"Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function q(e,t,n){if(!K[t])throw new Error("Font metrics not found for font: "+t+".");var i=e.charCodeAt(0),r=K[t][i];if(!r&&e[0]in j&&(i=j[e[0]].charCodeAt(0),r=K[t][i]),r||"text"!==n||S(i)&&(r=K[t][77]),r)return{depth:r[0],height:r[1],italic:r[2],skew:r[3],width:r[4]}}var H={},V={bin:1,close:1,inner:1,open:1,punct:1,rel:1},G={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Z={math:{},text:{}},W=Z;function Y(e,t,n,i,r,a){Z[e][r]={font:t,group:n,replace:i},a&&i&&(Z[e][i]=Z[e][r])}var X="math",J="text",Q="main",ee="ams",te="accent-token",ne="bin",ie="close",re="inner",ae="mathord",se="op-token",oe="open",le="punct",ce="rel",ue="spacing",de="textord";Y(X,Q,ce,"≡","\\equiv",!0),Y(X,Q,ce,"≺","\\prec",!0),Y(X,Q,ce,"≻","\\succ",!0),Y(X,Q,ce,"∼","\\sim",!0),Y(X,Q,ce,"⊥","\\perp"),Y(X,Q,ce,"⪯","\\preceq",!0),Y(X,Q,ce,"⪰","\\succeq",!0),Y(X,Q,ce,"≃","\\simeq",!0),Y(X,Q,ce,"∣","\\mid",!0),Y(X,Q,ce,"≪","\\ll",!0),Y(X,Q,ce,"≫","\\gg",!0),Y(X,Q,ce,"≍","\\asymp",!0),Y(X,Q,ce,"∥","\\parallel"),Y(X,Q,ce,"⋈","\\bowtie",!0),Y(X,Q,ce,"⌣","\\smile",!0),Y(X,Q,ce,"⊑","\\sqsubseteq",!0),Y(X,Q,ce,"⊒","\\sqsupseteq",!0),Y(X,Q,ce,"≐","\\doteq",!0),Y(X,Q,ce,"⌢","\\frown",!0),Y(X,Q,ce,"∋","\\ni",!0),Y(X,Q,ce,"∝","\\propto",!0),Y(X,Q,ce,"⊢","\\vdash",!0),Y(X,Q,ce,"⊣","\\dashv",!0),Y(X,Q,ce,"∋","\\owns"),Y(X,Q,le,".","\\ldotp"),Y(X,Q,le,"⋅","\\cdotp"),Y(X,Q,de,"#","\\#"),Y(J,Q,de,"#","\\#"),Y(X,Q,de,"&","\\&"),Y(J,Q,de,"&","\\&"),Y(X,Q,de,"ℵ","\\aleph",!0),Y(X,Q,de,"∀","\\forall",!0),Y(X,Q,de,"ℏ","\\hbar",!0),Y(X,Q,de,"∃","\\exists",!0),Y(X,Q,de,"∇","\\nabla",!0),Y(X,Q,de,"♭","\\flat",!0),Y(X,Q,de,"ℓ","\\ell",!0),Y(X,Q,de,"♮","\\natural",!0),Y(X,Q,de,"♣","\\clubsuit",!0),Y(X,Q,de,"℘","\\wp",!0),Y(X,Q,de,"♯","\\sharp",!0),Y(X,Q,de,"♢","\\diamondsuit",!0),Y(X,Q,de,"ℜ","\\Re",!0),Y(X,Q,de,"♡","\\heartsuit",!0),Y(X,Q,de,"ℑ","\\Im",!0),Y(X,Q,de,"♠","\\spadesuit",!0),Y(J,Q,de,"§","\\S",!0),Y(J,Q,de,"¶","\\P",!0),Y(X,Q,de,"†","\\dag"),Y(J,Q,de,"†","\\dag"),Y(J,Q,de,"†","\\textdagger"),Y(X,Q,de,"‡","\\ddag"),Y(J,Q,de,"‡","\\ddag"),Y(J,Q,de,"‡","\\textdaggerdbl"),Y(X,Q,ie,"⎱","\\rmoustache",!0),Y(X,Q,oe,"⎰","\\lmoustache",!0),Y(X,Q,ie,"⟯","\\rgroup",!0),Y(X,Q,oe,"⟮","\\lgroup",!0),Y(X,Q,ne,"∓","\\mp",!0),Y(X,Q,ne,"⊖","\\ominus",!0),Y(X,Q,ne,"⊎","\\uplus",!0),Y(X,Q,ne,"⊓","\\sqcap",!0),Y(X,Q,ne,"∗","\\ast"),Y(X,Q,ne,"⊔","\\sqcup",!0),Y(X,Q,ne,"◯","\\bigcirc"),Y(X,Q,ne,"∙","\\bullet"),Y(X,Q,ne,"‡","\\ddagger"),Y(X,Q,ne,"≀","\\wr",!0),Y(X,Q,ne,"⨿","\\amalg"),Y(X,Q,ne,"&","\\And"),Y(X,Q,ce,"⟵","\\longleftarrow",!0),Y(X,Q,ce,"⇐","\\Leftarrow",!0),Y(X,Q,ce,"⟸","\\Longleftarrow",!0),Y(X,Q,ce,"⟶","\\longrightarrow",!0),Y(X,Q,ce,"⇒","\\Rightarrow",!0),Y(X,Q,ce,"⟹","\\Longrightarrow",!0),Y(X,Q,ce,"↔","\\leftrightarrow",!0),Y(X,Q,ce,"⟷","\\longleftrightarrow",!0),Y(X,Q,ce,"⇔","\\Leftrightarrow",!0),Y(X,Q,ce,"⟺","\\Longleftrightarrow",!0),Y(X,Q,ce,"↦","\\mapsto",!0),Y(X,Q,ce,"⟼","\\longmapsto",!0),Y(X,Q,ce,"↗","\\nearrow",!0),Y(X,Q,ce,"↩","\\hookleftarrow",!0),Y(X,Q,ce,"↪","\\hookrightarrow",!0),Y(X,Q,ce,"↘","\\searrow",!0),Y(X,Q,ce,"↼","\\leftharpoonup",!0),Y(X,Q,ce,"⇀","\\rightharpoonup",!0),Y(X,Q,ce,"↙","\\swarrow",!0),Y(X,Q,ce,"↽","\\leftharpoondown",!0),Y(X,Q,ce,"⇁","\\rightharpoondown",!0),Y(X,Q,ce,"↖","\\nwarrow",!0),Y(X,Q,ce,"⇌","\\rightleftharpoons",!0),Y(X,ee,ce,"≮","\\nless",!0),Y(X,ee,ce,"","\\@nleqslant"),Y(X,ee,ce,"","\\@nleqq"),Y(X,ee,ce,"⪇","\\lneq",!0),Y(X,ee,ce,"≨","\\lneqq",!0),Y(X,ee,ce,"","\\@lvertneqq"),Y(X,ee,ce,"⋦","\\lnsim",!0),Y(X,ee,ce,"⪉","\\lnapprox",!0),Y(X,ee,ce,"⊀","\\nprec",!0),Y(X,ee,ce,"⋠","\\npreceq",!0),Y(X,ee,ce,"⋨","\\precnsim",!0),Y(X,ee,ce,"⪹","\\precnapprox",!0),Y(X,ee,ce,"≁","\\nsim",!0),Y(X,ee,ce,"","\\@nshortmid"),Y(X,ee,ce,"∤","\\nmid",!0),Y(X,ee,ce,"⊬","\\nvdash",!0),Y(X,ee,ce,"⊭","\\nvDash",!0),Y(X,ee,ce,"⋪","\\ntriangleleft"),Y(X,ee,ce,"⋬","\\ntrianglelefteq",!0),Y(X,ee,ce,"⊊","\\subsetneq",!0),Y(X,ee,ce,"","\\@varsubsetneq"),Y(X,ee,ce,"⫋","\\subsetneqq",!0),Y(X,ee,ce,"","\\@varsubsetneqq"),Y(X,ee,ce,"≯","\\ngtr",!0),Y(X,ee,ce,"","\\@ngeqslant"),Y(X,ee,ce,"","\\@ngeqq"),Y(X,ee,ce,"⪈","\\gneq",!0),Y(X,ee,ce,"≩","\\gneqq",!0),Y(X,ee,ce,"","\\@gvertneqq"),Y(X,ee,ce,"⋧","\\gnsim",!0),Y(X,ee,ce,"⪊","\\gnapprox",!0),Y(X,ee,ce,"⊁","\\nsucc",!0),Y(X,ee,ce,"⋡","\\nsucceq",!0),Y(X,ee,ce,"⋩","\\succnsim",!0),Y(X,ee,ce,"⪺","\\succnapprox",!0),Y(X,ee,ce,"≆","\\ncong",!0),Y(X,ee,ce,"","\\@nshortparallel"),Y(X,ee,ce,"∦","\\nparallel",!0),Y(X,ee,ce,"⊯","\\nVDash",!0),Y(X,ee,ce,"⋫","\\ntriangleright"),Y(X,ee,ce,"⋭","\\ntrianglerighteq",!0),Y(X,ee,ce,"","\\@nsupseteqq"),Y(X,ee,ce,"⊋","\\supsetneq",!0),Y(X,ee,ce,"","\\@varsupsetneq"),Y(X,ee,ce,"⫌","\\supsetneqq",!0),Y(X,ee,ce,"","\\@varsupsetneqq"),Y(X,ee,ce,"⊮","\\nVdash",!0),Y(X,ee,ce,"⪵","\\precneqq",!0),Y(X,ee,ce,"⪶","\\succneqq",!0),Y(X,ee,ce,"","\\@nsubseteqq"),Y(X,ee,ne,"⊴","\\unlhd"),Y(X,ee,ne,"⊵","\\unrhd"),Y(X,ee,ce,"↚","\\nleftarrow",!0),Y(X,ee,ce,"↛","\\nrightarrow",!0),Y(X,ee,ce,"⇍","\\nLeftarrow",!0),Y(X,ee,ce,"⇏","\\nRightarrow",!0),Y(X,ee,ce,"↮","\\nleftrightarrow",!0),Y(X,ee,ce,"⇎","\\nLeftrightarrow",!0),Y(X,ee,ce,"△","\\vartriangle"),Y(X,ee,de,"ℏ","\\hslash"),Y(X,ee,de,"▽","\\triangledown"),Y(X,ee,de,"◊","\\lozenge"),Y(X,ee,de,"Ⓢ","\\circledS"),Y(X,ee,de,"®","\\circledR"),Y(J,ee,de,"®","\\circledR"),Y(X,ee,de,"∡","\\measuredangle",!0),Y(X,ee,de,"∄","\\nexists"),Y(X,ee,de,"℧","\\mho"),Y(X,ee,de,"Ⅎ","\\Finv",!0),Y(X,ee,de,"⅁","\\Game",!0),Y(X,ee,de,"‵","\\backprime"),Y(X,ee,de,"▲","\\blacktriangle"),Y(X,ee,de,"▼","\\blacktriangledown"),Y(X,ee,de,"■","\\blacksquare"),Y(X,ee,de,"⧫","\\blacklozenge"),Y(X,ee,de,"★","\\bigstar"),Y(X,ee,de,"∢","\\sphericalangle",!0),Y(X,ee,de,"∁","\\complement",!0),Y(X,ee,de,"ð","\\eth",!0),Y(X,ee,de,"╱","\\diagup"),Y(X,ee,de,"╲","\\diagdown"),Y(X,ee,de,"□","\\square"),Y(X,ee,de,"□","\\Box"),Y(X,ee,de,"◊","\\Diamond"),Y(X,ee,de,"¥","\\yen",!0),Y(J,ee,de,"¥","\\yen",!0),Y(X,ee,de,"✓","\\checkmark",!0),Y(J,ee,de,"✓","\\checkmark"),Y(X,ee,de,"ℶ","\\beth",!0),Y(X,ee,de,"ℸ","\\daleth",!0),Y(X,ee,de,"ℷ","\\gimel",!0),Y(X,ee,de,"ϝ","\\digamma",!0),Y(X,ee,de,"ϰ","\\varkappa"),Y(X,ee,oe,"┌","\\ulcorner",!0),Y(X,ee,ie,"┐","\\urcorner",!0),Y(X,ee,oe,"└","\\llcorner",!0),Y(X,ee,ie,"┘","\\lrcorner",!0),Y(X,ee,ce,"≦","\\leqq",!0),Y(X,ee,ce,"⩽","\\leqslant",!0),Y(X,ee,ce,"⪕","\\eqslantless",!0),Y(X,ee,ce,"≲","\\lesssim",!0),Y(X,ee,ce,"⪅","\\lessapprox",!0),Y(X,ee,ce,"≊","\\approxeq",!0),Y(X,ee,ne,"⋖","\\lessdot"),Y(X,ee,ce,"⋘","\\lll",!0),Y(X,ee,ce,"≶","\\lessgtr",!0),Y(X,ee,ce,"⋚","\\lesseqgtr",!0),Y(X,ee,ce,"⪋","\\lesseqqgtr",!0),Y(X,ee,ce,"≑","\\doteqdot"),Y(X,ee,ce,"≓","\\risingdotseq",!0),Y(X,ee,ce,"≒","\\fallingdotseq",!0),Y(X,ee,ce,"∽","\\backsim",!0),Y(X,ee,ce,"⋍","\\backsimeq",!0),Y(X,ee,ce,"⫅","\\subseteqq",!0),Y(X,ee,ce,"⋐","\\Subset",!0),Y(X,ee,ce,"⊏","\\sqsubset",!0),Y(X,ee,ce,"≼","\\preccurlyeq",!0),Y(X,ee,ce,"⋞","\\curlyeqprec",!0),Y(X,ee,ce,"≾","\\precsim",!0),Y(X,ee,ce,"⪷","\\precapprox",!0),Y(X,ee,ce,"⊲","\\vartriangleleft"),Y(X,ee,ce,"⊴","\\trianglelefteq"),Y(X,ee,ce,"⊨","\\vDash",!0),Y(X,ee,ce,"⊪","\\Vvdash",!0),Y(X,ee,ce,"⌣","\\smallsmile"),Y(X,ee,ce,"⌢","\\smallfrown"),Y(X,ee,ce,"≏","\\bumpeq",!0),Y(X,ee,ce,"≎","\\Bumpeq",!0),Y(X,ee,ce,"≧","\\geqq",!0),Y(X,ee,ce,"⩾","\\geqslant",!0),Y(X,ee,ce,"⪖","\\eqslantgtr",!0),Y(X,ee,ce,"≳","\\gtrsim",!0),Y(X,ee,ce,"⪆","\\gtrapprox",!0),Y(X,ee,ne,"⋗","\\gtrdot"),Y(X,ee,ce,"⋙","\\ggg",!0),Y(X,ee,ce,"≷","\\gtrless",!0),Y(X,ee,ce,"⋛","\\gtreqless",!0),Y(X,ee,ce,"⪌","\\gtreqqless",!0),Y(X,ee,ce,"≖","\\eqcirc",!0),Y(X,ee,ce,"≗","\\circeq",!0),Y(X,ee,ce,"≜","\\triangleq",!0),Y(X,ee,ce,"∼","\\thicksim"),Y(X,ee,ce,"≈","\\thickapprox"),Y(X,ee,ce,"⫆","\\supseteqq",!0),Y(X,ee,ce,"⋑","\\Supset",!0),Y(X,ee,ce,"⊐","\\sqsupset",!0),Y(X,ee,ce,"≽","\\succcurlyeq",!0),Y(X,ee,ce,"⋟","\\curlyeqsucc",!0),Y(X,ee,ce,"≿","\\succsim",!0),Y(X,ee,ce,"⪸","\\succapprox",!0),Y(X,ee,ce,"⊳","\\vartriangleright"),Y(X,ee,ce,"⊵","\\trianglerighteq"),Y(X,ee,ce,"⊩","\\Vdash",!0),Y(X,ee,ce,"∣","\\shortmid"),Y(X,ee,ce,"∥","\\shortparallel"),Y(X,ee,ce,"≬","\\between",!0),Y(X,ee,ce,"⋔","\\pitchfork",!0),Y(X,ee,ce,"∝","\\varpropto"),Y(X,ee,ce,"◀","\\blacktriangleleft"),Y(X,ee,ce,"∴","\\therefore",!0),Y(X,ee,ce,"∍","\\backepsilon"),Y(X,ee,ce,"▶","\\blacktriangleright"),Y(X,ee,ce,"∵","\\because",!0),Y(X,ee,ce,"⋘","\\llless"),Y(X,ee,ce,"⋙","\\gggtr"),Y(X,ee,ne,"⊲","\\lhd"),Y(X,ee,ne,"⊳","\\rhd"),Y(X,ee,ce,"≂","\\eqsim",!0),Y(X,Q,ce,"⋈","\\Join"),Y(X,ee,ce,"≑","\\Doteq",!0),Y(X,ee,ne,"∔","\\dotplus",!0),Y(X,ee,ne,"∖","\\smallsetminus"),Y(X,ee,ne,"⋒","\\Cap",!0),Y(X,ee,ne,"⋓","\\Cup",!0),Y(X,ee,ne,"⩞","\\doublebarwedge",!0),Y(X,ee,ne,"⊟","\\boxminus",!0),Y(X,ee,ne,"⊞","\\boxplus",!0),Y(X,ee,ne,"⋇","\\divideontimes",!0),Y(X,ee,ne,"⋉","\\ltimes",!0),Y(X,ee,ne,"⋊","\\rtimes",!0),Y(X,ee,ne,"⋋","\\leftthreetimes",!0),Y(X,ee,ne,"⋌","\\rightthreetimes",!0),Y(X,ee,ne,"⋏","\\curlywedge",!0),Y(X,ee,ne,"⋎","\\curlyvee",!0),Y(X,ee,ne,"⊝","\\circleddash",!0),Y(X,ee,ne,"⊛","\\circledast",!0),Y(X,ee,ne,"⋅","\\centerdot"),Y(X,ee,ne,"⊺","\\intercal",!0),Y(X,ee,ne,"⋒","\\doublecap"),Y(X,ee,ne,"⋓","\\doublecup"),Y(X,ee,ne,"⊠","\\boxtimes",!0),Y(X,ee,ce,"⇢","\\dashrightarrow",!0),Y(X,ee,ce,"⇠","\\dashleftarrow",!0),Y(X,ee,ce,"⇇","\\leftleftarrows",!0),Y(X,ee,ce,"⇆","\\leftrightarrows",!0),Y(X,ee,ce,"⇚","\\Lleftarrow",!0),Y(X,ee,ce,"↞","\\twoheadleftarrow",!0),Y(X,ee,ce,"↢","\\leftarrowtail",!0),Y(X,ee,ce,"↫","\\looparrowleft",!0),Y(X,ee,ce,"⇋","\\leftrightharpoons",!0),Y(X,ee,ce,"↶","\\curvearrowleft",!0),Y(X,ee,ce,"↺","\\circlearrowleft",!0),Y(X,ee,ce,"↰","\\Lsh",!0),Y(X,ee,ce,"⇈","\\upuparrows",!0),Y(X,ee,ce,"↿","\\upharpoonleft",!0),Y(X,ee,ce,"⇃","\\downharpoonleft",!0),Y(X,ee,ce,"⊸","\\multimap",!0),Y(X,ee,ce,"↭","\\leftrightsquigarrow",!0),Y(X,ee,ce,"⇉","\\rightrightarrows",!0),Y(X,ee,ce,"⇄","\\rightleftarrows",!0),Y(X,ee,ce,"↠","\\twoheadrightarrow",!0),Y(X,ee,ce,"↣","\\rightarrowtail",!0),Y(X,ee,ce,"↬","\\looparrowright",!0),Y(X,ee,ce,"↷","\\curvearrowright",!0),Y(X,ee,ce,"↻","\\circlearrowright",!0),Y(X,ee,ce,"↱","\\Rsh",!0),Y(X,ee,ce,"⇊","\\downdownarrows",!0),Y(X,ee,ce,"↾","\\upharpoonright",!0),Y(X,ee,ce,"⇂","\\downharpoonright",!0),Y(X,ee,ce,"⇝","\\rightsquigarrow",!0),Y(X,ee,ce,"⇝","\\leadsto"),Y(X,ee,ce,"⇛","\\Rrightarrow",!0),Y(X,ee,ce,"↾","\\restriction"),Y(X,Q,de,"‘","`"),Y(X,Q,de,"$","\\$"),Y(J,Q,de,"$","\\$"),Y(J,Q,de,"$","\\textdollar"),Y(X,Q,de,"%","\\%"),Y(J,Q,de,"%","\\%"),Y(X,Q,de,"_","\\_"),Y(J,Q,de,"_","\\_"),Y(J,Q,de,"_","\\textunderscore"),Y(X,Q,de,"∠","\\angle",!0),Y(X,Q,de,"∞","\\infty",!0),Y(X,Q,de,"′","\\prime"),Y(X,Q,de,"△","\\triangle"),Y(X,Q,de,"Γ","\\Gamma",!0),Y(X,Q,de,"Δ","\\Delta",!0),Y(X,Q,de,"Θ","\\Theta",!0),Y(X,Q,de,"Λ","\\Lambda",!0),Y(X,Q,de,"Ξ","\\Xi",!0),Y(X,Q,de,"Π","\\Pi",!0),Y(X,Q,de,"Σ","\\Sigma",!0),Y(X,Q,de,"Υ","\\Upsilon",!0),Y(X,Q,de,"Φ","\\Phi",!0),Y(X,Q,de,"Ψ","\\Psi",!0),Y(X,Q,de,"Ω","\\Omega",!0),Y(X,Q,de,"A","Α"),Y(X,Q,de,"B","Β"),Y(X,Q,de,"E","Ε"),Y(X,Q,de,"Z","Ζ"),Y(X,Q,de,"H","Η"),Y(X,Q,de,"I","Ι"),Y(X,Q,de,"K","Κ"),Y(X,Q,de,"M","Μ"),Y(X,Q,de,"N","Ν"),Y(X,Q,de,"O","Ο"),Y(X,Q,de,"P","Ρ"),Y(X,Q,de,"T","Τ"),Y(X,Q,de,"X","Χ"),Y(X,Q,de,"¬","\\neg",!0),Y(X,Q,de,"¬","\\lnot"),Y(X,Q,de,"⊤","\\top"),Y(X,Q,de,"⊥","\\bot"),Y(X,Q,de,"∅","\\emptyset"),Y(X,ee,de,"∅","\\varnothing"),Y(X,Q,ae,"α","\\alpha",!0),Y(X,Q,ae,"β","\\beta",!0),Y(X,Q,ae,"γ","\\gamma",!0),Y(X,Q,ae,"δ","\\delta",!0),Y(X,Q,ae,"ϵ","\\epsilon",!0),Y(X,Q,ae,"ζ","\\zeta",!0),Y(X,Q,ae,"η","\\eta",!0),Y(X,Q,ae,"θ","\\theta",!0),Y(X,Q,ae,"ι","\\iota",!0),Y(X,Q,ae,"κ","\\kappa",!0),Y(X,Q,ae,"λ","\\lambda",!0),Y(X,Q,ae,"μ","\\mu",!0),Y(X,Q,ae,"ν","\\nu",!0),Y(X,Q,ae,"ξ","\\xi",!0),Y(X,Q,ae,"ο","\\omicron",!0),Y(X,Q,ae,"π","\\pi",!0),Y(X,Q,ae,"ρ","\\rho",!0),Y(X,Q,ae,"σ","\\sigma",!0),Y(X,Q,ae,"τ","\\tau",!0),Y(X,Q,ae,"υ","\\upsilon",!0),Y(X,Q,ae,"ϕ","\\phi",!0),Y(X,Q,ae,"χ","\\chi",!0),Y(X,Q,ae,"ψ","\\psi",!0),Y(X,Q,ae,"ω","\\omega",!0),Y(X,Q,ae,"ε","\\varepsilon",!0),Y(X,Q,ae,"ϑ","\\vartheta",!0),Y(X,Q,ae,"ϖ","\\varpi",!0),Y(X,Q,ae,"ϱ","\\varrho",!0),Y(X,Q,ae,"ς","\\varsigma",!0),Y(X,Q,ae,"φ","\\varphi",!0),Y(X,Q,ne,"∗","*"),Y(X,Q,ne,"+","+"),Y(X,Q,ne,"−","-"),Y(X,Q,ne,"⋅","\\cdot",!0),Y(X,Q,ne,"∘","\\circ"),Y(X,Q,ne,"÷","\\div",!0),Y(X,Q,ne,"±","\\pm",!0),Y(X,Q,ne,"×","\\times",!0),Y(X,Q,ne,"∩","\\cap",!0),Y(X,Q,ne,"∪","\\cup",!0),Y(X,Q,ne,"∖","\\setminus"),Y(X,Q,ne,"∧","\\land"),Y(X,Q,ne,"∨","\\lor"),Y(X,Q,ne,"∧","\\wedge",!0),Y(X,Q,ne,"∨","\\vee",!0),Y(X,Q,de,"√","\\surd"),Y(X,Q,oe,"(","("),Y(X,Q,oe,"[","["),Y(X,Q,oe,"⟨","\\langle",!0),Y(X,Q,oe,"∣","\\lvert"),Y(X,Q,oe,"∥","\\lVert"),Y(X,Q,ie,")",")"),Y(X,Q,ie,"]","]"),Y(X,Q,ie,"?","?"),Y(X,Q,ie,"!","!"),Y(X,Q,ie,"⟩","\\rangle",!0),Y(X,Q,ie,"∣","\\rvert"),Y(X,Q,ie,"∥","\\rVert"),Y(X,Q,ce,"=","="),Y(X,Q,ce,"<","<"),Y(X,Q,ce,">",">"),Y(X,Q,ce,":",":"),Y(X,Q,ce,"≈","\\approx",!0),Y(X,Q,ce,"≅","\\cong",!0),Y(X,Q,ce,"≥","\\ge"),Y(X,Q,ce,"≥","\\geq",!0),Y(X,Q,ce,"←","\\gets"),Y(X,Q,ce,">","\\gt"),Y(X,Q,ce,"∈","\\in",!0),Y(X,Q,ce,"","\\@not"),Y(X,Q,ce,"⊂","\\subset",!0),Y(X,Q,ce,"⊃","\\supset",!0),Y(X,Q,ce,"⊆","\\subseteq",!0),Y(X,Q,ce,"⊇","\\supseteq",!0),Y(X,ee,ce,"⊈","\\nsubseteq",!0),Y(X,ee,ce,"⊉","\\nsupseteq",!0),Y(X,Q,ce,"⊨","\\models"),Y(X,Q,ce,"←","\\leftarrow",!0),Y(X,Q,ce,"≤","\\le"),Y(X,Q,ce,"≤","\\leq",!0),Y(X,Q,ce,"<","\\lt"),Y(X,Q,ce,"→","\\rightarrow",!0),Y(X,Q,ce,"→","\\to"),Y(X,ee,ce,"≱","\\ngeq",!0),Y(X,ee,ce,"≰","\\nleq",!0),Y(X,Q,ue," ","\\ "),Y(X,Q,ue," ","~"),Y(X,Q,ue," ","\\space"),Y(X,Q,ue," ","\\nobreakspace"),Y(J,Q,ue," ","\\ "),Y(J,Q,ue," ","~"),Y(J,Q,ue," ","\\space"),Y(J,Q,ue," ","\\nobreakspace"),Y(X,Q,ue,null,"\\nobreak"),Y(X,Q,ue,null,"\\allowbreak"),Y(X,Q,le,",",","),Y(X,Q,le,";",";"),Y(X,ee,ne,"⊼","\\barwedge",!0),Y(X,ee,ne,"⊻","\\veebar",!0),Y(X,Q,ne,"⊙","\\odot",!0),Y(X,Q,ne,"⊕","\\oplus",!0),Y(X,Q,ne,"⊗","\\otimes",!0),Y(X,Q,de,"∂","\\partial",!0),Y(X,Q,ne,"⊘","\\oslash",!0),Y(X,ee,ne,"⊚","\\circledcirc",!0),Y(X,ee,ne,"⊡","\\boxdot",!0),Y(X,Q,ne,"△","\\bigtriangleup"),Y(X,Q,ne,"▽","\\bigtriangledown"),Y(X,Q,ne,"†","\\dagger"),Y(X,Q,ne,"⋄","\\diamond"),Y(X,Q,ne,"⋆","\\star"),Y(X,Q,ne,"◃","\\triangleleft"),Y(X,Q,ne,"▹","\\triangleright"),Y(X,Q,oe,"{","\\{"),Y(J,Q,de,"{","\\{"),Y(J,Q,de,"{","\\textbraceleft"),Y(X,Q,ie,"}","\\}"),Y(J,Q,de,"}","\\}"),Y(J,Q,de,"}","\\textbraceright"),Y(X,Q,oe,"{","\\lbrace"),Y(X,Q,ie,"}","\\rbrace"),Y(X,Q,oe,"[","\\lbrack"),Y(J,Q,de,"[","\\lbrack"),Y(X,Q,ie,"]","\\rbrack"),Y(J,Q,de,"]","\\rbrack"),Y(X,Q,oe,"(","\\lparen"),Y(X,Q,ie,")","\\rparen"),Y(J,Q,de,"<","\\textless"),Y(J,Q,de,">","\\textgreater"),Y(X,Q,oe,"⌊","\\lfloor",!0),Y(X,Q,ie,"⌋","\\rfloor",!0),Y(X,Q,oe,"⌈","\\lceil",!0),Y(X,Q,ie,"⌉","\\rceil",!0),Y(X,Q,de,"\\","\\backslash"),Y(X,Q,de,"∣","|"),Y(X,Q,de,"∣","\\vert"),Y(J,Q,de,"|","\\textbar"),Y(X,Q,de,"∥","\\|"),Y(X,Q,de,"∥","\\Vert"),Y(J,Q,de,"∥","\\textbardbl"),Y(J,Q,de,"~","\\textasciitilde"),Y(J,Q,de,"\\","\\textbackslash"),Y(J,Q,de,"^","\\textasciicircum"),Y(X,Q,ce,"↑","\\uparrow",!0),Y(X,Q,ce,"⇑","\\Uparrow",!0),Y(X,Q,ce,"↓","\\downarrow",!0),Y(X,Q,ce,"⇓","\\Downarrow",!0),Y(X,Q,ce,"↕","\\updownarrow",!0),Y(X,Q,ce,"⇕","\\Updownarrow",!0),Y(X,Q,se,"∐","\\coprod"),Y(X,Q,se,"⋁","\\bigvee"),Y(X,Q,se,"⋀","\\bigwedge"),Y(X,Q,se,"⨄","\\biguplus"),Y(X,Q,se,"⋂","\\bigcap"),Y(X,Q,se,"⋃","\\bigcup"),Y(X,Q,se,"∫","\\int"),Y(X,Q,se,"∫","\\intop"),Y(X,Q,se,"∬","\\iint"),Y(X,Q,se,"∭","\\iiint"),Y(X,Q,se,"∏","\\prod"),Y(X,Q,se,"∑","\\sum"),Y(X,Q,se,"⨂","\\bigotimes"),Y(X,Q,se,"⨁","\\bigoplus"),Y(X,Q,se,"⨀","\\bigodot"),Y(X,Q,se,"∮","\\oint"),Y(X,Q,se,"∯","\\oiint"),Y(X,Q,se,"∰","\\oiiint"),Y(X,Q,se,"⨆","\\bigsqcup"),Y(X,Q,se,"∫","\\smallint"),Y(J,Q,re,"…","\\textellipsis"),Y(X,Q,re,"…","\\mathellipsis"),Y(J,Q,re,"…","\\ldots",!0),Y(X,Q,re,"…","\\ldots",!0),Y(X,Q,re,"⋯","\\@cdots",!0),Y(X,Q,re,"⋱","\\ddots",!0),Y(X,Q,de,"⋮","\\varvdots"),Y(X,Q,te,"ˊ","\\acute"),Y(X,Q,te,"ˋ","\\grave"),Y(X,Q,te,"¨","\\ddot"),Y(X,Q,te,"~","\\tilde"),Y(X,Q,te,"ˉ","\\bar"),Y(X,Q,te,"˘","\\breve"),Y(X,Q,te,"ˇ","\\check"),Y(X,Q,te,"^","\\hat"),Y(X,Q,te,"⃗","\\vec"),Y(X,Q,te,"˙","\\dot"),Y(X,Q,te,"˚","\\mathring"),Y(X,Q,ae,"ı","\\imath",!0),Y(X,Q,ae,"ȷ","\\jmath",!0),Y(J,Q,de,"ı","\\i",!0),Y(J,Q,de,"ȷ","\\j",!0),Y(J,Q,de,"ß","\\ss",!0),Y(J,Q,de,"æ","\\ae",!0),Y(J,Q,de,"æ","\\ae",!0),Y(J,Q,de,"œ","\\oe",!0),Y(J,Q,de,"ø","\\o",!0),Y(J,Q,de,"Æ","\\AE",!0),Y(J,Q,de,"Œ","\\OE",!0),Y(J,Q,de,"Ø","\\O",!0),Y(J,Q,te,"ˊ","\\'"),Y(J,Q,te,"ˋ","\\`"),Y(J,Q,te,"ˆ","\\^"),Y(J,Q,te,"˜","\\~"),Y(J,Q,te,"ˉ","\\="),Y(J,Q,te,"˘","\\u"),Y(J,Q,te,"˙","\\."),Y(J,Q,te,"˚","\\r"),Y(J,Q,te,"ˇ","\\v"),Y(J,Q,te,"¨",'\\"'),Y(J,Q,te,"˝","\\H"),Y(J,Q,te,"◯","\\textcircled");var he={"--":!0,"---":!0,"``":!0,"''":!0};Y(J,Q,de,"–","--"),Y(J,Q,de,"–","\\textendash"),Y(J,Q,de,"—","---"),Y(J,Q,de,"—","\\textemdash"),Y(J,Q,de,"‘","`"),Y(J,Q,de,"‘","\\textquoteleft"),Y(J,Q,de,"’","'"),Y(J,Q,de,"’","\\textquoteright"),Y(J,Q,de,"“","``"),Y(J,Q,de,"“","\\textquotedblleft"),Y(J,Q,de,"”","''"),Y(J,Q,de,"”","\\textquotedblright"),Y(X,Q,de,"°","\\degree",!0),Y(J,Q,de,"°","\\degree"),Y(J,Q,de,"°","\\textdegree",!0),Y(X,Q,ae,"£","\\pounds"),Y(X,Q,ae,"£","\\mathsterling",!0),Y(J,Q,ae,"£","\\pounds"),Y(J,Q,ae,"£","\\textsterling",!0),Y(X,ee,de,"✠","\\maltese"),Y(J,ee,de,"✠","\\maltese"),Y(J,Q,ue," ","\\ "),Y(J,Q,ue," "," "),Y(J,Q,ue," ","~");for(var pe='0123456789/@."',fe=0;fe<pe.length;fe++){var me=pe.charAt(fe);Y(X,Q,de,me,me)}for(var ge='0123456789!@*()-=+[]<>|";:?/.,',ve=0;ve<ge.length;ve++){var be=ge.charAt(ve);Y(J,Q,de,be,be)}for(var ye="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",_e=0;_e<ye.length;_e++){var we=ye.charAt(_e);Y(X,Q,ae,we,we),Y(J,Q,de,we,we)}Y(X,ee,de,"C","ℂ"),Y(J,ee,de,"C","ℂ"),Y(X,ee,de,"H","ℍ"),Y(J,ee,de,"H","ℍ"),Y(X,ee,de,"N","ℕ"),Y(J,ee,de,"N","ℕ"),Y(X,ee,de,"P","ℙ"),Y(J,ee,de,"P","ℙ"),Y(X,ee,de,"Q","ℚ"),Y(J,ee,de,"Q","ℚ"),Y(X,ee,de,"R","ℝ"),Y(J,ee,de,"R","ℝ"),Y(X,ee,de,"Z","ℤ"),Y(J,ee,de,"Z","ℤ"),Y(X,Q,ae,"h","ℎ"),Y(J,Q,ae,"h","ℎ");for(var xe="",ke=0;ke<ye.length;ke++){var Se=ye.charAt(ke);Y(X,Q,ae,Se,xe=String.fromCharCode(55349,56320+ke)),Y(J,Q,de,Se,xe),Y(X,Q,ae,Se,xe=String.fromCharCode(55349,56372+ke)),Y(J,Q,de,Se,xe),Y(X,Q,ae,Se,xe=String.fromCharCode(55349,56424+ke)),Y(J,Q,de,Se,xe),Y(X,Q,ae,Se,xe=String.fromCharCode(55349,56580+ke)),Y(J,Q,de,Se,xe),Y(X,Q,ae,Se,xe=String.fromCharCode(55349,56736+ke)),Y(J,Q,de,Se,xe),Y(X,Q,ae,Se,xe=String.fromCharCode(55349,56788+ke)),Y(J,Q,de,Se,xe),Y(X,Q,ae,Se,xe=String.fromCharCode(55349,56840+ke)),Y(J,Q,de,Se,xe),Y(X,Q,ae,Se,xe=String.fromCharCode(55349,56944+ke)),Y(J,Q,de,Se,xe),ke<26&&(Y(X,Q,ae,Se,xe=String.fromCharCode(55349,56632+ke)),Y(J,Q,de,Se,xe),Y(X,Q,ae,Se,xe=String.fromCharCode(55349,56476+ke)),Y(J,Q,de,Se,xe))}Y(X,Q,ae,"k",xe=String.fromCharCode(55349,56668)),Y(J,Q,de,"k",xe);for(var Ee=0;Ee<10;Ee++){var Ce=Ee.toString();Y(X,Q,ae,Ce,xe=String.fromCharCode(55349,57294+Ee)),Y(J,Q,de,Ce,xe),Y(X,Q,ae,Ce,xe=String.fromCharCode(55349,57314+Ee)),Y(J,Q,de,Ce,xe),Y(X,Q,ae,Ce,xe=String.fromCharCode(55349,57324+Ee)),Y(J,Q,de,Ce,xe),Y(X,Q,ae,Ce,xe=String.fromCharCode(55349,57334+Ee)),Y(J,Q,de,Ce,xe)}for(var Te="ÇÐÞçþ",Ae=0;Ae<Te.length;Ae++){var Me=Te.charAt(Ae);Y(X,Q,ae,Me,Me),Y(J,Q,de,Me,Me)}Y(J,Q,de,"ð","ð"),Y(J,Q,de,"–","–"),Y(J,Q,de,"—","—"),Y(J,Q,de,"‘","‘"),Y(J,Q,de,"’","’"),Y(J,Q,de,"“","“"),Y(J,Q,de,"”","”");var Le=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathdefault","textit","Math-Italic"],["mathdefault","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["","",""],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],De=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],Ie=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Re=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Pe=function(e,t){return t.size<2?e:Ie[e-1][t.size-1]},Oe=function(){function e(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||e.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=Re[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}var t=e.prototype;return t.extend=function(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);return new e(n)},t.havingStyle=function(e){return this.style===e?this:this.extend({style:e,size:Pe(this.textSize,e)})},t.havingCrampedStyle=function(){return this.havingStyle(this.style.cramp())},t.havingSize=function(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Re[e-1]})},t.havingBaseStyle=function(t){t=t||this.style.text();var n=Pe(e.BASESIZE,t);return this.size===n&&this.textSize===e.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})},t.havingBaseSizing=function(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})},t.withColor=function(e){return this.extend({color:e})},t.withPhantom=function(){return this.extend({phantom:!0})},t.withFont=function(e){return this.extend({font:e})},t.withTextFontFamily=function(e){return this.extend({fontFamily:e,font:""})},t.withTextFontWeight=function(e){return this.extend({fontWeight:e,font:""})},t.withTextFontShape=function(e){return this.extend({fontShape:e,font:""})},t.sizingClasses=function(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]},t.baseSizingClasses=function(){return this.size!==e.BASESIZE?["sizing","reset-size"+this.size,"size"+e.BASESIZE]:[]},t.fontMetrics=function(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!H[t=e>=5?0:e>=3?1:2]){var n=H[t]={cssEmPerMu:U.quad[t]/18};for(var i in U)U.hasOwnProperty(i)&&(n[i]=U[i][t])}return H[t]}(this.size)),this._fontMetrics},t.getColor=function(){return this.phantom?"transparent":this.color},e}();Oe.BASESIZE=6;var Ne=Oe,Be={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},$e={ex:!0,em:!0,mu:!0},Fe=function(e){return"string"!=typeof e&&(e=e.unit),e in Be||e in $e||"ex"===e},ze=function(e,t){var n;if(e.unit in Be)n=Be[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)n=t.fontMetrics().cssEmPerMu;else{var i;if(i=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)n=i.fontMetrics().xHeight;else{if("em"!==e.unit)throw new s("Invalid unit: '"+e.unit+"'");n=i.fontMetrics().quad}i!==t&&(n*=i.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},Ke=["\\imath","ı","\\jmath","ȷ","\\pounds","\\mathsterling","\\textsterling","£"],Ue=function(e,t,n){return W[n][e]&&W[n][e].replace&&(e=W[n][e].replace),{value:e,metrics:q(e,t,n)}},je=function(e,t,n,i,r){var a,s=Ue(e,t,n),o=s.metrics;if(e=s.value,o){var l=o.italic;("text"===n||i&&"mathit"===i.font)&&(l=0),a=new N(e,o.height,o.depth,l,o.skew,o.width,r)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"' and mode '"+n+"'"),a=new N(e,0,0,0,0,0,r);if(i){a.maxFontSize=i.sizeMultiplier,i.style.isTight()&&a.classes.push("mtight");var c=i.getColor();c&&(a.style.color=c)}return a},qe=function(e,t){if(A(e.classes)!==A(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;for(var n in e.style)if(e.style.hasOwnProperty(n)&&e.style[n]!==t.style[n])return!1;for(var i in t.style)if(t.style.hasOwnProperty(i)&&e.style[i]!==t.style[i])return!1;return!0},He=function(e){for(var t=0,n=0,i=0,r=0;r<e.children.length;r++){var a=e.children[r];a.height>t&&(t=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>i&&(i=a.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=i},Ve=function(e,t,n,i){var r=new I(e,t,n,i);return He(r),r},Ge=function(e,t,n,i){return new I(e,t,n,i)},Ze=function(e){var t=new T(e);return He(t),t},We=function(e,t,n){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}return i+"-"+("textbf"===t&&"textit"===n?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular")},Ye={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Xe={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Je={fontMap:Ye,makeSymbol:je,mathsym:function(e,t,n,i){return void 0===i&&(i=[]),"boldsymbol"===n.font&&Ue(e,"Main-Bold",t).metrics?je(e,"Main-Bold",t,n,i.concat(["mathbf"])):"\\"===e||"main"===W[t][e].font?je(e,"Main-Regular",t,n,i):je(e,"AMS-Regular",t,n,i.concat(["amsrm"]))},makeSpan:Ve,makeSvgSpan:Ge,makeLineSpan:function(e,t,n){var i=Ve([e],[],t);return i.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),i.style.borderBottomWidth=i.height+"em",i.maxFontSize=1,i},makeAnchor:function(e,t,n,i){var r=new R(e,t,n,i);return He(r),r},makeFragment:Ze,wrapFragment:function(e,t){return e instanceof T?Ve([],[e],t):e},makeVList:function(e,t){for(var n=function(e){if("individualShift"===e.positionType){for(var t=e.children,n=[t[0]],i=-t[0].shift-t[0].elem.depth,r=i,a=1;a<t.length;a++){var s=-t[a].shift-r-t[a].elem.depth,o=s-(t[a-1].elem.height+t[a-1].elem.depth);r+=s,n.push({type:"kern",size:o}),n.push(t[a])}return{children:n,depth:i}}var l;if("top"===e.positionType){for(var c=e.positionData,u=0;u<e.children.length;u++){var d=e.children[u];c-="kern"===d.type?d.size:d.elem.height+d.elem.depth}l=c}else if("bottom"===e.positionType)l=-e.positionData;else{var h=e.children[0];if("elem"!==h.type)throw new Error('First child must have type "elem".');if("shift"===e.positionType)l=-h.elem.depth-e.positionData;else{if("firstBaseline"!==e.positionType)throw new Error("Invalid positionType "+e.positionType+".");l=-h.elem.depth}}return{children:e.children,depth:l}}(e),i=n.children,r=n.depth,a=0,s=0;s<i.length;s++){var o=i[s];if("elem"===o.type){var l=o.elem;a=Math.max(a,l.maxFontSize,l.height)}}a+=2;var c=Ve(["pstrut"],[]);c.style.height=a+"em";for(var u=[],d=r,h=r,p=r,f=0;f<i.length;f++){var m=i[f];if("kern"===m.type)p+=m.size;else{var g=m.elem,v=m.wrapperClasses||[],b=m.wrapperStyle||{},y=Ve(v,[c,g],void 0,b);y.style.top=-a-p-g.depth+"em",m.marginLeft&&(y.style.marginLeft=m.marginLeft),m.marginRight&&(y.style.marginRight=m.marginRight),u.push(y),p+=g.height+g.depth}d=Math.min(d,p),h=Math.max(h,p)}var _,w=Ve(["vlist"],u);if(w.style.height=h+"em",d<0){var x=Ve([],[]),k=Ve(["vlist"],[x]);k.style.height=-d+"em";var S=Ve(["vlist-s"],[new N("")]);_=[Ve(["vlist-r"],[w,S]),Ve(["vlist-r"],[k])]}else _=[Ve(["vlist-r"],[w])];var E=Ve(["vlist-t"],_);return 2===_.length&&E.classes.push("vlist-t2"),E.height=h,E.depth=-d,E},makeOrd:function(e,t,n){var i,r=e.mode,a=e.text,o=["mord"],l="math"===r||"text"===r&&t.font,c=l?t.font:t.fontFamily;if(55349===a.charCodeAt(0)){var u=function(e,t){var n=1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536,i="math"===t?0:1;if(119808<=n&&n<120484){var r=Math.floor((n-119808)/26);return[Le[r][2],Le[r][i]]}if(120782<=n&&n<=120831){var a=Math.floor((n-120782)/10);return[De[a][2],De[a][i]]}if(120485===n||120486===n)return[Le[0][2],Le[0][i]];if(120486<n&&n<120782)return["",""];throw new s("Unsupported character: "+e)}(a,r),h=u[0],p=u[1];return je(a,h,r,t,o.concat(p))}if(c){var f,m;if("boldsymbol"===c||"mathnormal"===c){var g="boldsymbol"===c?function(e,t,n,i){return Ue(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(a,r):(i=a,d.contains(Ke,i)?{fontName:"Main-Italic",fontClass:"mathit"}:/[0-9]/.test(i.charAt(0))?{fontName:"Caligraphic-Regular",fontClass:"mathcal"}:{fontName:"Math-Italic",fontClass:"mathdefault"});f=g.fontName,m=[g.fontClass]}else d.contains(Ke,a)?(f="Main-Italic",m=["mathit"]):l?(f=Ye[c].fontName,m=[c]):(f=We(c,t.fontWeight,t.fontShape),m=[c,t.fontWeight,t.fontShape]);if(Ue(a,f,r).metrics)return je(a,f,r,t,o.concat(m));if(he.hasOwnProperty(a)&&"Typewriter"===f.substr(0,10)){for(var v=[],b=0;b<a.length;b++)v.push(je(a[b],f,r,t,o.concat(m)));return Ze(v)}}if("mathord"===n){var y=function(e,t,n,i){return/[0-9]/.test(e.charAt(0))||d.contains(Ke,e)?{fontName:"Main-Italic",fontClass:"mathit"}:{fontName:"Math-Italic",fontClass:"mathdefault"}}(a);return je(a,y.fontName,r,t,o.concat([y.fontClass]))}if("textord"===n){var _=W[r][a]&&W[r][a].font;if("ams"===_){var w=We("amsrm",t.fontWeight,t.fontShape);return je(a,w,r,t,o.concat("amsrm",t.fontWeight,t.fontShape))}if("main"!==_&&_){var x=We(_,t.fontWeight,t.fontShape);return je(a,x,r,t,o.concat(x,t.fontWeight,t.fontShape))}var k=We("textrm",t.fontWeight,t.fontShape);return je(a,k,r,t,o.concat(t.fontWeight,t.fontShape))}throw new Error("unexpected type: "+n+" in makeOrd")},makeGlue:function(e,t){var n=Ve(["mspace"],[],t),i=ze(e,t);return n.style.marginRight=i+"em",n},staticSvg:function(e,t){var n=Xe[e],i=n[0],r=n[1],a=n[2],s=new $(i),o=new B([s],{width:r+"em",height:a+"em",style:"width:"+r+"em",viewBox:"0 0 "+1e3*r+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=Ge(["overlay"],[o],t);return l.height=a,l.style.height=a+"em",l.style.width=r+"em",l},svgData:Xe,tryCombineChars:function(e){for(var t=0;t<e.length-1;t++){var n=e[t],i=e[t+1];n instanceof N&&i instanceof N&&qe(n,i)&&(n.text+=i.text,n.height=Math.max(n.height,i.height),n.depth=Math.max(n.depth,i.depth),n.italic=i.italic,e.splice(t+1,1),t--)}return e}};function Qe(e,t){var n=et(e,t);if(!n)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return n}function et(e,t){return e&&e.type===t?e:null}function tt(e,t){var n=function(e,t){return e&&"atom"===e.type&&e.family===t?e:null}(e,t);if(!n)throw new Error('Expected node of type "atom" and family "'+t+'", but got '+(e?"atom"===e.type?"atom of family "+e.family:"node of type "+e.type:String(e)));return n}function nt(e){var t=it(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function it(e){return e&&("atom"===e.type||G.hasOwnProperty(e.type))?e:null}var rt={number:3,unit:"mu"},at={number:4,unit:"mu"},st={number:5,unit:"mu"},ot={mord:{mop:rt,mbin:at,mrel:st,minner:rt},mop:{mord:rt,mop:rt,mrel:st,minner:rt},mbin:{mord:at,mop:at,mopen:at,minner:at},mrel:{mord:st,mop:st,mopen:st,minner:st},mopen:{},mclose:{mop:rt,mbin:at,mrel:st,minner:rt},mpunct:{mord:rt,mop:rt,mrel:st,mopen:rt,mclose:rt,mpunct:rt,minner:rt},minner:{mord:rt,mop:rt,mbin:at,mrel:st,mopen:rt,mpunct:rt,minner:rt}},lt={mord:{mop:rt},mop:{mord:rt,mop:rt},mbin:{},mrel:{},mopen:{},mclose:{mop:rt},mpunct:{},minner:{mop:rt}},ct={},ut={},dt={};function ht(e){for(var t=e.type,n=e.names,i=e.props,r=e.handler,a=e.htmlBuilder,s=e.mathmlBuilder,o={type:t,numArgs:i.numArgs,argTypes:i.argTypes,greediness:void 0===i.greediness?1:i.greediness,allowedInText:!!i.allowedInText,allowedInMath:void 0===i.allowedInMath||i.allowedInMath,numOptionalArgs:i.numOptionalArgs||0,infix:!!i.infix,handler:r},l=0;l<n.length;++l)ct[n[l]]=o;t&&(a&&(ut[t]=a),s&&(dt[t]=s))}function pt(e){ht({type:e.type,names:[],props:{numArgs:0},handler:function(){throw new Error("Should never be called.")},htmlBuilder:e.htmlBuilder,mathmlBuilder:e.mathmlBuilder})}var ft=function(e){var t=et(e,"ordgroup");return t?t.body:[e]},mt=Je.makeSpan,gt=["leftmost","mbin","mopen","mrel","mop","mpunct"],vt=["rightmost","mrel","mclose","mpunct"],bt={display:w.DISPLAY,text:w.TEXT,script:w.SCRIPT,scriptscript:w.SCRIPTSCRIPT},yt={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},_t=function(e,t,n,i){void 0===i&&(i=[null,null]);for(var r=[],a=0;a<e.length;a++){var s=Ct(e[a],t);if(s instanceof T){var o=s.children;r.push.apply(r,o)}else r.push(s)}if(!n)return r;var l=t;if(1===e.length){var c=et(e[0],"sizing")||et(e[0],"styling");c&&("sizing"===c.type?l=t.havingSize(c.size):"styling"===c.type&&(l=t.havingStyle(bt[c.style])))}var u=mt([i[0]||"leftmost"],[],t),h=mt([i[1]||"rightmost"],[],t);return wt(r,(function(e,t){var n=t.classes[0],i=e.classes[0];"mbin"===n&&d.contains(vt,i)?t.classes[0]="mord":"mbin"===i&&d.contains(gt,n)&&(e.classes[0]="mord")}),{node:u},h),wt(r,(function(e,t){var n=St(t),i=St(e),r=n&&i?e.hasClass("mtight")?lt[n][i]:ot[n][i]:null;if(r)return Je.makeGlue(r,l)}),{node:u},h),r},wt=function e(t,n,i,r){r&&t.push(r);for(var a=0;a<t.length;a++){var s=t[a],o=xt(s);if(o)e(o.children,n,i);else if("mspace"!==s.classes[0]){var l=n(s,i.node);l&&(i.insertAfter?i.insertAfter(l):(t.unshift(l),a++)),i.node=s,i.insertAfter=function(e){return function(n){t.splice(e+1,0,n),a++}}(a)}}r&&t.pop()},xt=function(e){return e instanceof T||e instanceof R?e:null},kt=function e(t,n){var i=xt(t);if(i){var r=i.children;if(r.length){if("right"===n)return e(r[r.length-1],"right");if("left"===n)return e(r[0],"left")}}return t},St=function(e,t){return e?(t&&(e=kt(e,t)),yt[e.classes[0]]||null):null},Et=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return mt(t.concat(n))},Ct=function(e,t,n){if(!e)return mt();if(ut[e.type]){var i=ut[e.type](e,t);if(n&&t.size!==n.size){i=mt(t.sizingClasses(n),[i],t);var r=t.sizeMultiplier/n.sizeMultiplier;i.height*=r,i.depth*=r}return i}throw new s("Got group of unknown type: '"+e.type+"'")};function Tt(e,t){var n=mt(["base"],e,t),i=mt(["strut"]);return i.style.height=n.height+n.depth+"em",i.style.verticalAlign=-n.depth+"em",n.children.unshift(i),n}function At(e,t){var n=null;1===e.length&&"tag"===e[0].type&&(n=e[0].tag,e=e[0].body);for(var i,r=_t(e,t,!0),a=[],s=[],o=0;o<r.length;o++)if(s.push(r[o]),r[o].hasClass("mbin")||r[o].hasClass("mrel")||r[o].hasClass("allowbreak")){for(var l=!1;o<r.length-1&&r[o+1].hasClass("mspace")&&!r[o+1].hasClass("newline");)o++,s.push(r[o]),r[o].hasClass("nobreak")&&(l=!0);l||(a.push(Tt(s,t)),s=[])}else r[o].hasClass("newline")&&(s.pop(),s.length>0&&(a.push(Tt(s,t)),s=[]),a.push(r[o]));s.length>0&&a.push(Tt(s,t)),n&&((i=Tt(_t(n,t,!0))).classes=["tag"],a.push(i));var c=mt(["katex-html"],a);if(c.setAttribute("aria-hidden","true"),i){var u=i.children[0];u.style.height=c.height+c.depth+"em",u.style.verticalAlign=-c.depth+"em"}return c}function Mt(e){return new T(e)}var Lt=function(){function e(e,t){this.type=void 0,this.attributes=void 0,this.children=void 0,this.type=e,this.attributes={},this.children=t||[]}var t=e.prototype;return t.setAttribute=function(e,t){this.attributes[e]=t},t.getAttribute=function(e){return this.attributes[e]},t.toNode=function(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e},t.toMarkup=function(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=d.escape(this.attributes[t]),e+='"');e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</"+this.type+">"},t.toText=function(){return this.children.map((function(e){return e.toText()})).join("")},e}(),Dt=function(){function e(e){this.text=void 0,this.text=e}var t=e.prototype;return t.toNode=function(){return document.createTextNode(this.text)},t.toMarkup=function(){return d.escape(this.toText())},t.toText=function(){return this.text},e}(),It={MathNode:Lt,TextNode:Dt,SpaceNode:function(){function e(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?" ":e>=.1666&&e<=.1667?" ":e>=.2222&&e<=.2223?" ":e>=.2777&&e<=.2778?" ":e>=-.05556&&e<=-.05555?" ":e>=-.1667&&e<=-.1666?" ":e>=-.2223&&e<=-.2222?" ":e>=-.2778&&e<=-.2777?" ":null}var t=e.prototype;return t.toNode=function(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",this.width+"em"),e},t.toMarkup=function(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+this.width+'em"/>'},t.toText=function(){return this.character?this.character:" "},e}(),newDocumentFragment:Mt},Rt=function(e,t,n){return!W[t][e]||!W[t][e].replace||55349===e.charCodeAt(0)||he.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.substr(4,2)||n.font&&"tt"===n.font.substr(4,2))||(e=W[t][e].replace),new It.TextNode(e)},Pt=function(e){return 1===e.length?e[0]:new It.MathNode("mrow",e)},Ot=function(e,t){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";var n=t.font;if(!n||"mathnormal"===n)return null;var i=e.mode;if("mathit"===n)return"italic";if("boldsymbol"===n)return"bold-italic";if("mathbf"===n)return"bold";if("mathbb"===n)return"double-struck";if("mathfrak"===n)return"fraktur";if("mathscr"===n||"mathcal"===n)return"script";if("mathsf"===n)return"sans-serif";if("mathtt"===n)return"monospace";var r=e.text;return d.contains(["\\imath","\\jmath"],r)?null:(W[i][r]&&W[i][r].replace&&(r=W[i][r].replace),q(r,Je.fontMap[n].fontName,i)?Je.fontMap[n].variant:null)},Nt=function(e,t,n){if(1===e.length){var i=$t(e[0],t);return n&&i instanceof Lt&&"mo"===i.type&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var r,a=[],s=0;s<e.length;s++){var o=$t(e[s],t);if(o instanceof Lt&&r instanceof Lt){if("mtext"===o.type&&"mtext"===r.type&&o.getAttribute("mathvariant")===r.getAttribute("mathvariant")){var l;(l=r.children).push.apply(l,o.children);continue}if("mn"===o.type&&"mn"===r.type){var c;(c=r.children).push.apply(c,o.children);continue}if("mi"===o.type&&1===o.children.length&&"mn"===r.type){var u=o.children[0];if(u instanceof Dt&&"."===u.text){var d;(d=r.children).push.apply(d,o.children);continue}}else if("mi"===r.type&&1===r.children.length){var h=r.children[0];if(h instanceof Dt&&"̸"===h.text&&("mo"===o.type||"mi"===o.type||"mn"===o.type)){var p=o.children[0];p instanceof Dt&&p.text.length>0&&(p.text=p.text.slice(0,1)+"̸"+p.text.slice(1),a.pop())}}}a.push(o),r=o}return a},Bt=function(e,t,n){return Pt(Nt(e,t,n))},$t=function(e,t){if(!e)return new It.MathNode("mrow");if(dt[e.type])return dt[e.type](e,t);throw new s("Got group of unknown type: '"+e.type+"'")};function Ft(e,t,n,i){var r,a=Nt(e,n);r=1===a.length&&a[0]instanceof Lt&&d.contains(["mrow","mtable"],a[0].type)?a[0]:new It.MathNode("mrow",a);var s=new It.MathNode("annotation",[new It.TextNode(t)]);s.setAttribute("encoding","application/x-tex");var o=new It.MathNode("semantics",[r,s]),l=new It.MathNode("math",[o]);l.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML");var c=i?"katex":"katex-mathml";return Je.makeSpan([c],[l])}var zt=function(e){return new Ne({style:e.displayMode?w.DISPLAY:w.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},Kt=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=Je.makeSpan(n,[e])}return e},Ut=function(e,t,n){var i,r=zt(n);if("mathml"===n.output)return Ft(e,t,r,!0);if("html"===n.output){var a=At(e,r);i=Je.makeSpan(["katex"],[a])}else{var s=Ft(e,t,r,!1),o=At(e,r);i=Je.makeSpan(["katex"],[s,o])}return Kt(i,n)},jt={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋"},qt={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Ht=function(e,t,n,i){var r,a=e.height+e.depth+2*n;if(/fbox|color/.test(t)){if(r=Je.makeSpan(["stretchy",t],[],i),"fbox"===t){var s=i.color&&i.getColor();s&&(r.style.borderColor=s)}}else{var o=[];/^[bx]cancel$/.test(t)&&o.push(new F({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&o.push(new F({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var l=new B(o,{width:"100%",height:a+"em"});r=Je.makeSvgSpan([],[l],i)}return r.height=a,r.style.height=a+"em",r},Vt=function(e){var t=new It.MathNode("mo",[new It.TextNode(jt[e.substr(1)])]);return t.setAttribute("stretchy","true"),t},Gt=function(e,t){var n=function(){var n=4e5,i=e.label.substr(1);if(d.contains(["widehat","widecheck","widetilde","utilde"],i)){var r,a,s,o="ordgroup"===(f=e.base).type?f.body.length:1;if(o>5)"widehat"===i||"widecheck"===i?(r=420,n=2364,s=.42,a=i+"4"):(r=312,n=2340,s=.34,a="tilde4");else{var l=[1,1,2,2,3,3][o];"widehat"===i||"widecheck"===i?(n=[0,1062,2364,2364,2364][l],r=[0,239,300,360,420][l],s=[0,.24,.3,.3,.36,.42][l],a=i+l):(n=[0,600,1033,2339,2340][l],r=[0,260,286,306,312][l],s=[0,.26,.286,.3,.306,.34][l],a="tilde"+l)}var c=new $(a),u=new B([c],{width:"100%",height:s+"em",viewBox:"0 0 "+n+" "+r,preserveAspectRatio:"none"});return{span:Je.makeSvgSpan([],[u],t),minWidth:0,height:s}}var h,p,f,m=[],g=qt[i],v=g[0],b=g[1],y=g[2],_=y/1e3,w=v.length;if(1===w)h=["hide-tail"],p=[g[3]];else if(2===w)h=["halfarrow-left","halfarrow-right"],p=["xMinYMin","xMaxYMin"];else{if(3!==w)throw new Error("Correct katexImagesData or update code here to support\n "+w+" children.");h=["brace-left","brace-center","brace-right"],p=["xMinYMin","xMidYMin","xMaxYMin"]}for(var x=0;x<w;x++){var k=new $(v[x]),S=new B([k],{width:"400em",height:_+"em",viewBox:"0 0 "+n+" "+y,preserveAspectRatio:p[x]+" slice"}),E=Je.makeSvgSpan([h[x]],[S],t);if(1===w)return{span:E,minWidth:b,height:_};E.style.height=_+"em",m.push(E)}return{span:Je.makeSpan(["stretchy"],m,t),minWidth:b,height:_}}(),i=n.span,r=n.minWidth,a=n.height;return i.height=a,i.style.height=a+"em",r>0&&(i.style.minWidth=r+"em"),i},Zt=function(e,t){var n,i,r,a=et(e,"supsub");a?(n=(i=Qe(a.base,"accent")).base,a.base=n,r=function(e){if(e instanceof I)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(Ct(a,t)),a.base=i):n=(i=Qe(e,"accent")).base;var s=Ct(n,t.havingCrampedStyle()),o=0;if(i.isShifty&&d.isCharacterBox(n)){var l=d.getBaseElem(n);o=z(Ct(l,t.havingCrampedStyle())).skew}var c,u=Math.min(s.height,t.fontMetrics().xHeight);if(i.isStretchy)c=Gt(i,t),c=Je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:c,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+2*o+"em)",marginLeft:2*o+"em"}:void 0}]},t);else{var h,p;"\\vec"===i.label?(h=Je.staticSvg("vec",t),p=Je.svgData.vec[1]):((h=z(h=Je.makeOrd({mode:i.mode,text:i.label},t,"textord"))).italic=0,p=h.width),c=Je.makeSpan(["accent-body"],[h]);var f="\\textcircled"===i.label;f&&(c.classes.push("accent-full"),u=s.height);var m=o;f||(m-=p/2),c.style.left=m+"em","\\textcircled"===i.label&&(c.style.top=".2em"),c=Je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-u},{type:"elem",elem:c}]},t)}var g=Je.makeSpan(["mord","accent"],[c],t);return r?(r.children[0]=g,r.height=Math.max(g.height,r.height),r.classes[0]="mord",r):g},Wt=function(e,t){var n=e.isStretchy?Vt(e.label):new It.MathNode("mo",[Rt(e.label,e.mode)]),i=new It.MathNode("mover",[$t(e.base,t),n]);return i.setAttribute("accent","true"),i},Yt=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map((function(e){return"\\"+e})).join("|"));ht({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:function(e,t){var n=t[0],i=!Yt.test(e.funcName),r=!i||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:i,isShifty:r,base:n}},htmlBuilder:Zt,mathmlBuilder:Wt}),ht({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!1},handler:function(e,t){var n=t[0];return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:Zt,mathmlBuilder:Wt}),ht({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:function(e,t){var n=e.parser,i=e.funcName,r=t[0];return{type:"accentUnder",mode:n.mode,label:i,base:r}},htmlBuilder:function(e,t){var n=Ct(e.base,t),i=Gt(e,t),r="\\utilde"===e.label?.12:0,a=Je.makeVList({positionType:"bottom",positionData:i.height+r,children:[{type:"elem",elem:i,wrapperClasses:["svg-align"]},{type:"kern",size:r},{type:"elem",elem:n}]},t);return Je.makeSpan(["mord","accentunder"],[a],t)},mathmlBuilder:function(e,t){var n=Vt(e.label),i=new It.MathNode("munder",[$t(e.base,t),n]);return i.setAttribute("accentunder","true"),i}});var Xt=function(e){var t=new It.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};ht({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium"],props:{numArgs:1,numOptionalArgs:1},handler:function(e,t,n){var i=e.parser,r=e.funcName;return{type:"xArrow",mode:i.mode,label:r,body:t[0],below:n[0]}},htmlBuilder:function(e,t){var n,i=t.style,r=t.havingStyle(i.sup()),a=Je.wrapFragment(Ct(e.body,r,t),t);a.classes.push("x-arrow-pad"),e.below&&(r=t.havingStyle(i.sub()),(n=Je.wrapFragment(Ct(e.below,r,t),t)).classes.push("x-arrow-pad"));var s,o=Gt(e,t),l=-t.fontMetrics().axisHeight+.5*o.height,c=-t.fontMetrics().axisHeight-.5*o.height-.111;if((a.depth>.25||"\\xleftequilibrium"===e.label)&&(c-=a.depth),n){var u=-t.fontMetrics().axisHeight+n.height+.5*o.height+.111;s=Je.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:c},{type:"elem",elem:o,shift:l},{type:"elem",elem:n,shift:u}]},t)}else s=Je.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:c},{type:"elem",elem:o,shift:l}]},t);return s.children[0].children[0].children[1].classes.push("svg-align"),Je.makeSpan(["mrel","x-arrow"],[s],t)},mathmlBuilder:function(e,t){var n,i=Vt(e.label);if(e.body){var r=Xt($t(e.body,t));if(e.below){var a=Xt($t(e.below,t));n=new It.MathNode("munderover",[i,a,r])}else n=new It.MathNode("mover",[i,r])}else if(e.below){var s=Xt($t(e.below,t));n=new It.MathNode("munder",[i,s])}else n=Xt(),n=new It.MathNode("mover",[i,n]);return n}}),ht({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){for(var n=e.parser,i=Qe(t[0],"ordgroup").body,r="",a=0;a<i.length;a++)r+=Qe(i[a],"textord").text;var o=parseInt(r);if(isNaN(o))throw new s("\\@char has non-numeric argument "+r);return{type:"textord",mode:n.mode,text:String.fromCharCode(o)}}});var Jt=function(e,t){var n=_t(e.body,t.withColor(e.color),!1);return Je.makeFragment(n)},Qt=function(e,t){var n=Nt(e.body,t.withColor(e.color)),i=new It.MathNode("mstyle",n);return i.setAttribute("mathcolor",e.color),i};ht({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,greediness:3,argTypes:["color","original"]},handler:function(e,t){var n=e.parser,i=Qe(t[0],"color-token").color,r=t[1];return{type:"color",mode:n.mode,color:i,body:ft(r)}},htmlBuilder:Jt,mathmlBuilder:Qt}),ht({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,greediness:3,argTypes:["color"]},handler:function(e,t){var n=e.parser,i=e.breakOnTokenText,r=Qe(t[0],"color-token").color;n.gullet.macros.set("\\current@color",r);var a=n.parseExpression(!0,i);return{type:"color",mode:n.mode,color:r,body:a}},htmlBuilder:Jt,mathmlBuilder:Qt}),ht({type:"cr",names:["\\cr","\\newline"],props:{numArgs:0,numOptionalArgs:1,argTypes:["size"],allowedInText:!0},handler:function(e,t,n){var i=e.parser,r=e.funcName,a=n[0],s="\\cr"===r,o=!1;return s||(o=!i.settings.displayMode||!i.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode")),{type:"cr",mode:i.mode,newLine:o,newRow:s,size:a&&Qe(a,"size").value}},htmlBuilder:function(e,t){if(e.newRow)throw new s("\\cr valid only within a tabular/array environment");var n=Je.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=ze(e.size,t)+"em")),n},mathmlBuilder:function(e,t){var n=new It.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",ze(e.size,t)+"em")),n}});var en=function(e,t,n){var i=q(W.math[e]&&W.math[e].replace||e,t,n);if(!i)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return i},tn=function(e,t,n,i){var r=n.havingBaseStyle(t),a=Je.makeSpan(i.concat(r.sizingClasses(n)),[e],n),s=r.sizeMultiplier/n.sizeMultiplier;return a.height*=s,a.depth*=s,a.maxFontSize=r.sizeMultiplier,a},nn=function(e,t,n){var i=t.havingBaseStyle(n),r=(1-t.sizeMultiplier/i.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=r+"em",e.height-=r,e.depth+=r},rn=function(e,t,n,i,r,a){var s=function(e,t,n,i){return Je.makeSymbol(e,"Size"+t+"-Regular",n,i)}(e,t,r,i),o=tn(Je.makeSpan(["delimsizing","size"+t],[s],i),w.TEXT,i,a);return n&&nn(o,i,w.TEXT),o},an=function(e,t,n){var i;return i="Size1-Regular"===t?"delim-size1":"delim-size4",{type:"elem",elem:Je.makeSpan(["delimsizinginner",i],[Je.makeSpan([],[Je.makeSymbol(e,t,n)])])}},sn={type:"kern",size:-.005},on=function(e,t,n,i,r,a){var s,o,l,c;s=l=c=e,o=null;var u="Size1-Regular";"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?s=l="⏐":"\\Downarrow"===e?s=l="‖":"\\updownarrow"===e?(s="\\uparrow",l="⏐",c="\\downarrow"):"\\Updownarrow"===e?(s="\\Uparrow",l="‖",c="\\Downarrow"):"["===e||"\\lbrack"===e?(s="⎡",l="⎢",c="⎣",u="Size4-Regular"):"]"===e||"\\rbrack"===e?(s="⎤",l="⎥",c="⎦",u="Size4-Regular"):"\\lfloor"===e||"⌊"===e?(l=s="⎢",c="⎣",u="Size4-Regular"):"\\lceil"===e||"⌈"===e?(s="⎡",l=c="⎢",u="Size4-Regular"):"\\rfloor"===e||"⌋"===e?(l=s="⎥",c="⎦",u="Size4-Regular"):"\\rceil"===e||"⌉"===e?(s="⎤",l=c="⎥",u="Size4-Regular"):"("===e||"\\lparen"===e?(s="⎛",l="⎜",c="⎝",u="Size4-Regular"):")"===e||"\\rparen"===e?(s="⎞",l="⎟",c="⎠",u="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(s="⎧",o="⎨",c="⎩",l="⎪",u="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(s="⎫",o="⎬",c="⎭",l="⎪",u="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(s="⎧",c="⎩",l="⎪",u="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(s="⎫",c="⎭",l="⎪",u="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(s="⎧",c="⎭",l="⎪",u="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(s="⎫",c="⎩",l="⎪",u="Size4-Regular");var d=en(s,u,r),h=d.height+d.depth,p=en(l,u,r),f=p.height+p.depth,m=en(c,u,r),g=m.height+m.depth,v=0,b=1;if(null!==o){var y=en(o,u,r);v=y.height+y.depth,b=2}var _=h+g+v,x=Math.max(0,Math.ceil((t-_)/(b*f))),k=_+x*b*f,S=i.fontMetrics().axisHeight;n&&(S*=i.sizeMultiplier);var E=k/2-S,C=.005*(x+1)-f,T=[];if(T.push(an(c,u,r)),null===o)for(var A=0;A<x;A++)T.push(sn),T.push(an(l,u,r));else{for(var M=0;M<x;M++)T.push(sn),T.push(an(l,u,r));T.push({type:"kern",size:C}),T.push(an(l,u,r)),T.push(sn),T.push(an(o,u,r));for(var L=0;L<x;L++)T.push(sn),T.push(an(l,u,r))}T.push({type:"kern",size:C}),T.push(an(l,u,r)),T.push(sn),T.push(an(s,u,r));var D=i.havingBaseStyle(w.TEXT),I=Je.makeVList({positionType:"bottom",positionData:E,children:T},D);return tn(Je.makeSpan(["delimsizing","mult"],[I],D),w.TEXT,i,a)},ln=.08,cn=function(e,t,n,i,r){var a=function(e,t,n){t*=1e3;var i="";switch(e){case"sqrtMain":i=function(e,t){return"M95,"+(622+e+t)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,E);break;case"sqrtSize1":i=function(e,t){return"M263,"+(601+e+t)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,E);break;case"sqrtSize2":i=function(e,t){return"M983 "+(10+e+t)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,E);break;case"sqrtSize3":i=function(e,t){return"M424,"+(2398+e+t)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" "+t+"\nh400000v"+(40+e)+"h-400000z"}(t,E);break;case"sqrtSize4":i=function(e,t){return"M473,"+(2713+e+t)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"}(t,E);break;case"sqrtTall":i=function(e,t,n){return"M702 "+(e+t)+"H400000"+(40+e)+"\nH742v"+(n-54-t-e)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 "+t+"H400000v"+(40+e)+"H742z"}(t,E,n)}return i}(e,i,n),s=new $(e,a),o=new B([s],{width:"400em",height:t+"em",viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Je.makeSvgSpan(["hide-tail"],[o],r)},un=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],dn=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],hn=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],pn=[0,1.2,1.8,2.4,3],fn=[{type:"small",style:w.SCRIPTSCRIPT},{type:"small",style:w.SCRIPT},{type:"small",style:w.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],mn=[{type:"small",style:w.SCRIPTSCRIPT},{type:"small",style:w.SCRIPT},{type:"small",style:w.TEXT},{type:"stack"}],gn=[{type:"small",style:w.SCRIPTSCRIPT},{type:"small",style:w.SCRIPT},{type:"small",style:w.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],vn=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},bn=function(e,t,n,i){for(var r=Math.min(2,3-i.style.size);r<n.length&&"stack"!==n[r].type;r++){var a=en(e,vn(n[r]),"math"),s=a.height+a.depth;if("small"===n[r].type&&(s*=i.havingBaseStyle(n[r].style).sizeMultiplier),s>t)return n[r]}return n[n.length-1]},yn=function(e,t,n,i,r,a){var s;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),s=d.contains(hn,e)?fn:d.contains(un,e)?gn:mn;var o=bn(e,t,s,i);return"small"===o.type?function(e,t,n,i,r,a){var s=Je.makeSymbol(e,"Main-Regular",r,i),o=tn(s,t,i,a);return n&&nn(o,i,t),o}(e,o.style,n,i,r,a):"large"===o.type?rn(e,o.size,n,i,r,a):on(e,t,n,i,r,a)},_n=function(e,t){var n,i,r=t.havingBaseSizing(),a=bn("\\surd",e*r.sizeMultiplier,gn,r),s=r.sizeMultiplier,o=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),l=0,c=0,u=0;return"small"===a.type?(e<1?s=1:e<1.4&&(s=.7),c=(1+o)/s,(n=cn("sqrtMain",l=(1+o+ln)/s,u=1e3+1e3*o+80,o,t)).style.minWidth="0.853em",i=.833/s):"large"===a.type?(u=1080*pn[a.size],c=(pn[a.size]+o)/s,l=(pn[a.size]+o+ln)/s,(n=cn("sqrtSize"+a.size,l,u,o,t)).style.minWidth="1.02em",i=1/s):(l=e+o+ln,c=e+o,u=Math.floor(1e3*e+o)+80,(n=cn("sqrtTall",l,u,o,t)).style.minWidth="0.742em",i=1.056),n.height=c,n.style.height=l+"em",{span:n,advanceWidth:i,ruleWidth:(t.fontMetrics().sqrtRuleThickness+o)*s}},wn=function(e,t,n,i,r){if("<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),d.contains(un,e)||d.contains(hn,e))return rn(e,t,!1,n,i,r);if(d.contains(dn,e))return on(e,pn[t],!1,n,i,r);throw new s("Illegal delimiter: '"+e+"'")},xn=yn,kn=function(e,t,n,i,r,a){var s=i.fontMetrics().axisHeight*i.sizeMultiplier,o=5/i.fontMetrics().ptPerEm,l=Math.max(t-s,n+s),c=Math.max(l/500*901,2*l-o);return yn(e,c,!0,i,r,a)},Sn={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},En=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Cn(e,t){var n=it(e);if(n&&d.contains(En,n.text))return n;throw new s("Invalid delimiter: '"+(n?n.text:JSON.stringify(e))+"' after '"+t.funcName+"'",e)}function Tn(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ht({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1},handler:function(e,t){var n=Cn(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:Sn[e.funcName].size,mclass:Sn[e.funcName].mclass,delim:n.text}},htmlBuilder:function(e,t){return"."===e.delim?Je.makeSpan([e.mclass]):wn(e.delim,e.size,t,e.mode,[e.mclass])},mathmlBuilder:function(e){var t=[];"."!==e.delim&&t.push(Rt(e.delim,e.mode));var n=new It.MathNode("mo",t);return"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n}}),ht({type:"leftright-right",names:["\\right"],props:{numArgs:1},handler:function(e,t){var n=e.parser.gullet.macros.get("\\current@color");if(n&&"string"!=typeof n)throw new s("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Cn(t[0],e).text,color:n}}}),ht({type:"leftright",names:["\\left"],props:{numArgs:1},handler:function(e,t){var n=Cn(t[0],e),i=e.parser;++i.leftrightDepth;var r=i.parseExpression(!1);--i.leftrightDepth,i.expect("\\right",!1);var a=Qe(i.parseFunction(),"leftright-right");return{type:"leftright",mode:i.mode,body:r,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:function(e,t){Tn(e);for(var n,i,r=_t(e.body,t,!0,["mopen","mclose"]),a=0,s=0,o=!1,l=0;l<r.length;l++)r[l].isMiddle?o=!0:(a=Math.max(r[l].height,a),s=Math.max(r[l].depth,s));if(a*=t.sizeMultiplier,s*=t.sizeMultiplier,n="."===e.left?Et(t,["mopen"]):kn(e.left,a,s,t,e.mode,["mopen"]),r.unshift(n),o)for(var c=1;c<r.length;c++){var u=r[c].isMiddle;u&&(r[c]=kn(u.delim,a,s,u.options,e.mode,[]))}if("."===e.right)i=Et(t,["mclose"]);else{var d=e.rightColor?t.withColor(e.rightColor):t;i=kn(e.right,a,s,d,e.mode,["mclose"])}return r.push(i),Je.makeSpan(["minner"],r,t)},mathmlBuilder:function(e,t){Tn(e);var n=Nt(e.body,t);if("."!==e.left){var i=new It.MathNode("mo",[Rt(e.left,e.mode)]);i.setAttribute("fence","true"),n.unshift(i)}if("."!==e.right){var r=new It.MathNode("mo",[Rt(e.right,e.mode)]);r.setAttribute("fence","true"),e.rightColor&&r.setAttribute("mathcolor",e.rightColor),n.push(r)}return Pt(n)}}),ht({type:"middle",names:["\\middle"],props:{numArgs:1},handler:function(e,t){var n=Cn(t[0],e);if(!e.parser.leftrightDepth)throw new s("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:function(e,t){var n;if("."===e.delim)n=Et(t,[]);else{n=wn(e.delim,1,t,e.mode,[]);var i={delim:e.delim,options:t};n.isMiddle=i}return n},mathmlBuilder:function(e,t){var n="\\vert"===e.delim||"|"===e.delim?Rt("|","text"):Rt(e.delim,e.mode),i=new It.MathNode("mo",[n]);return i.setAttribute("fence","true"),i.setAttribute("lspace","0.05em"),i.setAttribute("rspace","0.05em"),i}});var An=function(e,t){var n,i,r=Je.wrapFragment(Ct(e.body,t),t),a=e.label.substr(1),s=t.sizeMultiplier,o=0,l=d.isCharacterBox(e.body);if("sout"===a)(n=Je.makeSpan(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/s,o=-.5*t.fontMetrics().xHeight;else{/cancel/.test(a)?l||r.classes.push("cancel-pad"):r.classes.push("boxpad");var c=0,u=0;/box/.test(a)?(u=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),c=t.fontMetrics().fboxsep+("colorbox"===a?0:u)):c=l?.2:0,n=Ht(r,a,c,t),/fbox|boxed|fcolorbox/.test(a)&&(n.style.borderStyle="solid",n.style.borderWidth=u+"em"),o=r.depth+c,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}return i=e.backgroundColor?Je.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:o},{type:"elem",elem:r,shift:0}]},t):Je.makeVList({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:n,shift:o,wrapperClasses:/cancel/.test(a)?["svg-align"]:[]}]},t),/cancel/.test(a)&&(i.height=r.height,i.depth=r.depth),/cancel/.test(a)&&!l?Je.makeSpan(["mord","cancel-lap"],[i],t):Je.makeSpan(["mord"],[i],t)},Mn=function(e,t){var n=0,i=new It.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[$t(e.body,t)]);switch(e.label){case"\\cancel":i.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":i.setAttribute("notation","downdiagonalstrike");break;case"\\sout":i.setAttribute("notation","horizontalstrike");break;case"\\fbox":i.setAttribute("notation","box");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,i.setAttribute("width","+"+2*n+"pt"),i.setAttribute("height","+"+2*n+"pt"),i.setAttribute("lspace",n+"pt"),i.setAttribute("voffset",n+"pt"),"\\fcolorbox"===e.label){var r=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);i.setAttribute("style","border: "+r+"em solid "+String(e.borderColor))}break;case"\\xcancel":i.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&i.setAttribute("mathbackground",e.backgroundColor),i};ht({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,greediness:3,argTypes:["color","text"]},handler:function(e,t,n){var i=e.parser,r=e.funcName,a=Qe(t[0],"color-token").color,s=t[1];return{type:"enclose",mode:i.mode,label:r,backgroundColor:a,body:s}},htmlBuilder:An,mathmlBuilder:Mn}),ht({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,greediness:3,argTypes:["color","color","text"]},handler:function(e,t,n){var i=e.parser,r=e.funcName,a=Qe(t[0],"color-token").color,s=Qe(t[1],"color-token").color,o=t[2];return{type:"enclose",mode:i.mode,label:r,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:An,mathmlBuilder:Mn}),ht({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler:function(e,t){return{type:"enclose",mode:e.parser.mode,label:"\\fbox",body:t[0]}}}),ht({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout"],props:{numArgs:1},handler:function(e,t,n){var i=e.parser,r=e.funcName,a=t[0];return{type:"enclose",mode:i.mode,label:r,body:a}},htmlBuilder:An,mathmlBuilder:Mn});var Ln={};function Dn(e){for(var t=e.type,n=e.names,i=e.props,r=e.handler,a=e.htmlBuilder,s=e.mathmlBuilder,o={type:t,numArgs:i.numArgs||0,greediness:1,allowedInText:!1,numOptionalArgs:0,handler:r},l=0;l<n.length;++l)Ln[n[l]]=o;a&&(ut[t]=a),s&&(dt[t]=s)}function In(e){var t=[];e.consumeSpaces();for(var n=e.fetch().text;"\\hline"===n||"\\hdashline"===n;)e.consume(),t.push("\\hdashline"===n),e.consumeSpaces(),n=e.fetch().text;return t}function Rn(e,t,n){var i=t.hskipBeforeAndAfter,r=t.addJot,a=t.cols,o=t.arraystretch,l=t.colSeparationType;if(e.gullet.beginGroup(),e.gullet.macros.set("\\\\","\\cr"),!o){var c=e.gullet.expandMacroAsText("\\arraystretch");if(null==c)o=1;else if(!(o=parseFloat(c))||o<0)throw new s("Invalid \\arraystretch: "+c)}e.gullet.beginGroup();var u=[],d=[u],h=[],p=[];for(p.push(In(e));;){var f=e.parseExpression(!1,"\\cr");e.gullet.endGroup(),e.gullet.beginGroup(),f={type:"ordgroup",mode:e.mode,body:f},n&&(f={type:"styling",mode:e.mode,style:n,body:[f]}),u.push(f);var m=e.fetch().text;if("&"===m)e.consume();else{if("\\end"===m){1===u.length&&"styling"===f.type&&0===f.body[0].body.length&&d.pop(),p.length<d.length+1&&p.push([]);break}if("\\cr"!==m)throw new s("Expected & or \\\\ or \\cr or \\end",e.nextToken);var g=Qe(e.parseFunction(),"cr");h.push(g.size),p.push(In(e)),u=[],d.push(u)}}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:r,arraystretch:o,body:d,cols:a,rowGaps:h,hskipBeforeAndAfter:i,hLinesBeforeRow:p,colSeparationType:l}}function Pn(e){return"d"===e.substr(0,1)?"display":"text"}var On=function(e,t){var n,i,r=e.body.length,a=e.hLinesBeforeRow,o=0,l=new Array(r),c=[],u=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),h=1/t.fontMetrics().ptPerEm,p=5*h;e.colSeparationType&&"small"===e.colSeparationType&&(p=t.havingStyle(w.SCRIPT).sizeMultiplier/t.sizeMultiplier*.2778);var f=12*h,m=3*h,g=e.arraystretch*f,v=.7*g,b=.3*g,y=0;function _(e){for(var t=0;t<e.length;++t)t>0&&(y+=.25),c.push({pos:y,isDashed:e[t]})}for(_(a[0]),n=0;n<e.body.length;++n){var x=e.body[n],k=v,S=b;o<x.length&&(o=x.length);var E=new Array(x.length);for(i=0;i<x.length;++i){var C=Ct(x[i],t);S<C.depth&&(S=C.depth),k<C.height&&(k=C.height),E[i]=C}var T=e.rowGaps[n],A=0;T&&(A=ze(T,t))>0&&(S<(A+=b)&&(S=A),A=0),e.addJot&&(S+=m),E.height=k,E.depth=S,y+=k,E.pos=y,y+=S+A,l[n]=E,_(a[n+1])}var M,L,D=y/2+t.fontMetrics().axisHeight,I=e.cols||[],R=[];for(i=0,L=0;i<o||L<I.length;++i,++L){for(var P=I[L]||{},O=!0;"separator"===P.type;){if(O||((M=Je.makeSpan(["arraycolsep"],[])).style.width=t.fontMetrics().doubleRuleSep+"em",R.push(M)),"|"!==P.separator&&":"!==P.separator)throw new s("Invalid separator type: "+P.separator);var N="|"===P.separator?"solid":"dashed",B=Je.makeSpan(["vertical-separator"],[],t);B.style.height=y+"em",B.style.borderRightWidth=u+"em",B.style.borderRightStyle=N,B.style.margin="0 -"+u/2+"em",B.style.verticalAlign=-(y-D)+"em",R.push(B),P=I[++L]||{},O=!1}if(!(i>=o)){var $=void 0;(i>0||e.hskipBeforeAndAfter)&&0!==($=d.deflt(P.pregap,p))&&((M=Je.makeSpan(["arraycolsep"],[])).style.width=$+"em",R.push(M));var F=[];for(n=0;n<r;++n){var z=l[n],K=z[i];if(K){var U=z.pos-D;K.depth=z.depth,K.height=z.height,F.push({type:"elem",elem:K,shift:U})}}F=Je.makeVList({positionType:"individualShift",children:F},t),F=Je.makeSpan(["col-align-"+(P.align||"c")],[F]),R.push(F),(i<o-1||e.hskipBeforeAndAfter)&&0!==($=d.deflt(P.postgap,p))&&((M=Je.makeSpan(["arraycolsep"],[])).style.width=$+"em",R.push(M))}}if(l=Je.makeSpan(["mtable"],R),c.length>0){for(var j=Je.makeLineSpan("hline",t,u),q=Je.makeLineSpan("hdashline",t,u),H=[{type:"elem",elem:l,shift:0}];c.length>0;){var V=c.pop(),G=V.pos-D;V.isDashed?H.push({type:"elem",elem:q,shift:G}):H.push({type:"elem",elem:j,shift:G})}l=Je.makeVList({positionType:"individualShift",children:H},t)}return Je.makeSpan(["mord"],[l],t)},Nn={c:"center ",l:"left ",r:"right "},Bn=function(e,t){var n=new It.MathNode("mtable",e.body.map((function(e){return new It.MathNode("mtr",e.map((function(e){return new It.MathNode("mtd",[$t(e,t)])})))}))),i=.5===e.arraystretch?.1:.16+e.arraystretch-1+(e.addJot?.09:0);n.setAttribute("rowspacing",i+"em");var r="",a="";if(e.cols){var s=e.cols,o="",l=!1,c=0,u=s.length;"separator"===s[0].type&&(r+="top ",c=1),"separator"===s[s.length-1].type&&(r+="bottom ",u-=1);for(var d=c;d<u;d++)"align"===s[d].type?(a+=Nn[s[d].align],l&&(o+="none "),l=!0):"separator"===s[d].type&&l&&(o+="|"===s[d].separator?"solid ":"dashed ",l=!1);n.setAttribute("columnalign",a.trim()),/[sd]/.test(o)&&n.setAttribute("columnlines",o.trim())}if("align"===e.colSeparationType){for(var h=e.cols||[],p="",f=1;f<h.length;f++)p+=f%2?"0em ":"1em ";n.setAttribute("columnspacing",p.trim())}else"alignat"===e.colSeparationType?n.setAttribute("columnspacing","0em"):"small"===e.colSeparationType?n.setAttribute("columnspacing","0.2778em"):n.setAttribute("columnspacing","1em");var m="",g=e.hLinesBeforeRow;r+=g[0].length>0?"left ":"",r+=g[g.length-1].length>0?"right ":"";for(var v=1;v<g.length-1;v++)m+=0===g[v].length?"none ":g[v][0]?"dashed ":"solid ";return/[sd]/.test(m)&&n.setAttribute("rowlines",m.trim()),""!==r&&(n=new It.MathNode("menclose",[n])).setAttribute("notation",r.trim()),e.arraystretch&&e.arraystretch<1&&(n=new It.MathNode("mstyle",[n])).setAttribute("scriptlevel","1"),n},$n=function(e,t){var n,i=[],r=Rn(e.parser,{cols:i,addJot:!0},"display"),a=0,o={type:"ordgroup",mode:e.mode,body:[]},l=et(t[0],"ordgroup");if(l){for(var c="",u=0;u<l.body.length;u++)c+=Qe(l.body[u],"textord").text;n=Number(c),a=2*n}var d=!a;r.body.forEach((function(e){for(var t=1;t<e.length;t+=2){var i=Qe(e[t],"styling");Qe(i.body[0],"ordgroup").body.unshift(o)}if(d)a<e.length&&(a=e.length);else{var r=e.length/2;if(n<r)throw new s("Too many math in a row: expected "+n+", but got "+r,e[0])}}));for(var h=0;h<a;++h){var p="r",f=0;h%2==1?p="l":h>0&&d&&(f=1),i[h]={type:"align",align:p,pregap:f,postgap:0}}return r.colSeparationType=d?"align":"alignat",r};Dn({type:"array",names:["array","darray"],props:{numArgs:1},handler:function(e,t){var n={cols:(it(t[0])?[t[0]]:Qe(t[0],"ordgroup").body).map((function(e){var t=nt(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"};throw new s("Unknown column alignment: "+t,e)})),hskipBeforeAndAfter:!0};return Rn(e.parser,n,Pn(e.envName))},htmlBuilder:On,mathmlBuilder:Bn}),Dn({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix"],props:{numArgs:0},handler:function(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName],n=Rn(e.parser,{hskipBeforeAndAfter:!1},Pn(e.envName));return t?{type:"leftright",mode:e.mode,body:[n],left:t[0],right:t[1],rightColor:void 0}:n},htmlBuilder:On,mathmlBuilder:Bn}),Dn({type:"array",names:["smallmatrix"],props:{numArgs:0},handler:function(e){var t=Rn(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:On,mathmlBuilder:Bn}),Dn({type:"array",names:["subarray"],props:{numArgs:1},handler:function(e,t){var n=(it(t[0])?[t[0]]:Qe(t[0],"ordgroup").body).map((function(e){var t=nt(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new s("Unknown column alignment: "+t,e)}));if(n.length>1)throw new s("{subarray} can contain only one column");var i={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if((i=Rn(e.parser,i,"script")).body[0].length>1)throw new s("{subarray} can contain only one column");return i},htmlBuilder:On,mathmlBuilder:Bn}),Dn({type:"array",names:["cases","dcases"],props:{numArgs:0},handler:function(e){var t=Rn(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},Pn(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:"\\{",right:".",rightColor:void 0}},htmlBuilder:On,mathmlBuilder:Bn}),Dn({type:"array",names:["aligned"],props:{numArgs:0},handler:$n,htmlBuilder:On,mathmlBuilder:Bn}),Dn({type:"array",names:["gathered"],props:{numArgs:0},handler:function(e){return Rn(e.parser,{cols:[{type:"align",align:"c"}],addJot:!0},"display")},htmlBuilder:On,mathmlBuilder:Bn}),Dn({type:"array",names:["alignedat"],props:{numArgs:1},handler:$n,htmlBuilder:On,mathmlBuilder:Bn}),ht({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler:function(e,t){throw new s(e.funcName+" valid only within array environment")}});var Fn=Ln;ht({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler:function(e,t){var n=e.parser,i=e.funcName,r=t[0];if("ordgroup"!==r.type)throw new s("Invalid environment name",r);for(var a="",o=0;o<r.body.length;++o)a+=Qe(r.body[o],"textord").text;if("\\begin"===i){if(!Fn.hasOwnProperty(a))throw new s("No such environment: "+a,r);var l=Fn[a],c=n.parseArguments("\\begin{"+a+"}",l),u=c.args,d=c.optArgs,h={mode:n.mode,envName:a,parser:n},p=l.handler(h,u,d);n.expect("\\end",!1);var f=n.nextToken,m=Qe(n.parseFunction(),"environment");if(m.name!==a)throw new s("Mismatch: \\begin{"+a+"} matched by \\end{"+m.name+"}",f);return p}return{type:"environment",mode:n.mode,name:a,nameGroup:r}}});var zn=Je.makeSpan;function Kn(e,t){var n=_t(e.body,t,!0);return zn([e.mclass],n,t)}function Un(e,t){var n,i=Nt(e.body,t);return"minner"===e.mclass?It.newDocumentFragment(i):("mord"===e.mclass?e.isCharacterBox?(n=i[0]).type="mi":n=new It.MathNode("mi",i):(e.isCharacterBox?(n=i[0]).type="mo":n=new It.MathNode("mo",i),"mbin"===e.mclass?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):"mpunct"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):"mopen"!==e.mclass&&"mclose"!==e.mclass||(n.attributes.lspace="0em",n.attributes.rspace="0em")),n)}ht({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1},handler:function(e,t){var n=e.parser,i=e.funcName,r=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+i.substr(5),body:ft(r),isCharacterBox:d.isCharacterBox(r)}},htmlBuilder:Kn,mathmlBuilder:Un});var jn=function(e){var t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==t.type||"bin"!==t.family&&"rel"!==t.family?"mord":"m"+t.family};ht({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler:function(e,t){return{type:"mclass",mode:e.parser.mode,mclass:jn(t[0]),body:[t[1]],isCharacterBox:d.isCharacterBox(t[1])}}}),ht({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler:function(e,t){var n,i=e.parser,r=e.funcName,a=t[1],s=t[0];n="\\stackrel"!==r?jn(a):"mrel";var o={type:"op",mode:a.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==r,body:ft(a)},l={type:"supsub",mode:s.mode,base:o,sup:"\\underset"===r?null:s,sub:"\\underset"===r?s:null};return{type:"mclass",mode:i.mode,mclass:n,body:[l],isCharacterBox:d.isCharacterBox(l)}},htmlBuilder:Kn,mathmlBuilder:Un});var qn=function(e,t){var n=e.font,i=t.withFont(n);return Ct(e.body,i)},Hn=function(e,t){var n=e.font,i=t.withFont(n);return $t(e.body,i)},Vn={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};ht({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,greediness:2},handler:function(e,t){var n=e.parser,i=e.funcName,r=t[0],a=i;return a in Vn&&(a=Vn[a]),{type:"font",mode:n.mode,font:a.slice(1),body:r}},htmlBuilder:qn,mathmlBuilder:Hn}),ht({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1,greediness:2},handler:function(e,t){var n=e.parser,i=t[0],r=d.isCharacterBox(i);return{type:"mclass",mode:n.mode,mclass:jn(i),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:i}],isCharacterBox:r}}}),ht({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it"],props:{numArgs:0,allowedInText:!0},handler:function(e,t){var n=e.parser,i=e.funcName,r=e.breakOnTokenText,a=n.mode,s=n.parseExpression(!0,r);return{type:"font",mode:a,font:"math"+i.slice(1),body:{type:"ordgroup",mode:n.mode,body:s}}},htmlBuilder:qn,mathmlBuilder:Hn});var Gn=function(e,t){var n=t;return"display"===e?n=n.id>=w.SCRIPT.id?n.text():w.DISPLAY:"text"===e&&n.size===w.DISPLAY.size?n=w.TEXT:"script"===e?n=w.SCRIPT:"scriptscript"===e&&(n=w.SCRIPTSCRIPT),n},Zn=function(e,t){var n,i=Gn(e.size,t.style),r=i.fracNum(),a=i.fracDen();n=t.havingStyle(r);var s=Ct(e.numer,n,t);if(e.continued){var o=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;s.height=s.height<o?o:s.height,s.depth=s.depth<l?l:s.depth}n=t.havingStyle(a);var c,u,d,h,p,f,m,g,v,b,y=Ct(e.denom,n,t);if(e.hasBarLine?(e.barSize?(u=ze(e.barSize,t),c=Je.makeLineSpan("frac-line",t,u)):c=Je.makeLineSpan("frac-line",t),u=c.height,d=c.height):(c=null,u=0,d=t.fontMetrics().defaultRuleThickness),i.size===w.DISPLAY.size||"display"===e.size?(h=t.fontMetrics().num1,p=u>0?3*d:7*d,f=t.fontMetrics().denom1):(u>0?(h=t.fontMetrics().num2,p=d):(h=t.fontMetrics().num3,p=3*d),f=t.fontMetrics().denom2),c){var _=t.fontMetrics().axisHeight;h-s.depth-(_+.5*u)<p&&(h+=p-(h-s.depth-(_+.5*u))),_-.5*u-(y.height-f)<p&&(f+=p-(_-.5*u-(y.height-f)));var x=-(_-.5*u);m=Je.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:f},{type:"elem",elem:c,shift:x},{type:"elem",elem:s,shift:-h}]},t)}else{var k=h-s.depth-(y.height-f);k<p&&(h+=.5*(p-k),f+=.5*(p-k)),m=Je.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:f},{type:"elem",elem:s,shift:-h}]},t)}return n=t.havingStyle(i),m.height*=n.sizeMultiplier/t.sizeMultiplier,m.depth*=n.sizeMultiplier/t.sizeMultiplier,g=i.size===w.DISPLAY.size?t.fontMetrics().delim1:t.fontMetrics().delim2,v=null==e.leftDelim?Et(t,["mopen"]):xn(e.leftDelim,g,!0,t.havingStyle(i),e.mode,["mopen"]),b=e.continued?Je.makeSpan([]):null==e.rightDelim?Et(t,["mclose"]):xn(e.rightDelim,g,!0,t.havingStyle(i),e.mode,["mclose"]),Je.makeSpan(["mord"].concat(n.sizingClasses(t)),[v,Je.makeSpan(["mfrac"],[m]),b],t)},Wn=function(e,t){var n=new It.MathNode("mfrac",[$t(e.numer,t),$t(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var i=ze(e.barSize,t);n.setAttribute("linethickness",i+"em")}}else n.setAttribute("linethickness","0px");var r=Gn(e.size,t.style);if(r.size!==t.style.size){n=new It.MathNode("mstyle",[n]);var a=r.size===w.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",a),n.setAttribute("scriptlevel","0")}if(null!=e.leftDelim||null!=e.rightDelim){var s=[];if(null!=e.leftDelim){var o=new It.MathNode("mo",[new It.TextNode(e.leftDelim.replace("\\",""))]);o.setAttribute("fence","true"),s.push(o)}if(s.push(n),null!=e.rightDelim){var l=new It.MathNode("mo",[new It.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),s.push(l)}return Pt(s)}return n};ht({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,greediness:2},handler:function(e,t){var n,i=e.parser,r=e.funcName,a=t[0],s=t[1],o=null,l=null,c="auto";switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":n=!0;break;case"\\\\atopfrac":n=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=!1,o="(",l=")";break;case"\\\\bracefrac":n=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":n=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(r){case"\\cfrac":case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text"}return{type:"genfrac",mode:i.mode,continued:"\\cfrac"===r,numer:a,denom:s,hasBarLine:n,leftDelim:o,rightDelim:l,size:c,barSize:null}},htmlBuilder:Zn,mathmlBuilder:Wn}),ht({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler:function(e){var t,n=e.parser,i=e.funcName,r=e.token;switch(i){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:t,token:r}}});var Yn=["display","text","script","scriptscript"],Xn=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};ht({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,greediness:6,argTypes:["math","math","size","text","math","math"]},handler:function(e,t){var n=e.parser,i=t[4],r=t[5],a=et(t[0],"atom");a&&(a=tt(t[0],"open"));var s=a?Xn(a.text):null,o=et(t[1],"atom");o&&(o=tt(t[1],"close"));var l,c=o?Xn(o.text):null,u=Qe(t[2],"size"),d=null;l=!!u.isBlank||(d=u.value).number>0;var h="auto",p=et(t[3],"ordgroup");if(p){if(p.body.length>0){var f=Qe(p.body[0],"textord");h=Yn[Number(f.text)]}}else p=Qe(t[3],"textord"),h=Yn[Number(p.text)];return{type:"genfrac",mode:n.mode,numer:i,denom:r,continued:!1,hasBarLine:l,barSize:d,leftDelim:s,rightDelim:c,size:h}},htmlBuilder:Zn,mathmlBuilder:Wn}),ht({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler:function(e,t){var n=e.parser,i=(e.funcName,e.token);return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Qe(t[0],"size").value,token:i}}}),ht({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:function(e,t){var n=e.parser,i=(e.funcName,t[0]),r=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}(Qe(t[1],"infix").size),a=t[2],s=r.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:a,continued:!1,hasBarLine:s,barSize:r,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Zn,mathmlBuilder:Wn});var Jn=function(e,t){var n,i,r=t.style,a=et(e,"supsub");a?(n=a.sup?Ct(a.sup,t.havingStyle(r.sup()),t):Ct(a.sub,t.havingStyle(r.sub()),t),i=Qe(a.base,"horizBrace")):i=Qe(e,"horizBrace");var s,o=Ct(i.base,t.havingBaseStyle(w.DISPLAY)),l=Gt(i,t);if(i.isOver?(s=Je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:l}]},t)).children[0].children[0].children[1].classes.push("svg-align"):(s=Je.makeVList({positionType:"bottom",positionData:o.depth+.1+l.height,children:[{type:"elem",elem:l},{type:"kern",size:.1},{type:"elem",elem:o}]},t)).children[0].children[0].children[0].classes.push("svg-align"),n){var c=Je.makeSpan(["mord",i.isOver?"mover":"munder"],[s],t);s=i.isOver?Je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:c},{type:"kern",size:.2},{type:"elem",elem:n}]},t):Je.makeVList({positionType:"bottom",positionData:c.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:c}]},t)}return Je.makeSpan(["mord",i.isOver?"mover":"munder"],[s],t)};ht({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler:function(e,t){var n=e.parser,i=e.funcName;return{type:"horizBrace",mode:n.mode,label:i,isOver:/^\\over/.test(i),base:t[0]}},htmlBuilder:Jn,mathmlBuilder:function(e,t){var n=Vt(e.label);return new It.MathNode(e.isOver?"mover":"munder",[$t(e.base,t),n])}}),ht({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:function(e,t){var n=e.parser,i=t[1],r=Qe(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:r})?{type:"href",mode:n.mode,href:r,body:ft(i)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:function(e,t){var n=_t(e.body,t,!1);return Je.makeAnchor(e.href,[],n,t)},mathmlBuilder:function(e,t){var n=Bt(e.body,t);return n instanceof Lt||(n=new Lt("mrow",[n])),n.setAttribute("href",e.href),n}}),ht({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:function(e,t){var n=e.parser,i=Qe(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:i}))return n.formatUnsupportedCmd("\\url");for(var r=[],a=0;a<i.length;a++){var s=i[a];"~"===s&&(s="\\textasciitilde"),r.push({type:"textord",mode:"text",text:s})}var o={type:"text",mode:n.mode,font:"\\texttt",body:r};return{type:"href",mode:n.mode,href:i,body:ft(o)}}}),ht({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:function(e,t){return{type:"htmlmathml",mode:e.parser.mode,html:ft(t[0]),mathml:ft(t[1])}},htmlBuilder:function(e,t){var n=_t(e.html,t,!1);return Je.makeFragment(n)},mathmlBuilder:function(e,t){return Bt(e.mathml,t)}});var Qn=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new s("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!Fe(n))throw new s("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};ht({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:function(e,t,n){var i=e.parser,r={number:0,unit:"em"},a={number:.9,unit:"em"},o={number:0,unit:"em"},l="";if(n[0])for(var c=Qe(n[0],"raw").string.split(","),u=0;u<c.length;u++){var d=c[u].split("=");if(2===d.length){var h=d[1].trim();switch(d[0].trim()){case"alt":l=h;break;case"width":r=Qn(h);break;case"height":a=Qn(h);break;case"totalheight":o=Qn(h);break;default:throw new s("Invalid key: '"+d[0]+"' in \\includegraphics.")}}}var p=Qe(t[0],"url").url;return""===l&&(l=(l=(l=p).replace(/^.*[\\/]/,"")).substring(0,l.lastIndexOf("."))),i.settings.isTrusted({command:"\\includegraphics",url:p})?{type:"includegraphics",mode:i.mode,alt:l,width:r,height:a,totalheight:o,src:p}:i.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:function(e,t){var n=ze(e.height,t),i=0;e.totalheight.number>0&&(i=ze(e.totalheight,t)-n,i=Number(i.toFixed(2)));var r=0;e.width.number>0&&(r=ze(e.width,t));var a={height:n+i+"em"};r>0&&(a.width=r+"em"),i>0&&(a.verticalAlign=-i+"em");var s=new P(e.src,e.alt,a);return s.height=n,s.depth=i,s},mathmlBuilder:function(e,t){var n=new It.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var i=ze(e.height,t),r=0;if(e.totalheight.number>0&&(r=(r=ze(e.totalheight,t)-i).toFixed(2),n.setAttribute("valign","-"+r+"em")),n.setAttribute("height",i+r+"em"),e.width.number>0){var a=ze(e.width,t);n.setAttribute("width",a+"em")}return n.setAttribute("src",e.src),n}}),ht({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],allowedInText:!0},handler:function(e,t){var n=e.parser,i=e.funcName,r=Qe(t[0],"size");if(n.settings.strict){var a="m"===i[1],s="mu"===r.value.unit;a?(s||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+i+" supports only mu units, not "+r.value.unit+" units"),"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+i+" works only in math mode")):s&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+i+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:r.value}},htmlBuilder:function(e,t){return Je.makeGlue(e.dimension,t)},mathmlBuilder:function(e,t){var n=ze(e.dimension,t);return new It.SpaceNode(n)}}),ht({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){var n=e.parser,i=e.funcName,r=t[0];return{type:"lap",mode:n.mode,alignment:i.slice(5),body:r}},htmlBuilder:function(e,t){var n;"clap"===e.alignment?(n=Je.makeSpan([],[Ct(e.body,t)]),n=Je.makeSpan(["inner"],[n],t)):n=Je.makeSpan(["inner"],[Ct(e.body,t)]);var i=Je.makeSpan(["fix"],[]),r=Je.makeSpan([e.alignment],[n,i],t),a=Je.makeSpan(["strut"]);return a.style.height=r.height+r.depth+"em",a.style.verticalAlign=-r.depth+"em",r.children.unshift(a),r=Je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r}]},t),Je.makeSpan(["mord"],[r],t)},mathmlBuilder:function(e,t){var n=new It.MathNode("mpadded",[$t(e.body,t)]);if("rlap"!==e.alignment){var i="llap"===e.alignment?"-1":"-0.5";n.setAttribute("lspace",i+"width")}return n.setAttribute("width","0px"),n}}),ht({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(e,t){var n=e.funcName,i=e.parser,r=i.mode;i.switchMode("math");var a="\\("===n?"\\)":"$",s=i.parseExpression(!1,a);return i.expect(a),i.switchMode(r),{type:"styling",mode:i.mode,style:"text",body:s}}}),ht({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(e,t){throw new s("Mismatched "+e.funcName)}});var ei=function(e,t){switch(t.style.size){case w.DISPLAY.size:return e.display;case w.TEXT.size:return e.text;case w.SCRIPT.size:return e.script;case w.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};ht({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4},handler:function(e,t){return{type:"mathchoice",mode:e.parser.mode,display:ft(t[0]),text:ft(t[1]),script:ft(t[2]),scriptscript:ft(t[3])}},htmlBuilder:function(e,t){var n=ei(e,t),i=_t(n,t,!1);return Je.makeFragment(i)},mathmlBuilder:function(e,t){var n=ei(e,t);return Bt(n,t)}});var ti=function(e,t,n,i,r,a,s){var o,l,c;if(e=Je.makeSpan([],[e]),t){var u=Ct(t,i.havingStyle(r.sup()),i);l={elem:u,kern:Math.max(i.fontMetrics().bigOpSpacing1,i.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=Ct(n,i.havingStyle(r.sub()),i);o={elem:d,kern:Math.max(i.fontMetrics().bigOpSpacing2,i.fontMetrics().bigOpSpacing4-d.height)}}if(l&&o){var h=i.fontMetrics().bigOpSpacing5+o.elem.height+o.elem.depth+o.kern+e.depth+s;c=Je.makeVList({positionType:"bottom",positionData:h,children:[{type:"kern",size:i.fontMetrics().bigOpSpacing5},{type:"elem",elem:o.elem,marginLeft:-a+"em"},{type:"kern",size:o.kern},{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:a+"em"},{type:"kern",size:i.fontMetrics().bigOpSpacing5}]},i)}else if(o){var p=e.height-s;c=Je.makeVList({positionType:"top",positionData:p,children:[{type:"kern",size:i.fontMetrics().bigOpSpacing5},{type:"elem",elem:o.elem,marginLeft:-a+"em"},{type:"kern",size:o.kern},{type:"elem",elem:e}]},i)}else{if(!l)return e;var f=e.depth+s;c=Je.makeVList({positionType:"bottom",positionData:f,children:[{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:a+"em"},{type:"kern",size:i.fontMetrics().bigOpSpacing5}]},i)}return Je.makeSpan(["mop","op-limits"],[c],i)},ni=["\\smallint"],ii=function(e,t){var n,i,r,a=!1,s=et(e,"supsub");s?(n=s.sup,i=s.sub,r=Qe(s.base,"op"),a=!0):r=Qe(e,"op");var o,l=t.style,c=!1;if(l.size===w.DISPLAY.size&&r.symbol&&!d.contains(ni,r.name)&&(c=!0),r.symbol){var u=c?"Size2-Regular":"Size1-Regular",h="";if("\\oiint"!==r.name&&"\\oiiint"!==r.name||(h=r.name.substr(1),r.name="oiint"===h?"\\iint":"\\iiint"),o=Je.makeSymbol(r.name,u,"math",t,["mop","op-symbol",c?"large-op":"small-op"]),h.length>0){var p=o.italic,f=Je.staticSvg(h+"Size"+(c?"2":"1"),t);o=Je.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:f,shift:c?.08:0}]},t),r.name="\\"+h,o.classes.unshift("mop"),o.italic=p}}else if(r.body){var m=_t(r.body,t,!0);1===m.length&&m[0]instanceof N?(o=m[0]).classes[0]="mop":o=Je.makeSpan(["mop"],Je.tryCombineChars(m),t)}else{for(var g=[],v=1;v<r.name.length;v++)g.push(Je.mathsym(r.name[v],r.mode,t));o=Je.makeSpan(["mop"],g,t)}var b=0,y=0;return(o instanceof N||"\\oiint"===r.name||"\\oiiint"===r.name)&&!r.suppressBaseShift&&(b=(o.height-o.depth)/2-t.fontMetrics().axisHeight,y=o.italic),a?ti(o,n,i,t,l,y,b):(b&&(o.style.position="relative",o.style.top=b+"em"),o)},ri=function(e,t){var n;if(e.symbol)n=new Lt("mo",[Rt(e.name,e.mode)]),d.contains(ni,e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Lt("mo",Nt(e.body,t));else{n=new Lt("mi",[new Dt(e.name.slice(1))]);var i=new Lt("mo",[Rt("","text")]);n=e.parentIsSupSub?new Lt("mo",[n,i]):Mt([n,i])}return n},ai={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ht({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:function(e,t){var n=e.parser,i=e.funcName;return 1===i.length&&(i=ai[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:ii,mathmlBuilder:ri}),ht({type:"op",names:["\\mathop"],props:{numArgs:1},handler:function(e,t){var n=e.parser,i=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:ft(i)}},htmlBuilder:ii,mathmlBuilder:ri});var si={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ht({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler:function(e){var t=e.parser,n=e.funcName;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:ii,mathmlBuilder:ri}),ht({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler:function(e){var t=e.parser,n=e.funcName;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:ii,mathmlBuilder:ri}),ht({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler:function(e){var t=e.parser,n=e.funcName;return 1===n.length&&(n=si[n]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:ii,mathmlBuilder:ri});var oi=function(e,t){var n,i,r,a,s=!1,o=et(e,"supsub");if(o?(n=o.sup,i=o.sub,r=Qe(o.base,"operatorname"),s=!0):r=Qe(e,"operatorname"),r.body.length>0){for(var l=r.body.map((function(e){var t=e.text;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e})),c=_t(l,t.withFont("mathrm"),!0),u=0;u<c.length;u++){var d=c[u];d instanceof N&&(d.text=d.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}a=Je.makeSpan(["mop"],c,t)}else a=Je.makeSpan(["mop"],[],t);return s?ti(a,n,i,t,t.style,0,0):a};function li(e,t,n){for(var i=_t(e,t,!1),r=t.sizeMultiplier/n.sizeMultiplier,a=0;a<i.length;a++){var s=i[a].classes.indexOf("sizing");s<0?Array.prototype.push.apply(i[a].classes,t.sizingClasses(n)):i[a].classes[s+1]==="reset-size"+t.size&&(i[a].classes[s+1]="reset-size"+n.size),i[a].height*=r,i[a].depth*=r}return Je.makeFragment(i)}ht({type:"operatorname",names:["\\operatorname","\\operatorname*"],props:{numArgs:1},handler:function(e,t){var n=e.parser,i=e.funcName,r=t[0];return{type:"operatorname",mode:n.mode,body:ft(r),alwaysHandleSupSub:"\\operatorname*"===i,limits:!1,parentIsSupSub:!1}},htmlBuilder:oi,mathmlBuilder:function(e,t){for(var n=Nt(e.body,t.withFont("mathrm")),i=!0,r=0;r<n.length;r++){var a=n[r];if(a instanceof It.SpaceNode);else if(a instanceof It.MathNode)switch(a.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":var s=a.children[0];1===a.children.length&&s instanceof It.TextNode?s.text=s.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):i=!1;break;default:i=!1}else i=!1}if(i){var o=n.map((function(e){return e.toText()})).join("");n=[new It.TextNode(o)]}var l=new It.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new It.MathNode("mo",[Rt("","text")]);return e.parentIsSupSub?new It.MathNode("mo",[l,c]):It.newDocumentFragment([l,c])}}),pt({type:"ordgroup",htmlBuilder:function(e,t){return e.semisimple?Je.makeFragment(_t(e.body,t,!1)):Je.makeSpan(["mord"],_t(e.body,t,!0),t)},mathmlBuilder:function(e,t){return Bt(e.body,t,!0)}}),ht({type:"overline",names:["\\overline"],props:{numArgs:1},handler:function(e,t){var n=e.parser,i=t[0];return{type:"overline",mode:n.mode,body:i}},htmlBuilder:function(e,t){var n=Ct(e.body,t.havingCrampedStyle()),i=Je.makeLineSpan("overline-line",t),r=t.fontMetrics().defaultRuleThickness,a=Je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*r},{type:"elem",elem:i},{type:"kern",size:r}]},t);return Je.makeSpan(["mord","overline"],[a],t)},mathmlBuilder:function(e,t){var n=new It.MathNode("mo",[new It.TextNode("‾")]);n.setAttribute("stretchy","true");var i=new It.MathNode("mover",[$t(e.body,t),n]);return i.setAttribute("accent","true"),i}}),ht({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){var n=e.parser,i=t[0];return{type:"phantom",mode:n.mode,body:ft(i)}},htmlBuilder:function(e,t){var n=_t(e.body,t.withPhantom(),!1);return Je.makeFragment(n)},mathmlBuilder:function(e,t){var n=Nt(e.body,t);return new It.MathNode("mphantom",n)}}),ht({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){var n=e.parser,i=t[0];return{type:"hphantom",mode:n.mode,body:i}},htmlBuilder:function(e,t){var n=Je.makeSpan([],[Ct(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var i=0;i<n.children.length;i++)n.children[i].height=0,n.children[i].depth=0;return n=Je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t),Je.makeSpan(["mord"],[n],t)},mathmlBuilder:function(e,t){var n=Nt(ft(e.body),t),i=new It.MathNode("mphantom",n),r=new It.MathNode("mpadded",[i]);return r.setAttribute("height","0px"),r.setAttribute("depth","0px"),r}}),ht({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){var n=e.parser,i=t[0];return{type:"vphantom",mode:n.mode,body:i}},htmlBuilder:function(e,t){var n=Je.makeSpan(["inner"],[Ct(e.body,t.withPhantom())]),i=Je.makeSpan(["fix"],[]);return Je.makeSpan(["mord","rlap"],[n,i],t)},mathmlBuilder:function(e,t){var n=Nt(ft(e.body),t),i=new It.MathNode("mphantom",n),r=new It.MathNode("mpadded",[i]);return r.setAttribute("width","0px"),r}}),ht({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler:function(e,t){var n=e.parser,i=Qe(t[0],"size").value,r=t[1];return{type:"raisebox",mode:n.mode,dy:i,body:r}},htmlBuilder:function(e,t){var n=Ct(e.body,t),i=ze(e.dy,t);return Je.makeVList({positionType:"shift",positionData:-i,children:[{type:"elem",elem:n}]},t)},mathmlBuilder:function(e,t){var n=new It.MathNode("mpadded",[$t(e.body,t)]),i=e.dy.number+e.dy.unit;return n.setAttribute("voffset",i),n}}),ht({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler:function(e,t,n){var i=e.parser,r=n[0],a=Qe(t[0],"size"),s=Qe(t[1],"size");return{type:"rule",mode:i.mode,shift:r&&Qe(r,"size").value,width:a.value,height:s.value}},htmlBuilder:function(e,t){var n=Je.makeSpan(["mord","rule"],[],t),i=ze(e.width,t),r=ze(e.height,t),a=e.shift?ze(e.shift,t):0;return n.style.borderRightWidth=i+"em",n.style.borderTopWidth=r+"em",n.style.bottom=a+"em",n.width=i,n.height=r+a,n.depth=-a,n.maxFontSize=1.125*r*t.sizeMultiplier,n},mathmlBuilder:function(e,t){var n=ze(e.width,t),i=ze(e.height,t),r=e.shift?ze(e.shift,t):0,a=t.color&&t.getColor()||"black",s=new It.MathNode("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",n+"em"),s.setAttribute("height",i+"em");var o=new It.MathNode("mpadded",[s]);return r>=0?o.setAttribute("height","+"+r+"em"):(o.setAttribute("height",r+"em"),o.setAttribute("depth","+"+-r+"em")),o.setAttribute("voffset",r+"em"),o}});var ci=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];ht({type:"sizing",names:ci,props:{numArgs:0,allowedInText:!0},handler:function(e,t){var n=e.breakOnTokenText,i=e.funcName,r=e.parser,a=r.parseExpression(!1,n);return{type:"sizing",mode:r.mode,size:ci.indexOf(i)+1,body:a}},htmlBuilder:function(e,t){var n=t.havingSize(e.size);return li(e.body,n,t)},mathmlBuilder:function(e,t){var n=t.havingSize(e.size),i=Nt(e.body,n),r=new It.MathNode("mstyle",i);return r.setAttribute("mathsize",n.sizeMultiplier+"em"),r}}),ht({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:function(e,t,n){var i=e.parser,r=!1,a=!1,s=n[0]&&Qe(n[0],"ordgroup");if(s)for(var o="",l=0;l<s.body.length;++l)if("t"===(o=s.body[l].text))r=!0;else{if("b"!==o){r=!1,a=!1;break}a=!0}else r=!0,a=!0;var c=t[0];return{type:"smash",mode:i.mode,body:c,smashHeight:r,smashDepth:a}},htmlBuilder:function(e,t){var n=Je.makeSpan([],[Ct(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var i=0;i<n.children.length;i++)n.children[i].height=0;if(e.smashDepth&&(n.depth=0,n.children))for(var r=0;r<n.children.length;r++)n.children[r].depth=0;var a=Je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t);return Je.makeSpan(["mord"],[a],t)},mathmlBuilder:function(e,t){var n=new It.MathNode("mpadded",[$t(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),ht({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler:function(e,t,n){var i=e.parser,r=n[0],a=t[0];return{type:"sqrt",mode:i.mode,body:a,index:r}},htmlBuilder:function(e,t){var n=Ct(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=Je.wrapFragment(n,t);var i=t.fontMetrics().defaultRuleThickness,r=i;t.style.id<w.TEXT.id&&(r=t.fontMetrics().xHeight);var a=i+r/4,s=n.height+n.depth+a+i,o=_n(s,t),l=o.span,c=o.ruleWidth,u=o.advanceWidth,d=l.height-c;d>n.height+n.depth+a&&(a=(a+d-n.height-n.depth)/2);var h=l.height-n.height-a-c;n.style.paddingLeft=u+"em";var p=Je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+h)},{type:"elem",elem:l},{type:"kern",size:c}]},t);if(e.index){var f=t.havingStyle(w.SCRIPTSCRIPT),m=Ct(e.index,f,t),g=.6*(p.height-p.depth),v=Je.makeVList({positionType:"shift",positionData:-g,children:[{type:"elem",elem:m}]},t),b=Je.makeSpan(["root"],[v]);return Je.makeSpan(["mord","sqrt"],[b,p],t)}return Je.makeSpan(["mord","sqrt"],[p],t)},mathmlBuilder:function(e,t){var n=e.body,i=e.index;return i?new It.MathNode("mroot",[$t(n,t),$t(i,t)]):new It.MathNode("msqrt",[$t(n,t)])}});var ui={display:w.DISPLAY,text:w.TEXT,script:w.SCRIPT,scriptscript:w.SCRIPTSCRIPT};ht({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0},handler:function(e,t){var n=e.breakOnTokenText,i=e.funcName,r=e.parser,a=r.parseExpression(!0,n),s=i.slice(1,i.length-5);return{type:"styling",mode:r.mode,style:s,body:a}},htmlBuilder:function(e,t){var n=ui[e.style],i=t.havingStyle(n).withFont("");return li(e.body,i,t)},mathmlBuilder:function(e,t){var n=ui[e.style],i=t.havingStyle(n),r=Nt(e.body,i),a=new It.MathNode("mstyle",r),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return a.setAttribute("scriptlevel",s[0]),a.setAttribute("displaystyle",s[1]),a}}),pt({type:"supsub",htmlBuilder:function(e,t){var n=function(e,t){var n=e.base;return n?"op"===n.type?n.limits&&(t.style.size===w.DISPLAY.size||n.alwaysHandleSupSub)?ii:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(t.style.size===w.DISPLAY.size||n.limits)?oi:null:"accent"===n.type?d.isCharacterBox(n.base)?Zt:null:"horizBrace"===n.type&&!e.sub===n.isOver?Jn:null:null}(e,t);if(n)return n(e,t);var i,r,a,s=e.base,o=e.sup,l=e.sub,c=Ct(s,t),u=t.fontMetrics(),h=0,p=0,f=s&&d.isCharacterBox(s);if(o){var m=t.havingStyle(t.style.sup());i=Ct(o,m,t),f||(h=c.height-m.fontMetrics().supDrop*m.sizeMultiplier/t.sizeMultiplier)}if(l){var g=t.havingStyle(t.style.sub());r=Ct(l,g,t),f||(p=c.depth+g.fontMetrics().subDrop*g.sizeMultiplier/t.sizeMultiplier)}a=t.style===w.DISPLAY?u.sup1:t.style.cramped?u.sup3:u.sup2;var v,b=t.sizeMultiplier,y=.5/u.ptPerEm/b+"em",_=null;if(r){var x=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof N||x)&&(_=-c.italic+"em")}if(i&&r){h=Math.max(h,a,i.depth+.25*u.xHeight),p=Math.max(p,u.sub2);var k=4*u.defaultRuleThickness;if(h-i.depth-(r.height-p)<k){p=k-(h-i.depth)+r.height;var S=.8*u.xHeight-(h-i.depth);S>0&&(h+=S,p-=S)}var E=[{type:"elem",elem:r,shift:p,marginRight:y,marginLeft:_},{type:"elem",elem:i,shift:-h,marginRight:y}];v=Je.makeVList({positionType:"individualShift",children:E},t)}else if(r){p=Math.max(p,u.sub1,r.height-.8*u.xHeight);var C=[{type:"elem",elem:r,marginLeft:_,marginRight:y}];v=Je.makeVList({positionType:"shift",positionData:p,children:C},t)}else{if(!i)throw new Error("supsub must have either sup or sub.");h=Math.max(h,a,i.depth+.25*u.xHeight),v=Je.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:i,marginRight:y}]},t)}var T=St(c,"right")||"mord";return Je.makeSpan([T],[c,Je.makeSpan(["msupsub"],[v])],t)},mathmlBuilder:function(e,t){var n,i=!1,r=et(e.base,"horizBrace");r&&!!e.sup===r.isOver&&(i=!0,n=r.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var a,s=[$t(e.base,t)];if(e.sub&&s.push($t(e.sub,t)),e.sup&&s.push($t(e.sup,t)),i)a=n?"mover":"munder";else if(e.sub)if(e.sup){var o=e.base;a=o&&"op"===o.type&&o.limits&&t.style===w.DISPLAY||o&&"operatorname"===o.type&&o.alwaysHandleSupSub&&(t.style===w.DISPLAY||o.limits)?"munderover":"msubsup"}else{var l=e.base;a=l&&"op"===l.type&&l.limits&&(t.style===w.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===w.DISPLAY)?"munder":"msub"}else{var c=e.base;a=c&&"op"===c.type&&c.limits&&(t.style===w.DISPLAY||c.alwaysHandleSupSub)||c&&"operatorname"===c.type&&c.alwaysHandleSupSub&&(c.limits||t.style===w.DISPLAY)?"mover":"msup"}return new It.MathNode(a,s)}}),pt({type:"atom",htmlBuilder:function(e,t){return Je.mathsym(e.text,e.mode,t,["m"+e.family])},mathmlBuilder:function(e,t){var n=new It.MathNode("mo",[Rt(e.text,e.mode)]);if("bin"===e.family){var i=Ot(e,t);"bold-italic"===i&&n.setAttribute("mathvariant",i)}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var di={mi:"italic",mn:"normal",mtext:"normal"};pt({type:"mathord",htmlBuilder:function(e,t){return Je.makeOrd(e,t,"mathord")},mathmlBuilder:function(e,t){var n=new It.MathNode("mi",[Rt(e.text,e.mode,t)]),i=Ot(e,t)||"italic";return i!==di[n.type]&&n.setAttribute("mathvariant",i),n}}),pt({type:"textord",htmlBuilder:function(e,t){return Je.makeOrd(e,t,"textord")},mathmlBuilder:function(e,t){var n,i=Rt(e.text,e.mode,t),r=Ot(e,t)||"normal";return n="text"===e.mode?new It.MathNode("mtext",[i]):/[0-9]/.test(e.text)?new It.MathNode("mn",[i]):"\\prime"===e.text?new It.MathNode("mo",[i]):new It.MathNode("mi",[i]),r!==di[n.type]&&n.setAttribute("mathvariant",r),n}});var hi={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},pi={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};pt({type:"spacing",htmlBuilder:function(e,t){if(pi.hasOwnProperty(e.text)){var n=pi[e.text].className||"";if("text"===e.mode){var i=Je.makeOrd(e,t,"textord");return i.classes.push(n),i}return Je.makeSpan(["mspace",n],[Je.mathsym(e.text,e.mode,t)],t)}if(hi.hasOwnProperty(e.text))return Je.makeSpan(["mspace",hi[e.text]],[],t);throw new s('Unknown type of space "'+e.text+'"')},mathmlBuilder:function(e,t){if(!pi.hasOwnProperty(e.text)){if(hi.hasOwnProperty(e.text))return new It.MathNode("mspace");throw new s('Unknown type of space "'+e.text+'"')}return new It.MathNode("mtext",[new It.TextNode(" ")])}});var fi=function(){var e=new It.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};pt({type:"tag",mathmlBuilder:function(e,t){var n=new It.MathNode("mtable",[new It.MathNode("mtr",[fi(),new It.MathNode("mtd",[Bt(e.body,t)]),fi(),new It.MathNode("mtd",[Bt(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var mi={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},gi={"\\textbf":"textbf","\\textmd":"textmd"},vi={"\\textit":"textit","\\textup":"textup"},bi=function(e,t){var n=e.font;return n?mi[n]?t.withTextFontFamily(mi[n]):gi[n]?t.withTextFontWeight(gi[n]):t.withTextFontShape(vi[n]):t};ht({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],greediness:2,allowedInText:!0},handler:function(e,t){var n=e.parser,i=e.funcName,r=t[0];return{type:"text",mode:n.mode,body:ft(r),font:i}},htmlBuilder:function(e,t){var n=bi(e,t),i=_t(e.body,n,!0);return Je.makeSpan(["mord","text"],Je.tryCombineChars(i),n)},mathmlBuilder:function(e,t){var n=bi(e,t);return Bt(e.body,n)}}),ht({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){return{type:"underline",mode:e.parser.mode,body:t[0]}},htmlBuilder:function(e,t){var n=Ct(e.body,t),i=Je.makeLineSpan("underline-line",t),r=t.fontMetrics().defaultRuleThickness,a=Je.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:r},{type:"elem",elem:i},{type:"kern",size:3*r},{type:"elem",elem:n}]},t);return Je.makeSpan(["mord","underline"],[a],t)},mathmlBuilder:function(e,t){var n=new It.MathNode("mo",[new It.TextNode("‾")]);n.setAttribute("stretchy","true");var i=new It.MathNode("munder",[$t(e.body,t),n]);return i.setAttribute("accentunder","true"),i}}),ht({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler:function(e,t,n){throw new s("\\verb ended by end of line instead of matching delimiter")},htmlBuilder:function(e,t){for(var n=yi(e),i=[],r=t.havingStyle(t.style.text()),a=0;a<n.length;a++){var s=n[a];"~"===s&&(s="\\textasciitilde"),i.push(Je.makeSymbol(s,"Typewriter-Regular",e.mode,r,["mord","texttt"]))}return Je.makeSpan(["mord","text"].concat(r.sizingClasses(t)),Je.tryCombineChars(i),r)},mathmlBuilder:function(e,t){var n=new It.TextNode(yi(e)),i=new It.MathNode("mtext",[n]);return i.setAttribute("mathvariant","monospace"),i}});var yi=function(e){return e.body.replace(/ /g,e.star?"␣":" ")},_i=ct,wi="[ \r\n\t]",xi="\\\\[a-zA-Z@]+",ki=""+xi+wi+"*",Si=new RegExp("^("+xi+")"+wi+"*$"),Ei="[̀-ͯ]",Ci=new RegExp(Ei+"+$"),Ti="("+wi+"+)|([!-\\[\\]-‧-豈-]"+Ei+"*|[\ud800-\udbff][\udc00-\udfff]"+Ei+"*|\\\\verb\\*([^]).*?\\3|\\\\verb([^*a-zA-Z]).*?\\4|\\\\operatorname\\*|"+ki+"|\\\\[^\ud800-\udfff])",Ai=function(){function e(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(Ti,"g"),this.catcodes={"%":14}}var t=e.prototype;return t.setCatcode=function(e,t){this.catcodes[e]=t},t.lex=function(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new r("EOF",new i(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new s("Unexpected character: '"+e[t]+"'",new r(e[t],new i(this,t,t+1)));var a=n[2]||" ";if(14===this.catcodes[a]){var o=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===o?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=o+1,this.lex()}var l=a.match(Si);return l&&(a=l[1]),new r(a,new i(this,t,this.tokenRegex.lastIndex))},e}(),Mi=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}var t=e.prototype;return t.beginGroup=function(){this.undefStack.push({})},t.endGroup=function(){if(0===this.undefStack.length)throw new s("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(void 0===e[t]?delete this.current[t]:this.current[t]=e[t])},t.has=function(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)},t.get=function(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]},t.set=function(e,t,n){if(void 0===n&&(n=!1),n){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var r=this.undefStack[this.undefStack.length-1];r&&!r.hasOwnProperty(e)&&(r[e]=this.current[e])}this.current[e]=t},e}(),Li={},Di=Li;function Ii(e,t){Li[e]=t}Ii("\\@firstoftwo",(function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}})),Ii("\\@secondoftwo",(function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}})),Ii("\\@ifnextchar",(function(e){var t=e.consumeArgs(3),n=e.future();return 1===t[0].length&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}})),Ii("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),Ii("\\TextOrMath",(function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}}));var Ri={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Ii("\\char",(function(e){var t,n=e.popToken(),i="";if("'"===n.text)t=8,n=e.popToken();else if('"'===n.text)t=16,n=e.popToken();else if("`"===n.text)if("\\"===(n=e.popToken()).text[0])i=n.text.charCodeAt(1);else{if("EOF"===n.text)throw new s("\\char` missing argument");i=n.text.charCodeAt(0)}else t=10;if(t){if(null==(i=Ri[n.text])||i>=t)throw new s("Invalid base-"+t+" digit "+n.text);for(var r;null!=(r=Ri[e.future().text])&&r<t;)i*=t,i+=r,e.popToken()}return"\\@char{"+i+"}"}));var Pi=function(e,t){var n=e.consumeArgs(1)[0];if(1!==n.length)throw new s("\\gdef's first argument must be a macro name");var i=n[0].text,r=0;for(n=e.consumeArgs(1)[0];1===n.length&&"#"===n[0].text;){if(1!==(n=e.consumeArgs(1)[0]).length)throw new s('Invalid argument number length "'+n.length+'"');if(!/^[1-9]$/.test(n[0].text))throw new s('Invalid argument number "'+n[0].text+'"');if(r++,parseInt(n[0].text)!==r)throw new s('Argument number "'+n[0].text+'" out of order');n=e.consumeArgs(1)[0]}return e.macros.set(i,{tokens:n,numArgs:r},t),""};Ii("\\gdef",(function(e){return Pi(e,!0)})),Ii("\\def",(function(e){return Pi(e,!1)})),Ii("\\global",(function(e){var t=e.consumeArgs(1)[0];if(1!==t.length)throw new s("Invalid command after \\global");var n=t[0].text;if("\\def"===n)return Pi(e,!0);throw new s("Invalid command '"+n+"' after \\global")}));var Oi=function(e,t,n){var i=e.consumeArgs(1)[0];if(1!==i.length)throw new s("\\newcommand's first argument must be a macro name");var r=i[0].text,a=e.isDefined(r);if(a&&!t)throw new s("\\newcommand{"+r+"} attempting to redefine "+r+"; use \\renewcommand");if(!a&&!n)throw new s("\\renewcommand{"+r+"} when command "+r+" does not yet exist; use \\newcommand");var o=0;if(1===(i=e.consumeArgs(1)[0]).length&&"["===i[0].text){for(var l="",c=e.expandNextToken();"]"!==c.text&&"EOF"!==c.text;)l+=c.text,c=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new s("Invalid number of arguments: "+l);o=parseInt(l),i=e.consumeArgs(1)[0]}return e.macros.set(r,{tokens:i,numArgs:o}),""};Ii("\\newcommand",(function(e){return Oi(e,!1,!0)})),Ii("\\renewcommand",(function(e){return Oi(e,!0,!1)})),Ii("\\providecommand",(function(e){return Oi(e,!0,!0)})),Ii("\\bgroup","{"),Ii("\\egroup","}"),Ii("\\lq","`"),Ii("\\rq","'"),Ii("\\aa","\\r a"),Ii("\\AA","\\r A"),Ii("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),Ii("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),Ii("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),Ii("ℬ","\\mathscr{B}"),Ii("ℰ","\\mathscr{E}"),Ii("ℱ","\\mathscr{F}"),Ii("ℋ","\\mathscr{H}"),Ii("ℐ","\\mathscr{I}"),Ii("ℒ","\\mathscr{L}"),Ii("ℳ","\\mathscr{M}"),Ii("ℛ","\\mathscr{R}"),Ii("ℭ","\\mathfrak{C}"),Ii("ℌ","\\mathfrak{H}"),Ii("ℨ","\\mathfrak{Z}"),Ii("\\Bbbk","\\Bbb{k}"),Ii("·","\\cdotp"),Ii("\\llap","\\mathllap{\\textrm{#1}}"),Ii("\\rlap","\\mathrlap{\\textrm{#1}}"),Ii("\\clap","\\mathclap{\\textrm{#1}}"),Ii("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),Ii("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),Ii("\\ne","\\neq"),Ii("≠","\\neq"),Ii("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),Ii("∉","\\notin"),Ii("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),Ii("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),Ii("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),Ii("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),Ii("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),Ii("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),Ii("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),Ii("⟂","\\perp"),Ii("‼","\\mathclose{!\\mkern-0.8mu!}"),Ii("∌","\\notni"),Ii("⌜","\\ulcorner"),Ii("⌝","\\urcorner"),Ii("⌞","\\llcorner"),Ii("⌟","\\lrcorner"),Ii("©","\\copyright"),Ii("®","\\textregistered"),Ii("️","\\textregistered"),Ii("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),Ii("⋮","\\vdots"),Ii("\\varGamma","\\mathit{\\Gamma}"),Ii("\\varDelta","\\mathit{\\Delta}"),Ii("\\varTheta","\\mathit{\\Theta}"),Ii("\\varLambda","\\mathit{\\Lambda}"),Ii("\\varXi","\\mathit{\\Xi}"),Ii("\\varPi","\\mathit{\\Pi}"),Ii("\\varSigma","\\mathit{\\Sigma}"),Ii("\\varUpsilon","\\mathit{\\Upsilon}"),Ii("\\varPhi","\\mathit{\\Phi}"),Ii("\\varPsi","\\mathit{\\Psi}"),Ii("\\varOmega","\\mathit{\\Omega}"),Ii("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),Ii("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu"),Ii("\\boxed","\\fbox{$\\displaystyle{#1}$}"),Ii("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),Ii("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),Ii("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var Ni={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};Ii("\\dots",(function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in Ni?t=Ni[n]:("\\not"===n.substr(0,4)||n in W.math&&d.contains(["bin","rel"],W.math[n].group))&&(t="\\dotsb"),t}));var Bi={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Ii("\\dotso",(function(e){return e.future().text in Bi?"\\ldots\\,":"\\ldots"})),Ii("\\dotsc",(function(e){var t=e.future().text;return t in Bi&&","!==t?"\\ldots\\,":"\\ldots"})),Ii("\\cdots",(function(e){return e.future().text in Bi?"\\@cdots\\,":"\\@cdots"})),Ii("\\dotsb","\\cdots"),Ii("\\dotsm","\\cdots"),Ii("\\dotsi","\\!\\cdots"),Ii("\\dotsx","\\ldots\\,"),Ii("\\DOTSI","\\relax"),Ii("\\DOTSB","\\relax"),Ii("\\DOTSX","\\relax"),Ii("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),Ii("\\,","\\tmspace+{3mu}{.1667em}"),Ii("\\thinspace","\\,"),Ii("\\>","\\mskip{4mu}"),Ii("\\:","\\tmspace+{4mu}{.2222em}"),Ii("\\medspace","\\:"),Ii("\\;","\\tmspace+{5mu}{.2777em}"),Ii("\\thickspace","\\;"),Ii("\\!","\\tmspace-{3mu}{.1667em}"),Ii("\\negthinspace","\\!"),Ii("\\negmedspace","\\tmspace-{4mu}{.2222em}"),Ii("\\negthickspace","\\tmspace-{5mu}{.277em}"),Ii("\\enspace","\\kern.5em "),Ii("\\enskip","\\hskip.5em\\relax"),Ii("\\quad","\\hskip1em\\relax"),Ii("\\qquad","\\hskip2em\\relax"),Ii("\\tag","\\@ifstar\\tag@literal\\tag@paren"),Ii("\\tag@paren","\\tag@literal{({#1})}"),Ii("\\tag@literal",(function(e){if(e.macros.get("\\df@tag"))throw new s("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"})),Ii("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),Ii("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),Ii("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),Ii("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),Ii("\\pmb","\\html@mathml{\\@binrel{#1}{\\mathrlap{#1}\\kern0.5px#1}}{\\mathbf{#1}}"),Ii("\\\\","\\newline"),Ii("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var $i=K["Main-Regular"]["T".charCodeAt(0)][1]-.7*K["Main-Regular"]["A".charCodeAt(0)][1]+"em";Ii("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+$i+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),Ii("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+$i+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),Ii("\\hspace","\\@ifstar\\@hspacer\\@hspace"),Ii("\\@hspace","\\hskip #1\\relax"),Ii("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),Ii("\\ordinarycolon",":"),Ii("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),Ii("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),Ii("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),Ii("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),Ii("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),Ii("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),Ii("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),Ii("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),Ii("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),Ii("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),Ii("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),Ii("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),Ii("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),Ii("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),Ii("∷","\\dblcolon"),Ii("∹","\\eqcolon"),Ii("≔","\\coloneqq"),Ii("≕","\\eqqcolon"),Ii("⩴","\\Coloneqq"),Ii("\\ratio","\\vcentcolon"),Ii("\\coloncolon","\\dblcolon"),Ii("\\colonequals","\\coloneqq"),Ii("\\coloncolonequals","\\Coloneqq"),Ii("\\equalscolon","\\eqqcolon"),Ii("\\equalscoloncolon","\\Eqqcolon"),Ii("\\colonminus","\\coloneq"),Ii("\\coloncolonminus","\\Coloneq"),Ii("\\minuscolon","\\eqcolon"),Ii("\\minuscoloncolon","\\Eqcolon"),Ii("\\coloncolonapprox","\\Colonapprox"),Ii("\\coloncolonsim","\\Colonsim"),Ii("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Ii("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Ii("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Ii("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Ii("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),Ii("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),Ii("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),Ii("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),Ii("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),Ii("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),Ii("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),Ii("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),Ii("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),Ii("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),Ii("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),Ii("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),Ii("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),Ii("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),Ii("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),Ii("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),Ii("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),Ii("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),Ii("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),Ii("⟦","\\llbracket"),Ii("⟧","\\rrbracket"),Ii("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),Ii("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),Ii("⦃","\\lBrace"),Ii("⦄","\\rBrace"),Ii("\\darr","\\downarrow"),Ii("\\dArr","\\Downarrow"),Ii("\\Darr","\\Downarrow"),Ii("\\lang","\\langle"),Ii("\\rang","\\rangle"),Ii("\\uarr","\\uparrow"),Ii("\\uArr","\\Uparrow"),Ii("\\Uarr","\\Uparrow"),Ii("\\N","\\mathbb{N}"),Ii("\\R","\\mathbb{R}"),Ii("\\Z","\\mathbb{Z}"),Ii("\\alef","\\aleph"),Ii("\\alefsym","\\aleph"),Ii("\\Alpha","\\mathrm{A}"),Ii("\\Beta","\\mathrm{B}"),Ii("\\bull","\\bullet"),Ii("\\Chi","\\mathrm{X}"),Ii("\\clubs","\\clubsuit"),Ii("\\cnums","\\mathbb{C}"),Ii("\\Complex","\\mathbb{C}"),Ii("\\Dagger","\\ddagger"),Ii("\\diamonds","\\diamondsuit"),Ii("\\empty","\\emptyset"),Ii("\\Epsilon","\\mathrm{E}"),Ii("\\Eta","\\mathrm{H}"),Ii("\\exist","\\exists"),Ii("\\harr","\\leftrightarrow"),Ii("\\hArr","\\Leftrightarrow"),Ii("\\Harr","\\Leftrightarrow"),Ii("\\hearts","\\heartsuit"),Ii("\\image","\\Im"),Ii("\\infin","\\infty"),Ii("\\Iota","\\mathrm{I}"),Ii("\\isin","\\in"),Ii("\\Kappa","\\mathrm{K}"),Ii("\\larr","\\leftarrow"),Ii("\\lArr","\\Leftarrow"),Ii("\\Larr","\\Leftarrow"),Ii("\\lrarr","\\leftrightarrow"),Ii("\\lrArr","\\Leftrightarrow"),Ii("\\Lrarr","\\Leftrightarrow"),Ii("\\Mu","\\mathrm{M}"),Ii("\\natnums","\\mathbb{N}"),Ii("\\Nu","\\mathrm{N}"),Ii("\\Omicron","\\mathrm{O}"),Ii("\\plusmn","\\pm"),Ii("\\rarr","\\rightarrow"),Ii("\\rArr","\\Rightarrow"),Ii("\\Rarr","\\Rightarrow"),Ii("\\real","\\Re"),Ii("\\reals","\\mathbb{R}"),Ii("\\Reals","\\mathbb{R}"),Ii("\\Rho","\\mathrm{P}"),Ii("\\sdot","\\cdot"),Ii("\\sect","\\S"),Ii("\\spades","\\spadesuit"),Ii("\\sub","\\subset"),Ii("\\sube","\\subseteq"),Ii("\\supe","\\supseteq"),Ii("\\Tau","\\mathrm{T}"),Ii("\\thetasym","\\vartheta"),Ii("\\weierp","\\wp"),Ii("\\Zeta","\\mathrm{Z}"),Ii("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),Ii("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),Ii("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),Ii("\\blue","\\textcolor{##6495ed}{#1}"),Ii("\\orange","\\textcolor{##ffa500}{#1}"),Ii("\\pink","\\textcolor{##ff00af}{#1}"),Ii("\\red","\\textcolor{##df0030}{#1}"),Ii("\\green","\\textcolor{##28ae7b}{#1}"),Ii("\\gray","\\textcolor{gray}{#1}"),Ii("\\purple","\\textcolor{##9d38bd}{#1}"),Ii("\\blueA","\\textcolor{##ccfaff}{#1}"),Ii("\\blueB","\\textcolor{##80f6ff}{#1}"),Ii("\\blueC","\\textcolor{##63d9ea}{#1}"),Ii("\\blueD","\\textcolor{##11accd}{#1}"),Ii("\\blueE","\\textcolor{##0c7f99}{#1}"),Ii("\\tealA","\\textcolor{##94fff5}{#1}"),Ii("\\tealB","\\textcolor{##26edd5}{#1}"),Ii("\\tealC","\\textcolor{##01d1c1}{#1}"),Ii("\\tealD","\\textcolor{##01a995}{#1}"),Ii("\\tealE","\\textcolor{##208170}{#1}"),Ii("\\greenA","\\textcolor{##b6ffb0}{#1}"),Ii("\\greenB","\\textcolor{##8af281}{#1}"),Ii("\\greenC","\\textcolor{##74cf70}{#1}"),Ii("\\greenD","\\textcolor{##1fab54}{#1}"),Ii("\\greenE","\\textcolor{##0d923f}{#1}"),Ii("\\goldA","\\textcolor{##ffd0a9}{#1}"),Ii("\\goldB","\\textcolor{##ffbb71}{#1}"),Ii("\\goldC","\\textcolor{##ff9c39}{#1}"),Ii("\\goldD","\\textcolor{##e07d10}{#1}"),Ii("\\goldE","\\textcolor{##a75a05}{#1}"),Ii("\\redA","\\textcolor{##fca9a9}{#1}"),Ii("\\redB","\\textcolor{##ff8482}{#1}"),Ii("\\redC","\\textcolor{##f9685d}{#1}"),Ii("\\redD","\\textcolor{##e84d39}{#1}"),Ii("\\redE","\\textcolor{##bc2612}{#1}"),Ii("\\maroonA","\\textcolor{##ffbde0}{#1}"),Ii("\\maroonB","\\textcolor{##ff92c6}{#1}"),Ii("\\maroonC","\\textcolor{##ed5fa6}{#1}"),Ii("\\maroonD","\\textcolor{##ca337c}{#1}"),Ii("\\maroonE","\\textcolor{##9e034e}{#1}"),Ii("\\purpleA","\\textcolor{##ddd7ff}{#1}"),Ii("\\purpleB","\\textcolor{##c6b9fc}{#1}"),Ii("\\purpleC","\\textcolor{##aa87ff}{#1}"),Ii("\\purpleD","\\textcolor{##7854ab}{#1}"),Ii("\\purpleE","\\textcolor{##543b78}{#1}"),Ii("\\mintA","\\textcolor{##f5f9e8}{#1}"),Ii("\\mintB","\\textcolor{##edf2df}{#1}"),Ii("\\mintC","\\textcolor{##e0e5cc}{#1}"),Ii("\\grayA","\\textcolor{##f6f7f7}{#1}"),Ii("\\grayB","\\textcolor{##f0f1f2}{#1}"),Ii("\\grayC","\\textcolor{##e3e5e6}{#1}"),Ii("\\grayD","\\textcolor{##d6d8da}{#1}"),Ii("\\grayE","\\textcolor{##babec2}{#1}"),Ii("\\grayF","\\textcolor{##888d93}{#1}"),Ii("\\grayG","\\textcolor{##626569}{#1}"),Ii("\\grayH","\\textcolor{##3b3e40}{#1}"),Ii("\\grayI","\\textcolor{##21242c}{#1}"),Ii("\\kaBlue","\\textcolor{##314453}{#1}"),Ii("\\kaGreen","\\textcolor{##71B307}{#1}");var Fi={"\\relax":!0,"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},zi=function(){function e(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new Mi(Di,t.macros),this.mode=n,this.stack=[]}var t=e.prototype;return t.feed=function(e){this.lexer=new Ai(e,this.settings)},t.switchMode=function(e){this.mode=e},t.beginGroup=function(){this.macros.beginGroup()},t.endGroup=function(){this.macros.endGroup()},t.future=function(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]},t.popToken=function(){return this.future(),this.stack.pop()},t.pushToken=function(e){this.stack.push(e)},t.pushTokens=function(e){var t;(t=this.stack).push.apply(t,e)},t.consumeSpaces=function(){for(;" "===this.future().text;)this.stack.pop()},t.consumeArgs=function(e){for(var t=[],n=0;n<e;++n){this.consumeSpaces();var i=this.popToken();if("{"===i.text){for(var r=[],a=1;0!==a;){var o=this.popToken();if(r.push(o),"{"===o.text)++a;else if("}"===o.text)--a;else if("EOF"===o.text)throw new s("End of input in macro argument",i)}r.pop(),r.reverse(),t[n]=r}else{if("EOF"===i.text)throw new s("End of input expecting macro argument");t[n]=[i]}}return t},t.expandOnce=function(){var e=this.popToken(),t=e.text,n=this._getExpansion(t);if(null==n)return this.pushToken(e),e;if(this.expansionCount++,this.expansionCount>this.settings.maxExpand)throw new s("Too many expansions: infinite loop or need to increase maxExpand setting");var i=n.tokens;if(n.numArgs)for(var r=this.consumeArgs(n.numArgs),a=(i=i.slice()).length-1;a>=0;--a){var o=i[a];if("#"===o.text){if(0===a)throw new s("Incomplete placeholder at end of macro body",o);if("#"===(o=i[--a]).text)i.splice(a+1,1);else{if(!/^[1-9]$/.test(o.text))throw new s("Not a valid argument number",o);var l;(l=i).splice.apply(l,[a,2].concat(r[+o.text-1]))}}}return this.pushTokens(i),i},t.expandAfterFuture=function(){return this.expandOnce(),this.future()},t.expandNextToken=function(){for(;;){var e=this.expandOnce();if(e instanceof r){if("\\relax"!==e.text)return this.stack.pop();this.stack.pop()}}throw new Error},t.expandMacro=function(e){if(this.macros.get(e)){var t=[],n=this.stack.length;for(this.pushToken(new r(e));this.stack.length>n;)this.expandOnce()instanceof r&&t.push(this.stack.pop());return t}},t.expandMacroAsText=function(e){var t=this.expandMacro(e);return t?t.map((function(e){return e.text})).join(""):t},t._getExpansion=function(e){var t=this.macros.get(e);if(null==t)return t;var n="function"==typeof t?t(this):t;if("string"==typeof n){var i=0;if(-1!==n.indexOf("#"))for(var r=n.replace(/##/g,"");-1!==r.indexOf("#"+(i+1));)++i;for(var a=new Ai(n,this.settings),s=[],o=a.lex();"EOF"!==o.text;)s.push(o),o=a.lex();return s.reverse(),{tokens:s,numArgs:i}}return n},t.isDefined=function(e){return this.macros.has(e)||_i.hasOwnProperty(e)||W.math.hasOwnProperty(e)||W.text.hasOwnProperty(e)||Fi.hasOwnProperty(e)},e}(),Ki={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"}},Ui={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","č":"č","ĉ":"ĉ","ċ":"ċ","ď":"ď","ḋ":"ḋ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ě":"ě","ê":"ê","ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ĺ":"ĺ","ľ":"ľ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ","ŏ":"ŏ","ǒ":"ǒ","ô":"ô","ố":"ố","ồ":"ồ","ỗ":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","ṕ":"ṕ","ṗ":"ṗ","ŕ":"ŕ","ř":"ř","ṙ":"ṙ","ś":"ś","ṥ":"ṥ","š":"š","ṧ":"ṧ","ŝ":"ŝ","ṡ":"ṡ","ẗ":"ẗ","ť":"ť","ṫ":"ṫ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","ṹ":"ṹ","ū":"ū","ṻ":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","ṽ":"ṽ","ẃ":"ẃ","ẁ":"ẁ","ẅ":"ẅ","ŵ":"ŵ","ẇ":"ẇ","ẘ":"ẘ","ẍ":"ẍ","ẋ":"ẋ","ý":"ý","ỳ":"ỳ","ÿ":"ÿ","ỹ":"ỹ","ȳ":"ȳ","ŷ":"ŷ","ẏ":"ẏ","ẙ":"ẙ","ź":"ź","ž":"ž","ẑ":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","Ắ":"Ắ","Ằ":"Ằ","Ẵ":"Ẵ","Ǎ":"Ǎ","Â":"Â","Ấ":"Ấ","Ầ":"Ầ","Ẫ":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","Ḃ":"Ḃ","Ć":"Ć","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ď":"Ď","Ḋ":"Ḋ","É":"É","È":"È","Ë":"Ë","Ẽ":"Ẽ","Ē":"Ē","Ḗ":"Ḗ","Ḕ":"Ḕ","Ĕ":"Ĕ","Ě":"Ě","Ê":"Ê","Ế":"Ế","Ề":"Ề","Ễ":"Ễ","Ė":"Ė","Ḟ":"Ḟ","Ǵ":"Ǵ","Ḡ":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","Ḧ":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","Ḣ":"Ḣ","Í":"Í","Ì":"Ì","Ï":"Ï","Ḯ":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","Ḱ":"Ḱ","Ǩ":"Ǩ","Ĺ":"Ĺ","Ľ":"Ľ","Ḿ":"Ḿ","Ṁ":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","Ṅ":"Ṅ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","Ṍ":"Ṍ","Ṏ":"Ṏ","Ȭ":"Ȭ","Ō":"Ō","Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ","Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ť":"Ť","Ṫ":"Ṫ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"},ji=function(){function e(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new zi(e,t,this.mode),this.settings=t,this.leftrightDepth=0}var t=e.prototype;return t.expect=function(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new s("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()},t.consume=function(){this.nextToken=null},t.fetch=function(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken},t.switchMode=function(e){this.mode=e,this.gullet.switchMode(e)},t.parse=function(){this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");var e=this.parseExpression(!1);return this.expect("EOF"),this.gullet.endGroup(),e},t.parseExpression=function(t,n){for(var i=[];;){"math"===this.mode&&this.consumeSpaces();var r=this.fetch();if(-1!==e.endOfExpression.indexOf(r.text))break;if(n&&r.text===n)break;if(t&&_i[r.text]&&_i[r.text].infix)break;var a=this.parseAtom(n);if(!a)break;i.push(a)}return"text"===this.mode&&this.formLigatures(i),this.handleInfixNodes(i)},t.handleInfixNodes=function(e){for(var t,n=-1,i=0;i<e.length;i++){var r=et(e[i],"infix");if(r){if(-1!==n)throw new s("only one infix operator per group",r.token);n=i,t=r.replaceWith}}if(-1!==n&&t){var a,o,l=e.slice(0,n),c=e.slice(n+1);return a=1===l.length&&"ordgroup"===l[0].type?l[0]:{type:"ordgroup",mode:this.mode,body:l},o=1===c.length&&"ordgroup"===c[0].type?c[0]:{type:"ordgroup",mode:this.mode,body:c},["\\\\abovefrac"===t?this.callFunction(t,[a,e[n],o],[]):this.callFunction(t,[a,o],[])]}return e},t.handleSupSubscript=function(t){var n=this.fetch(),i=n.text;this.consume();var r=this.parseGroup(t,!1,e.SUPSUB_GREEDINESS,void 0,void 0,!0);if(!r)throw new s("Expected group after '"+i+"'",n);return r},t.formatUnsupportedCmd=function(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var i={type:"text",mode:this.mode,body:t};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[i]}},t.parseAtom=function(e){var t,n,i=this.parseGroup("atom",!1,null,e);if("text"===this.mode)return i;for(;;){this.consumeSpaces();var r=this.fetch();if("\\limits"===r.text||"\\nolimits"===r.text){var a=et(i,"op");if(a){var o="\\limits"===r.text;a.limits=o,a.alwaysHandleSupSub=!0}else{if(!(a=et(i,"operatorname"))||!a.alwaysHandleSupSub)throw new s("Limit controls must follow a math operator",r);var l="\\limits"===r.text;a.limits=l}this.consume()}else if("^"===r.text){if(t)throw new s("Double superscript",r);t=this.handleSupSubscript("superscript")}else if("_"===r.text){if(n)throw new s("Double subscript",r);n=this.handleSupSubscript("subscript")}else{if("'"!==r.text)break;if(t)throw new s("Double superscript",r);var c={type:"textord",mode:this.mode,text:"\\prime"},u=[c];for(this.consume();"'"===this.fetch().text;)u.push(c),this.consume();"^"===this.fetch().text&&u.push(this.handleSupSubscript("superscript")),t={type:"ordgroup",mode:this.mode,body:u}}}return t||n?{type:"supsub",mode:this.mode,base:i,sup:t,sub:n}:i},t.parseFunction=function(e,t,n){var i=this.fetch(),r=i.text,a=_i[r];if(!a)return null;if(this.consume(),null!=n&&a.greediness<=n)throw new s("Got function '"+r+"' with no arguments"+(t?" as "+t:""),i);if("text"===this.mode&&!a.allowedInText)throw new s("Can't use function '"+r+"' in text mode",i);if("math"===this.mode&&!1===a.allowedInMath)throw new s("Can't use function '"+r+"' in math mode",i);var o=this.parseArguments(r,a),l=o.args,c=o.optArgs;return this.callFunction(r,l,c,i,e)},t.callFunction=function(e,t,n,i,r){var a={funcName:e,parser:this,token:i,breakOnTokenText:r},o=_i[e];if(o&&o.handler)return o.handler(a,t,n);throw new s("No function handler for "+e)},t.parseArguments=function(e,t){var n=t.numArgs+t.numOptionalArgs;if(0===n)return{args:[],optArgs:[]};for(var i=t.greediness,r=[],a=[],o=0;o<n;o++){var l=t.argTypes&&t.argTypes[o],c=o<t.numOptionalArgs,u=o>0&&!c||0===o&&!c&&"math"===this.mode,d=this.parseGroupOfType("argument to '"+e+"'",l,c,i,u);if(!d){if(c){a.push(null);continue}throw new s("Expected group after '"+e+"'",this.fetch())}(c?a:r).push(d)}return{args:r,optArgs:a}},t.parseGroupOfType=function(e,t,n,i,r){switch(t){case"color":return r&&this.consumeSpaces(),this.parseColorGroup(n);case"size":return r&&this.consumeSpaces(),this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n,r);case"math":case"text":return this.parseGroup(e,n,i,void 0,t,r);case"hbox":var a=this.parseGroup(e,n,i,void 0,"text",r);return a?{type:"styling",mode:a.mode,body:[a],style:"text"}:a;case"raw":if(r&&this.consumeSpaces(),n&&"{"===this.fetch().text)return null;var o=this.parseStringGroup("raw",n,!0);if(o)return{type:"raw",mode:"text",string:o.text};throw new s("Expected raw group",this.fetch());case"original":case null:case void 0:return this.parseGroup(e,n,i,void 0,void 0,r);default:throw new s("Unknown group type as "+e,this.fetch())}},t.consumeSpaces=function(){for(;" "===this.fetch().text;)this.consume()},t.parseStringGroup=function(e,t,n){var i=t?"[":"{",r=t?"]":"}",a=this.fetch();if(a.text!==i){if(t)return null;if(n&&"EOF"!==a.text&&/[^{}[\]]/.test(a.text))return this.consume(),a}var o=this.mode;this.mode="text",this.expect(i);for(var l,c="",u=this.fetch(),d=0,h=u;(l=this.fetch()).text!==r||n&&d>0;){switch(l.text){case"EOF":throw new s("Unexpected end of input in "+e,u.range(h,c));case i:d++;break;case r:d--}c+=(h=l).text,this.consume()}return this.expect(r),this.mode=o,u.range(h,c)},t.parseRegexGroup=function(e,t){var n=this.mode;this.mode="text";for(var i,r=this.fetch(),a=r,o="";"EOF"!==(i=this.fetch()).text&&e.test(o+i.text);)o+=(a=i).text,this.consume();if(""===o)throw new s("Invalid "+t+": '"+r.text+"'",r);return this.mode=n,r.range(a,o)},t.parseColorGroup=function(e){var t=this.parseStringGroup("color",e);if(!t)return null;var n=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new s("Invalid color: '"+t.text+"'",t);var i=n[0];return/^[0-9a-f]{6}$/i.test(i)&&(i="#"+i),{type:"color-token",mode:this.mode,color:i}},t.parseSizeGroup=function(e){var t,n=!1;if(!(t=e||"{"===this.fetch().text?this.parseStringGroup("size",e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;e||0!==t.text.length||(t.text="0pt",n=!0);var i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!i)throw new s("Invalid size: '"+t.text+"'",t);var r={number:+(i[1]+i[2]),unit:i[3]};if(!Fe(r))throw new s("Invalid unit: '"+r.unit+"'",t);return{type:"size",mode:this.mode,value:r,isBlank:n}},t.parseUrlGroup=function(e,t){this.gullet.lexer.setCatcode("%",13);var n=this.parseStringGroup("url",e,!0);if(this.gullet.lexer.setCatcode("%",14),!n)return null;var i=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:i}},t.parseGroup=function(t,n,r,a,o,l){var c=this.mode;o&&this.switchMode(o),l&&this.consumeSpaces();var u,d=this.fetch(),h=d.text;if(n?"["===h:"{"===h||"\\begingroup"===h){this.consume();var p=e.endOfGroup[h];this.gullet.beginGroup();var f=this.parseExpression(!1,p),m=this.fetch();this.expect(p),this.gullet.endGroup(),u={type:"ordgroup",mode:this.mode,loc:i.range(d,m),body:f,semisimple:"\\begingroup"===h||void 0}}else if(n)u=null;else if(null==(u=this.parseFunction(a,t,r)||this.parseSymbol())&&"\\"===h[0]&&!Fi.hasOwnProperty(h)){if(this.settings.throwOnError)throw new s("Undefined control sequence: "+h,d);u=this.formatUnsupportedCmd(h),this.consume()}return o&&this.switchMode(c),u},t.formLigatures=function(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n],a=r.text;"-"===a&&"-"===e[n+1].text&&(n+1<t&&"-"===e[n+2].text?(e.splice(n,3,{type:"textord",mode:"text",loc:i.range(r,e[n+2]),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:i.range(r,e[n+1]),text:"--"}),t-=1)),"'"!==a&&"`"!==a||e[n+1].text!==a||(e.splice(n,2,{type:"textord",mode:"text",loc:i.range(r,e[n+1]),text:a+a}),t-=1)}},t.parseSymbol=function(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r="*"===n.charAt(0);if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new s("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:n=n.slice(1,-1),star:r}}Ui.hasOwnProperty(t[0])&&!W[this.mode][t[0]]&&(this.settings.strict&&"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=Ui[t[0]]+t.substr(1));var a,o=Ci.exec(t);if(o&&("i"===(t=t.substring(0,o.index))?t="ı":"j"===t&&(t="ȷ")),W[this.mode][t]){this.settings.strict&&"math"===this.mode&&Te.indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var l,c=W[this.mode][t].group,u=i.range(e);if(V.hasOwnProperty(c)){var d=c;l={type:"atom",mode:this.mode,family:d,loc:u,text:t}}else l={type:c,mode:this.mode,loc:u,text:t};a=l}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(S(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),a={type:"textord",mode:"text",loc:i.range(e),text:t}}if(this.consume(),o)for(var h=0;h<o[0].length;h++){var p=o[0][h];if(!Ki[p])throw new s("Unknown accent ' "+p+"'",e);var f=Ki[p][this.mode];if(!f)throw new s("Accent "+p+" unsupported in "+this.mode+" mode",e);a={type:"accent",mode:this.mode,loc:i.range(e),label:f,isStretchy:!1,isShifty:!0,base:a}}return a},e}();ji.endOfExpression=["}","\\endgroup","\\end","\\right","&"],ji.endOfGroup={"[":"]","{":"}","\\begingroup":"\\endgroup"},ji.SUPSUB_GREEDINESS=1;var qi=function(e,t){if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new ji(e,t);delete n.gullet.macros.current["\\df@tag"];var i=n.parse();if(n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new s("\\tag works only in display equations");n.gullet.feed("\\df@tag"),i=[{type:"tag",mode:"text",body:i,tag:n.parse()}]}return i},Hi=function(e,t,n){t.textContent="";var i=Gi(e,n).toNode();t.appendChild(i)};"undefined"!=typeof document&&"CSS1Compat"!==document.compatMode&&("undefined"!=typeof console&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Hi=function(){throw new s("KaTeX doesn't work in quirks mode.")});var Vi=function(e,t,n){if(n.throwOnError||!(e instanceof s))throw e;var i=Je.makeSpan(["katex-error"],[new N(t)]);return i.setAttribute("title",e.toString()),i.setAttribute("style","color:"+n.errorColor),i},Gi=function(e,t){var n=new h(t);try{var i=qi(e,n);return Ut(i,e,n)}catch(t){return Vi(t,e,n)}},Zi={version:"0.11.1",render:Hi,renderToString:function(e,t){return Gi(e,t).toMarkup()},ParseError:s,__parse:function(e,t){var n=new h(t);return qi(e,n)},__renderToDomTree:Gi,__renderToHTMLTree:function(e,t){var n=new h(t);try{return function(e,t,n){var i=At(e,zt(n)),r=Je.makeSpan(["katex"],[i]);return Kt(r,n)}(qi(e,n),0,n)}catch(t){return Vi(t,e,n)}},__setFontMetrics:function(e,t){K[e]=t},__defineSymbol:Y,__defineMacro:Ii,__domTree:{Span:I,Anchor:R,SymbolNode:N,SvgNode:B,PathNode:$,LineNode:F}};t.default=Zi}]).default},e.exports=t()},32834:function(e){e.exports=function(){"use strict";function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function t(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}function n(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function r(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=n(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a={exports:{}};function s(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function o(e){a.exports.defaults=e}a.exports={defaults:s(),getDefaults:s,changeDefaults:o};var l=/[&<>"']/,c=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,d=/[<>"']|&(?!#?\w+;)/g,h={"&":"&","<":"<",">":">",'"':""","'":"'"},p=function(e){return h[e]};function f(e,t){if(t){if(l.test(e))return e.replace(c,p)}else if(u.test(e))return e.replace(d,p);return e}var m=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function g(e){return e.replace(m,(function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))}var v=/(^|[^\[])\^/g;function b(e,t){e=e.source||e,t=t||"";var n={replace:function(t,i){return i=(i=i.source||i).replace(v,"$1"),e=e.replace(t,i),n},getRegex:function(){return new RegExp(e,t)}};return n}var y=/[^\w:]/g,_=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function w(e,t,n){if(e){var i;try{i=decodeURIComponent(g(n)).replace(y,"").toLowerCase()}catch(e){return null}if(0===i.indexOf("javascript:")||0===i.indexOf("vbscript:")||0===i.indexOf("data:"))return null}t&&!_.test(n)&&(n=C(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}var x={},k=/^[^:]+:\/*[^/]*$/,S=/^([^:]+:)[\s\S]*$/,E=/^([^:]+:\/*[^/]*)[\s\S]*$/;function C(e,t){x[" "+e]||(k.test(e)?x[" "+e]=e+"/":x[" "+e]=M(e,"/",!0));var n=-1===(e=x[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(S,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(E,"$1")+t:e+t}function T(e){for(var t,n,i=1;i<arguments.length;i++)for(n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function A(e,t){var n=e.replace(/\|/g,(function(e,t,n){for(var i=!1,r=t;--r>=0&&"\\"===n[r];)i=!i;return i?"|":" |"})).split(/ \|/),i=0;if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n}function M(e,t,n){var i=e.length;if(0===i)return"";for(var r=0;r<i;){var a=e.charAt(i-r-1);if(a!==t||n){if(a===t||!n)break;r++}else r++}return e.substr(0,i-r)}function L(e,t){if(-1===e.indexOf(t[1]))return-1;for(var n=e.length,i=0,r=0;r<n;r++)if("\\"===e[r])r++;else if(e[r]===t[0])i++;else if(e[r]===t[1]&&--i<0)return r;return-1}function D(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function I(e,t){if(t<1)return"";for(var n="";t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}var R={escape:f,unescape:g,edit:b,cleanUrl:w,resolveUrl:C,noopTest:{exec:function(){}},merge:T,splitCells:A,rtrim:M,findClosingBracket:L,checkSanitizeDeprecation:D,repeatString:I},P=a.exports.defaults,O=R.rtrim,N=R.splitCells,B=R.escape,$=R.findClosingBracket;function F(e,t,n){var i=t.href,r=t.title?B(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?{type:"link",raw:n,href:i,title:r,text:a}:{type:"image",raw:n,href:i,title:r,text:B(a)}}function z(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var i=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=i.length?e.slice(i.length):e})).join("\n")}var K=function(){function e(e){this.options=e||P}var t=e.prototype;return t.space=function(e){var t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}},t.code=function(e){var t=this.rules.block.code.exec(e);if(t){var n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:O(n,"\n")}}},t.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],i=z(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim():t[2],text:i}}},t.heading=function(e){var t=this.rules.block.heading.exec(e);if(t){var n=t[2].trim();if(/#$/.test(n)){var i=O(n,"#");this.options.pedantic?n=i.trim():i&&!/ $/.test(i)||(n=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n}}},t.nptable=function(e){var t=this.rules.block.nptable.exec(e);if(t){var n={type:"table",header:N(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(n.header.length===n.align.length){var i,r=n.align.length;for(i=0;i<r;i++)/^ *-+: *$/.test(n.align[i])?n.align[i]="right":/^ *:-+: *$/.test(n.align[i])?n.align[i]="center":/^ *:-+ *$/.test(n.align[i])?n.align[i]="left":n.align[i]=null;for(r=n.cells.length,i=0;i<r;i++)n.cells[i]=N(n.cells[i],n.header.length);return n}}},t.hr=function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}},t.blockquote=function(e){var t=this.rules.block.blockquote.exec(e);if(t){var n=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],text:n}}},t.list=function(e){var t=this.rules.block.list.exec(e);if(t){var n,i,r,a,s,o,l,c,u,d=t[0],h=t[2],p=h.length>1,f={type:"list",raw:d,ordered:p,start:p?+h.slice(0,-1):"",loose:!1,items:[]},m=t[0].match(this.rules.block.item),g=!1,v=m.length;r=this.rules.block.listItemStart.exec(m[0]);for(var b=0;b<v;b++){if(d=n=m[b],this.options.pedantic||(u=n.match(new RegExp("\\n\\s*\\n {0,"+(r[0].length-1)+"}\\S")))&&(s=n.length-u.index+m.slice(b+1).join("\n").length,f.raw=f.raw.substring(0,f.raw.length-s),d=n=n.substring(0,u.index),v=b+1),b!==v-1){if(a=this.rules.block.listItemStart.exec(m[b+1]),this.options.pedantic?a[1].length>r[1].length:a[1].length>=r[0].length||a[1].length>3){m.splice(b,2,m[b]+(!this.options.pedantic&&a[1].length<r[0].length&&!m[b].match(/\n$/)?"":"\n")+m[b+1]),b--,v--;continue}(!this.options.pedantic||this.options.smartLists?a[2][a[2].length-1]!==h[h.length-1]:p===(1===a[2].length))&&(s=m.slice(b+1).join("\n").length,f.raw=f.raw.substring(0,f.raw.length-s),b=v-1),r=a}i=n.length,~(n=n.replace(/^ *([*+-]|\d+[.)]) ?/,"")).indexOf("\n ")&&(i-=n.length,n=this.options.pedantic?n.replace(/^ {1,4}/gm,""):n.replace(new RegExp("^ {1,"+i+"}","gm"),"")),n=O(n,"\n"),b!==v-1&&(d+="\n"),o=g||/\n\n(?!\s*$)/.test(d),b!==v-1&&(g="\n\n"===d.slice(-2),o||(o=g)),o&&(f.loose=!0),this.options.gfm&&(c=void 0,(l=/^\[[ xX]\] /.test(n))&&(c=" "!==n[1],n=n.replace(/^\[[ xX]\] +/,""))),f.items.push({type:"list_item",raw:d,task:l,checked:c,loose:o,text:n})}return f}},t.html=function(e){var t=this.rules.block.html.exec(e);if(t)return{type:this.options.sanitize?"paragraph":"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):B(t[0]):t[0]}},t.def=function(e){var t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}},t.table=function(e){var t=this.rules.block.table.exec(e);if(t){var n={type:"table",header:N(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[]};if(n.header.length===n.align.length){n.raw=t[0];var i,r=n.align.length;for(i=0;i<r;i++)/^ *-+: *$/.test(n.align[i])?n.align[i]="right":/^ *:-+: *$/.test(n.align[i])?n.align[i]="center":/^ *:-+ *$/.test(n.align[i])?n.align[i]="left":n.align[i]=null;for(r=n.cells.length,i=0;i<r;i++)n.cells[i]=N(n.cells[i].replace(/^ *\| *| *\| *$/g,""),n.header.length);return n}}},t.lheading=function(e){var t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1]}},t.paragraph=function(e){var t=this.rules.block.paragraph.exec(e);if(t)return{type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1]}},t.text=function(e){var t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0]}},t.escape=function(e){var t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:B(t[1])}},t.tag=function(e,t,n){var i=this.rules.inline.tag.exec(e);if(i)return!t&&/^<a /i.test(i[0])?t=!0:t&&/^<\/a>/i.test(i[0])&&(t=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:i[0],inLink:t,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):B(i[0]):i[0]}},t.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var n=t[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;var i=O(n.slice(0,-1),"\\");if((n.length-i.length)%2==0)return}else{var r=$(t[2],"()");if(r>-1){var a=(0===t[0].indexOf("!")?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,a).trim(),t[3]=""}}var s=t[2],o="";if(this.options.pedantic){var l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(s);l&&(s=l[1],o=l[3])}else o=t[3]?t[3].slice(1,-1):"";return s=s.trim(),/^</.test(s)&&(s=this.options.pedantic&&!/>$/.test(n)?s.slice(1):s.slice(1,-1)),F(t,{href:s?s.replace(this.rules.inline._escapes,"$1"):s,title:o?o.replace(this.rules.inline._escapes,"$1"):o},t[0])}},t.reflink=function(e,t){var n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){var i=(n[2]||n[1]).replace(/\s+/g," ");if(!(i=t[i.toLowerCase()])||!i.href){var r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return F(n,i,n[0])}},t.emStrong=function(e,t,n){void 0===n&&(n="");var i=this.rules.inline.emStrong.lDelim.exec(e);if(i&&(!i[3]||!n.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var r=i[1]||i[2]||"";if(!r||r&&(""===n||this.rules.inline.punctuation.exec(n))){var a,s,o=i[0].length-1,l=o,c=0,u="*"===i[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+o);null!=(i=u.exec(t));)if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6])if(s=a.length,i[3]||i[4])l+=s;else if(!((i[5]||i[6])&&o%3)||(o+s)%3){if(!((l-=s)>0))return s=Math.min(s,s+l+c),Math.min(o,s)%2?{type:"em",raw:e.slice(0,o+i.index+s+1),text:e.slice(1,o+i.index+s)}:{type:"strong",raw:e.slice(0,o+i.index+s+1),text:e.slice(2,o+i.index+s-1)}}else c+=s}}},t.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var n=t[2].replace(/\n/g," "),i=/[^ ]/.test(n),r=/^ /.test(n)&&/ $/.test(n);return i&&r&&(n=n.substring(1,n.length-1)),n=B(n,!0),{type:"codespan",raw:t[0],text:n}}},t.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},t.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2]}},t.autolink=function(e,t){var n,i,r=this.rules.inline.autolink.exec(e);if(r)return i="@"===r[2]?"mailto:"+(n=B(this.options.mangle?t(r[1]):r[1])):n=B(r[1]),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}},t.url=function(e,t){var n;if(n=this.rules.inline.url.exec(e)){var i,r;if("@"===n[2])r="mailto:"+(i=B(this.options.mangle?t(n[0]):n[0]));else{var a;do{a=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(a!==n[0]);i=B(n[0]),r="www."===n[1]?"http://"+i:i}return{type:"link",raw:n[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}},t.inlineText=function(e,t,n){var i,r=this.rules.inline.text.exec(e);if(r)return i=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):B(r[0]):r[0]:B(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}},e}(),U=R.noopTest,j=R.edit,q=R.merge,H={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:U,table:U,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};H.def=j(H.def).replace("label",H._label).replace("title",H._title).getRegex(),H.bullet=/(?:[*+-]|\d{1,9}[.)])/,H.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,H.item=j(H.item,"gm").replace(/bull/g,H.bullet).getRegex(),H.listItemStart=j(/^( *)(bull) */).replace("bull",H.bullet).getRegex(),H.list=j(H.list).replace(/bull/g,H.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+H.def.source+")").getRegex(),H._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",H._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,H.html=j(H.html,"i").replace("comment",H._comment).replace("tag",H._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),H.paragraph=j(H._paragraph).replace("hr",H.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",H._tag).getRegex(),H.blockquote=j(H.blockquote).replace("paragraph",H.paragraph).getRegex(),H.normal=q({},H),H.gfm=q({},H.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),H.gfm.nptable=j(H.gfm.nptable).replace("hr",H.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",H._tag).getRegex(),H.gfm.table=j(H.gfm.table).replace("hr",H.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",H._tag).getRegex(),H.pedantic=q({},H.normal,{html:j("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",H._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:U,paragraph:j(H.normal._paragraph).replace("hr",H.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",H.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var V={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:U,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:U,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/,_punctuation:"!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~"};V.punctuation=j(V.punctuation).replace(/punctuation/g,V._punctuation).getRegex(),V.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,V.escapedEmSt=/\\\*|\\_/g,V._comment=j(H._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),V.emStrong.lDelim=j(V.emStrong.lDelim).replace(/punct/g,V._punctuation).getRegex(),V.emStrong.rDelimAst=j(V.emStrong.rDelimAst,"g").replace(/punct/g,V._punctuation).getRegex(),V.emStrong.rDelimUnd=j(V.emStrong.rDelimUnd,"g").replace(/punct/g,V._punctuation).getRegex(),V._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,V._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,V._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,V.autolink=j(V.autolink).replace("scheme",V._scheme).replace("email",V._email).getRegex(),V._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,V.tag=j(V.tag).replace("comment",V._comment).replace("attribute",V._attribute).getRegex(),V._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,V._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,V._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,V.link=j(V.link).replace("label",V._label).replace("href",V._href).replace("title",V._title).getRegex(),V.reflink=j(V.reflink).replace("label",V._label).getRegex(),V.reflinkSearch=j(V.reflinkSearch,"g").replace("reflink",V.reflink).replace("nolink",V.nolink).getRegex(),V.normal=q({},V),V.pedantic=q({},V.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:j(/^!?\[(label)\]\((.*?)\)/).replace("label",V._label).getRegex(),reflink:j(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",V._label).getRegex()}),V.gfm=q({},V.normal,{escape:j(V.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),V.gfm.url=j(V.gfm.url,"i").replace("email",V.gfm._extended_email).getRegex(),V.breaks=q({},V.gfm,{br:j(V.br).replace("{2,}","*").getRegex(),text:j(V.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var G={block:H,inline:V},Z=K,W=a.exports.defaults,Y=G.block,X=G.inline,J=R.repeatString;function Q(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function ee(e){var t,n,i="",r=e.length;for(t=0;t<r;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),i+="&#"+n+";";return i}var te=function(){function e(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||W,this.options.tokenizer=this.options.tokenizer||new Z,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var t={block:Y.normal,inline:X.normal};this.options.pedantic?(t.block=Y.pedantic,t.inline=X.pedantic):this.options.gfm&&(t.block=Y.gfm,this.options.breaks?t.inline=X.breaks:t.inline=X.gfm),this.tokenizer.rules=t}e.lex=function(t,n){return new e(n).lex(t)},e.lexInline=function(t,n){return new e(n).inlineTokens(t)};var n=e.prototype;return n.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens},n.blockTokens=function(e,t,n){var i,r,a,s;for(void 0===t&&(t=[]),void 0===n&&(n=!0),this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(i=this.tokenizer.space(e))e=e.substring(i.raw.length),i.type&&t.push(i);else if(i=this.tokenizer.code(e))e=e.substring(i.raw.length),(s=t[t.length-1])&&"paragraph"===s.type?(s.raw+="\n"+i.raw,s.text+="\n"+i.text):t.push(i);else if(i=this.tokenizer.fences(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.heading(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.nptable(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.hr(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.blockquote(e))e=e.substring(i.raw.length),i.tokens=this.blockTokens(i.text,[],n),t.push(i);else if(i=this.tokenizer.list(e)){for(e=e.substring(i.raw.length),a=i.items.length,r=0;r<a;r++)i.items[r].tokens=this.blockTokens(i.items[r].text,[],!1);t.push(i)}else if(i=this.tokenizer.html(e))e=e.substring(i.raw.length),t.push(i);else if(n&&(i=this.tokenizer.def(e)))e=e.substring(i.raw.length),this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});else if(i=this.tokenizer.table(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.lheading(e))e=e.substring(i.raw.length),t.push(i);else if(n&&(i=this.tokenizer.paragraph(e)))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.text(e))e=e.substring(i.raw.length),(s=t[t.length-1])&&"text"===s.type?(s.raw+="\n"+i.raw,s.text+="\n"+i.text):t.push(i);else if(e){var o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}throw new Error(o)}return t},n.inline=function(e){var t,n,i,r,a,s,o=e.length;for(t=0;t<o;t++)switch((s=e[t]).type){case"paragraph":case"text":case"heading":s.tokens=[],this.inlineTokens(s.text,s.tokens);break;case"table":for(s.tokens={header:[],cells:[]},r=s.header.length,n=0;n<r;n++)s.tokens.header[n]=[],this.inlineTokens(s.header[n],s.tokens.header[n]);for(r=s.cells.length,n=0;n<r;n++)for(a=s.cells[n],s.tokens.cells[n]=[],i=0;i<a.length;i++)s.tokens.cells[n][i]=[],this.inlineTokens(a[i],s.tokens.cells[n][i]);break;case"blockquote":this.inline(s.tokens);break;case"list":for(r=s.items.length,n=0;n<r;n++)this.inline(s.items[n].tokens)}return e},n.inlineTokens=function(e,t,n,i){var r,a;void 0===t&&(t=[]),void 0===n&&(n=!1),void 0===i&&(i=!1);var s,o,l,c=e;if(this.tokens.links){var u=Object.keys(this.tokens.links);if(u.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(c));)u.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,s.index)+"["+J("a",s[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,s.index)+"["+J("a",s[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.escapedEmSt.exec(c));)c=c.slice(0,s.index)+"++"+c.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(o||(l=""),o=!1,r=this.tokenizer.escape(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.tag(e,n,i)){e=e.substring(r.raw.length),n=r.inLink,i=r.inRawBlock;var d=t[t.length-1];d&&"text"===r.type&&"text"===d.type?(d.raw+=r.raw,d.text+=r.text):t.push(r)}else if(r=this.tokenizer.link(e))e=e.substring(r.raw.length),"link"===r.type&&(r.tokens=this.inlineTokens(r.text,[],!0,i)),t.push(r);else if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);var h=t[t.length-1];"link"===r.type?(r.tokens=this.inlineTokens(r.text,[],!0,i),t.push(r)):h&&"text"===r.type&&"text"===h.type?(h.raw+=r.raw,h.text+=r.text):t.push(r)}else if(r=this.tokenizer.emStrong(e,c,l))e=e.substring(r.raw.length),r.tokens=this.inlineTokens(r.text,[],n,i),t.push(r);else if(r=this.tokenizer.codespan(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.br(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.del(e))e=e.substring(r.raw.length),r.tokens=this.inlineTokens(r.text,[],n,i),t.push(r);else if(r=this.tokenizer.autolink(e,ee))e=e.substring(r.raw.length),t.push(r);else if(n||!(r=this.tokenizer.url(e,ee))){if(r=this.tokenizer.inlineText(e,i,Q))e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(l=r.raw.slice(-1)),o=!0,(a=t[t.length-1])&&"text"===a.type?(a.raw+=r.raw,a.text+=r.text):t.push(r);else if(e){var p="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(p);break}throw new Error(p)}}else e=e.substring(r.raw.length),t.push(r);return t},t(e,null,[{key:"rules",get:function(){return{block:Y,inline:X}}}]),e}(),ne=a.exports.defaults,ie=R.cleanUrl,re=R.escape,ae=function(){function e(e){this.options=e||ne}var t=e.prototype;return t.code=function(e,t,n){var i=(t||"").match(/\S*/)[0];if(this.options.highlight){var r=this.options.highlight(e,i);null!=r&&r!==e&&(n=!0,e=r)}return e=e.replace(/\n$/,"")+"\n",i?'<pre><code class="'+this.options.langPrefix+re(i,!0)+'">'+(n?e:re(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:re(e,!0))+"</code></pre>\n"},t.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},t.html=function(e){return e},t.heading=function(e,t,n,i){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+i.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},t.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},t.list=function(e,t,n){var i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+i+">\n"},t.listitem=function(e){return"<li>"+e+"</li>\n"},t.checkbox=function(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},t.paragraph=function(e){return"<p>"+e+"</p>\n"},t.table=function(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"},t.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},t.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},t.strong=function(e){return"<strong>"+e+"</strong>"},t.em=function(e){return"<em>"+e+"</em>"},t.codespan=function(e){return"<code>"+e+"</code>"},t.br=function(){return this.options.xhtml?"<br/>":"<br>"},t.del=function(e){return"<del>"+e+"</del>"},t.link=function(e,t,n){if(null===(e=ie(this.options.sanitize,this.options.baseUrl,e)))return n;var i='<a href="'+re(e)+'"';return t&&(i+=' title="'+t+'"'),i+=">"+n+"</a>"},t.image=function(e,t,n){if(null===(e=ie(this.options.sanitize,this.options.baseUrl,e)))return n;var i='<img src="'+e+'" alt="'+n+'"';return t&&(i+=' title="'+t+'"'),i+=this.options.xhtml?"/>":">"},t.text=function(e){return e},e}(),se=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,n){return""+n},t.image=function(e,t,n){return""+n},t.br=function(){return""},e}(),oe=function(){function e(){this.seen={}}var t=e.prototype;return t.serialize=function(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},t.getNextSafeSlug=function(e,t){var n=e,i=0;if(this.seen.hasOwnProperty(n)){i=this.seen[e];do{n=e+"-"+ ++i}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=i,this.seen[n]=0),n},t.slug=function(e,t){void 0===t&&(t={});var n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)},e}(),le=ae,ce=se,ue=oe,de=a.exports.defaults,he=R.unescape,pe=te,fe=function(){function e(e){this.options=e||de,this.options.renderer=this.options.renderer||new le,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ce,this.slugger=new ue}e.parse=function(t,n){return new e(n).parse(t)},e.parseInline=function(t,n){return new e(n).parseInline(t)};var t=e.prototype;return t.parse=function(e,t){void 0===t&&(t=!0);var n,i,r,a,s,o,l,c,u,d,h,p,f,m,g,v,b,y,_="",w=e.length;for(n=0;n<w;n++)switch((d=e[n]).type){case"space":continue;case"hr":_+=this.renderer.hr();continue;case"heading":_+=this.renderer.heading(this.parseInline(d.tokens),d.depth,he(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue;case"code":_+=this.renderer.code(d.text,d.lang,d.escaped);continue;case"table":for(c="",l="",a=d.header.length,i=0;i<a;i++)l+=this.renderer.tablecell(this.parseInline(d.tokens.header[i]),{header:!0,align:d.align[i]});for(c+=this.renderer.tablerow(l),u="",a=d.cells.length,i=0;i<a;i++){for(l="",s=(o=d.tokens.cells[i]).length,r=0;r<s;r++)l+=this.renderer.tablecell(this.parseInline(o[r]),{header:!1,align:d.align[r]});u+=this.renderer.tablerow(l)}_+=this.renderer.table(c,u);continue;case"blockquote":u=this.parse(d.tokens),_+=this.renderer.blockquote(u);continue;case"list":for(h=d.ordered,p=d.start,f=d.loose,a=d.items.length,u="",i=0;i<a;i++)v=(g=d.items[i]).checked,b=g.task,m="",g.task&&(y=this.renderer.checkbox(v),f?g.tokens.length>0&&"text"===g.tokens[0].type?(g.tokens[0].text=y+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=y+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:y}):m+=y),m+=this.parse(g.tokens,f),u+=this.renderer.listitem(m,b,v);_+=this.renderer.list(u,h,p);continue;case"html":_+=this.renderer.html(d.text);continue;case"paragraph":_+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(u=d.tokens?this.parseInline(d.tokens):d.text;n+1<w&&"text"===e[n+1].type;)u+="\n"+((d=e[++n]).tokens?this.parseInline(d.tokens):d.text);_+=t?this.renderer.paragraph(u):u;continue;default:var x='Token with "'+d.type+'" type was not found.';if(this.options.silent)return void console.error(x);throw new Error(x)}return _},t.parseInline=function(e,t){t=t||this.renderer;var n,i,r="",a=e.length;for(n=0;n<a;n++)switch((i=e[n]).type){case"escape":case"text":r+=t.text(i.text);break;case"html":r+=t.html(i.text);break;case"link":r+=t.link(i.href,i.title,this.parseInline(i.tokens,t));break;case"image":r+=t.image(i.href,i.title,i.text);break;case"strong":r+=t.strong(this.parseInline(i.tokens,t));break;case"em":r+=t.em(this.parseInline(i.tokens,t));break;case"codespan":r+=t.codespan(i.text);break;case"br":r+=t.br();break;case"del":r+=t.del(this.parseInline(i.tokens,t));break;default:var s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return void console.error(s);throw new Error(s)}return r},e}(),me=K,ge=ae,ve=se,be=oe,ye=R.merge,_e=R.checkSanitizeDeprecation,we=R.escape,xe=a.exports.getDefaults,ke=a.exports.changeDefaults,Se=a.exports.defaults;function Ee(e,t,n){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(n=t,t=null),t=ye({},Ee.defaults,t||{}),_e(t),n){var i,r=t.highlight;try{i=pe.lex(e,t)}catch(e){return n(e)}var a=function(e){var a;if(!e)try{t.walkTokens&&Ee.walkTokens(i,t.walkTokens),a=fe.parse(i,t)}catch(t){e=t}return t.highlight=r,e?n(e):n(null,a)};if(!r||r.length<3)return a();if(delete t.highlight,!i.length)return a();var s=0;return Ee.walkTokens(i,(function(e){"code"===e.type&&(s++,setTimeout((function(){r(e.text,e.lang,(function(t,n){if(t)return a(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),0==--s&&a()}))}),0))})),void(0===s&&a())}try{var o=pe.lex(e,t);return t.walkTokens&&Ee.walkTokens(o,t.walkTokens),fe.parse(o,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+we(e.message+"",!0)+"</pre>";throw e}}return Ee.options=Ee.setOptions=function(e){return ye(Ee.defaults,e),ke(Ee.defaults),Ee},Ee.getDefaults=xe,Ee.defaults=Se,Ee.use=function(e){var t=ye({},e);if(e.renderer&&function(){var n=Ee.defaults.renderer||new ge,i=function(t){var i=n[t];n[t]=function(){for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];var o=e.renderer[t].apply(n,a);return!1===o&&(o=i.apply(n,a)),o}};for(var r in e.renderer)i(r);t.renderer=n}(),e.tokenizer&&function(){var n=Ee.defaults.tokenizer||new me,i=function(t){var i=n[t];n[t]=function(){for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];var o=e.tokenizer[t].apply(n,a);return!1===o&&(o=i.apply(n,a)),o}};for(var r in e.tokenizer)i(r);t.tokenizer=n}(),e.walkTokens){var n=Ee.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens(t),n&&n(t)}}Ee.setOptions(t)},Ee.walkTokens=function(e,t){for(var n,i=r(e);!(n=i()).done;){var a=n.value;switch(t(a),a.type){case"table":for(var s,o=r(a.tokens.header);!(s=o()).done;){var l=s.value;Ee.walkTokens(l,t)}for(var c,u=r(a.tokens.cells);!(c=u()).done;)for(var d,h=r(c.value);!(d=h()).done;){var p=d.value;Ee.walkTokens(p,t)}break;case"list":Ee.walkTokens(a.items,t);break;default:a.tokens&&Ee.walkTokens(a.tokens,t)}}},Ee.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");t=ye({},Ee.defaults,t||{}),_e(t);try{var n=pe.lexInline(e,t);return t.walkTokens&&Ee.walkTokens(n,t.walkTokens),fe.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+we(e.message+"",!0)+"</pre>";throw e}},Ee.Parser=fe,Ee.parser=fe.parse,Ee.Renderer=ge,Ee.TextRenderer=ve,Ee.Lexer=pe,Ee.lexer=pe.lex,Ee.Tokenizer=me,Ee.Slugger=be,Ee.parse=Ee,Ee}()},11690:function(e){const t=/[&<>"']/,n=/[&<>"']/g,i=/[<>"']|&(?!#?\w+;)/,r=/[<>"']|&(?!#?\w+;)/g,a={"&":"&","<":"<",">":">",'"':""","'":"'"},s=e=>a[e];const o=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function l(e){return e.replace(o,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const c=/(^|[^\[])\^/g;const u=/[^\w:]/g,d=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const h={},p=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,m=/^([^:]+:\/*[^/]*)[\s\S]*$/;function g(e,t){h[" "+e]||(p.test(e)?h[" "+e]=e+"/":h[" "+e]=v(e,"/",!0));const n=-1===(e=h[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(f,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(m,"$1")+t:e+t}function v(e,t,n){const i=e.length;if(0===i)return"";let r=0;for(;r<i;){const a=e.charAt(i-r-1);if(a!==t||n){if(a===t||!n)break;r++}else r++}return e.substr(0,i-r)}e.exports={escape:function(e,a){if(a){if(t.test(e))return e.replace(n,s)}else if(i.test(e))return e.replace(r,s);return e},unescape:l,edit:function(e,t){e=e.source||e,t=t||"";const n={replace:(t,i)=>(i=(i=i.source||i).replace(c,"$1"),e=e.replace(t,i),n),getRegex:()=>new RegExp(e,t)};return n},cleanUrl:function(e,t,n){if(e){let e;try{e=decodeURIComponent(l(n)).replace(u,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!d.test(n)&&(n=g(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},resolveUrl:g,noopTest:{exec:function(){}},merge:function(e){let t,n,i=1;for(;i<arguments.length;i++)for(n in t=arguments[i],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},splitCells:function(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let i=!1,r=t;for(;--r>=0&&"\\"===n[r];)i=!i;return i?"|":" |"})).split(/ \|/);let i=0;if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n},rtrim:v,findClosingBracket:function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let i=0,r=0;for(;r<n;r++)if("\\"===e[r])r++;else if(e[r]===t[0])i++;else if(e[r]===t[1]&&(i--,i<0))return r;return-1},checkSanitizeDeprecation:function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")},repeatString:function(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}}},75918:function(e,t,n){"use strict";n.d(t,{Wi:function(){return l},Z0:function(){return c},aU:function(){return o},eZ:function(){return d},wY:function(){return u}});var i=n(4348),r=n(69323),a=n(13268),s=function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,o)}l((i=i.apply(e,t||[])).next())}))};class o extends r.JT{constructor(e,t="",n="",r=!0,a){super(),this._onDidChange=this._register(new i.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=n,this._enabled=r,this._actionCallback=a}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}run(e,t){return s(this,void 0,void 0,(function*(){this._actionCallback&&(yield this._actionCallback(e))}))}}class l extends r.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new i.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new i.Q5),this.onDidRun=this._onDidRun.event}run(e,t){return s(this,void 0,void 0,(function*(){if(!e.enabled)return;let n;this._onBeforeRun.fire({action:e});try{yield this.runAction(e,t)}catch(e){n=e}this._onDidRun.fire({action:e,error:n})}))}runAction(e,t){return s(this,void 0,void 0,(function*(){yield e.run(t)}))}}class c extends o{constructor(e){super(c.ID,e,e?"separator text":"separator"),this.checked=!1,this.enabled=!1}}c.ID="vs.actions.separator";class u{constructor(e,t,n,i){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=e,this.label=t,this.class=i,this._actions=n}get actions(){return this._actions}dispose(){}run(){return s(this,void 0,void 0,(function*(){}))}}class d extends o{constructor(){super(d.ID,a.N("submenu.empty","(empty)"),void 0,!1)}}d.ID="vs.actions.empty"},76068:function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t?`Assertion failed (${t})`:"Assertion Failed")}n.d(t,{ok:function(){return i}})},52615:function(e,t,n){"use strict";n.d(t,{CM:function(){return s},JL:function(){return o},dT:function(){return c},fK:function(){return a},lA:function(){return l}});var i=n(4348);const r=new class{constructor(){this._icons=new Map,this._onDidRegister=new i.Q5}add(e){const t=this._icons.get(e.id);t?e.description?t.description=e.description:console.error(`Duplicate registration of codicon ${e.id}`):(this._icons.set(e.id,e),this._onDidRegister.fire(e))}get(e){return this._icons.get(e)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}},a=r;function s(e,t){return new l(e,t)}function o(e){return e?e.replace(/\$\((.*?)\)/g,((e,t)=>` ${t} `)).trim():""}class l{constructor(e,t,n){this.id=e,this.definition=t,this.description=n,r.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var c;!function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9\\-]+",e.iconModifierExpression="~[A-Za-z]+";const t=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function n(e){if(e instanceof l)return["codicon","codicon-"+e.id];const i=t.exec(e.id);if(!i)return n(l.error);let[,r,a]=i;const s=["codicon","codicon-"+r];return a&&s.push("codicon-modifier-"+a.substr(1)),s}e.asClassNameArray=n,e.asClassName=function(e){return n(e).join(" ")},e.asCSSSelector=function(e){return"."+n(e).join(".")}}(c||(c={})),function(e){e.add=new e("add",{fontCharacter:"\\ea60"}),e.plus=new e("plus",e.add.definition),e.gistNew=new e("gist-new",e.add.definition),e.repoCreate=new e("repo-create",e.add.definition),e.lightbulb=new e("lightbulb",{fontCharacter:"\\ea61"}),e.lightBulb=new e("light-bulb",{fontCharacter:"\\ea61"}),e.repo=new e("repo",{fontCharacter:"\\ea62"}),e.repoDelete=new e("repo-delete",{fontCharacter:"\\ea62"}),e.gistFork=new e("gist-fork",{fontCharacter:"\\ea63"}),e.repoForked=new e("repo-forked",{fontCharacter:"\\ea63"}),e.gitPullRequest=new e("git-pull-request",{fontCharacter:"\\ea64"}),e.gitPullRequestAbandoned=new e("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),e.recordKeys=new e("record-keys",{fontCharacter:"\\ea65"}),e.keyboard=new e("keyboard",{fontCharacter:"\\ea65"}),e.tag=new e("tag",{fontCharacter:"\\ea66"}),e.tagAdd=new e("tag-add",{fontCharacter:"\\ea66"}),e.tagRemove=new e("tag-remove",{fontCharacter:"\\ea66"}),e.person=new e("person",{fontCharacter:"\\ea67"}),e.personFollow=new e("person-follow",{fontCharacter:"\\ea67"}),e.personOutline=new e("person-outline",{fontCharacter:"\\ea67"}),e.personFilled=new e("person-filled",{fontCharacter:"\\ea67"}),e.gitBranch=new e("git-branch",{fontCharacter:"\\ea68"}),e.gitBranchCreate=new e("git-branch-create",{fontCharacter:"\\ea68"}),e.gitBranchDelete=new e("git-branch-delete",{fontCharacter:"\\ea68"}),e.sourceControl=new e("source-control",{fontCharacter:"\\ea68"}),e.mirror=new e("mirror",{fontCharacter:"\\ea69"}),e.mirrorPublic=new e("mirror-public",{fontCharacter:"\\ea69"}),e.star=new e("star",{fontCharacter:"\\ea6a"}),e.starAdd=new e("star-add",{fontCharacter:"\\ea6a"}),e.starDelete=new e("star-delete",{fontCharacter:"\\ea6a"}),e.starEmpty=new e("star-empty",{fontCharacter:"\\ea6a"}),e.comment=new e("comment",{fontCharacter:"\\ea6b"}),e.commentAdd=new e("comment-add",{fontCharacter:"\\ea6b"}),e.alert=new e("alert",{fontCharacter:"\\ea6c"}),e.warning=new e("warning",{fontCharacter:"\\ea6c"}),e.search=new e("search",{fontCharacter:"\\ea6d"}),e.searchSave=new e("search-save",{fontCharacter:"\\ea6d"}),e.logOut=new e("log-out",{fontCharacter:"\\ea6e"}),e.signOut=new e("sign-out",{fontCharacter:"\\ea6e"}),e.logIn=new e("log-in",{fontCharacter:"\\ea6f"}),e.signIn=new e("sign-in",{fontCharacter:"\\ea6f"}),e.eye=new e("eye",{fontCharacter:"\\ea70"}),e.eyeUnwatch=new e("eye-unwatch",{fontCharacter:"\\ea70"}),e.eyeWatch=new e("eye-watch",{fontCharacter:"\\ea70"}),e.circleFilled=new e("circle-filled",{fontCharacter:"\\ea71"}),e.primitiveDot=new e("primitive-dot",{fontCharacter:"\\ea71"}),e.closeDirty=new e("close-dirty",{fontCharacter:"\\ea71"}),e.debugBreakpoint=new e("debug-breakpoint",{fontCharacter:"\\ea71"}),e.debugBreakpointDisabled=new e("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),e.debugHint=new e("debug-hint",{fontCharacter:"\\ea71"}),e.primitiveSquare=new e("primitive-square",{fontCharacter:"\\ea72"}),e.edit=new e("edit",{fontCharacter:"\\ea73"}),e.pencil=new e("pencil",{fontCharacter:"\\ea73"}),e.info=new e("info",{fontCharacter:"\\ea74"}),e.issueOpened=new e("issue-opened",{fontCharacter:"\\ea74"}),e.gistPrivate=new e("gist-private",{fontCharacter:"\\ea75"}),e.gitForkPrivate=new e("git-fork-private",{fontCharacter:"\\ea75"}),e.lock=new e("lock",{fontCharacter:"\\ea75"}),e.mirrorPrivate=new e("mirror-private",{fontCharacter:"\\ea75"}),e.close=new e("close",{fontCharacter:"\\ea76"}),e.removeClose=new e("remove-close",{fontCharacter:"\\ea76"}),e.x=new e("x",{fontCharacter:"\\ea76"}),e.repoSync=new e("repo-sync",{fontCharacter:"\\ea77"}),e.sync=new e("sync",{fontCharacter:"\\ea77"}),e.clone=new e("clone",{fontCharacter:"\\ea78"}),e.desktopDownload=new e("desktop-download",{fontCharacter:"\\ea78"}),e.beaker=new e("beaker",{fontCharacter:"\\ea79"}),e.microscope=new e("microscope",{fontCharacter:"\\ea79"}),e.vm=new e("vm",{fontCharacter:"\\ea7a"}),e.deviceDesktop=new e("device-desktop",{fontCharacter:"\\ea7a"}),e.file=new e("file",{fontCharacter:"\\ea7b"}),e.fileText=new e("file-text",{fontCharacter:"\\ea7b"}),e.more=new e("more",{fontCharacter:"\\ea7c"}),e.ellipsis=new e("ellipsis",{fontCharacter:"\\ea7c"}),e.kebabHorizontal=new e("kebab-horizontal",{fontCharacter:"\\ea7c"}),e.mailReply=new e("mail-reply",{fontCharacter:"\\ea7d"}),e.reply=new e("reply",{fontCharacter:"\\ea7d"}),e.organization=new e("organization",{fontCharacter:"\\ea7e"}),e.organizationFilled=new e("organization-filled",{fontCharacter:"\\ea7e"}),e.organizationOutline=new e("organization-outline",{fontCharacter:"\\ea7e"}),e.newFile=new e("new-file",{fontCharacter:"\\ea7f"}),e.fileAdd=new e("file-add",{fontCharacter:"\\ea7f"}),e.newFolder=new e("new-folder",{fontCharacter:"\\ea80"}),e.fileDirectoryCreate=new e("file-directory-create",{fontCharacter:"\\ea80"}),e.trash=new e("trash",{fontCharacter:"\\ea81"}),e.trashcan=new e("trashcan",{fontCharacter:"\\ea81"}),e.history=new e("history",{fontCharacter:"\\ea82"}),e.clock=new e("clock",{fontCharacter:"\\ea82"}),e.folder=new e("folder",{fontCharacter:"\\ea83"}),e.fileDirectory=new e("file-directory",{fontCharacter:"\\ea83"}),e.symbolFolder=new e("symbol-folder",{fontCharacter:"\\ea83"}),e.logoGithub=new e("logo-github",{fontCharacter:"\\ea84"}),e.markGithub=new e("mark-github",{fontCharacter:"\\ea84"}),e.github=new e("github",{fontCharacter:"\\ea84"}),e.terminal=new e("terminal",{fontCharacter:"\\ea85"}),e.console=new e("console",{fontCharacter:"\\ea85"}),e.repl=new e("repl",{fontCharacter:"\\ea85"}),e.zap=new e("zap",{fontCharacter:"\\ea86"}),e.symbolEvent=new e("symbol-event",{fontCharacter:"\\ea86"}),e.error=new e("error",{fontCharacter:"\\ea87"}),e.stop=new e("stop",{fontCharacter:"\\ea87"}),e.variable=new e("variable",{fontCharacter:"\\ea88"}),e.symbolVariable=new e("symbol-variable",{fontCharacter:"\\ea88"}),e.array=new e("array",{fontCharacter:"\\ea8a"}),e.symbolArray=new e("symbol-array",{fontCharacter:"\\ea8a"}),e.symbolModule=new e("symbol-module",{fontCharacter:"\\ea8b"}),e.symbolPackage=new e("symbol-package",{fontCharacter:"\\ea8b"}),e.symbolNamespace=new e("symbol-namespace",{fontCharacter:"\\ea8b"}),e.symbolObject=new e("symbol-object",{fontCharacter:"\\ea8b"}),e.symbolMethod=new e("symbol-method",{fontCharacter:"\\ea8c"}),e.symbolFunction=new e("symbol-function",{fontCharacter:"\\ea8c"}),e.symbolConstructor=new e("symbol-constructor",{fontCharacter:"\\ea8c"}),e.symbolBoolean=new e("symbol-boolean",{fontCharacter:"\\ea8f"}),e.symbolNull=new e("symbol-null",{fontCharacter:"\\ea8f"}),e.symbolNumeric=new e("symbol-numeric",{fontCharacter:"\\ea90"}),e.symbolNumber=new e("symbol-number",{fontCharacter:"\\ea90"}),e.symbolStructure=new e("symbol-structure",{fontCharacter:"\\ea91"}),e.symbolStruct=new e("symbol-struct",{fontCharacter:"\\ea91"}),e.symbolParameter=new e("symbol-parameter",{fontCharacter:"\\ea92"}),e.symbolTypeParameter=new e("symbol-type-parameter",{fontCharacter:"\\ea92"}),e.symbolKey=new e("symbol-key",{fontCharacter:"\\ea93"}),e.symbolText=new e("symbol-text",{fontCharacter:"\\ea93"}),e.symbolReference=new e("symbol-reference",{fontCharacter:"\\ea94"}),e.goToFile=new e("go-to-file",{fontCharacter:"\\ea94"}),e.symbolEnum=new e("symbol-enum",{fontCharacter:"\\ea95"}),e.symbolValue=new e("symbol-value",{fontCharacter:"\\ea95"}),e.symbolRuler=new e("symbol-ruler",{fontCharacter:"\\ea96"}),e.symbolUnit=new e("symbol-unit",{fontCharacter:"\\ea96"}),e.activateBreakpoints=new e("activate-breakpoints",{fontCharacter:"\\ea97"}),e.archive=new e("archive",{fontCharacter:"\\ea98"}),e.arrowBoth=new e("arrow-both",{fontCharacter:"\\ea99"}),e.arrowDown=new e("arrow-down",{fontCharacter:"\\ea9a"}),e.arrowLeft=new e("arrow-left",{fontCharacter:"\\ea9b"}),e.arrowRight=new e("arrow-right",{fontCharacter:"\\ea9c"}),e.arrowSmallDown=new e("arrow-small-down",{fontCharacter:"\\ea9d"}),e.arrowSmallLeft=new e("arrow-small-left",{fontCharacter:"\\ea9e"}),e.arrowSmallRight=new e("arrow-small-right",{fontCharacter:"\\ea9f"}),e.arrowSmallUp=new e("arrow-small-up",{fontCharacter:"\\eaa0"}),e.arrowUp=new e("arrow-up",{fontCharacter:"\\eaa1"}),e.bell=new e("bell",{fontCharacter:"\\eaa2"}),e.bold=new e("bold",{fontCharacter:"\\eaa3"}),e.book=new e("book",{fontCharacter:"\\eaa4"}),e.bookmark=new e("bookmark",{fontCharacter:"\\eaa5"}),e.debugBreakpointConditionalUnverified=new e("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),e.debugBreakpointConditional=new e("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),e.debugBreakpointConditionalDisabled=new e("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),e.debugBreakpointDataUnverified=new e("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),e.debugBreakpointData=new e("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),e.debugBreakpointDataDisabled=new e("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),e.debugBreakpointLogUnverified=new e("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),e.debugBreakpointLog=new e("debug-breakpoint-log",{fontCharacter:"\\eaab"}),e.debugBreakpointLogDisabled=new e("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),e.briefcase=new e("briefcase",{fontCharacter:"\\eaac"}),e.broadcast=new e("broadcast",{fontCharacter:"\\eaad"}),e.browser=new e("browser",{fontCharacter:"\\eaae"}),e.bug=new e("bug",{fontCharacter:"\\eaaf"}),e.calendar=new e("calendar",{fontCharacter:"\\eab0"}),e.caseSensitive=new e("case-sensitive",{fontCharacter:"\\eab1"}),e.check=new e("check",{fontCharacter:"\\eab2"}),e.checklist=new e("checklist",{fontCharacter:"\\eab3"}),e.chevronDown=new e("chevron-down",{fontCharacter:"\\eab4"}),e.dropDownButton=new e("drop-down-button",e.chevronDown.definition),e.chevronLeft=new e("chevron-left",{fontCharacter:"\\eab5"}),e.chevronRight=new e("chevron-right",{fontCharacter:"\\eab6"}),e.chevronUp=new e("chevron-up",{fontCharacter:"\\eab7"}),e.chromeClose=new e("chrome-close",{fontCharacter:"\\eab8"}),e.chromeMaximize=new e("chrome-maximize",{fontCharacter:"\\eab9"}),e.chromeMinimize=new e("chrome-minimize",{fontCharacter:"\\eaba"}),e.chromeRestore=new e("chrome-restore",{fontCharacter:"\\eabb"}),e.circleOutline=new e("circle-outline",{fontCharacter:"\\eabc"}),e.debugBreakpointUnverified=new e("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),e.circleSlash=new e("circle-slash",{fontCharacter:"\\eabd"}),e.circuitBoard=new e("circuit-board",{fontCharacter:"\\eabe"}),e.clearAll=new e("clear-all",{fontCharacter:"\\eabf"}),e.clippy=new e("clippy",{fontCharacter:"\\eac0"}),e.closeAll=new e("close-all",{fontCharacter:"\\eac1"}),e.cloudDownload=new e("cloud-download",{fontCharacter:"\\eac2"}),e.cloudUpload=new e("cloud-upload",{fontCharacter:"\\eac3"}),e.code=new e("code",{fontCharacter:"\\eac4"}),e.collapseAll=new e("collapse-all",{fontCharacter:"\\eac5"}),e.colorMode=new e("color-mode",{fontCharacter:"\\eac6"}),e.commentDiscussion=new e("comment-discussion",{fontCharacter:"\\eac7"}),e.compareChanges=new e("compare-changes",{fontCharacter:"\\eafd"}),e.creditCard=new e("credit-card",{fontCharacter:"\\eac9"}),e.dash=new e("dash",{fontCharacter:"\\eacc"}),e.dashboard=new e("dashboard",{fontCharacter:"\\eacd"}),e.database=new e("database",{fontCharacter:"\\eace"}),e.debugContinue=new e("debug-continue",{fontCharacter:"\\eacf"}),e.debugDisconnect=new e("debug-disconnect",{fontCharacter:"\\ead0"}),e.debugPause=new e("debug-pause",{fontCharacter:"\\ead1"}),e.debugRestart=new e("debug-restart",{fontCharacter:"\\ead2"}),e.debugStart=new e("debug-start",{fontCharacter:"\\ead3"}),e.debugStepInto=new e("debug-step-into",{fontCharacter:"\\ead4"}),e.debugStepOut=new e("debug-step-out",{fontCharacter:"\\ead5"}),e.debugStepOver=new e("debug-step-over",{fontCharacter:"\\ead6"}),e.debugStop=new e("debug-stop",{fontCharacter:"\\ead7"}),e.debug=new e("debug",{fontCharacter:"\\ead8"}),e.deviceCameraVideo=new e("device-camera-video",{fontCharacter:"\\ead9"}),e.deviceCamera=new e("device-camera",{fontCharacter:"\\eada"}),e.deviceMobile=new e("device-mobile",{fontCharacter:"\\eadb"}),e.diffAdded=new e("diff-added",{fontCharacter:"\\eadc"}),e.diffIgnored=new e("diff-ignored",{fontCharacter:"\\eadd"}),e.diffModified=new e("diff-modified",{fontCharacter:"\\eade"}),e.diffRemoved=new e("diff-removed",{fontCharacter:"\\eadf"}),e.diffRenamed=new e("diff-renamed",{fontCharacter:"\\eae0"}),e.diff=new e("diff",{fontCharacter:"\\eae1"}),e.discard=new e("discard",{fontCharacter:"\\eae2"}),e.editorLayout=new e("editor-layout",{fontCharacter:"\\eae3"}),e.emptyWindow=new e("empty-window",{fontCharacter:"\\eae4"}),e.exclude=new e("exclude",{fontCharacter:"\\eae5"}),e.extensions=new e("extensions",{fontCharacter:"\\eae6"}),e.eyeClosed=new e("eye-closed",{fontCharacter:"\\eae7"}),e.fileBinary=new e("file-binary",{fontCharacter:"\\eae8"}),e.fileCode=new e("file-code",{fontCharacter:"\\eae9"}),e.fileMedia=new e("file-media",{fontCharacter:"\\eaea"}),e.filePdf=new e("file-pdf",{fontCharacter:"\\eaeb"}),e.fileSubmodule=new e("file-submodule",{fontCharacter:"\\eaec"}),e.fileSymlinkDirectory=new e("file-symlink-directory",{fontCharacter:"\\eaed"}),e.fileSymlinkFile=new e("file-symlink-file",{fontCharacter:"\\eaee"}),e.fileZip=new e("file-zip",{fontCharacter:"\\eaef"}),e.files=new e("files",{fontCharacter:"\\eaf0"}),e.filter=new e("filter",{fontCharacter:"\\eaf1"}),e.flame=new e("flame",{fontCharacter:"\\eaf2"}),e.foldDown=new e("fold-down",{fontCharacter:"\\eaf3"}),e.foldUp=new e("fold-up",{fontCharacter:"\\eaf4"}),e.fold=new e("fold",{fontCharacter:"\\eaf5"}),e.folderActive=new e("folder-active",{fontCharacter:"\\eaf6"}),e.folderOpened=new e("folder-opened",{fontCharacter:"\\eaf7"}),e.gear=new e("gear",{fontCharacter:"\\eaf8"}),e.gift=new e("gift",{fontCharacter:"\\eaf9"}),e.gistSecret=new e("gist-secret",{fontCharacter:"\\eafa"}),e.gist=new e("gist",{fontCharacter:"\\eafb"}),e.gitCommit=new e("git-commit",{fontCharacter:"\\eafc"}),e.gitCompare=new e("git-compare",{fontCharacter:"\\eafd"}),e.gitMerge=new e("git-merge",{fontCharacter:"\\eafe"}),e.githubAction=new e("github-action",{fontCharacter:"\\eaff"}),e.githubAlt=new e("github-alt",{fontCharacter:"\\eb00"}),e.globe=new e("globe",{fontCharacter:"\\eb01"}),e.grabber=new e("grabber",{fontCharacter:"\\eb02"}),e.graph=new e("graph",{fontCharacter:"\\eb03"}),e.gripper=new e("gripper",{fontCharacter:"\\eb04"}),e.heart=new e("heart",{fontCharacter:"\\eb05"}),e.home=new e("home",{fontCharacter:"\\eb06"}),e.horizontalRule=new e("horizontal-rule",{fontCharacter:"\\eb07"}),e.hubot=new e("hubot",{fontCharacter:"\\eb08"}),e.inbox=new e("inbox",{fontCharacter:"\\eb09"}),e.issueClosed=new e("issue-closed",{fontCharacter:"\\eba4"}),e.issueReopened=new e("issue-reopened",{fontCharacter:"\\eb0b"}),e.issues=new e("issues",{fontCharacter:"\\eb0c"}),e.italic=new e("italic",{fontCharacter:"\\eb0d"}),e.jersey=new e("jersey",{fontCharacter:"\\eb0e"}),e.json=new e("json",{fontCharacter:"\\eb0f"}),e.kebabVertical=new e("kebab-vertical",{fontCharacter:"\\eb10"}),e.key=new e("key",{fontCharacter:"\\eb11"}),e.law=new e("law",{fontCharacter:"\\eb12"}),e.lightbulbAutofix=new e("lightbulb-autofix",{fontCharacter:"\\eb13"}),e.linkExternal=new e("link-external",{fontCharacter:"\\eb14"}),e.link=new e("link",{fontCharacter:"\\eb15"}),e.listOrdered=new e("list-ordered",{fontCharacter:"\\eb16"}),e.listUnordered=new e("list-unordered",{fontCharacter:"\\eb17"}),e.liveShare=new e("live-share",{fontCharacter:"\\eb18"}),e.loading=new e("loading",{fontCharacter:"\\eb19"}),e.location=new e("location",{fontCharacter:"\\eb1a"}),e.mailRead=new e("mail-read",{fontCharacter:"\\eb1b"}),e.mail=new e("mail",{fontCharacter:"\\eb1c"}),e.markdown=new e("markdown",{fontCharacter:"\\eb1d"}),e.megaphone=new e("megaphone",{fontCharacter:"\\eb1e"}),e.mention=new e("mention",{fontCharacter:"\\eb1f"}),e.milestone=new e("milestone",{fontCharacter:"\\eb20"}),e.mortarBoard=new e("mortar-board",{fontCharacter:"\\eb21"}),e.move=new e("move",{fontCharacter:"\\eb22"}),e.multipleWindows=new e("multiple-windows",{fontCharacter:"\\eb23"}),e.mute=new e("mute",{fontCharacter:"\\eb24"}),e.noNewline=new e("no-newline",{fontCharacter:"\\eb25"}),e.note=new e("note",{fontCharacter:"\\eb26"}),e.octoface=new e("octoface",{fontCharacter:"\\eb27"}),e.openPreview=new e("open-preview",{fontCharacter:"\\eb28"}),e.package_=new e("package",{fontCharacter:"\\eb29"}),e.paintcan=new e("paintcan",{fontCharacter:"\\eb2a"}),e.pin=new e("pin",{fontCharacter:"\\eb2b"}),e.play=new e("play",{fontCharacter:"\\eb2c"}),e.run=new e("run",{fontCharacter:"\\eb2c"}),e.plug=new e("plug",{fontCharacter:"\\eb2d"}),e.preserveCase=new e("preserve-case",{fontCharacter:"\\eb2e"}),e.preview=new e("preview",{fontCharacter:"\\eb2f"}),e.project=new e("project",{fontCharacter:"\\eb30"}),e.pulse=new e("pulse",{fontCharacter:"\\eb31"}),e.question=new e("question",{fontCharacter:"\\eb32"}),e.quote=new e("quote",{fontCharacter:"\\eb33"}),e.radioTower=new e("radio-tower",{fontCharacter:"\\eb34"}),e.reactions=new e("reactions",{fontCharacter:"\\eb35"}),e.references=new e("references",{fontCharacter:"\\eb36"}),e.refresh=new e("refresh",{fontCharacter:"\\eb37"}),e.regex=new e("regex",{fontCharacter:"\\eb38"}),e.remoteExplorer=new e("remote-explorer",{fontCharacter:"\\eb39"}),e.remote=new e("remote",{fontCharacter:"\\eb3a"}),e.remove=new e("remove",{fontCharacter:"\\eb3b"}),e.replaceAll=new e("replace-all",{fontCharacter:"\\eb3c"}),e.replace=new e("replace",{fontCharacter:"\\eb3d"}),e.repoClone=new e("repo-clone",{fontCharacter:"\\eb3e"}),e.repoForcePush=new e("repo-force-push",{fontCharacter:"\\eb3f"}),e.repoPull=new e("repo-pull",{fontCharacter:"\\eb40"}),e.repoPush=new e("repo-push",{fontCharacter:"\\eb41"}),e.report=new e("report",{fontCharacter:"\\eb42"}),e.requestChanges=new e("request-changes",{fontCharacter:"\\eb43"}),e.rocket=new e("rocket",{fontCharacter:"\\eb44"}),e.rootFolderOpened=new e("root-folder-opened",{fontCharacter:"\\eb45"}),e.rootFolder=new e("root-folder",{fontCharacter:"\\eb46"}),e.rss=new e("rss",{fontCharacter:"\\eb47"}),e.ruby=new e("ruby",{fontCharacter:"\\eb48"}),e.saveAll=new e("save-all",{fontCharacter:"\\eb49"}),e.saveAs=new e("save-as",{fontCharacter:"\\eb4a"}),e.save=new e("save",{fontCharacter:"\\eb4b"}),e.screenFull=new e("screen-full",{fontCharacter:"\\eb4c"}),e.screenNormal=new e("screen-normal",{fontCharacter:"\\eb4d"}),e.searchStop=new e("search-stop",{fontCharacter:"\\eb4e"}),e.server=new e("server",{fontCharacter:"\\eb50"}),e.settingsGear=new e("settings-gear",{fontCharacter:"\\eb51"}),e.settings=new e("settings",{fontCharacter:"\\eb52"}),e.shield=new e("shield",{fontCharacter:"\\eb53"}),e.smiley=new e("smiley",{fontCharacter:"\\eb54"}),e.sortPrecedence=new e("sort-precedence",{fontCharacter:"\\eb55"}),e.splitHorizontal=new e("split-horizontal",{fontCharacter:"\\eb56"}),e.splitVertical=new e("split-vertical",{fontCharacter:"\\eb57"}),e.squirrel=new e("squirrel",{fontCharacter:"\\eb58"}),e.starFull=new e("star-full",{fontCharacter:"\\eb59"}),e.starHalf=new e("star-half",{fontCharacter:"\\eb5a"}),e.symbolClass=new e("symbol-class",{fontCharacter:"\\eb5b"}),e.symbolColor=new e("symbol-color",{fontCharacter:"\\eb5c"}),e.symbolConstant=new e("symbol-constant",{fontCharacter:"\\eb5d"}),e.symbolEnumMember=new e("symbol-enum-member",{fontCharacter:"\\eb5e"}),e.symbolField=new e("symbol-field",{fontCharacter:"\\eb5f"}),e.symbolFile=new e("symbol-file",{fontCharacter:"\\eb60"}),e.symbolInterface=new e("symbol-interface",{fontCharacter:"\\eb61"}),e.symbolKeyword=new e("symbol-keyword",{fontCharacter:"\\eb62"}),e.symbolMisc=new e("symbol-misc",{fontCharacter:"\\eb63"}),e.symbolOperator=new e("symbol-operator",{fontCharacter:"\\eb64"}),e.symbolProperty=new e("symbol-property",{fontCharacter:"\\eb65"}),e.wrench=new e("wrench",{fontCharacter:"\\eb65"}),e.wrenchSubaction=new e("wrench-subaction",{fontCharacter:"\\eb65"}),e.symbolSnippet=new e("symbol-snippet",{fontCharacter:"\\eb66"}),e.tasklist=new e("tasklist",{fontCharacter:"\\eb67"}),e.telescope=new e("telescope",{fontCharacter:"\\eb68"}),e.textSize=new e("text-size",{fontCharacter:"\\eb69"}),e.threeBars=new e("three-bars",{fontCharacter:"\\eb6a"}),e.thumbsdown=new e("thumbsdown",{fontCharacter:"\\eb6b"}),e.thumbsup=new e("thumbsup",{fontCharacter:"\\eb6c"}),e.tools=new e("tools",{fontCharacter:"\\eb6d"}),e.triangleDown=new e("triangle-down",{fontCharacter:"\\eb6e"}),e.triangleLeft=new e("triangle-left",{fontCharacter:"\\eb6f"}),e.triangleRight=new e("triangle-right",{fontCharacter:"\\eb70"}),e.triangleUp=new e("triangle-up",{fontCharacter:"\\eb71"}),e.twitter=new e("twitter",{fontCharacter:"\\eb72"}),e.unfold=new e("unfold",{fontCharacter:"\\eb73"}),e.unlock=new e("unlock",{fontCharacter:"\\eb74"}),e.unmute=new e("unmute",{fontCharacter:"\\eb75"}),e.unverified=new e("unverified",{fontCharacter:"\\eb76"}),e.verified=new e("verified",{fontCharacter:"\\eb77"}),e.versions=new e("versions",{fontCharacter:"\\eb78"}),e.vmActive=new e("vm-active",{fontCharacter:"\\eb79"}),e.vmOutline=new e("vm-outline",{fontCharacter:"\\eb7a"}),e.vmRunning=new e("vm-running",{fontCharacter:"\\eb7b"}),e.watch=new e("watch",{fontCharacter:"\\eb7c"}),e.whitespace=new e("whitespace",{fontCharacter:"\\eb7d"}),e.wholeWord=new e("whole-word",{fontCharacter:"\\eb7e"}),e.window=new e("window",{fontCharacter:"\\eb7f"}),e.wordWrap=new e("word-wrap",{fontCharacter:"\\eb80"}),e.zoomIn=new e("zoom-in",{fontCharacter:"\\eb81"}),e.zoomOut=new e("zoom-out",{fontCharacter:"\\eb82"}),e.listFilter=new e("list-filter",{fontCharacter:"\\eb83"}),e.listFlat=new e("list-flat",{fontCharacter:"\\eb84"}),e.listSelection=new e("list-selection",{fontCharacter:"\\eb85"}),e.selection=new e("selection",{fontCharacter:"\\eb85"}),e.listTree=new e("list-tree",{fontCharacter:"\\eb86"}),e.debugBreakpointFunctionUnverified=new e("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),e.debugBreakpointFunction=new e("debug-breakpoint-function",{fontCharacter:"\\eb88"}),e.debugBreakpointFunctionDisabled=new e("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),e.debugStackframeActive=new e("debug-stackframe-active",{fontCharacter:"\\eb89"}),e.debugStackframeDot=new e("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),e.debugStackframe=new e("debug-stackframe",{fontCharacter:"\\eb8b"}),e.debugStackframeFocused=new e("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),e.debugBreakpointUnsupported=new e("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),e.symbolString=new e("symbol-string",{fontCharacter:"\\eb8d"}),e.debugReverseContinue=new e("debug-reverse-continue",{fontCharacter:"\\eb8e"}),e.debugStepBack=new e("debug-step-back",{fontCharacter:"\\eb8f"}),e.debugRestartFrame=new e("debug-restart-frame",{fontCharacter:"\\eb90"}),e.callIncoming=new e("call-incoming",{fontCharacter:"\\eb92"}),e.callOutgoing=new e("call-outgoing",{fontCharacter:"\\eb93"}),e.menu=new e("menu",{fontCharacter:"\\eb94"}),e.expandAll=new e("expand-all",{fontCharacter:"\\eb95"}),e.feedback=new e("feedback",{fontCharacter:"\\eb96"}),e.groupByRefType=new e("group-by-ref-type",{fontCharacter:"\\eb97"}),e.ungroupByRefType=new e("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),e.account=new e("account",{fontCharacter:"\\eb99"}),e.bellDot=new e("bell-dot",{fontCharacter:"\\eb9a"}),e.debugConsole=new e("debug-console",{fontCharacter:"\\eb9b"}),e.library=new e("library",{fontCharacter:"\\eb9c"}),e.output=new e("output",{fontCharacter:"\\eb9d"}),e.runAll=new e("run-all",{fontCharacter:"\\eb9e"}),e.syncIgnored=new e("sync-ignored",{fontCharacter:"\\eb9f"}),e.pinned=new e("pinned",{fontCharacter:"\\eba0"}),e.githubInverted=new e("github-inverted",{fontCharacter:"\\eba1"}),e.debugAlt=new e("debug-alt",{fontCharacter:"\\eb91"}),e.serverProcess=new e("server-process",{fontCharacter:"\\eba2"}),e.serverEnvironment=new e("server-environment",{fontCharacter:"\\eba3"}),e.pass=new e("pass",{fontCharacter:"\\eba4"}),e.stopCircle=new e("stop-circle",{fontCharacter:"\\eba5"}),e.playCircle=new e("play-circle",{fontCharacter:"\\eba6"}),e.record=new e("record",{fontCharacter:"\\eba7"}),e.debugAltSmall=new e("debug-alt-small",{fontCharacter:"\\eba8"}),e.vmConnect=new e("vm-connect",{fontCharacter:"\\eba9"}),e.cloud=new e("cloud",{fontCharacter:"\\ebaa"}),e.merge=new e("merge",{fontCharacter:"\\ebab"}),e.exportIcon=new e("export",{fontCharacter:"\\ebac"}),e.graphLeft=new e("graph-left",{fontCharacter:"\\ebad"}),e.magnet=new e("magnet",{fontCharacter:"\\ebae"}),e.notebook=new e("notebook",{fontCharacter:"\\ebaf"}),e.redo=new e("redo",{fontCharacter:"\\ebb0"}),e.checkAll=new e("check-all",{fontCharacter:"\\ebb1"}),e.pinnedDirty=new e("pinned-dirty",{fontCharacter:"\\ebb2"}),e.passFilled=new e("pass-filled",{fontCharacter:"\\ebb3"}),e.circleLargeFilled=new e("circle-large-filled",{fontCharacter:"\\ebb4"}),e.circleLargeOutline=new e("circle-large-outline",{fontCharacter:"\\ebb5"}),e.combine=new e("combine",{fontCharacter:"\\ebb6"}),e.gather=new e("gather",{fontCharacter:"\\ebb6"}),e.table=new e("table",{fontCharacter:"\\ebb7"}),e.variableGroup=new e("variable-group",{fontCharacter:"\\ebb8"}),e.typeHierarchy=new e("type-hierarchy",{fontCharacter:"\\ebb9"}),e.typeHierarchySub=new e("type-hierarchy-sub",{fontCharacter:"\\ebba"}),e.typeHierarchySuper=new e("type-hierarchy-super",{fontCharacter:"\\ebbb"}),e.gitPullRequestCreate=new e("git-pull-request-create",{fontCharacter:"\\ebbc"}),e.runAbove=new e("run-above",{fontCharacter:"\\ebbd"}),e.runBelow=new e("run-below",{fontCharacter:"\\ebbe"}),e.notebookTemplate=new e("notebook-template",{fontCharacter:"\\ebbf"}),e.debugRerun=new e("debug-rerun",{fontCharacter:"\\ebc0"}),e.workspaceTrusted=new e("workspace-trusted",{fontCharacter:"\\ebc1"}),e.workspaceUntrusted=new e("workspace-untrusted",{fontCharacter:"\\ebc2"}),e.workspaceUnspecified=new e("workspace-unspecified",{fontCharacter:"\\ebc3"}),e.terminalCmd=new e("terminal-cmd",{fontCharacter:"\\ebc4"}),e.terminalDebian=new e("terminal-debian",{fontCharacter:"\\ebc5"}),e.terminalLinux=new e("terminal-linux",{fontCharacter:"\\ebc6"}),e.terminalPowershell=new e("terminal-powershell",{fontCharacter:"\\ebc7"}),e.terminalTmux=new e("terminal-tmux",{fontCharacter:"\\ebc8"}),e.terminalUbuntu=new e("terminal-ubuntu",{fontCharacter:"\\ebc9"}),e.terminalBash=new e("terminal-bash",{fontCharacter:"\\ebca"}),e.arrowSwap=new e("arrow-swap",{fontCharacter:"\\ebcb"}),e.copy=new e("copy",{fontCharacter:"\\ebcc"}),e.personAdd=new e("person-add",{fontCharacter:"\\ebcd"}),e.filterFilled=new e("filter-filled",{fontCharacter:"\\ebce"}),e.wand=new e("wand",{fontCharacter:"\\ebcf"}),e.debugLineByLine=new e("debug-line-by-line",{fontCharacter:"\\ebd0"}),e.inspect=new e("inspect",{fontCharacter:"\\ebd1"}),e.layers=new e("layers",{fontCharacter:"\\ebd2"}),e.layersDot=new e("layers-dot",{fontCharacter:"\\ebd3"}),e.layersActive=new e("layers-active",{fontCharacter:"\\ebd4"}),e.compass=new e("compass",{fontCharacter:"\\ebd5"}),e.compassDot=new e("compass-dot",{fontCharacter:"\\ebd6"}),e.compassActive=new e("compass-active",{fontCharacter:"\\ebd7"}),e.azure=new e("azure",{fontCharacter:"\\ebd8"}),e.issueDraft=new e("issue-draft",{fontCharacter:"\\ebd9"}),e.gitPullRequestClosed=new e("git-pull-request-closed",{fontCharacter:"\\ebda"}),e.gitPullRequestDraft=new e("git-pull-request-draft",{fontCharacter:"\\ebdb"}),e.debugAll=new e("debug-all",{fontCharacter:"\\ebdc"}),e.debugCoverage=new e("debug-coverage",{fontCharacter:"\\ebdd"}),e.runErrors=new e("run-errors",{fontCharacter:"\\ebde"}),e.folderLibrary=new e("folder-library",{fontCharacter:"\\ebdf"}),e.debugContinueSmall=new e("debug-continue-small",{fontCharacter:"\\ebe0"}),e.beakerStop=new e("beaker-stop",{fontCharacter:"\\ebe1"}),e.graphLine=new e("graph-line",{fontCharacter:"\\ebe2"}),e.graphScatter=new e("graph-scatter",{fontCharacter:"\\ebe3"}),e.pieChart=new e("pie-chart",{fontCharacter:"\\ebe4"}),e.bracket=new e("bracket",e.json.definition),e.bracketDot=new e("bracket-dot",{fontCharacter:"\\ebe5"}),e.bracketError=new e("bracket-error",{fontCharacter:"\\ebe6"}),e.lockSmall=new e("lock-small",{fontCharacter:"\\ebe7"}),e.azureDevops=new e("azure-devops",{fontCharacter:"\\ebe8"}),e.verifiedFilled=new e("verified-filled",{fontCharacter:"\\ebe9"})}(l||(l={}))},79881:function(e,t,n){"use strict";n.d(t,{B8:function(){return h},Cp:function(){return a},F0:function(){return c},L6:function(){return d},VV:function(){return l},b1:function(){return u},dL:function(){return r},ri:function(){return s}});const i=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout((()=>{if(e.stack)throw new Error(e.message+"\n\n"+e.stack);throw e}),0)}}emit(e){this.listeners.forEach((t=>{t(e)}))}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function r(e){l(e)||i.onUnexpectedError(e)}function a(e){l(e)||i.onUnexpectedExternalError(e)}function s(e){if(e instanceof Error){let{name:t,message:n}=e;return{$isError:!0,name:t,message:n,stack:e.stacktrace||e.stack}}return e}const o="Canceled";function l(e){return e instanceof Error&&e.name===o&&e.message===o}function c(){const e=new Error(o);return e.name=e.message,e}function u(e){return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")}function d(e){return e?new Error(`Illegal state: ${e}`):new Error("Illegal state")}class h extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}},4348:function(e,t,n){"use strict";n.d(t,{D0:function(){return d},E7:function(){return h},K3:function(){return u},Q5:function(){return c},ZD:function(){return p},ju:function(){return i}});var i,r=n(79881),a=n(69323),s=n(34502),o=n(95830);!function(e){function t(e){return(t,n=null,i)=>{let r,a=!1;return r=e((e=>{if(!a)return r?r.dispose():a=!0,t.call(n,e)}),null,i),a&&r.dispose(),r}}function n(e,t){return o(((n,i=null,r)=>e((e=>n.call(i,t(e))),null,r)))}function i(e,t){return o(((n,i=null,r)=>e((e=>{t(e),n.call(i,e)}),null,r)))}function r(e,t){return o(((n,i=null,r)=>e((e=>t(e)&&n.call(i,e)),null,r)))}function s(e,t,i){let r=i;return n(e,(e=>(r=t(r,e),r)))}function o(e){let t;const n=new c({onFirstListenerAdd(){t=e(n.fire,n)},onLastListenerRemove(){t.dispose()}});return n.event}function l(e,t,n=100,i=!1,r){let a,s,o,l=0;const u=new c({leakWarningThreshold:r,onFirstListenerAdd(){a=e((e=>{l++,s=t(s,e),i&&!o&&(u.fire(s),s=void 0),clearTimeout(o),o=setTimeout((()=>{const e=s;s=void 0,o=void 0,(!i||l>1)&&u.fire(e),l=0}),n)}))},onLastListenerRemove(){a.dispose()}});return u.event}function u(e,t=((e,t)=>e===t)){let n,i=!0;return r(e,(e=>{const r=i||!t(e,n);return i=!1,n=e,r}))}e.None=()=>a.JT.None,e.once=t,e.map=n,e.forEach=i,e.filter=r,e.signal=function(e){return e},e.any=function(...e){return(t,n=null,i)=>(0,a.F8)(...e.map((e=>e((e=>t.call(n,e)),null,i))))},e.reduce=s,e.debounce=l,e.latch=u,e.split=function(t,n){return[e.filter(t,n),e.filter(t,(e=>!n(e)))]},e.buffer=function(e,t=!1,n=[]){let i=n.slice(),r=e((e=>{i?i.push(e):s.fire(e)}));const a=()=>{i&&i.forEach((e=>s.fire(e))),i=null},s=new c({onFirstListenerAdd(){r||(r=e((e=>s.fire(e))))},onFirstListenerDidAdd(){i&&(t?setTimeout(a):a())},onLastListenerRemove(){r&&r.dispose(),r=null}});return s.event};class d{constructor(e){this.event=e}map(e){return new d(n(this.event,e))}forEach(e){return new d(i(this.event,e))}filter(e){return new d(r(this.event,e))}reduce(e,t){return new d(s(this.event,e,t))}latch(){return new d(u(this.event))}debounce(e,t=100,n=!1,i){return new d(l(this.event,e,t,n,i))}on(e,t,n){return this.event(e,t,n)}once(e,n,i){return t(this.event)(e,n,i)}}e.chain=function(e){return new d(e)},e.fromNodeEventEmitter=function(e,t,n=(e=>e)){const i=(...e)=>r.fire(n(...e)),r=new c({onFirstListenerAdd:()=>e.on(t,i),onLastListenerRemove:()=>e.removeListener(t,i)});return r.event},e.fromDOMEventEmitter=function(e,t,n=(e=>e)){const i=(...e)=>r.fire(n(...e)),r=new c({onFirstListenerAdd:()=>e.addEventListener(t,i),onLastListenerRemove:()=>e.removeEventListener(t,i)});return r.event},e.toPromise=function(e){return new Promise((n=>t(e)(n)))}}(i||(i={}));class l{constructor(e){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${e}_${l._idPool++}`}start(e){this._stopWatch=new o.G(!0),this._listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this._elapsedOverall+=e,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${e.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}l._idPool=0;class c{constructor(e){var t;this._disposed=!1,this._options=e,this._leakageMon=void 0,this._perfMon=(null===(t=this._options)||void 0===t?void 0:t._profName)?new l(this._options._profName):void 0}get event(){return this._event||(this._event=(e,t,n)=>{var i;this._listeners||(this._listeners=new s.S);const r=this._listeners.isEmpty();r&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const o=this._listeners.push(t?[e,t]:e);r&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,e,t);const l=null===(i=this._leakageMon)||void 0===i?void 0:i.check(this._listeners.size),c=(0,a.OF)((()=>{if(l&&l(),!this._disposed&&(o(),this._options&&this._options.onLastListenerRemove)){this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)}}));return n instanceof a.SL?n.add(c):Array.isArray(n)&&n.push(c),c}),this._event}fire(e){var t,n;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new s.S);for(let t of this._listeners)this._deliveryQueue.push([t,e]);for(null===(t=this._perfMon)||void 0===t||t.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[e,t]=this._deliveryQueue.shift();try{"function"==typeof e?e.call(void 0,t):e[0].call(e[1],t)}catch(e){(0,r.dL)(e)}}null===(n=this._perfMon)||void 0===n||n.stop()}}dispose(){var e,t,n,i,r;this._disposed||(this._disposed=!0,null===(e=this._listeners)||void 0===e||e.clear(),null===(t=this._deliveryQueue)||void 0===t||t.clear(),null===(i=null===(n=this._options)||void 0===n?void 0:n.onLastListenerRemove)||void 0===i||i.call(n),null===(r=this._leakageMon)||void 0===r||r.dispose())}}class u extends c{constructor(e){super(e),this._isPaused=0,this._eventQueue=new s.S,this._mergeFn=null==e?void 0:e.merge}pause(){this._isPaused++}resume(){if(0!==this._isPaused&&0==--this._isPaused)if(this._mergeFn){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}else for(;!this._isPaused&&0!==this._eventQueue.size;)super.fire(this._eventQueue.shift())}fire(e){this._listeners&&(0!==this._isPaused?this._eventQueue.push(e):super.fire(e))}}class d extends u{constructor(e){var t;super(e),this._delay=null!==(t=e.delay)&&void 0!==t?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout((()=>{this._handle=void 0,this.resume()}),this._delay)),super.fire(e)}}class h{constructor(){this.buffers=[]}wrapEvent(e){return(t,n,i)=>e((e=>{const i=this.buffers[this.buffers.length-1];i?i.push((()=>t.call(n,e))):t.call(n,e)}),void 0,i)}bufferEvents(e){const t=[];this.buffers.push(t);const n=e();return this.buffers.pop(),t.forEach((e=>e())),n}}class p{constructor(){this.listening=!1,this.inputEvent=i.None,this.inputEventListener=a.JT.None,this.emitter=new c({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function(e,t,n){"use strict";function i(e){const t=this;let n,i=!1;return function(){return i||(i=!0,n=e.apply(t,arguments)),n}}n.d(t,{I:function(){return i}})},88226:function(e,t,n){"use strict";var i;n.d(t,{$:function(){return i}}),function(e){e.is=function(e){return e&&"object"==typeof e&&"function"==typeof e[Symbol.iterator]};const t=Object.freeze([]);e.empty=function(){return t},e.single=function*(e){yield e},e.from=function(e){return e||t},e.isEmpty=function(e){return!e||!0===e[Symbol.iterator]().next().done},e.first=function(e){return e[Symbol.iterator]().next().value},e.some=function(e,t){for(const n of e)if(t(n))return!0;return!1},e.find=function(e,t){for(const n of e)if(t(n))return n},e.filter=function*(e,t){for(const n of e)t(n)&&(yield n)},e.map=function*(e,t){let n=0;for(const i of e)yield t(i,n++)},e.concat=function*(...e){for(const t of e)for(const e of t)yield e},e.concatNested=function*(e){for(const t of e)for(const e of t)yield e},e.reduce=function(e,t,n){let i=n;for(const n of e)i=t(i,n);return i},e.slice=function*(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);t<n;t++)yield e[t]},e.consume=function(t,n=Number.POSITIVE_INFINITY){const i=[];if(0===n)return[i,t];const r=t[Symbol.iterator]();for(let t=0;t<n;t++){const t=r.next();if(t.done)return[i,e.empty()];i.push(t.value)}return[i,{[Symbol.iterator](){return r}}]},e.equals=function(e,t,n=((e,t)=>e===t)){const i=e[Symbol.iterator](),r=t[Symbol.iterator]();for(;;){const e=i.next(),t=r.next();if(e.done!==t.done)return!1;if(e.done)return!0;if(!n(e.value,t.value))return!1}}}(i||(i={}))},69323:function(e,t,n){"use strict";n.d(t,{B9:function(){return h},F8:function(){return p},JT:function(){return g},Jz:function(){return b},OF:function(){return f},SL:function(){return m},Wf:function(){return d},XK:function(){return v},dk:function(){return c}});var i=n(17845),r=n(88226);let a=null;function s(e){return null==a||a.trackDisposable(e),e}function o(e){null==a||a.markAsDisposed(e)}function l(e,t){null==a||a.setParent(e,t)}function c(e){return null==a||a.markAsSingleton(e),e}class u extends Error{constructor(e){super(`Encountered errors while disposing of store. Errors: [${e.join(", ")}]`),this.errors=e}}function d(e){return"function"==typeof e.dispose&&0===e.dispose.length}function h(e){if(r.$.is(e)){let t=[];for(const n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(1===t.length)throw t[0];if(t.length>1)throw new u(t);return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function p(...e){const t=f((()=>h(e)));return function(e,t){if(a)for(const n of e)a.setParent(n,t)}(e,t),t}function f(e){const t=s({dispose:(0,i.I)((()=>{o(t),e()}))});return t}class m{constructor(){this._toDispose=new Set,this._isDisposed=!1,s(this)}dispose(){this._isDisposed||(o(this),this._isDisposed=!0,this.clear())}clear(){try{h(this._toDispose.values())}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return l(e,this),this._isDisposed?m.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}}m.DISABLE_DISPOSED_WARNING=!1;class g{constructor(){this._store=new m,s(this),l(this._store,this)}dispose(){o(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}g.None=Object.freeze({dispose(){}});class v{constructor(){this._isDisposed=!1,s(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||(null===(t=this._value)||void 0===t||t.dispose(),e&&l(e,this),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,o(this),null===(e=this._value)||void 0===e||e.dispose(),this._value=void 0}clearAndLeak(){const e=this._value;return this._value=void 0,e&&l(e,null),e}}class b{constructor(e){this.object=e}dispose(){}}},34502:function(e,t,n){"use strict";n.d(t,{S:function(){return r}});class i{constructor(e){this.element=e,this.next=i.Undefined,this.prev=i.Undefined}}i.Undefined=new i(void 0);class r{constructor(){this._first=i.Undefined,this._last=i.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===i.Undefined}clear(){let e=this._first;for(;e!==i.Undefined;){const t=e.next;e.prev=i.Undefined,e.next=i.Undefined,e=t}this._first=i.Undefined,this._last=i.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const n=new i(e);if(this._first===i.Undefined)this._first=n,this._last=n;else if(t){const e=this._last;this._last=n,n.prev=e,e.next=n}else{const e=this._first;this._first=n,n.next=e,e.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==i.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==i.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==i.Undefined&&e.next!==i.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===i.Undefined&&e.next===i.Undefined?(this._first=i.Undefined,this._last=i.Undefined):e.next===i.Undefined?(this._last=this._last.prev,this._last.next=i.Undefined):e.prev===i.Undefined&&(this._first=this._first.next,this._first.prev=i.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==i.Undefined;)yield e.element,e=e.next}}},23345:function(e,t,n){"use strict";n.d(t,{$L:function(){return E},ED:function(){return w},IJ:function(){return k},OS:function(){return M},WE:function(){return T},dz:function(){return x},gn:function(){return C},li:function(){return v},r:function(){return I},tY:function(){return S},xS:function(){return A}});var i,r=n(97671);const a="en";let s,o,l=!1,c=!1,u=!1,d=!1,h=!1,p=!1,f=!1,m=null,g=null;const v="object"==typeof self?self:"object"==typeof n.g?n.g:{};let b;void 0!==v.vscode&&void 0!==v.vscode.process?b=v.vscode.process:void 0!==r&&(b=r);const y="string"==typeof(null===(i=null==b?void 0:b.versions)||void 0===i?void 0:i.electron)&&"renderer"===b.type;if("object"!=typeof navigator||y)if("object"==typeof b){l="win32"===b.platform,c="darwin"===b.platform,u="linux"===b.platform,d=u&&!!b.env.SNAP&&!!b.env.SNAP_REVISION,s=a,m=a;const e=b.env.VSCODE_NLS_CONFIG;if(e)try{const t=JSON.parse(e),n=t.availableLanguages["*"];s=t.locale,m=n||a,g=t._translationsConfigFile}catch(e){}h=!0}else console.error("Unable to resolve platform.");else o=navigator.userAgent,l=o.indexOf("Windows")>=0,c=o.indexOf("Macintosh")>=0,f=(o.indexOf("Macintosh")>=0||o.indexOf("iPad")>=0||o.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,u=o.indexOf("Linux")>=0,p=!0,s=navigator.language,m=s;let _=0;c?_=1:l?_=3:u&&(_=2);const w=l,x=c,k=u,S=h,E=p,C=f,T=o,A=function(){if(v.setImmediate)return v.setImmediate.bind(v);if("function"==typeof v.postMessage&&!v.importScripts){let e=[];v.addEventListener("message",(t=>{if(t.data&&t.data.vscodeSetImmediateId)for(let n=0,i=e.length;n<i;n++){const i=e[n];if(i.id===t.data.vscodeSetImmediateId)return e.splice(n,1),void i.callback()}}));let t=0;return n=>{const i=++t;e.push({id:i,callback:n}),v.postMessage({vscodeSetImmediateId:i},"*")}}if("function"==typeof(null==b?void 0:b.nextTick))return b.nextTick.bind(b);const e=Promise.resolve();return t=>e.then(t)}(),M=c||f?2:l?1:3;let L=!0,D=!1;function I(){if(!D){D=!0;const e=new Uint8Array(2);e[0]=1,e[1]=2;const t=new Uint16Array(e.buffer);L=513===t[0]}return L}},95830:function(e,t,n){"use strict";n.d(t,{G:function(){return a}});var i=n(23345);const r=i.li.performance&&"function"==typeof i.li.performance.now;class a{constructor(e){this._highResolution=r&&e,this._startTime=this._now(),this._stopTime=-1}static create(e=!0){return new a(e)}stop(){this._stopTime=this._now()}elapsed(){return-1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?i.li.performance.now():Date.now()}}},82983:function(e,t,n){"use strict";function i(e){return!e||"string"!=typeof e||0===e.trim().length}n.d(t,{$i:function(){return U},C8:function(){return G},GF:function(){return p},HO:function(){return N},IO:function(){return f},K7:function(){return V},Kw:function(){return Y},LC:function(){return v},Mh:function(){return A},P1:function(){return M},PJ:function(){return X},Qe:function(){return j},R1:function(){return h},RP:function(){return z},S6:function(){return J},TT:function(){return w},Ut:function(){return $},V8:function(){return b},WU:function(){return a},YK:function(){return D},YU:function(){return s},ZG:function(){return L},ZH:function(){return R},ab:function(){return q},c1:function(){return Z},df:function(){return E},ec:function(){return o},fi:function(){return Q},fy:function(){return l},j3:function(){return c},j_:function(){return k},m5:function(){return i},mK:function(){return S},mr:function(){return m},oH:function(){return te},oL:function(){return u},ok:function(){return T},ow:function(){return y},qq:function(){return C},qu:function(){return _},rL:function(){return I},uS:function(){return W},un:function(){return d},uq:function(){return g},vH:function(){return O},xe:function(){return H},zY:function(){return x}});const r=/{(\d+)}/g;function a(e,...t){return 0===t.length?e:e.replace(r,(function(e,n){const i=parseInt(n,10);return isNaN(i)||i<0||i>=t.length?e:t[i]}))}function s(e){return e.replace(/[<>&]/g,(function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}}))}function o(e){return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function l(e,t=" "){return u(c(e,t),t)}function c(e,t){if(!e||!t)return e;const n=t.length;if(0===n||0===e.length)return e;let i=0;for(;e.indexOf(t,i)===i;)i+=n;return e.substring(i)}function u(e,t){if(!e||!t)return e;const n=t.length,i=e.length;if(0===n||0===i)return e;let r=i,a=-1;for(;a=e.lastIndexOf(t,r-1),-1!==a&&a+n===r;){if(0===a)return"";r=a}return e.substring(0,r)}function d(e){return e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function h(e){return e.replace(/\*/g,"")}function p(e,t,n={}){if(!e)throw new Error("Cannot create regex from empty string");t||(e=o(e)),n.wholeWord&&(/\B/.test(e.charAt(0))||(e="\\b"+e),/\B/.test(e.charAt(e.length-1))||(e+="\\b"));let i="";return n.global&&(i+="g"),n.matchCase||(i+="i"),n.multiline&&(i+="m"),n.unicode&&(i+="u"),new RegExp(e,i)}function f(e){if("^"===e.source||"^$"===e.source||"$"===e.source||"^\\s*$"===e.source)return!1;return!(!e.exec("")||0!==e.lastIndex)}function m(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")}function g(e){return e.split(/\r\n|\r|\n/)}function v(e){for(let t=0,n=e.length;t<n;t++){const n=e.charCodeAt(t);if(32!==n&&9!==n)return t}return-1}function b(e,t=0,n=e.length){for(let i=t;i<n;i++){const n=e.charCodeAt(i);if(32!==n&&9!==n)return e.substring(t,i)}return e.substring(t,n)}function y(e,t=e.length-1){for(let n=t;n>=0;n--){const t=e.charCodeAt(n);if(32!==t&&9!==t)return n}return-1}function _(e,t){return e<t?-1:e>t?1:0}function w(e,t,n=0,i=e.length,r=0,a=t.length){for(;n<i&&r<a;n++,r++){let i=e.charCodeAt(n),a=t.charCodeAt(r);if(i<a)return-1;if(i>a)return 1}const s=i-n,o=a-r;return s<o?-1:s>o?1:0}function x(e,t){return k(e,t,0,e.length,0,t.length)}function k(e,t,n=0,i=e.length,r=0,a=t.length){for(;n<i&&r<a;n++,r++){let s=e.charCodeAt(n),o=t.charCodeAt(r);if(s===o)continue;if(s>=128||o>=128)return w(e.toLowerCase(),t.toLowerCase(),n,i,r,a);S(s)&&(s-=32),S(o)&&(o-=32);const l=s-o;if(0!==l)return l}const s=i-n,o=a-r;return s<o?-1:s>o?1:0}function S(e){return e>=97&&e<=122}function E(e){return e>=65&&e<=90}function C(e,t){return e.length===t.length&&0===k(e,t)}function T(e,t){const n=t.length;return!(t.length>e.length)&&0===k(e,t,0,n)}function A(e,t){let n,i=Math.min(e.length,t.length);for(n=0;n<i;n++)if(e.charCodeAt(n)!==t.charCodeAt(n))return n;return i}function M(e,t){let n,i=Math.min(e.length,t.length);const r=e.length-1,a=t.length-1;for(n=0;n<i;n++)if(e.charCodeAt(r-n)!==t.charCodeAt(a-n))return n;return i}function L(e){return 55296<=e&&e<=56319}function D(e){return 56320<=e&&e<=57343}function I(e,t){return t-56320+(e-55296<<10)+65536}function R(e,t,n){const i=e.charCodeAt(n);if(L(i)&&n+1<t){const t=e.charCodeAt(n+1);if(D(t))return I(i,t)}return i}function P(e,t){const n=e.charCodeAt(t-1);if(D(n)&&t>1){const i=e.charCodeAt(t-2);if(L(i))return I(i,n)}return n}function O(e,t){const n=ee.getInstance(),i=t,r=e.length,a=R(e,r,t);t+=a>=65536?2:1;let s=n.getGraphemeBreakType(a);for(;t<r;){const i=R(e,r,t),a=n.getGraphemeBreakType(i);if(Q(s,a))break;t+=i>=65536?2:1,s=a}return t-i}function N(e,t){const n=ee.getInstance(),i=t,r=P(e,t);t-=r>=65536?2:1;let a=n.getGraphemeBreakType(r);for(;t>0;){const i=P(e,t),r=n.getGraphemeBreakType(i);if(Q(r,a))break;t-=i>=65536?2:1,a=r}return i-t}const B=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function $(e){return B.test(e)}const F=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function z(e){return F.test(e)}const K=/^[\t\n\r\x20-\x7E]*$/;function U(e){return K.test(e)}const j=/[\u2028\u2029]/;function q(e){return j.test(e)}function H(e){for(let t=0,n=e.length;t<n;t++)if(V(e.charCodeAt(t)))return!0;return!1}function V(e){return(e=+e)>=11904&&e<=55215||e>=63744&&e<=64255||e>=65281&&e<=65374}function G(e){return e>=127462&&e<=127487||8986===e||8987===e||9200===e||9203===e||e>=9728&&e<=10175||11088===e||11093===e||e>=127744&&e<=128591||e>=128640&&e<=128764||e>=128992&&e<=129003||e>=129280&&e<=129535||e>=129648&&e<=129750}const Z=String.fromCharCode(65279);function W(e){return!!(e&&e.length>0&&65279===e.charCodeAt(0))}function Y(e,t=!1){return!!e&&(t&&(e=e.replace(/\\./g,"")),e.toLowerCase()!==e)}function X(e){return(e%=52)<26?String.fromCharCode(97+e):String.fromCharCode(65+e-26)}function J(e){return ee.getInstance().getGraphemeBreakType(e)}function Q(e,t){return 0===e?5!==t&&7!==t:(2!==e||3!==t)&&(4===e||2===e||3===e||(4===t||2===t||3===t||(8!==e||8!==t&&9!==t&&11!==t&&12!==t)&&((11!==e&&9!==e||9!==t&&10!==t)&&((12!==e&&10!==e||10!==t)&&(5!==t&&13!==t&&(7!==t&&(1!==e&&((13!==e||14!==t)&&(6!==e||6!==t)))))))))}class ee{constructor(){this._data=JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}static getInstance(){return ee._INSTANCE||(ee._INSTANCE=new ee),ee._INSTANCE}getGraphemeBreakType(e){if(e<32)return 10===e?3:13===e?2:4;if(e<127)return 0;const t=this._data,n=t.length/3;let i=1;for(;i<=n;)if(e<t[3*i])i*=2;else{if(!(e>t[3*i+1]))return t[3*i+2];i=2*i+1}return 0}}function te(e,t){if(0===e)return 0;const n=function(e,t){let n=P(t,e);e-=ne(n);for(;ie(n)||65039===n||8419===n;){if(0===e)return;n=P(t,e),e-=ne(n)}if(!G(n))return;if(e>=0){const n=P(t,e);8205===n&&(e-=ne(n))}return e}(e,t);if(void 0!==n)return n;return e-=ne(P(t,e))}function ne(e){return e>=65536?2:1}function ie(e){return 127995<=e&&e<=127999}ee._INSTANCE=null},72999:function(e,t,n){"use strict";function i(e){return Array.isArray(e)}function r(e){return"string"==typeof e}function a(e){return!("object"!=typeof e||null===e||Array.isArray(e)||e instanceof RegExp||e instanceof Date)}function s(e){return"number"==typeof e&&!isNaN(e)}function o(e){return!0===e||!1===e}function l(e){return void 0===e}function c(e){return!u(e)}function u(e){return l(e)||null===e}function d(e,t){if(!e)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function h(e){if(u(e))throw new Error("Assertion Failed: argument is undefined or null");return e}function p(e){return"function"==typeof e}function f(e,t){const n=Math.min(e.length,t.length);for(let i=0;i<n;i++)m(e[i],t[i])}function m(e,t){if(r(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(p(t)){try{if(e instanceof t)return}catch(e){}if(!u(e)&&e.constructor===t)return;if(1===t.length&&!0===t.call(void 0,e))return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function g(e){const t=[];for(const n of function(e){let t=[],n=Object.getPrototypeOf(e);for(;Object.prototype!==n;)t=t.concat(Object.getOwnPropertyNames(n)),n=Object.getPrototypeOf(n);return t}(e))"function"==typeof e[n]&&t.push(n);return t}function v(e,t){const n=e=>function(){const n=Array.prototype.slice.call(arguments,0);return t(e,n)};let i={};for(const t of e)i[t]=n(t);return i}function b(e){return null===e?void 0:e}function y(e,t="Unreachable"){throw new Error(t)}n.d(t,{$E:function(){return g},$K:function(){return c},D8:function(){return f},HD:function(){return r},IU:function(){return v},Jp:function(){return u},Kn:function(){return a},cW:function(){return h},f6:function(){return b},hj:function(){return s},jn:function(){return o},kJ:function(){return i},mf:function(){return p},o8:function(){return l},p_:function(){return d},vE:function(){return y}})},13268:function(e,t,n){"use strict";function i(e,t,...n){return function(e,t){let n;return n=0===t.length?e:e.replace(/\{(\d+)\}/g,(function(e,n){const i=n[0];return void 0!==t[i]?t[i]:e})),n}(t,n)}n.d(t,{N:function(){return i}})},96236:function(e,t,n){"use strict";n.d(t,{BH:function(){return b},NZ:function(){return y},U8:function(){return _},co:function(){return v},eH:function(){return g},vr:function(){return m}});var i=n(75918),r=n(52615),a=n(4348),s=n(88226),o=n(69323),l=n(34502),c=n(35884),u=n(90689),d=n(16925),h=n(49055),p=function(e,t,n,i){var r,a=arguments.length,s=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,n,s):r(t,n))||s);return a>3&&s&&Object.defineProperty(t,n,s),s},f=function(e,t){return function(n,i){t(n,i,e)}};function m(e){return void 0!==e.command}class g{constructor(e){this.id=g._idPool++,this._debugName=e}}g._idPool=0,g.CommandPalette=new g("CommandPalette"),g.EditorContext=new g("EditorContext"),g.SimpleEditorContext=new g("SimpleEditorContext"),g.EditorContextCopy=new g("EditorContextCopy"),g.EditorContextPeek=new g("EditorContextPeek"),g.MenubarEditMenu=new g("MenubarEditMenu"),g.MenubarCopy=new g("MenubarCopy"),g.MenubarGoMenu=new g("MenubarGoMenu"),g.MenubarSelectionMenu=new g("MenubarSelectionMenu"),g.InlineCompletionsActions=new g("InlineCompletionsActions");const v=(0,d.yh)("menuService"),b=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new a.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:e=>e===g.CommandPalette}}addCommand(e){return this.addCommands(s.$.single(e))}addCommands(e){for(const t of e)this._commands.set(t.id,t);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,o.OF)((()=>{let t=!1;for(const n of e)t=this._commands.delete(n.id)||t;t&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)}))}getCommand(e){return this._commands.get(e)}getCommands(){const e=new Map;return this._commands.forEach(((t,n)=>e.set(n,t))),e}appendMenuItem(e,t){return this.appendMenuItems(s.$.single({id:e,item:t}))}appendMenuItems(e){const t=new Set,n=new l.S;for(const{id:i,item:r}of e){let e=this._menuItems.get(i);e||(e=new l.S,this._menuItems.set(i,e)),n.push(e.push(r)),t.add(i)}return this._onDidChangeMenu.fire(t),(0,o.OF)((()=>{if(n.size>0){for(let e of n)e();this._onDidChangeMenu.fire(t),n.clear()}}))}getMenuItems(e){let t;return t=this._menuItems.has(e)?[...this._menuItems.get(e)]:[],e===g.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(e){const t=new Set;for(const n of e)m(n)&&(t.add(n.command.id),n.alt&&t.add(n.alt.id));this._commands.forEach(((n,i)=>{t.has(i)||e.push({command:n})}))}};class y extends i.wY{constructor(e,t,n,i){super(`submenuitem.${e.submenu.id}`,"string"==typeof e.title?e.title:e.title.value,[],"submenu"),this.item=e,this._menuService=t,this._contextKeyService=n,this._options=i}get actions(){const e=[],t=this._menuService.createMenu(this.item.submenu,this._contextKeyService),n=t.getActions(this._options);t.dispose();for(const[,t]of n)t.length>0&&(e.push(...t),e.push(new i.Z0));return e.length&&e.pop(),e}}let _=class e{constructor(t,n,i,a,s){var o,l;if(this._commandService=s,this.id=t.id,this.label=(null==i?void 0:i.renderShortTitle)&&t.shortTitle?"string"==typeof t.shortTitle?t.shortTitle:t.shortTitle.value:"string"==typeof t.title?t.title:t.title.value,this.tooltip=null!==(l="string"==typeof t.tooltip?t.tooltip:null===(o=t.tooltip)||void 0===o?void 0:o.value)&&void 0!==l?l:"",this.enabled=!t.precondition||a.contextMatchesRules(t.precondition),this.checked=void 0,t.toggled){const e=t.toggled.condition?t.toggled:{condition:t.toggled};this.checked=a.contextMatchesRules(e.condition),this.checked&&e.tooltip&&(this.tooltip="string"==typeof e.tooltip?e.tooltip:e.tooltip.value),e.title&&(this.label="string"==typeof e.title?e.title:e.title.value)}this.item=t,this.alt=n?new e(n,void 0,i,a,s):void 0,this._options=i,h.kS.isThemeIcon(t.icon)&&(this.class=r.dT.asClassName(t.icon))}dispose(){}run(...e){var t,n;let i=[];return(null===(t=this._options)||void 0===t?void 0:t.arg)&&(i=[...i,this._options.arg]),(null===(n=this._options)||void 0===n?void 0:n.shouldForwardArgs)&&(i=[...i,...e]),this._commandService.executeCommand(this.id,...i)}};_=p([f(3,u.i6),f(4,c.H)],_)},35884:function(e,t,n){"use strict";n.d(t,{H:function(){return l},P:function(){return c}});var i=n(4348),r=n(88226),a=n(69323),s=n(34502),o=n(72999);const l=(0,n(16925).yh)("commandService"),c=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new i.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,t){if(!e)throw new Error("invalid command");if("string"==typeof e){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t})}if(e.description){const t=[];for(let n of e.description.args)t.push(n.constraint);const n=e.handler;e.handler=function(e,...i){return(0,o.D8)(i,t),n(e,...i)}}const{id:n}=e;let i=this._commands.get(n);i||(i=new s.S,this._commands.set(n,i));let r=i.unshift(e),l=(0,a.OF)((()=>{r();const e=this._commands.get(n);(null==e?void 0:e.isEmpty())&&this._commands.delete(n)}));return this._onDidRegisterCommand.fire(n),l}registerCommandAlias(e,t){return c.registerCommand(e,((e,...n)=>e.get(l).executeCommand(t,...n)))}getCommand(e){const t=this._commands.get(e);if(t&&!t.isEmpty())return r.$.first(t)}getCommands(){const e=new Map;for(const t of this._commands.keys()){const n=this.getCommand(t);n&&e.set(t,n)}return e}};c.registerCommand("noop",(()=>{}))},90689:function(e,t,n){"use strict";n.d(t,{Ao:function(){return c},Eq:function(){return I},Fb:function(){return u},K8:function(){return O},i6:function(){return D},uy:function(){return L}});var i=n(23345),r=n(82983),a=n(16925);let s=i.WE||"";const o=new Map;o.set("false",!1),o.set("true",!0),o.set("isMac",i.dz),o.set("isLinux",i.IJ),o.set("isWindows",i.ED),o.set("isWeb",i.$L),o.set("isMacNative",i.dz&&!i.$L),o.set("isEdge",s.indexOf("Edg/")>=0),o.set("isFirefox",s.indexOf("Firefox")>=0),o.set("isChrome",s.indexOf("Chrome")>=0),o.set("isSafari",s.indexOf("Safari")>=0);const l=Object.prototype.hasOwnProperty;class c{static has(e){return f.create(e)}static equals(e,t){return m.create(e,t)}static regex(e,t){return E.create(e,t)}static not(e){return y.create(e)}static and(...e){return A.create(e,null)}static or(...e){return M.create(e,null,!0)}static deserialize(e,t=!1){if(e)return this._deserializeOrExpression(e,t)}static _deserializeOrExpression(e,t){let n=e.split("||");return M.create(n.map((e=>this._deserializeAndExpression(e,t))),null,!0)}static _deserializeAndExpression(e,t){let n=e.split("&&");return A.create(n.map((e=>this._deserializeOne(e,t))),null)}static _deserializeOne(e,t){if((e=e.trim()).indexOf("!=")>=0){let n=e.split("!=");return b.create(n[0].trim(),this._deserializeValue(n[1],t))}if(e.indexOf("==")>=0){let n=e.split("==");return m.create(n[0].trim(),this._deserializeValue(n[1],t))}if(e.indexOf("=~")>=0){let n=e.split("=~");return E.create(n[0].trim(),this._deserializeRegexValue(n[1],t))}if(e.indexOf(" in ")>=0){let t=e.split(" in ");return g.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(e)){const t=e.split(">=");return x.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(e)){const t=e.split(">");return w.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(e)){const t=e.split("<=");return S.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(e)){const t=e.split("<");return k.create(t[0].trim(),t[1].trim())}return/^\!\s*/.test(e)?y.create(e.substr(1).trim()):f.create(e)}static _deserializeValue(e,t){if("true"===(e=e.trim()))return!0;if("false"===e)return!1;let n=/^'([^']*)'$/.exec(e);return n?n[1].trim():e}static _deserializeRegexValue(e,t){if((0,r.m5)(e)){if(t)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let n=e.indexOf("/"),i=e.lastIndexOf("/");if(n===i||n<0){if(t)throw new Error(`bad regexp-value '${e}', missing /-enclosure`);return console.warn(`bad regexp-value '${e}', missing /-enclosure`),null}let a=e.slice(n+1,i),s="i"===e[i+1]?"i":"";try{return new RegExp(a,s)}catch(n){if(t)throw new Error(`bad regexp-value '${e}', parse error: ${n}`);return console.warn(`bad regexp-value '${e}', parse error: ${n}`),null}}}function u(e,t){const n=e?e.substituteConstants():void 0,i=t?t.substituteConstants():void 0;return!n&&!i||!(!n||!i)&&n.equals(i)}function d(e,t){return e.cmp(t)}class h{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return p.INSTANCE}}h.INSTANCE=new h;class p{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return h.INSTANCE}}p.INSTANCE=new p;class f{constructor(e,t){this.key=e,this.negated=t,this.type=2}static create(e,t=null){const n=o.get(e);return"boolean"==typeof n?n?p.INSTANCE:h.INSTANCE:new f(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:R(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=o.get(this.key);return"boolean"==typeof e?e?p.INSTANCE:h.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=y.create(this.key,this)),this.negated}}class m{constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=4}static create(e,t,n=null){if("boolean"==typeof t)return t?f.create(e,n):y.create(e,n);const i=o.get(e);if("boolean"==typeof i){return t===(i?"true":"false")?p.INSTANCE:h.INSTANCE}return new m(e,t,n)}cmp(e){return e.type!==this.type?this.type-e.type:P(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){const e=o.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?p.INSTANCE:h.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=b.create(this.key,this.value,this)),this.negated}}class g{constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}static create(e,t){return new g(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:P(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type&&(this.key===e.key&&this.valueKey===e.valueKey)}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),n=e.getValue(this.key);return Array.isArray(t)?t.indexOf(n)>=0:"string"==typeof n&&"object"==typeof t&&null!==t&&l.call(t,n)}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=v.create(this)),this.negated}}class v{constructor(e){this._actual=e,this.type=11}static create(e){return new v(e)}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type&&this._actual.equals(e._actual)}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class b{constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=5}static create(e,t,n=null){if("boolean"==typeof t)return t?y.create(e,n):f.create(e,n);const i=o.get(e);if("boolean"==typeof i){return t===(i?"true":"false")?h.INSTANCE:p.INSTANCE}return new b(e,t,n)}cmp(e){return e.type!==this.type?this.type-e.type:P(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){const e=o.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?h.INSTANCE:p.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this.value,this)),this.negated}}class y{constructor(e,t){this.key=e,this.negated=t,this.type=3}static create(e,t=null){const n=o.get(e);return"boolean"==typeof n?n?h.INSTANCE:p.INSTANCE:new y(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:R(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=o.get(this.key);return"boolean"==typeof e?e?h.INSTANCE:p.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this)),this.negated}}function _(e,t){if("string"==typeof e){const t=parseFloat(e);isNaN(t)||(e=t)}return"string"==typeof e||"number"==typeof e?t(e):h.INSTANCE}class w{constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=12}static create(e,t,n=null){return _(t,(t=>new w(e,t,n)))}cmp(e){return e.type!==this.type?this.type-e.type:P(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=S.create(this.key,this.value,this)),this.negated}}class x{constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=13}static create(e,t,n=null){return _(t,(t=>new x(e,t,n)))}cmp(e){return e.type!==this.type?this.type-e.type:P(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=k.create(this.key,this.value,this)),this.negated}}class k{constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=14}static create(e,t,n=null){return _(t,(t=>new k(e,t,n)))}cmp(e){return e.type!==this.type?this.type-e.type:P(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=x.create(this.key,this.value,this)),this.negated}}class S{constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=15}static create(e,t,n=null){return _(t,(t=>new S(e,t,n)))}cmp(e){return e.type!==this.type?this.type-e.type:P(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=w.create(this.key,this.value,this)),this.negated}}class E{constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}static create(e,t){return new E(e,t)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.key<e.key)return-1;if(this.key>e.key)return 1;const t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return t<n?-1:t>n?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return this.key===e.key&&t===n}return!1}substituteConstants(){return this}evaluate(e){let t=e.getValue(this.key);return!!this.regexp&&this.regexp.test(t)}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=C.create(this)),this.negated}}class C{constructor(e){this._actual=e,this.type=8}static create(e){return new C(e)}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type&&this._actual.equals(e._actual)}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function T(e){let t=null;for(let n=0,i=e.length;n<i;n++){const i=e[n].substituteConstants();if(e[n]!==i&&null===t){t=[];for(let i=0;i<n;i++)t[i]=e[i]}null!==t&&(t[n]=i)}return null===t?e:t}class A{constructor(e,t){this.expr=e,this.negated=t,this.type=6}static create(e,t){return A._normalizeArr(e,t)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,n=this.expr.length;t<n;t++){const n=d(this.expr[t],e.expr[t]);if(0!==n)return n}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,n=this.expr.length;t<n;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const e=T(this.expr);return e===this.expr?this:A.create(e,this.negated)}evaluate(e){for(let t=0,n=this.expr.length;t<n;t++)if(!this.expr[t].evaluate(e))return!1;return!0}static _normalizeArr(e,t){const n=[];let i=!1;for(const t of e)if(t)if(1!==t.type){if(0===t.type)return h.INSTANCE;6!==t.type?n.push(t):n.push(...t.expr)}else i=!0;if(0===n.length&&i)return p.INSTANCE;if(0!==n.length){if(1===n.length)return n[0];n.sort(d);for(let e=1;e<n.length;e++)n[e-1].equals(n[e])&&(n.splice(e,1),e--);if(1===n.length)return n[0];for(;n.length>1;){const e=n[n.length-1];if(9!==e.type)break;n.pop();const t=n.pop(),i=0===n.length,r=M.create(e.expr.map((e=>A.create([e,t],null))),null,i);r&&(n.push(r),n.sort(d))}return 1===n.length?n[0]:new A(n,t)}}serialize(){return this.expr.map((e=>e.serialize())).join(" && ")}keys(){const e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(let t of this.expr)e.push(t.negate());this.negated=M.create(e,this,!0)}return this.negated}}class M{constructor(e,t){this.expr=e,this.negated=t,this.type=9}static create(e,t,n){return M._normalizeArr(e,t,n)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,n=this.expr.length;t<n;t++){const n=d(this.expr[t],e.expr[t]);if(0!==n)return n}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,n=this.expr.length;t<n;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const e=T(this.expr);return e===this.expr?this:M.create(e,this.negated,!1)}evaluate(e){for(let t=0,n=this.expr.length;t<n;t++)if(this.expr[t].evaluate(e))return!0;return!1}static _normalizeArr(e,t,n){let i=[],r=!1;if(e){for(let t=0,n=e.length;t<n;t++){const n=e[t];if(n)if(0!==n.type){if(1===n.type)return p.INSTANCE;9!==n.type?i.push(n):i=i.concat(n.expr)}else r=!0}if(0===i.length&&r)return h.INSTANCE;i.sort(d)}if(0!==i.length){if(1===i.length)return i[0];for(let e=1;e<i.length;e++)i[e-1].equals(i[e])&&(i.splice(e,1),e--);if(1===i.length)return i[0];if(n){for(let e=0;e<i.length;e++)for(let t=e+1;t<i.length;t++)O(i[e],i[t])&&(i.splice(t,1),t--);if(1===i.length)return i[0]}return new M(i,t)}}serialize(){return this.expr.map((e=>e.serialize())).join(" || ")}keys(){const e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){let e=[];for(let t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),n=e.shift(),i=[];for(const e of N(t))for(const t of N(n))i.push(A.create([e,t],null));const r=0===e.length;e.unshift(M.create(i,null,r))}this.negated=e[0]}return this.negated}}class L extends f{constructor(e,t,n){super(e,null),this._defaultValue=t,"object"==typeof n?L._info.push(Object.assign(Object.assign({},n),{key:e})):!0!==n&&L._info.push({key:e,description:n,type:null!=t?typeof t:void 0})}static all(){return L._info.values()}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return m.create(this.key,e)}}L._info=[];const D=(0,a.yh)("contextKeyService"),I="setContext";function R(e,t){return e<t?-1:e>t?1:0}function P(e,t,n,i){return e<n?-1:e>n?1:t<i?-1:t>i?1:0}function O(e,t){if(6===t.type&&9!==e.type&&6!==e.type)for(const n of t.expr)if(e.equals(n))return!0;const n=N(e.negate()).concat(N(t));n.sort(d);for(let e=0;e<n.length;e++){const t=n[e].negate();for(let i=e+1;i<n.length;i++){const e=n[i];if(t.equals(e))return!0}}return!1}function N(e){return 9===e.type?e.expr:[e]}},16925:function(e,t,n){"use strict";var i;n.d(t,{I8:function(){return i},TG:function(){return r},jt:function(){return o},yh:function(){return s}}),function(e){e.serviceIds=new Map,e.DI_TARGET="$di$target",e.DI_DEPENDENCIES="$di$dependencies",e.getServiceDependencies=function(t){return t[e.DI_DEPENDENCIES]||[]}}(i||(i={}));const r=s("instantiationService");function a(e,t,n,r){t[i.DI_TARGET]===t?t[i.DI_DEPENDENCIES].push({id:e,index:n,optional:r}):(t[i.DI_DEPENDENCIES]=[{id:e,index:n,optional:r}],t[i.DI_TARGET]=t)}function s(e){if(i.serviceIds.has(e))return i.serviceIds.get(e);const t=function(e,n,i){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");a(t,e,i,!1)};return t.toString=()=>e,i.serviceIds.set(e,t),t}function o(e){return function(t,n,i){if(3!==arguments.length)throw new Error("@optional-decorator can only be used to decorate a parameter");a(e,t,i,!0)}}},44650:function(e,t,n){"use strict";n.d(t,{B:function(){return a}});var i=n(76068),r=n(72999);const a=new class{constructor(){this.data=new Map}add(e,t){i.ok(r.HD(e)),i.ok(r.Kn(t)),i.ok(!this.data.has(e),"There is already an extension with this id"),this.data.set(e,t)}as(e){return this.data.get(e)||null}}},66213:function(e,t,n){"use strict";var i;n.d(t,{e:function(){return i}}),function(e){e.DARK="dark",e.LIGHT="light",e.HIGH_CONTRAST="hc"}(i||(i={}))},49055:function(e,t,n){"use strict";n.d(t,{EN:function(){return h},IP:function(){return f},Ic:function(){return g},XE:function(){return c},bB:function(){return v},kS:function(){return d},m6:function(){return p}});var i=n(52615),r=n(4348),a=n(69323),s=n(16925),o=n(44650),l=n(66213);const c=(0,s.yh)("themeService");var u,d;function h(e){return{id:e}}function p(e){switch(e){case l.e.DARK:return"vs-dark";case l.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}!function(e){e.isThemeColor=function(e){return e&&"object"==typeof e&&"string"==typeof e.id}}(u||(u={})),function(e){e.isThemeIcon=function(e){return e&&"object"==typeof e&&"string"==typeof e.id&&(void 0===e.color||u.isThemeColor(e.color))};const t=new RegExp(`^\\$\\((${i.dT.iconNameExpression}(?:${i.dT.iconModifierExpression})?)\\)$`);e.fromString=function(e){const n=t.exec(e);if(!n)return;let[,i]=n;return{id:i}},e.modify=function(e,t){let n=e.id;const i=n.lastIndexOf("~");return-1!==i&&(n=n.substring(0,i)),t&&(n=`${n}~${t}`),{id:n}},e.isEqual=function(e,t){var n,i;return e.id===t.id&&(null===(n=e.color)||void 0===n?void 0:n.id)===(null===(i=t.color)||void 0===i?void 0:i.id)},e.asThemeIcon=function(e,t){return{id:e.id,color:t?h(t):void 0}},e.asClassNameArray=i.dT.asClassNameArray,e.asClassName=i.dT.asClassName,e.asCSSSelector=i.dT.asCSSSelector}(d||(d={}));const f={ThemingContribution:"base.contributions.theming"};let m=new class{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new r.Q5}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),(0,a.OF)((()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)}))}getThemingParticipants(){return this.themingParticipants}};function g(e){return m.onColorThemeChange(e)}o.B.add(f.ThemingContribution,m);class v extends a.JT{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange((e=>this.onThemeChange(e))))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}},5630:function(e,t,n){"use strict";var i=n(14809),r=n(20439),a=n(4635),s=n(50298),o=n(62646),l=n(92310),c=n.n(l),u=n(18929),d=n(59301),h=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],p=(0,d.forwardRef)((function(e,t){var n,l=e.prefixCls,p=void 0===l?"rc-checkbox":l,f=e.className,m=e.style,g=e.checked,v=e.disabled,b=e.defaultChecked,y=void 0!==b&&b,_=e.type,w=void 0===_?"checkbox":_,x=e.title,k=e.onChange,S=(0,o.Z)(e,h),E=(0,d.useRef)(null),C=(0,u.Z)(y,{value:g}),T=(0,s.Z)(C,2),A=T[0],M=T[1];(0,d.useImperativeHandle)(t,(function(){return{focus:function(){var e;null===(e=E.current)||void 0===e||e.focus()},blur:function(){var e;null===(e=E.current)||void 0===e||e.blur()},input:E.current}}));var L=c()(p,f,(n={},(0,a.Z)(n,"".concat(p,"-checked"),A),(0,a.Z)(n,"".concat(p,"-disabled"),v),n));return d.createElement("span",{className:L,title:x,style:m},d.createElement("input",(0,i.Z)({},S,{className:"".concat(p,"-input"),ref:E,onChange:function(t){v||("checked"in e||M(t.target.checked),null==k||k({target:(0,r.Z)((0,r.Z)({},e),{},{type:w,checked:t.target.checked}),stopPropagation:function(){t.stopPropagation()},preventDefault:function(){t.preventDefault()},nativeEvent:t.nativeEvent}))},disabled:v,checked:!!A,type:w})),d.createElement("span",{className:"".concat(p,"-inner")}))}));t.Z=p},17115:function(e,t,n){"use strict";n.d(t,{ZP:function(){return l}});var i=n(50298),r=n(59301),a=n(47273),s=0,o=(0,a.Z)();function l(e){var t=r.useState(),n=(0,i.Z)(t,2),a=n[0],l=n[1];return r.useEffect((function(){var e;l("rc_select_".concat((o?(e=s,s+=1):e="TEST_OR_SSR",e)))}),[]),e||a}},77861:function(e,t,n){"use strict";n.d(t,{Ac:function(){return J},Xo:function(){return ce},Wx:function(){return de},ZP:function(){return Ee},lk:function(){return w}});var i=n(14809),r=n(95190),a=n(4635),s=n(20439),o=n(50298),l=n(62646),c=n(93664),u=n(18929),d=n(48736),h=n(59301),p=n(92310),f=n.n(p),m=n(34280),g=n(49658),v=n(10228),b=n(8654),y=function(e){var t,n=e.className,i=e.customizeIcon,r=e.customizeIconProps,a=e.onMouseDown,s=e.onClick,o=e.children;return t="function"==typeof i?i(r):i,h.createElement("span",{className:n,onMouseDown:function(e){e.preventDefault(),a&&a(e)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:s,"aria-hidden":!0},void 0!==t?t:h.createElement("span",{className:f()(n.split(/\s+/).map((function(e){return"".concat(e,"-icon")})))},o))};var _=h.createContext(null);function w(){return h.useContext(_)}function x(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250,t=h.useRef(null),n=h.useRef(null);function i(i){(i||null===t.current)&&(t.current=i),window.clearTimeout(n.current),n.current=window.setTimeout((function(){t.current=null}),e)}return h.useEffect((function(){return function(){window.clearTimeout(n.current)}}),[]),[function(){return t.current},i]}var k=n(26112),S=n(11780),E=function(e,t){var n,i,r=e.prefixCls,a=e.id,o=e.inputElement,l=e.disabled,c=e.tabIndex,u=e.autoFocus,p=e.autoComplete,m=e.editable,g=e.activeDescendantId,v=e.value,y=e.maxLength,_=e.onKeyDown,w=e.onMouseDown,x=e.onChange,k=e.onPaste,S=e.onCompositionStart,E=e.onCompositionEnd,C=e.open,T=e.attrs,A=o||h.createElement("input",null),M=A,L=M.ref,D=M.props,I=D.onKeyDown,R=D.onChange,P=D.onMouseDown,O=D.onCompositionStart,N=D.onCompositionEnd,B=D.style;return(0,d.Kp)(!("maxLength"in A.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),A=h.cloneElement(A,(0,s.Z)((0,s.Z)((0,s.Z)({type:"search"},D),{},{id:a,ref:(0,b.sQ)(t,L),disabled:l,tabIndex:c,autoComplete:p||"off",autoFocus:u,className:f()("".concat(r,"-selection-search-input"),null===(n=A)||void 0===n||null===(i=n.props)||void 0===i?void 0:i.className),role:"combobox","aria-label":"Search","aria-expanded":C||!1,"aria-haspopup":"listbox","aria-owns":"".concat(a,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(a,"_list"),"aria-activedescendant":C?g:void 0},T),{},{value:m?v:"",maxLength:y,readOnly:!m,unselectable:m?null:"on",style:(0,s.Z)((0,s.Z)({},B),{},{opacity:m?null:0}),onKeyDown:function(e){_(e),I&&I(e)},onMouseDown:function(e){w(e),P&&P(e)},onChange:function(e){x(e),R&&R(e)},onCompositionStart:function(e){S(e),O&&O(e)},onCompositionEnd:function(e){E(e),N&&N(e)},onPaste:k}))},C=h.forwardRef(E);C.displayName="Input";var T=C;function A(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}var M="undefined"!=typeof window&&window.document&&window.document.documentElement;function L(e){return["string","number"].includes((0,c.Z)(e))}function D(e){var t=void 0;return e&&(L(e.title)?t=e.title.toString():L(e.label)&&(t=e.label.toString())),t}function I(e){var t;return null!==(t=e.key)&&void 0!==t?t:e.value}var R=function(e){e.preventDefault(),e.stopPropagation()},P=function(e){var t,n,i=e.id,r=e.prefixCls,s=e.values,l=e.open,c=e.searchValue,u=e.autoClearSearchValue,d=e.inputRef,p=e.placeholder,m=e.disabled,g=e.mode,v=e.showSearch,b=e.autoFocus,_=e.autoComplete,w=e.activeDescendantId,x=e.tabIndex,E=e.removeIcon,C=e.maxTagCount,A=e.maxTagTextLength,L=e.maxTagPlaceholder,P=void 0===L?function(e){return"+ ".concat(e.length," ...")}:L,O=e.tagRender,N=e.onToggleOpen,B=e.onRemove,$=e.onInputChange,F=e.onInputPaste,z=e.onInputKeyDown,K=e.onInputMouseDown,U=e.onInputCompositionStart,j=e.onInputCompositionEnd,q=h.useRef(null),H=(0,h.useState)(0),V=(0,o.Z)(H,2),G=V[0],Z=V[1],W=(0,h.useState)(!1),Y=(0,o.Z)(W,2),X=Y[0],J=Y[1],Q="".concat(r,"-selection"),ee=l||"multiple"===g&&!1===u||"tags"===g?c:"",te="tags"===g||"multiple"===g&&!1===u||v&&(l||X);function ne(e,t,n,i,r){return h.createElement("span",{className:f()("".concat(Q,"-item"),(0,a.Z)({},"".concat(Q,"-item-disabled"),n)),title:D(e)},h.createElement("span",{className:"".concat(Q,"-item-content")},t),i&&h.createElement(y,{className:"".concat(Q,"-item-remove"),onMouseDown:R,onClick:r,customizeIcon:E},"×"))}t=function(){Z(q.current.scrollWidth)},n=[ee],M?h.useLayoutEffect(t,n):h.useEffect(t,n);var ie=h.createElement("div",{className:"".concat(Q,"-search"),style:{width:G},onFocus:function(){J(!0)},onBlur:function(){J(!1)}},h.createElement(T,{ref:d,open:l,prefixCls:r,id:i,inputElement:null,disabled:m,autoFocus:b,autoComplete:_,editable:te,activeDescendantId:w,value:ee,onKeyDown:z,onMouseDown:K,onChange:$,onPaste:F,onCompositionStart:U,onCompositionEnd:j,tabIndex:x,attrs:(0,k.Z)(e,!0)}),h.createElement("span",{ref:q,className:"".concat(Q,"-search-mirror"),"aria-hidden":!0},ee," ")),re=h.createElement(S.Z,{prefixCls:"".concat(Q,"-overflow"),data:s,renderItem:function(e){var t=e.disabled,n=e.label,i=e.value,r=!m&&!t,a=n;if("number"==typeof A&&("string"==typeof n||"number"==typeof n)){var s=String(a);s.length>A&&(a="".concat(s.slice(0,A),"..."))}var o=function(t){t&&t.stopPropagation(),B(e)};return"function"==typeof O?function(e,t,n,i,r){return h.createElement("span",{onMouseDown:function(e){R(e),N(!l)}},O({label:t,value:e,disabled:n,closable:i,onClose:r}))}(i,a,t,r,o):ne(e,a,t,r,o)},renderRest:function(e){var t="function"==typeof P?P(e):P;return ne({title:t},t,!1)},suffix:ie,itemKey:I,maxCount:C});return h.createElement(h.Fragment,null,re,!s.length&&!ee&&h.createElement("span",{className:"".concat(Q,"-placeholder")},p))},O=function(e){var t=e.inputElement,n=e.prefixCls,i=e.id,r=e.inputRef,a=e.disabled,s=e.autoFocus,l=e.autoComplete,c=e.activeDescendantId,u=e.mode,d=e.open,p=e.values,f=e.placeholder,m=e.tabIndex,g=e.showSearch,v=e.searchValue,b=e.activeValue,y=e.maxLength,_=e.onInputKeyDown,w=e.onInputMouseDown,x=e.onInputChange,S=e.onInputPaste,E=e.onInputCompositionStart,C=e.onInputCompositionEnd,A=e.title,M=h.useState(!1),L=(0,o.Z)(M,2),I=L[0],R=L[1],P="combobox"===u,O=P||g,N=p[0],B=v||"";P&&b&&!I&&(B=b),h.useEffect((function(){P&&R(!1)}),[P,b]);var $=!("combobox"!==u&&!d&&!g)&&!!B,F=void 0===A?D(N):A;return h.createElement(h.Fragment,null,h.createElement("span",{className:"".concat(n,"-selection-search")},h.createElement(T,{ref:r,prefixCls:n,id:i,open:d,inputElement:t,disabled:a,autoFocus:s,autoComplete:l,editable:O,activeDescendantId:c,value:B,onKeyDown:_,onMouseDown:w,onChange:function(e){R(!0),x(e)},onPaste:S,onCompositionStart:E,onCompositionEnd:C,tabIndex:m,attrs:(0,k.Z)(e,!0),maxLength:P?y:void 0})),!P&&N?h.createElement("span",{className:"".concat(n,"-selection-item"),title:F,style:$?{visibility:"hidden"}:void 0},N.label):null,function(){if(N)return null;var e=$?{visibility:"hidden"}:void 0;return h.createElement("span",{className:"".concat(n,"-selection-placeholder"),style:e},f)}())};var N=function(e,t){var n=(0,h.useRef)(null),r=(0,h.useRef)(!1),a=e.prefixCls,s=e.open,l=e.mode,c=e.showSearch,u=e.tokenWithEnter,d=e.autoClearSearchValue,p=e.onSearch,f=e.onSearchSubmit,m=e.onToggleOpen,g=e.onInputKeyDown,b=e.domRef;h.useImperativeHandle(t,(function(){return{focus:function(){n.current.focus()},blur:function(){n.current.blur()}}}));var y=x(0),_=(0,o.Z)(y,2),w=_[0],k=_[1],S=(0,h.useRef)(null),E=function(e){!1!==p(e,!0,r.current)&&m(!0)},C={inputRef:n,onInputKeyDown:function(e){var t,n=e.which;n!==v.Z.UP&&n!==v.Z.DOWN||e.preventDefault(),g&&g(e),n!==v.Z.ENTER||"tags"!==l||r.current||s||null==f||f(e.target.value),t=n,[v.Z.ESC,v.Z.SHIFT,v.Z.BACKSPACE,v.Z.TAB,v.Z.WIN_KEY,v.Z.ALT,v.Z.META,v.Z.WIN_KEY_RIGHT,v.Z.CTRL,v.Z.SEMICOLON,v.Z.EQUALS,v.Z.CAPS_LOCK,v.Z.CONTEXT_MENU,v.Z.F1,v.Z.F2,v.Z.F3,v.Z.F4,v.Z.F5,v.Z.F6,v.Z.F7,v.Z.F8,v.Z.F9,v.Z.F10,v.Z.F11,v.Z.F12].includes(t)||m(!0)},onInputMouseDown:function(){k(!0)},onInputChange:function(e){var t=e.target.value;if(u&&S.current&&/[\r\n]/.test(S.current)){var n=S.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");t=t.replace(n,S.current)}S.current=null,E(t)},onInputPaste:function(e){var t=e.clipboardData.getData("text");S.current=t},onInputCompositionStart:function(){r.current=!0},onInputCompositionEnd:function(e){r.current=!1,"combobox"!==l&&E(e.target.value)}},T="multiple"===l||"tags"===l?h.createElement(P,(0,i.Z)({},e,C)):h.createElement(O,(0,i.Z)({},e,C));return h.createElement("div",{ref:b,className:"".concat(a,"-selector"),onClick:function(e){e.target!==n.current&&(void 0!==document.body.style.msTouchAction?setTimeout((function(){n.current.focus()})):n.current.focus())},onMouseDown:function(e){var t=w();e.target===n.current||t||"combobox"===l||e.preventDefault(),("combobox"===l||c&&t)&&s||(s&&!1!==d&&p("",!0,!1),m())}},T)},B=h.forwardRef(N);B.displayName="Selector";var $=B,F=n(35593),z=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],K=function(e,t){var n=e.prefixCls,r=(e.disabled,e.visible),o=e.children,c=e.popupElement,u=e.animation,d=e.transitionName,p=e.dropdownStyle,m=e.dropdownClassName,g=e.direction,v=void 0===g?"ltr":g,b=e.placement,y=e.builtinPlacements,_=e.dropdownMatchSelectWidth,w=e.dropdownRender,x=e.dropdownAlign,k=e.getPopupContainer,S=e.empty,E=e.getTriggerDOMNode,C=e.onPopupVisibleChange,T=e.onPopupMouseEnter,A=(0,l.Z)(e,z),M="".concat(n,"-dropdown"),L=c;w&&(L=w(c));var D=h.useMemo((function(){return y||function(e){var t=!0===e?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"}}}(_)}),[y,_]),I=u?"".concat(M,"-").concat(u):d,R="number"==typeof _,P=h.useMemo((function(){return R?null:!1===_?"minWidth":"width"}),[_,R]),O=p;R&&(O=(0,s.Z)((0,s.Z)({},O),{},{width:_}));var N=h.useRef(null);return h.useImperativeHandle(t,(function(){return{getPopupElement:function(){return N.current}}})),h.createElement(F.Z,(0,i.Z)({},A,{showAction:C?["click"]:[],hideAction:C?["click"]:[],popupPlacement:b||("rtl"===v?"bottomRight":"bottomLeft"),builtinPlacements:D,prefixCls:M,popupTransitionName:I,popup:h.createElement("div",{ref:N,onMouseEnter:T},L),stretch:P,popupAlign:x,popupVisible:r,getPopupContainer:k,popupClassName:f()(m,(0,a.Z)({},"".concat(M,"-empty"),S)),popupStyle:O,getTriggerDOMNode:E,onPopupVisibleChange:C}),o)},U=h.forwardRef(K);U.displayName="SelectTrigger";var j=U,q=n(21696);function H(e,t){var n,i=e.key;return"value"in e&&(n=e.value),null!=i?i:void 0!==n?n:"rc-index-key-".concat(t)}function V(e,t){var n=e||{},i=n.label||(t?"children":"label");return{label:i,value:n.value||"value",options:n.options||"options",groupLabel:n.groupLabel||i}}function G(e){var t=(0,s.Z)({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return(0,d.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}var Z=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],W=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function Y(e){return"tags"===e||"multiple"===e}var X=h.forwardRef((function(e,t){var n,d,p=e.id,w=e.prefixCls,k=e.className,S=e.showSearch,E=e.tagRender,C=e.direction,T=e.omitDomProps,A=e.displayValues,M=e.onDisplayValuesChange,L=e.emptyOptions,D=e.notFoundContent,I=void 0===D?"Not Found":D,R=e.onClear,P=e.mode,O=e.disabled,N=e.loading,B=e.getInputElement,F=e.getRawInputElement,z=e.open,K=e.defaultOpen,U=e.onDropdownVisibleChange,H=e.activeValue,V=e.onActiveValueChange,G=e.activeDescendantId,X=e.searchValue,J=e.autoClearSearchValue,Q=e.onSearch,ee=e.onSearchSplit,te=e.tokenSeparators,ne=e.allowClear,ie=e.suffixIcon,re=e.clearIcon,ae=e.OptionList,se=e.animation,oe=e.transitionName,le=e.dropdownStyle,ce=e.dropdownClassName,ue=e.dropdownMatchSelectWidth,de=e.dropdownRender,he=e.dropdownAlign,pe=e.placement,fe=e.builtinPlacements,me=e.getPopupContainer,ge=e.showAction,ve=void 0===ge?[]:ge,be=e.onFocus,ye=e.onBlur,_e=e.onKeyUp,we=e.onKeyDown,xe=e.onMouseDown,ke=(0,l.Z)(e,Z),Se=Y(P),Ee=(void 0!==S?S:Se)||"combobox"===P,Ce=(0,s.Z)({},ke);W.forEach((function(e){delete Ce[e]})),null==T||T.forEach((function(e){delete Ce[e]}));var Te=h.useState(!1),Ae=(0,o.Z)(Te,2),Me=Ae[0],Le=Ae[1];h.useEffect((function(){Le((0,g.Z)())}),[]);var De=h.useRef(null),Ie=h.useRef(null),Re=h.useRef(null),Pe=h.useRef(null),Oe=h.useRef(null),Ne=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=h.useState(!1),n=(0,o.Z)(t,2),i=n[0],r=n[1],a=h.useRef(null),s=function(){window.clearTimeout(a.current)};return h.useEffect((function(){return s}),[]),[i,function(t,n){s(),a.current=window.setTimeout((function(){r(t),n&&n()}),e)},s]}(),Be=(0,o.Z)(Ne,3),$e=Be[0],Fe=Be[1],ze=Be[2];h.useImperativeHandle(t,(function(){var e,t;return{focus:null===(e=Pe.current)||void 0===e?void 0:e.focus,blur:null===(t=Pe.current)||void 0===t?void 0:t.blur,scrollTo:function(e){var t;return null===(t=Oe.current)||void 0===t?void 0:t.scrollTo(e)}}}));var Ke=h.useMemo((function(){var e;if("combobox"!==P)return X;var t=null===(e=A[0])||void 0===e?void 0:e.value;return"string"==typeof t||"number"==typeof t?String(t):""}),[X,P,A]),Ue="combobox"===P&&"function"==typeof B&&B()||null,je="function"==typeof F&&F(),qe=(0,b.x1)(Ie,null==je||null===(n=je.props)||void 0===n?void 0:n.ref),He=h.useState(!1),Ve=(0,o.Z)(He,2),Ge=Ve[0],Ze=Ve[1];(0,m.Z)((function(){Ze(!0)}),[]);var We=(0,u.Z)(!1,{defaultValue:K,value:z}),Ye=(0,o.Z)(We,2),Xe=Ye[0],Je=Ye[1],Qe=!!Ge&&Xe,et=!I&&L;(O||et&&Qe&&"combobox"===P)&&(Qe=!1);var tt=!et&&Qe,nt=h.useCallback((function(e){var t=void 0!==e?e:!Qe;O||(Je(t),Qe!==t&&(null==U||U(t)))}),[O,Qe,Je,U]),it=h.useMemo((function(){return(te||[]).some((function(e){return["\n","\r\n"].includes(e)}))}),[te]),rt=function(e,t,n){var i=!0,a=e;null==V||V(null);var s=n?null:function(e,t){if(!t||!t.length)return null;var n=!1,i=function e(t,i){var a=(0,q.Z)(i),s=a[0],o=a.slice(1);if(!s)return[t];var l=t.split(s);return n=n||l.length>1,l.reduce((function(t,n){return[].concat((0,r.Z)(t),(0,r.Z)(e(n,o)))}),[]).filter((function(e){return e}))}(e,t);return n?i:null}(e,te);return"combobox"!==P&&s&&(a="",null==ee||ee(s),nt(!1),i=!1),Q&&Ke!==a&&Q(a,{source:t?"typing":"effect"}),i};h.useEffect((function(){Qe||Se||"combobox"===P||rt("",!1,!1)}),[Qe]),h.useEffect((function(){Xe&&O&&Je(!1),O&&Fe(!1)}),[O]);var at=x(),st=(0,o.Z)(at,2),ot=st[0],lt=st[1],ct=h.useRef(!1),ut=[];h.useEffect((function(){return function(){ut.forEach((function(e){return clearTimeout(e)})),ut.splice(0,ut.length)}}),[]);var dt,ht=h.useState({}),pt=(0,o.Z)(ht,2)[1];je&&(dt=function(e){nt(e)}),function(e,t,n,i){var r=h.useRef(null);r.current={open:t,triggerOpen:n,customizedTrigger:i},h.useEffect((function(){function t(t){var n;if(null===(n=r.current)||void 0===n||!n.customizedTrigger){var i=t.target;i.shadowRoot&&t.composed&&(i=t.composedPath()[0]||i),r.current.open&&e().filter((function(e){return e})).every((function(e){return!e.contains(i)&&e!==i}))&&r.current.triggerOpen(!1)}}return window.addEventListener("mousedown",t),function(){return window.removeEventListener("mousedown",t)}}),[])}((function(){var e;return[De.current,null===(e=Re.current)||void 0===e?void 0:e.getPopupElement()]}),tt,nt,!!je);var ft,mt=h.useMemo((function(){return(0,s.Z)((0,s.Z)({},e),{},{notFoundContent:I,open:Qe,triggerOpen:tt,id:p,showSearch:Ee,multiple:Se,toggleOpen:nt})}),[e,I,tt,Qe,p,Ee,Se,nt]),gt=!!ie||N;gt&&(ft=h.createElement(y,{className:f()("".concat(w,"-arrow"),(0,a.Z)({},"".concat(w,"-arrow-loading"),N)),customizeIcon:ie,customizeIconProps:{loading:N,searchValue:Ke,open:Qe,focused:$e,showSearch:Ee}}));var vt,bt=function(e,t,n,i,r){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6?arguments[6]:void 0,o=arguments.length>7?arguments[7]:void 0,l=h.useMemo((function(){return"object"===(0,c.Z)(i)?i.clearIcon:r||void 0}),[i,r]),u=h.useMemo((function(){return!(a||!i||!n.length&&!s||"combobox"===o&&""===s)}),[i,a,n.length,s,o]);return{allowClear:u,clearIcon:h.createElement(y,{className:"".concat(e,"-clear"),onMouseDown:t,customizeIcon:l},"×")}}(w,(function(){var e;null==R||R(),null===(e=Pe.current)||void 0===e||e.focus(),M([],{type:"clear",values:A}),rt("",!1,!1)}),A,ne,re,O,Ke,P),yt=bt.allowClear,_t=bt.clearIcon,wt=h.createElement(ae,{ref:Oe}),xt=f()(w,k,(d={},(0,a.Z)(d,"".concat(w,"-focused"),$e),(0,a.Z)(d,"".concat(w,"-multiple"),Se),(0,a.Z)(d,"".concat(w,"-single"),!Se),(0,a.Z)(d,"".concat(w,"-allow-clear"),ne),(0,a.Z)(d,"".concat(w,"-show-arrow"),gt),(0,a.Z)(d,"".concat(w,"-disabled"),O),(0,a.Z)(d,"".concat(w,"-loading"),N),(0,a.Z)(d,"".concat(w,"-open"),Qe),(0,a.Z)(d,"".concat(w,"-customize-input"),Ue),(0,a.Z)(d,"".concat(w,"-show-search"),Ee),d)),kt=h.createElement(j,{ref:Re,disabled:O,prefixCls:w,visible:tt,popupElement:wt,animation:se,transitionName:oe,dropdownStyle:le,dropdownClassName:ce,direction:C,dropdownMatchSelectWidth:ue,dropdownRender:de,dropdownAlign:he,placement:pe,builtinPlacements:fe,getPopupContainer:me,empty:L,getTriggerDOMNode:function(){return Ie.current},onPopupVisibleChange:dt,onPopupMouseEnter:function(){pt({})}},je?h.cloneElement(je,{ref:qe}):h.createElement($,(0,i.Z)({},e,{domRef:Ie,prefixCls:w,inputElement:Ue,ref:Pe,id:p,showSearch:Ee,autoClearSearchValue:J,mode:P,activeDescendantId:G,tagRender:E,values:A,open:Qe,onToggleOpen:nt,activeValue:H,searchValue:Ke,onSearch:rt,onSearchSubmit:function(e){e&&e.trim()&&Q(e,{source:"submit"})},onRemove:function(e){var t=A.filter((function(t){return t!==e}));M(t,{type:"remove",values:[e]})},tokenWithEnter:it})));return vt=je?kt:h.createElement("div",(0,i.Z)({className:xt},Ce,{ref:De,onMouseDown:function(e){var t,n=e.target,i=null===(t=Re.current)||void 0===t?void 0:t.getPopupElement();if(i&&i.contains(n)){var r=setTimeout((function(){var e,t=ut.indexOf(r);-1!==t&&ut.splice(t,1),ze(),Me||i.contains(document.activeElement)||null===(e=Pe.current)||void 0===e||e.focus()}));ut.push(r)}for(var a=arguments.length,s=new Array(a>1?a-1:0),o=1;o<a;o++)s[o-1]=arguments[o];null==xe||xe.apply(void 0,[e].concat(s))},onKeyDown:function(e){var t,n=ot(),i=e.which;if(i===v.Z.ENTER&&("combobox"!==P&&e.preventDefault(),Qe||nt(!0)),lt(!!Ke),i===v.Z.BACKSPACE&&!n&&Se&&!Ke&&A.length){for(var a=(0,r.Z)(A),s=null,o=a.length-1;o>=0;o-=1){var l=a[o];if(!l.disabled){a.splice(o,1),s=l;break}}s&&M(a,{type:"remove",values:[s]})}for(var c=arguments.length,u=new Array(c>1?c-1:0),d=1;d<c;d++)u[d-1]=arguments[d];Qe&&Oe.current&&(t=Oe.current).onKeyDown.apply(t,[e].concat(u)),null==we||we.apply(void 0,[e].concat(u))},onKeyUp:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var r;Qe&&Oe.current&&(r=Oe.current).onKeyUp.apply(r,[e].concat(n)),null==_e||_e.apply(void 0,[e].concat(n))},onFocus:function(){Fe(!0),O||(be&&!ct.current&&be.apply(void 0,arguments),ve.includes("focus")&&nt(!0)),ct.current=!0},onBlur:function(){Fe(!1,(function(){ct.current=!1,nt(!1)})),O||(Ke&&("tags"===P?Q(Ke,{source:"submit"}):"multiple"===P&&Q("",{source:"blur"})),ye&&ye.apply(void 0,arguments))}}),$e&&!Qe&&h.createElement("span",{style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0},"aria-live":"polite"},"".concat(A.map((function(e){var t=e.label,n=e.value;return["number","string"].includes((0,c.Z)(t))?t:n})).join(", "))),kt,ft,yt&&_t),h.createElement(_.Provider,{value:mt},vt)}));var J=X;function Q(e,t){return A(e).join("").toUpperCase().includes(t)}var ee=n(17115),te=n(11592),ne=["children","value"],ie=["children"];function re(e){var t=e,n=t.key,i=t.props,r=i.children,a=i.value,o=(0,l.Z)(i,ne);return(0,s.Z)({key:n,value:void 0!==a?a:n,children:r},o)}function ae(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,te.Z)(e).map((function(e,n){if(!h.isValidElement(e)||!e.type)return null;var i=e,r=i.type.isSelectOptGroup,a=i.key,o=i.props,c=o.children,u=(0,l.Z)(o,ie);return t||!r?re(e):(0,s.Z)((0,s.Z)({key:"__RC_SELECT_GRP__".concat(null===a?n:a,"__"),label:a},u),{},{options:ae(c)})})).filter((function(e){return e}))}function se(e,t,n,i,r){return h.useMemo((function(){var a=e;!e&&(a=ae(t));var s=new Map,o=new Map,l=function(e,t,n){n&&"string"==typeof n&&e.set(t[n],t)};return function e(t){for(var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c=0;c<t.length;c+=1){var u=t[c];!u[n.options]||a?(s.set(u[n.value],u),l(o,u,n.label),l(o,u,i),l(o,u,r)):e(u[n.options],!0)}}(a),{options:a,valueOptions:s,labelOptions:o}}),[e,t,n,i,r])}function oe(e){var t=h.useRef();t.current=e;var n=h.useCallback((function(){return t.current.apply(t,arguments)}),[]);return n}var le=function(){return null};le.isSelectOptGroup=!0;var ce=le,ue=function(){return null};ue.isSelectOption=!0;var de=ue,he=n(80547),pe=n(2738),fe=n(65283),me=h.createContext(null);var ge=["disabled","title","children","style","className"];function ve(e){return"string"==typeof e||"number"==typeof e}var be=function(e,t){var n=w(),s=n.prefixCls,c=n.id,u=n.open,d=n.multiple,p=n.mode,m=n.searchValue,g=n.toggleOpen,b=n.notFoundContent,_=n.onPopupScroll,x=h.useContext(me),S=x.flattenOptions,E=x.onActiveValue,C=x.defaultActiveFirstOption,T=x.onSelect,A=x.menuItemSelectedIcon,M=x.rawValues,L=x.fieldNames,D=x.virtual,I=x.direction,R=x.listHeight,P=x.listItemHeight,O="".concat(s,"-item"),N=(0,he.Z)((function(){return S}),[u,S],(function(e,t){return t[0]&&e[1]!==t[1]})),B=h.useRef(null),$=function(e){e.preventDefault()},F=function(e){B.current&&B.current.scrollTo("number"==typeof e?{index:e}:e)},z=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=N.length,i=0;i<n;i+=1){var r=(e+i*t+n)%n,a=N[r],s=a.group,o=a.data;if(!s&&!o.disabled)return r}return-1},K=h.useState((function(){return z(0)})),U=(0,o.Z)(K,2),j=U[0],q=U[1],H=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];q(e);var n={source:t?"keyboard":"mouse"},i=N[e];i?E(i.value,e,n):E(null,-1,n)};(0,h.useEffect)((function(){H(!1!==C?z(0):-1)}),[N.length,m]);var V=h.useCallback((function(e){return M.has(e)&&"combobox"!==p}),[p,(0,r.Z)(M).toString(),M.size]);(0,h.useEffect)((function(){var e,t=setTimeout((function(){if(!d&&u&&1===M.size){var e=Array.from(M)[0],t=N.findIndex((function(t){return t.data.value===e}));-1!==t&&(H(t),F(t))}}));u&&(null===(e=B.current)||void 0===e||e.scrollTo(void 0));return function(){return clearTimeout(t)}}),[u,m,S.length]);var G=function(e){void 0!==e&&T(e,{selected:!M.has(e)}),d||g(!1)};if(h.useImperativeHandle(t,(function(){return{onKeyDown:function(e){var t=e.which,n=e.ctrlKey;switch(t){case v.Z.N:case v.Z.P:case v.Z.UP:case v.Z.DOWN:var i=0;if(t===v.Z.UP?i=-1:t===v.Z.DOWN?i=1:/(mac\sos|macintosh)/i.test(navigator.appVersion)&&n&&(t===v.Z.N?i=1:t===v.Z.P&&(i=-1)),0!==i){var r=z(j+i,i);F(r),H(r,!0)}break;case v.Z.ENTER:var a=N[j];a&&!a.data.disabled?G(a.value):G(void 0),u&&e.preventDefault();break;case v.Z.ESC:g(!1),u&&e.stopPropagation()}},onKeyUp:function(){},scrollTo:function(e){F(e)}}})),0===N.length)return h.createElement("div",{role:"listbox",id:"".concat(c,"_list"),className:"".concat(O,"-empty"),onMouseDown:$},b);var Z=Object.keys(L).map((function(e){return L[e]})),W=function(e){return e.label};function Y(e,t){return{role:e.group?"presentation":"option",id:"".concat(c,"_list_").concat(t)}}var X=function(e){var t=N[e];if(!t)return null;var n=t.data||{},r=n.value,a=t.group,s=(0,k.Z)(n,!0),o=W(t);return t?h.createElement("div",(0,i.Z)({"aria-label":"string"!=typeof o||a?null:o},s,{key:e},Y(t,e),{"aria-selected":V(r)}),r):null},J={role:"listbox",id:"".concat(c,"_list")};return h.createElement(h.Fragment,null,D&&h.createElement("div",(0,i.Z)({},J,{style:{height:0,width:0,overflow:"hidden"}}),X(j-1),X(j),X(j+1)),h.createElement(fe.Z,{itemKey:"key",ref:B,data:N,height:R,itemHeight:P,fullHeight:!1,onMouseDown:$,onScroll:_,virtual:D,direction:I,innerProps:D?null:J},(function(e,t){var n,r=e.group,s=e.groupOption,o=e.data,c=e.label,u=e.value,d=o.key;if(r){var p,m=null!==(p=o.title)&&void 0!==p?p:ve(c)?c.toString():void 0;return h.createElement("div",{className:f()(O,"".concat(O,"-group")),title:m},void 0!==c?c:d)}var g=o.disabled,v=o.title,b=(o.children,o.style),_=o.className,w=(0,l.Z)(o,ge),x=(0,pe.Z)(w,Z),S=V(u),E="".concat(O,"-option"),C=f()(O,E,_,(n={},(0,a.Z)(n,"".concat(E,"-grouped"),s),(0,a.Z)(n,"".concat(E,"-active"),j===t&&!g),(0,a.Z)(n,"".concat(E,"-disabled"),g),(0,a.Z)(n,"".concat(E,"-selected"),S),n)),T=W(e),M=!A||"function"==typeof A||S,L="number"==typeof T?T:T||u,I=ve(L)?L.toString():void 0;return void 0!==v&&(I=v),h.createElement("div",(0,i.Z)({},(0,k.Z)(x),D?{}:Y(e,t),{"aria-selected":S,className:C,title:I,onMouseMove:function(){j===t||g||H(t)},onClick:function(){g||G(u)},style:b}),h.createElement("div",{className:"".concat(E,"-content")},L),h.isValidElement(A)||S,M&&h.createElement(y,{className:"".concat(O,"-option-state"),customizeIcon:A,customizeIconProps:{isSelected:S}},S?"✓":null))})))},ye=h.forwardRef(be);ye.displayName="OptionList";var _e=ye;var we=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","value","defaultValue","labelInValue","onChange"],xe=["inputValue"];var ke=h.forwardRef((function(e,t){var n=e.id,d=e.mode,p=e.prefixCls,f=void 0===p?"rc-select":p,m=e.backfill,g=e.fieldNames,v=e.inputValue,b=e.searchValue,y=e.onSearch,_=e.autoClearSearchValue,w=void 0===_||_,x=e.onSelect,k=e.onDeselect,S=e.dropdownMatchSelectWidth,E=void 0===S||S,C=e.filterOption,T=e.filterSort,M=e.optionFilterProp,L=e.optionLabelProp,D=e.options,I=e.children,R=e.defaultActiveFirstOption,P=e.menuItemSelectedIcon,O=e.virtual,N=e.direction,B=e.listHeight,$=void 0===B?200:B,F=e.listItemHeight,z=void 0===F?20:F,K=e.value,U=e.defaultValue,j=e.labelInValue,q=e.onChange,Z=(0,l.Z)(e,we),W=(0,ee.ZP)(n),X=Y(d),te=!(D||!I),ne=h.useMemo((function(){return(void 0!==C||"combobox"!==d)&&C}),[C,d]),ie=h.useMemo((function(){return V(g,te)}),[JSON.stringify(g),te]),re=(0,u.Z)("",{value:void 0!==b?b:v,postState:function(e){return e||""}}),ae=(0,o.Z)(re,2),le=ae[0],ce=ae[1],ue=se(D,I,ie,M,L),de=ue.valueOptions,he=ue.labelOptions,pe=ue.options,fe=h.useCallback((function(e){return A(e).map((function(e){var t,n,i,r,a,s;(function(e){return!e||"object"!==(0,c.Z)(e)})(e)?t=e:(i=e.key,n=e.label,t=null!==(s=e.value)&&void 0!==s?s:i);var o,l=de.get(t);l&&(void 0===n&&(n=null==l?void 0:l[L||ie.label]),void 0===i&&(i=null!==(o=null==l?void 0:l.key)&&void 0!==o?o:t),r=null==l?void 0:l.disabled,a=null==l?void 0:l.title);return{label:n,value:t,key:i,disabled:r,title:a}}))}),[ie,L,de]),ge=(0,u.Z)(U,{value:K}),ve=(0,o.Z)(ge,2),be=ve[0],ye=ve[1],ke=h.useMemo((function(){var e,t=fe(be);return"combobox"===d&&function(e){return!e&&0!==e}(null===(e=t[0])||void 0===e?void 0:e.value)?[]:t}),[be,fe,d]),Se=function(e,t){var n=h.useRef({values:new Map,options:new Map});return[h.useMemo((function(){var i=n.current,r=i.values,a=i.options,o=e.map((function(e){var t;return void 0===e.label?(0,s.Z)((0,s.Z)({},e),{},{label:null===(t=r.get(e.value))||void 0===t?void 0:t.label}):e})),l=new Map,c=new Map;return o.forEach((function(e){l.set(e.value,e),c.set(e.value,t.get(e.value)||a.get(e.value))})),n.current.values=l,n.current.options=c,o}),[e,t]),h.useCallback((function(e){return t.get(e)||n.current.options.get(e)}),[t])]}(ke,de),Ee=(0,o.Z)(Se,2),Ce=Ee[0],Te=Ee[1],Ae=h.useMemo((function(){if(!d&&1===Ce.length){var e=Ce[0];if(null===e.value&&(null===e.label||void 0===e.label))return[]}return Ce.map((function(e){var t;return(0,s.Z)((0,s.Z)({},e),{},{label:null!==(t=e.label)&&void 0!==t?t:e.value})}))}),[d,Ce]),Me=h.useMemo((function(){return new Set(Ce.map((function(e){return e.value})))}),[Ce]);h.useEffect((function(){if("combobox"===d){var e,t=null===(e=Ce[0])||void 0===e?void 0:e.value;ce(function(e){return null!=e}(t)?String(t):"")}}),[Ce]);var Le=oe((function(e,t){var n,i=null!=t?t:e;return n={},(0,a.Z)(n,ie.value,e),(0,a.Z)(n,ie.label,i),n})),De=function(e,t,n,i,r){return h.useMemo((function(){if(!n||!1===i)return e;var o=t.options,l=t.label,c=t.value,u=[],d="function"==typeof i,h=n.toUpperCase(),p=d?i:function(e,t){return r?Q(t[r],h):t[o]?Q(t["children"!==l?l:"label"],h):Q(t[c],h)},f=d?function(e){return G(e)}:function(e){return e};return e.forEach((function(e){if(e[o])if(p(n,f(e)))u.push(e);else{var t=e[o].filter((function(e){return p(n,f(e))}));t.length&&u.push((0,s.Z)((0,s.Z)({},e),{},(0,a.Z)({},o,t)))}else p(n,f(e))&&u.push(e)})),u}),[e,i,r,n,t])}(h.useMemo((function(){if("tags"!==d)return pe;var e=(0,r.Z)(pe);return(0,r.Z)(Ce).sort((function(e,t){return e.value<t.value?-1:1})).forEach((function(t){var n=t.value;(function(e){return de.has(e)})(n)||e.push(Le(n,t.label))})),e}),[Le,pe,de,Ce,d]),ie,le,ne,M),Ie=h.useMemo((function(){return"tags"!==d||!le||De.some((function(e){return e[M||"value"]===le}))||De.some((function(e){return e[ie.value]===le}))?De:[Le(le)].concat((0,r.Z)(De))}),[Le,M,d,De,le,ie]),Re=h.useMemo((function(){return T?(0,r.Z)(Ie).sort((function(e,t){return T(e,t)})):Ie}),[Ie,T]),Pe=h.useMemo((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.fieldNames,i=t.childrenAsData,r=[],a=V(n,!1),s=a.label,o=a.value,l=a.options,c=a.groupLabel;function u(e,t){e.forEach((function(e){if(t||!(l in e)){var n=e[o];r.push({key:H(e,r.length),groupOption:t,data:e,label:e[s],value:n})}else{var a=e[c];void 0===a&&i&&(a=e.label),r.push({key:H(e,r.length),group:!0,data:e,label:a}),u(e[l],!0)}}))}return u(e,!1),r}(Re,{fieldNames:ie,childrenAsData:te})}),[Re,ie,te]),Oe=function(e){var t=fe(e);if(ye(t),q&&(t.length!==Ce.length||t.some((function(e,t){var n;return(null===(n=Ce[t])||void 0===n?void 0:n.value)!==(null==e?void 0:e.value)})))){var n=j?t:t.map((function(e){return e.value})),i=t.map((function(e){return G(Te(e.value))}));q(X?n:n[0],X?i:i[0])}},Ne=h.useState(null),Be=(0,o.Z)(Ne,2),$e=Be[0],Fe=Be[1],ze=h.useState(0),Ke=(0,o.Z)(ze,2),Ue=Ke[0],je=Ke[1],qe=void 0!==R?R:"combobox"!==d,He=h.useCallback((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.source,r=void 0===i?"keyboard":i;je(t),m&&"combobox"===d&&null!==e&&"keyboard"===r&&Fe(String(e))}),[m,d]),Ve=function(e,t,n){var i=function(){var t,n=Te(e);return[j?{label:null==n?void 0:n[ie.label],value:e,key:null!==(t=null==n?void 0:n.key)&&void 0!==t?t:e}:e,G(n)]};if(t&&x){var r=i(),a=(0,o.Z)(r,2),s=a[0],l=a[1];x(s,l)}else if(!t&&k&&"clear"!==n){var c=i(),u=(0,o.Z)(c,2),d=u[0],h=u[1];k(d,h)}},Ge=oe((function(e,t){var n,i=!X||t.selected;n=i?X?[].concat((0,r.Z)(Ce),[e]):[e]:Ce.filter((function(t){return t.value!==e})),Oe(n),Ve(e,i),"combobox"===d?Fe(""):Y&&!w||(ce(""),Fe(""))})),Ze=h.useMemo((function(){var e=!1!==O&&!1!==E;return(0,s.Z)((0,s.Z)({},ue),{},{flattenOptions:Pe,onActiveValue:He,defaultActiveFirstOption:qe,onSelect:Ge,menuItemSelectedIcon:P,rawValues:Me,fieldNames:ie,virtual:e,direction:N,listHeight:$,listItemHeight:z,childrenAsData:te})}),[ue,Pe,He,qe,Ge,P,Me,ie,O,E,$,z,te]);return h.createElement(me.Provider,{value:Ze},h.createElement(J,(0,i.Z)({},Z,{id:W,prefixCls:f,ref:t,omitDomProps:xe,mode:d,displayValues:Ae,onDisplayValuesChange:function(e,t){Oe(e);var n=t.type,i=t.values;"remove"!==n&&"clear"!==n||i.forEach((function(e){Ve(e.value,!1,n)}))},direction:N,searchValue:le,onSearch:function(e,t){if(ce(e),Fe(null),"submit"!==t.source)"blur"!==t.source&&("combobox"===d&&Oe(e),null==y||y(e));else{var n=(e||"").trim();if(n){var i=Array.from(new Set([].concat((0,r.Z)(Me),[n])));Oe(i),Ve(n,!0),ce("")}}},autoClearSearchValue:w,onSearchSplit:function(e){var t=e;"tags"!==d&&(t=e.map((function(e){var t=he.get(e);return null==t?void 0:t.value})).filter((function(e){return void 0!==e})));var n=Array.from(new Set([].concat((0,r.Z)(Me),(0,r.Z)(t))));Oe(n),n.forEach((function(e){Ve(e,!0)}))},dropdownMatchSelectWidth:E,OptionList:_e,emptyOptions:!Pe.length,activeValue:$e,activeDescendantId:"".concat(W,"_list_").concat(Ue)})))}));var Se=ke;Se.Option=de,Se.OptGroup=ce;var Ee=Se},39417:function(e,t,n){"use strict";n.d(t,{Z:function(){return C}});var i=n(14809),r=n(4635),a=n(62646),s=n(20439),o=n(99153),l=n(84851),c=n(13028),u=n(19257),d=n(54941),h=n(92310),p=n.n(h),f=n(26112),m=n(59301),g=n(39378),v=function(e){for(var t=e.prefixCls,n=e.level,i=e.isStart,a=e.isEnd,s="".concat(t,"-indent-unit"),o=[],l=0;l<n;l+=1){var c;o.push(m.createElement("span",{key:l,className:p()(s,(c={},(0,r.Z)(c,"".concat(s,"-start"),i[l]),(0,r.Z)(c,"".concat(s,"-end"),a[l]),c))}))}return m.createElement("span",{"aria-hidden":"true",className:"".concat(t,"-indent")},o)},b=m.memo(v),y=n(67841),_=n(71430),w=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],x="open",k="close",S=function(e){(0,u.Z)(n,e);var t=(0,d.Z)(n);function n(){var e;(0,o.Z)(this,n);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return(e=t.call.apply(t,[this].concat(r))).state={dragNodeHighlight:!1},e.selectHandle=void 0,e.cacheIndent=void 0,e.onSelectorClick=function(t){(0,e.props.context.onNodeClick)(t,(0,_.F)(e.props)),e.isSelectable()?e.onSelect(t):e.onCheck(t)},e.onSelectorDoubleClick=function(t){(0,e.props.context.onNodeDoubleClick)(t,(0,_.F)(e.props))},e.onSelect=function(t){e.isDisabled()||(0,e.props.context.onNodeSelect)(t,(0,_.F)(e.props))},e.onCheck=function(t){if(!e.isDisabled()){var n=e.props,i=n.disableCheckbox,r=n.checked,a=e.props.context.onNodeCheck;if(e.isCheckable()&&!i){var s=!r;a(t,(0,_.F)(e.props),s)}}},e.onMouseEnter=function(t){(0,e.props.context.onNodeMouseEnter)(t,(0,_.F)(e.props))},e.onMouseLeave=function(t){(0,e.props.context.onNodeMouseLeave)(t,(0,_.F)(e.props))},e.onContextMenu=function(t){(0,e.props.context.onNodeContextMenu)(t,(0,_.F)(e.props))},e.onDragStart=function(t){var n=e.props.context.onNodeDragStart;t.stopPropagation(),e.setState({dragNodeHighlight:!0}),n(t,(0,c.Z)(e));try{t.dataTransfer.setData("text/plain","")}catch(e){}},e.onDragEnter=function(t){var n=e.props.context.onNodeDragEnter;t.preventDefault(),t.stopPropagation(),n(t,(0,c.Z)(e))},e.onDragOver=function(t){var n=e.props.context.onNodeDragOver;t.preventDefault(),t.stopPropagation(),n(t,(0,c.Z)(e))},e.onDragLeave=function(t){var n=e.props.context.onNodeDragLeave;t.stopPropagation(),n(t,(0,c.Z)(e))},e.onDragEnd=function(t){var n=e.props.context.onNodeDragEnd;t.stopPropagation(),e.setState({dragNodeHighlight:!1}),n(t,(0,c.Z)(e))},e.onDrop=function(t){var n=e.props.context.onNodeDrop;t.preventDefault(),t.stopPropagation(),e.setState({dragNodeHighlight:!1}),n(t,(0,c.Z)(e))},e.onExpand=function(t){var n=e.props,i=n.loading,r=n.context.onNodeExpand;i||r(t,(0,_.F)(e.props))},e.setSelectHandle=function(t){e.selectHandle=t},e.getNodeState=function(){var t=e.props.expanded;return e.isLeaf()?null:t?x:k},e.hasChildren=function(){var t=e.props.eventKey,n=e.props.context.keyEntities;return!!(((0,y.Z)(n,t)||{}).children||[]).length},e.isLeaf=function(){var t=e.props,n=t.isLeaf,i=t.loaded,r=e.props.context.loadData,a=e.hasChildren();return!1!==n&&(n||!r&&!a||r&&i&&!a)},e.isDisabled=function(){var t=e.props.disabled;return!(!e.props.context.disabled&&!t)},e.isCheckable=function(){var t=e.props.checkable,n=e.props.context.checkable;return!(!n||!1===t)&&n},e.syncLoadData=function(t){var n=t.expanded,i=t.loading,r=t.loaded,a=e.props.context,s=a.loadData,o=a.onNodeLoad;i||s&&n&&!e.isLeaf()&&(e.hasChildren()||r||o((0,_.F)(e.props)))},e.isDraggable=function(){var t=e.props,n=t.data,i=t.context.draggable;return!(!i||i.nodeDraggable&&!i.nodeDraggable(n))},e.renderDragHandler=function(){var t=e.props.context,n=t.draggable,i=t.prefixCls;return(null==n?void 0:n.icon)?m.createElement("span",{className:"".concat(i,"-draggable-icon")},n.icon):null},e.renderSwitcherIconDom=function(t){var n=e.props.switcherIcon,i=e.props.context.switcherIcon,r=n||i;return"function"==typeof r?r((0,s.Z)((0,s.Z)({},e.props),{},{isLeaf:t})):r},e.renderSwitcher=function(){var t=e.props.expanded,n=e.props.context.prefixCls;if(e.isLeaf()){var i=e.renderSwitcherIconDom(!0);return!1!==i?m.createElement("span",{className:p()("".concat(n,"-switcher"),"".concat(n,"-switcher-noop"))},i):null}var r=p()("".concat(n,"-switcher"),"".concat(n,"-switcher_").concat(t?x:k)),a=e.renderSwitcherIconDom(!1);return!1!==a?m.createElement("span",{onClick:e.onExpand,className:r},a):null},e.renderCheckbox=function(){var t=e.props,n=t.checked,i=t.halfChecked,r=t.disableCheckbox,a=e.props.context.prefixCls,s=e.isDisabled(),o=e.isCheckable();if(!o)return null;var l="boolean"!=typeof o?o:null;return m.createElement("span",{className:p()("".concat(a,"-checkbox"),n&&"".concat(a,"-checkbox-checked"),!n&&i&&"".concat(a,"-checkbox-indeterminate"),(s||r)&&"".concat(a,"-checkbox-disabled")),onClick:e.onCheck},l)},e.renderIcon=function(){var t=e.props.loading,n=e.props.context.prefixCls;return m.createElement("span",{className:p()("".concat(n,"-iconEle"),"".concat(n,"-icon__").concat(e.getNodeState()||"docu"),t&&"".concat(n,"-icon_loading"))})},e.renderSelector=function(){var t,n,i=e.state.dragNodeHighlight,r=e.props,a=r.title,s=void 0===a?"---":a,o=r.selected,l=r.icon,c=r.loading,u=r.data,d=e.props.context,h=d.prefixCls,f=d.showIcon,g=d.icon,v=d.loadData,b=d.titleRender,y=e.isDisabled(),_="".concat(h,"-node-content-wrapper");if(f){var w=l||g;t=w?m.createElement("span",{className:p()("".concat(h,"-iconEle"),"".concat(h,"-icon__customize"))},"function"==typeof w?w(e.props):w):e.renderIcon()}else v&&c&&(t=e.renderIcon());n="function"==typeof s?s(u):b?b(u):s;var x=m.createElement("span",{className:"".concat(h,"-title")},n);return m.createElement("span",{ref:e.setSelectHandle,title:"string"==typeof s?s:"",className:p()("".concat(_),"".concat(_,"-").concat(e.getNodeState()||"normal"),!y&&(o||i)&&"".concat(h,"-node-selected")),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onContextMenu:e.onContextMenu,onClick:e.onSelectorClick,onDoubleClick:e.onSelectorDoubleClick},t,x,e.renderDropIndicator())},e.renderDropIndicator=function(){var t=e.props,n=t.disabled,i=t.eventKey,r=e.props.context,a=r.draggable,s=r.dropLevelOffset,o=r.dropPosition,l=r.prefixCls,c=r.indent,u=r.dropIndicatorRender,d=r.dragOverNodeKey,h=r.direction,p=!n&&!!a&&d===i,f=null!=c?c:e.cacheIndent;return e.cacheIndent=c,p?u({dropPosition:o,dropLevelOffset:s,indent:f,prefixCls:l,direction:h}):null},e}return(0,l.Z)(n,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var e=this.props.selectable,t=this.props.context.selectable;return"boolean"==typeof e?e:t}},{key:"render",value:function(){var e,t=this.props,n=t.eventKey,s=t.className,o=t.style,l=t.dragOver,c=t.dragOverGapTop,u=t.dragOverGapBottom,d=t.isLeaf,h=t.isStart,g=t.isEnd,v=t.expanded,x=t.selected,k=t.checked,S=t.halfChecked,E=t.loading,C=t.domRef,T=t.active,A=(t.data,t.onMouseMove),M=t.selectable,L=(0,a.Z)(t,w),D=this.props.context,I=D.prefixCls,R=D.filterTreeNode,P=D.keyEntities,O=D.dropContainerKey,N=D.dropTargetKey,B=D.draggingNodeKey,$=this.isDisabled(),F=(0,f.Z)(L,{aria:!0,data:!0}),z=((0,y.Z)(P,n)||{}).level,K=g[g.length-1],U=this.isDraggable(),j=!$&&U,q=B===n,H=void 0!==M?{"aria-selected":!!M}:void 0;return m.createElement("div",(0,i.Z)({ref:C,className:p()(s,"".concat(I,"-treenode"),(e={},(0,r.Z)(e,"".concat(I,"-treenode-disabled"),$),(0,r.Z)(e,"".concat(I,"-treenode-switcher-").concat(v?"open":"close"),!d),(0,r.Z)(e,"".concat(I,"-treenode-checkbox-checked"),k),(0,r.Z)(e,"".concat(I,"-treenode-checkbox-indeterminate"),S),(0,r.Z)(e,"".concat(I,"-treenode-selected"),x),(0,r.Z)(e,"".concat(I,"-treenode-loading"),E),(0,r.Z)(e,"".concat(I,"-treenode-active"),T),(0,r.Z)(e,"".concat(I,"-treenode-leaf-last"),K),(0,r.Z)(e,"".concat(I,"-treenode-draggable"),U),(0,r.Z)(e,"dragging",q),(0,r.Z)(e,"drop-target",N===n),(0,r.Z)(e,"drop-container",O===n),(0,r.Z)(e,"drag-over",!$&&l),(0,r.Z)(e,"drag-over-gap-top",!$&&c),(0,r.Z)(e,"drag-over-gap-bottom",!$&&u),(0,r.Z)(e,"filter-node",R&&R((0,_.F)(this.props))),e)),style:o,draggable:j,"aria-grabbed":q,onDragStart:j?this.onDragStart:void 0,onDragEnter:U?this.onDragEnter:void 0,onDragOver:U?this.onDragOver:void 0,onDragLeave:U?this.onDragLeave:void 0,onDrop:U?this.onDrop:void 0,onDragEnd:U?this.onDragEnd:void 0,onMouseMove:A},H,F),m.createElement(b,{prefixCls:I,level:z,isStart:h,isEnd:g}),this.renderDragHandler(),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),n}(m.Component),E=function(e){return m.createElement(g.k.Consumer,null,(function(t){return m.createElement(S,(0,i.Z)({},e,{context:t}))}))};E.displayName="TreeNode",E.isTreeNode=1;var C=E},39378:function(e,t,n){"use strict";n.d(t,{k:function(){return i}});var i=n(59301).createContext(null)},35654:function(e,t,n){"use strict";n.d(t,{BT:function(){return p},E6:function(){return f},L0:function(){return l},OM:function(){return h},_5:function(){return o},r7:function(){return m},wA:function(){return u},yx:function(){return c}});var i=n(95190),r=n(93664),a=n(48736),s=(n(59301),n(39417),n(67841));n(71430);function o(e,t){if(!e)return[];var n=e.slice(),i=n.indexOf(t);return i>=0&&n.splice(i,1),n}function l(e,t){var n=(e||[]).slice();return-1===n.indexOf(t)&&n.push(t),n}function c(e){return e.split("-")}function u(e,t){var n=[];return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.forEach((function(t){var i=t.key,r=t.children;n.push(i),e(r)}))}((0,s.Z)(t,e).children),n}function d(e){if(e.parent){var t=c(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1}function h(e,t,n,i,r,a,o,l,u,h){var p,f=e.clientX,m=e.clientY,g=e.target.getBoundingClientRect(),v=g.top,b=g.height,y=(("rtl"===h?-1:1)*(((null==r?void 0:r.x)||0)-f)-12)/i,_=(0,s.Z)(l,n.props.eventKey);if(m<v+b/2){var w=o.findIndex((function(e){return e.key===_.key})),x=o[w<=0?0:w-1].key;_=(0,s.Z)(l,x)}var k=_.key,S=_,E=_.key,C=0,T=0;if(!u.includes(k))for(var A=0;A<y&&d(_);A+=1)_=_.parent,T+=1;var M,L=t.props.data,D=_.node,I=!0;return M=c(_.pos),0===Number(M[M.length-1])&&0===_.level&&m<v+b/2&&a({dragNode:L,dropNode:D,dropPosition:-1})&&_.key===n.props.eventKey?C=-1:(S.children||[]).length&&u.includes(E)?a({dragNode:L,dropNode:D,dropPosition:0})?C=0:I=!1:0===T?y>-1.5?a({dragNode:L,dropNode:D,dropPosition:1})?C=1:I=!1:a({dragNode:L,dropNode:D,dropPosition:0})?C=0:a({dragNode:L,dropNode:D,dropPosition:1})?C=1:I=!1:a({dragNode:L,dropNode:D,dropPosition:1})?C=1:I=!1,{dropPosition:C,dropLevelOffset:T,dropTargetKey:_.key,dropTargetPos:_.pos,dragOverNodeKey:E,dropContainerKey:0===C?null:(null===(p=_.parent)||void 0===p?void 0:p.key)||null,dropAllowed:I}}function p(e,t){if(e)return t.multiple?e.slice():e.length?[e[0]]:e}function f(e){if(!e)return null;var t;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else{if("object"!==(0,r.Z)(e))return(0,a.ZP)(!1,"`checkedKeys` is not an array or an object"),null;t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0}}return t}function m(e,t){var n=new Set;function r(e){if(!n.has(e)){var i=(0,s.Z)(t,e);if(i){n.add(e);var a=i.parent;i.node.disabled||a&&r(a.key)}}}return(e||[]).forEach((function(e){r(e)})),(0,i.Z)(n)}},90782:function(e,t,n){"use strict";n.d(t,{S:function(){return o}});var i=n(48736),r=n(67841);function a(e,t){var n=new Set;return e.forEach((function(e){t.has(e)||n.add(e)})),n}function s(e){var t=e||{},n=t.disabled,i=t.disableCheckbox,r=t.checkable;return!(!n&&!i)||!1===r}function o(e,t,n,o){var l,c=[];l=o||s;var u,d=new Set(e.filter((function(e){var t=!!(0,r.Z)(n,e);return t||c.push(e),t}))),h=new Map,p=0;return Object.keys(n).forEach((function(e){var t=n[e],i=t.level,r=h.get(i);r||(r=new Set,h.set(i,r)),r.add(t),p=Math.max(p,i)})),(0,i.ZP)(!c.length,"Tree missing follow keys: ".concat(c.slice(0,100).map((function(e){return"'".concat(e,"'")})).join(", "))),u=!0===t?function(e,t,n,i){for(var r=new Set(e),s=new Set,o=0;o<=n;o+=1)(t.get(o)||new Set).forEach((function(e){var t=e.key,n=e.node,a=e.children,s=void 0===a?[]:a;r.has(t)&&!i(n)&&s.filter((function(e){return!i(e.node)})).forEach((function(e){r.add(e.key)}))}));for(var l=new Set,c=n;c>=0;c-=1)(t.get(c)||new Set).forEach((function(e){var t=e.parent,n=e.node;if(!i(n)&&e.parent&&!l.has(e.parent.key))if(i(e.parent.node))l.add(t.key);else{var a=!0,o=!1;(t.children||[]).filter((function(e){return!i(e.node)})).forEach((function(e){var t=e.key,n=r.has(t);a&&!n&&(a=!1),o||!n&&!s.has(t)||(o=!0)})),a&&r.add(t.key),o&&s.add(t.key),l.add(t.key)}}));return{checkedKeys:Array.from(r),halfCheckedKeys:Array.from(a(s,r))}}(d,h,p,l):function(e,t,n,i,r){for(var s=new Set(e),o=new Set(t),l=0;l<=i;l+=1)(n.get(l)||new Set).forEach((function(e){var t=e.key,n=e.node,i=e.children,a=void 0===i?[]:i;s.has(t)||o.has(t)||r(n)||a.filter((function(e){return!r(e.node)})).forEach((function(e){s.delete(e.key)}))}));o=new Set;for(var c=new Set,u=i;u>=0;u-=1)(n.get(u)||new Set).forEach((function(e){var t=e.parent,n=e.node;if(!r(n)&&e.parent&&!c.has(e.parent.key))if(r(e.parent.node))c.add(t.key);else{var i=!0,a=!1;(t.children||[]).filter((function(e){return!r(e.node)})).forEach((function(e){var t=e.key,n=s.has(t);i&&!n&&(i=!1),a||!n&&!o.has(t)||(a=!0)})),i||s.delete(t.key),a&&o.add(t.key),c.add(t.key)}}));return{checkedKeys:Array.from(s),halfCheckedKeys:Array.from(a(o,s))}}(d,t.halfCheckedKeys,h,p,l),u}},67841:function(e,t,n){"use strict";function i(e,t){return e[t]}n.d(t,{Z:function(){return i}})},71430:function(e,t,n){"use strict";n.d(t,{F:function(){return _},H8:function(){return y},I8:function(){return b},km:function(){return p},oH:function(){return g},w$:function(){return f},zn:function(){return m}});var i=n(93664),r=n(95190),a=n(20439),s=n(62646),o=n(11592),l=n(2738),c=n(48736),u=n(67841),d=["children"];function h(e,t){return"".concat(e,"-").concat(t)}function p(e,t){return null!=e?e:t}function f(e){var t=e||{},n=t.title||"title";return{title:n,_title:t._title||[n],key:t.key||"key",children:t.children||"children"}}function m(e){return function e(t){return(0,o.Z)(t).map((function(t){if(!function(e){return e&&e.type&&e.type.isTreeNode}(t))return(0,c.ZP)(!t,"Tree/TreeNode can only accept TreeNode as children."),null;var n=t.key,i=t.props,r=i.children,o=(0,s.Z)(i,d),l=(0,a.Z)({key:n},o),u=e(r);return u.length&&(l.children=u),l})).filter((function(e){return e}))}(e)}function g(e,t,n){var i=f(n),s=i._title,o=i.key,c=i.children,u=new Set(!0===t?[]:t),d=[];return function e(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return n.map((function(f,m){for(var g,v=h(i?i.pos:"0",m),b=p(f[o],v),y=0;y<s.length;y+=1){var _=s[y];if(void 0!==f[_]){g=f[_];break}}var w=(0,a.Z)((0,a.Z)({},(0,l.Z)(f,[].concat((0,r.Z)(s),[o,c]))),{},{title:g,key:b,parent:i,pos:v,children:null,data:f,isStart:[].concat((0,r.Z)(i?i.isStart:[]),[0===m]),isEnd:[].concat((0,r.Z)(i?i.isEnd:[]),[m===n.length-1])});return d.push(w),!0===t||u.has(b)?w.children=e(f[c]||[],w):w.children=[],w}))}(e),d}function v(e,t,n){var a,s=("object"===(0,i.Z)(n)?n:{externalGetKey:n})||{},o=s.childrenPropName,l=s.externalGetKey,c=f(s.fieldNames),u=c.key,d=c.children,m=o||d;l?"string"==typeof l?a=function(e){return e[l]}:"function"==typeof l&&(a=function(e){return l(e)}):a=function(e,t){return p(e[u],t)},function n(i,s,o,l){var c=i?i[m]:e,u=i?h(o.pos,s):"0",d=i?[].concat((0,r.Z)(l),[i]):[];if(i){var p=a(i,u),f={node:i,index:s,pos:u,key:p,parentPos:o.node?o.pos:null,level:o.level+1,nodes:d};t(f)}c&&c.forEach((function(e,t){n(e,t,{node:i,pos:u,level:o?o.level+1:-1},d)}))}(null)}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.initWrapper,i=t.processEntity,r=t.onProcessFinished,a=t.externalGetKey,s=t.childrenPropName,o=t.fieldNames,l=arguments.length>2?arguments[2]:void 0,c=a||l,u={},d={},h={posEntities:u,keyEntities:d};return n&&(h=n(h)||h),v(e,(function(e){var t=e.node,n=e.index,r=e.pos,a=e.key,s=e.parentPos,o=e.level,l={node:t,nodes:e.nodes,index:n,key:a,pos:r,level:o},c=p(a,r);u[r]=l,d[c]=l,l.parent=u[s],l.parent&&(l.parent.children=l.parent.children||[],l.parent.children.push(l)),i&&i(l,h)}),{externalGetKey:c,childrenPropName:s,fieldNames:o}),r&&r(h),h}function y(e,t){var n=t.expandedKeys,i=t.selectedKeys,r=t.loadedKeys,a=t.loadingKeys,s=t.checkedKeys,o=t.halfCheckedKeys,l=t.dragOverNodeKey,c=t.dropPosition,d=t.keyEntities,h=(0,u.Z)(d,e);return{eventKey:e,expanded:-1!==n.indexOf(e),selected:-1!==i.indexOf(e),loaded:-1!==r.indexOf(e),loading:-1!==a.indexOf(e),checked:-1!==s.indexOf(e),halfChecked:-1!==o.indexOf(e),pos:String(h?h.pos:""),dragOver:l===e&&0===c,dragOverGapTop:l===e&&-1===c,dragOverGapBottom:l===e&&1===c}}function _(e){var t=e.data,n=e.expanded,i=e.selected,r=e.checked,s=e.loaded,o=e.loading,l=e.halfChecked,u=e.dragOver,d=e.dragOverGapTop,h=e.dragOverGapBottom,p=e.pos,f=e.active,m=e.eventKey,g=(0,a.Z)((0,a.Z)({},t),{},{expanded:n,selected:i,checked:r,loaded:s,loading:o,halfChecked:l,dragOver:u,dragOverGapTop:d,dragOverGapBottom:h,pos:p,active:f,key:m});return"props"in g||Object.defineProperty(g,"props",{get:function(){return(0,c.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),g}},65283:function(e,t,n){"use strict";n.d(t,{Z:function(){return $}});var i=n(14809),r=n(93664),a=n(20439),s=n(4635),o=n(50298),l=n(62646),c=n(92310),u=n.n(c),d=n(29301),h=n(70425),p=n(34280),f=n(59301),m=n(4676),g=f.forwardRef((function(e,t){var n=e.height,r=e.offsetY,o=e.offsetX,l=e.children,c=e.prefixCls,h=e.onInnerResize,p=e.innerProps,m=e.rtl,g=e.extra,v={},b={display:"flex",flexDirection:"column"};return void 0!==r&&(v={height:n,position:"relative",overflow:"hidden"},b=(0,a.Z)((0,a.Z)({},b),{},(0,s.Z)((0,s.Z)((0,s.Z)((0,s.Z)((0,s.Z)({transform:"translateY(".concat(r,"px)")},m?"marginRight":"marginLeft",-o),"position","absolute"),"left",0),"right",0),"top",0))),f.createElement("div",{style:v},f.createElement(d.Z,{onResize:function(e){e.offsetHeight&&h&&h()}},f.createElement("div",(0,i.Z)({style:b,className:u()((0,s.Z)({},"".concat(c,"-holder-inner"),c)),ref:t},p),l,g)))}));g.displayName="Filler";var v=g;function b(e){var t=e.children,n=e.setRef,i=f.useCallback((function(e){n(e)}),[]);return f.cloneElement(t,{ref:i})}function y(e,t,n){var i=f.useState(e),r=(0,o.Z)(i,2),a=r[0],s=r[1],l=f.useState(null),c=(0,o.Z)(l,2),u=c[0],d=c[1];return f.useEffect((function(){var i=function(e,t,n){var i,r,a=e.length,s=t.length;if(0===a&&0===s)return null;a<s?(i=e,r=t):(i=t,r=e);var o={__EMPTY_ITEM__:!0};function l(e){return void 0!==e?n(e):o}for(var c=null,u=1!==Math.abs(a-s),d=0;d<r.length;d+=1){var h=l(i[d]);if(h!==l(r[d])){c=d,u=u||h!==l(r[d+1]);break}}return null===c?null:{index:c,multiple:u}}(a||[],e||[],t);void 0!==(null==i?void 0:i.index)&&(null==n||n(i.index),d(e[i.index])),s(e)}),[e]),[u]}var _=n(16089),w="object"===("undefined"==typeof navigator?"undefined":(0,r.Z)(navigator))&&/Firefox/i.test(navigator.userAgent),x=function(e,t,n,i){var r=(0,f.useRef)(!1),a=(0,f.useRef)(null);function s(){clearTimeout(a.current),r.current=!0,a.current=setTimeout((function(){r.current=!1}),50)}var o=(0,f.useRef)({top:e,bottom:t,left:n,right:i});return o.current.top=e,o.current.bottom=t,o.current.left=n,o.current.right=i,function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e?t<0&&o.current.left||t>0&&o.current.right:t<0&&o.current.top||t>0&&o.current.bottom;return n&&i?(clearTimeout(a.current),r.current=!1):i&&!r.current||s(),!r.current&&i}};function k(e,t,n,i,r,a,s){var o=(0,f.useRef)(0),l=(0,f.useRef)(null),c=(0,f.useRef)(null),u=(0,f.useRef)(!1),d=x(t,n,i,r);var h=(0,f.useRef)(null),p=(0,f.useRef)(null);return[function(t){if(e){_.Z.cancel(p.current),p.current=(0,_.Z)((function(){h.current=null}),2);var n=t.deltaX,i=t.deltaY,r=t.shiftKey,f=n,m=i;("sx"===h.current||!h.current&&r&&i&&!n)&&(f=i,m=0,h.current="sx");var g=Math.abs(f),v=Math.abs(m);null===h.current&&(h.current=a&&g>v?"x":"y"),"y"===h.current?function(e,t){if(_.Z.cancel(l.current),!d(!1,t)){var n=e;n._virtualHandled||(n._virtualHandled=!0,o.current+=t,c.current=t,w||n.preventDefault(),l.current=(0,_.Z)((function(){var e=u.current?10:1;s(o.current*e,!1),o.current=0})))}}(t,m):function(e,t){s(t,!0),w||e.preventDefault()}(t,f)}},function(t){e&&(u.current=t.detail===c.current)}]}var S=n(99153),E=n(84851),C=function(){function e(){(0,S.Z)(this,e),(0,s.Z)(this,"maps",void 0),(0,s.Z)(this,"id",0),(0,s.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,E.Z)(e,[{key:"set",value:function(e,t){this.diffRecords.set(e,this.maps[e]),this.maps[e]=t,this.id+=1}},{key:"get",value:function(e){return this.maps[e]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),e}();function T(e){var t=parseFloat(e);return isNaN(t)?0:t}var A=14/15;function M(e){return Math.floor(Math.pow(e,.5))}function L(e,t){return("touches"in e?e.touches[0]:e)[t?"pageX":"pageY"]-window[t?"scrollX":"scrollY"]}var D=f.forwardRef((function(e,t){var n=e.prefixCls,i=e.rtl,r=e.scrollOffset,l=e.scrollRange,c=e.onStartMove,d=e.onStopMove,h=e.onScroll,p=e.horizontal,m=e.spinSize,g=e.containerSize,v=e.style,b=e.thumbStyle,y=e.showScrollBar,w=f.useState(!1),x=(0,o.Z)(w,2),k=x[0],S=x[1],E=f.useState(null),C=(0,o.Z)(E,2),T=C[0],A=C[1],M=f.useState(null),D=(0,o.Z)(M,2),I=D[0],R=D[1],P=!i,O=f.useRef(),N=f.useRef(),B=f.useState(y),$=(0,o.Z)(B,2),F=$[0],z=$[1],K=f.useRef(),U=function(){!0!==y&&!1!==y&&(clearTimeout(K.current),z(!0),K.current=setTimeout((function(){z(!1)}),3e3))},j=l-g||0,q=g-m||0,H=f.useMemo((function(){return 0===r||0===j?0:r/j*q}),[r,j,q]),V=f.useRef({top:H,dragging:k,pageY:T,startTop:I});V.current={top:H,dragging:k,pageY:T,startTop:I};var G=function(e){S(!0),A(L(e,p)),R(V.current.top),c(),e.stopPropagation(),e.preventDefault()};f.useEffect((function(){var e=function(e){e.preventDefault()},t=O.current,n=N.current;return t.addEventListener("touchstart",e,{passive:!1}),n.addEventListener("touchstart",G,{passive:!1}),function(){t.removeEventListener("touchstart",e),n.removeEventListener("touchstart",G)}}),[]);var Z=f.useRef();Z.current=j;var W=f.useRef();W.current=q,f.useEffect((function(){if(k){var e,t=function(t){var n=V.current,i=n.dragging,r=n.pageY,a=n.startTop;_.Z.cancel(e);var s=O.current.getBoundingClientRect(),o=g/(p?s.width:s.height);if(i){var l=(L(t,p)-r)*o,c=a;!P&&p?c-=l:c+=l;var u=Z.current,d=W.current,f=d?c/d:0,m=Math.ceil(f*u);m=Math.max(m,0),m=Math.min(m,u),e=(0,_.Z)((function(){h(m,p)}))}},n=function(){S(!1),d()};return window.addEventListener("mousemove",t,{passive:!0}),window.addEventListener("touchmove",t,{passive:!0}),window.addEventListener("mouseup",n,{passive:!0}),window.addEventListener("touchend",n,{passive:!0}),function(){window.removeEventListener("mousemove",t),window.removeEventListener("touchmove",t),window.removeEventListener("mouseup",n),window.removeEventListener("touchend",n),_.Z.cancel(e)}}}),[k]),f.useEffect((function(){return U(),function(){clearTimeout(K.current)}}),[r]),f.useImperativeHandle(t,(function(){return{delayHidden:U}}));var Y="".concat(n,"-scrollbar"),X={position:"absolute",visibility:F?null:"hidden"},J={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return p?(X.height=8,X.left=0,X.right=0,X.bottom=0,J.height="100%",J.width=m,P?J.left=H:J.right=H):(X.width=8,X.top=0,X.bottom=0,P?X.right=0:X.left=0,J.width="100%",J.height=m,J.top=H),f.createElement("div",{ref:O,className:u()(Y,(0,s.Z)((0,s.Z)((0,s.Z)({},"".concat(Y,"-horizontal"),p),"".concat(Y,"-vertical"),!p),"".concat(Y,"-visible"),F)),style:(0,a.Z)((0,a.Z)({},X),v),onMouseDown:function(e){e.stopPropagation(),e.preventDefault()},onMouseMove:U},f.createElement("div",{ref:N,className:u()("".concat(Y,"-thumb"),(0,s.Z)({},"".concat(Y,"-thumb-moving"),k)),style:(0,a.Z)((0,a.Z)({},J),b),onMouseDown:G}))}));function I(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e/t*e;return isNaN(n)&&(n=0),n=Math.max(n,20),Math.floor(n)}var R=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],P=[],O={overflowY:"auto",overflowAnchor:"none"};function N(e,t){var n=e.prefixCls,c=void 0===n?"rc-virtual-list":n,g=e.className,w=e.height,S=e.itemHeight,E=e.fullHeight,N=void 0===E||E,B=e.style,$=e.data,F=e.children,z=e.itemKey,K=e.virtual,U=e.direction,j=e.scrollWidth,q=e.component,H=void 0===q?"div":q,V=e.onScroll,G=e.onVirtualScroll,Z=e.onVisibleChange,W=e.innerProps,Y=e.extraRender,X=e.styles,J=e.showScrollBar,Q=void 0===J?"optional":J,ee=(0,l.Z)(e,R),te=f.useCallback((function(e){return"function"==typeof z?z(e):null==e?void 0:e[z]}),[z]),ne=function(e,t,n){var i=f.useState(0),r=(0,o.Z)(i,2),a=r[0],s=r[1],l=(0,f.useRef)(new Map),c=(0,f.useRef)(new C),u=(0,f.useRef)(0);function d(){u.current+=1}function h(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];d();var t=function(){var e=!1;l.current.forEach((function(t,n){if(t&&t.offsetParent){var i=t.offsetHeight,r=getComputedStyle(t),a=r.marginTop,s=r.marginBottom,o=i+T(a)+T(s);c.current.get(n)!==o&&(c.current.set(n,o),e=!0)}})),e&&s((function(e){return e+1}))};if(e)t();else{u.current+=1;var n=u.current;Promise.resolve().then((function(){n===u.current&&t()}))}}return(0,f.useEffect)((function(){return d}),[]),[function(i,r){var a=e(i),s=l.current.get(a);r?(l.current.set(a,r),h()):l.current.delete(a),!s!=!r&&(r?null==t||t(i):null==n||n(i))},h,c.current,a]}(te,null,null),ie=(0,o.Z)(ne,4),re=ie[0],ae=ie[1],se=ie[2],oe=ie[3],le=!(!1===K||!w||!S),ce=f.useMemo((function(){return Object.values(se.maps).reduce((function(e,t){return e+t}),0)}),[se.id,se.maps]),ue=le&&$&&(Math.max(S*$.length,ce)>w||!!j),de="rtl"===U,he=u()(c,(0,s.Z)({},"".concat(c,"-rtl"),de),g),pe=$||P,fe=(0,f.useRef)(),me=(0,f.useRef)(),ge=(0,f.useRef)(),ve=(0,f.useState)(0),be=(0,o.Z)(ve,2),ye=be[0],_e=be[1],we=(0,f.useState)(0),xe=(0,o.Z)(we,2),ke=xe[0],Se=xe[1],Ee=(0,f.useState)(!1),Ce=(0,o.Z)(Ee,2),Te=Ce[0],Ae=Ce[1],Me=function(){Ae(!0)},Le=function(){Ae(!1)},De={getKey:te};function Ie(e){_e((function(t){var n=function(e){var t=e;Number.isNaN(Xe.current)||(t=Math.min(t,Xe.current));return t=Math.max(t,0),t}("function"==typeof e?e(t):e);return fe.current.scrollTop=n,n}))}var Re=(0,f.useRef)({start:0,end:pe.length}),Pe=(0,f.useRef)(),Oe=y(pe,te),Ne=(0,o.Z)(Oe,1)[0];Pe.current=Ne;var Be=f.useMemo((function(){if(!le)return{scrollHeight:void 0,start:0,end:pe.length-1,offset:void 0};var e;if(!ue)return{scrollHeight:(null===(e=me.current)||void 0===e?void 0:e.offsetHeight)||0,start:0,end:pe.length-1,offset:void 0};for(var t,n,i,r=0,a=pe.length,s=0;s<a;s+=1){var o=pe[s],l=te(o),c=se.get(l),u=r+(void 0===c?S:c);u>=ye&&void 0===t&&(t=s,n=r),u>ye+w&&void 0===i&&(i=s),r=u}return void 0===t&&(t=0,n=0,i=Math.ceil(w/S)),void 0===i&&(i=pe.length-1),{scrollHeight:r,start:t,end:i=Math.min(i+1,pe.length-1),offset:n}}),[ue,le,ye,pe,oe,w]),$e=Be.scrollHeight,Fe=Be.start,ze=Be.end,Ke=Be.offset;Re.current.start=Fe,Re.current.end=ze,f.useLayoutEffect((function(){var e=se.getRecord();if(1===e.size){var t=Array.from(e.keys())[0],n=e.get(t),i=pe[Fe];if(i&&void 0===n)if(te(i)===t){var r=se.get(t)-S;Ie((function(e){return e+r}))}}se.resetRecord()}),[$e]);var Ue=f.useState({width:0,height:w}),je=(0,o.Z)(Ue,2),qe=je[0],He=je[1],Ve=(0,f.useRef)(),Ge=(0,f.useRef)(),Ze=f.useMemo((function(){return I(qe.width,j)}),[qe.width,j]),We=f.useMemo((function(){return I(qe.height,$e)}),[qe.height,$e]),Ye=$e-w,Xe=(0,f.useRef)(Ye);Xe.current=Ye;var Je=ye<=0,Qe=ye>=Ye,et=ke<=0,tt=ke>=j,nt=x(Je,Qe,et,tt),it=function(){return{x:de?-ke:ke,y:ye}},rt=(0,f.useRef)(it()),at=(0,h.zX)((function(e){if(G){var t=(0,a.Z)((0,a.Z)({},it()),e);rt.current.x===t.x&&rt.current.y===t.y||(G(t),rt.current=t)}}));function st(e,t){var n=e;t?((0,m.flushSync)((function(){Se(n)})),at()):Ie(n)}var ot=function(e){var t=e,n=j?j-qe.width:0;return t=Math.max(t,0),t=Math.min(t,n)},lt=(0,h.zX)((function(e,t){t?((0,m.flushSync)((function(){Se((function(t){return ot(t+(de?-e:e))}))})),at()):Ie((function(t){return t+e}))})),ct=k(le,Je,Qe,et,tt,!!j,lt),ut=(0,o.Z)(ct,2),dt=ut[0],ht=ut[1];!function(e,t,n){var i,r=(0,f.useRef)(!1),a=(0,f.useRef)(0),s=(0,f.useRef)(0),o=(0,f.useRef)(null),l=(0,f.useRef)(null),c=function(e){if(r.current){var t=Math.ceil(e.touches[0].pageX),i=Math.ceil(e.touches[0].pageY),o=a.current-t,c=s.current-i,u=Math.abs(o)>Math.abs(c);u?a.current=t:s.current=i;var d=n(u,u?o:c,!1,e);d&&e.preventDefault(),clearInterval(l.current),d&&(l.current=setInterval((function(){u?o*=A:c*=A;var e=Math.floor(u?o:c);(!n(u,e,!0)||Math.abs(e)<=.1)&&clearInterval(l.current)}),16))}},u=function(){r.current=!1,i()},d=function(e){i(),1!==e.touches.length||r.current||(r.current=!0,a.current=Math.ceil(e.touches[0].pageX),s.current=Math.ceil(e.touches[0].pageY),o.current=e.target,o.current.addEventListener("touchmove",c,{passive:!1}),o.current.addEventListener("touchend",u,{passive:!0}))};i=function(){o.current&&(o.current.removeEventListener("touchmove",c),o.current.removeEventListener("touchend",u))},(0,p.Z)((function(){return e&&t.current.addEventListener("touchstart",d,{passive:!0}),function(){var e;null===(e=t.current)||void 0===e||e.removeEventListener("touchstart",d),i(),clearInterval(l.current)}}),[e])}(le,fe,(function(e,t,n,i){var r=i;return!nt(e,t,n)&&((!r||!r._virtualHandled)&&(r&&(r._virtualHandled=!0),dt({preventDefault:function(){},deltaX:e?t:0,deltaY:e?0:t}),!0))})),function(e,t,n){f.useEffect((function(){var i=t.current;if(e&&i){var r,a,s=!1,o=function(){_.Z.cancel(r)},l=function e(){o(),r=(0,_.Z)((function(){n(a),e()}))},c=function(e){if(!e.target.draggable&&0===e.button){var t=e;t._virtualHandled||(t._virtualHandled=!0,s=!0)}},u=function(){s=!1,o()},d=function(e){if(s){var t=L(e,!1),n=i.getBoundingClientRect(),r=n.top,c=n.bottom;t<=r?(a=-M(r-t),l()):t>=c?(a=M(t-c),l()):o()}};return i.addEventListener("mousedown",c),i.ownerDocument.addEventListener("mouseup",u),i.ownerDocument.addEventListener("mousemove",d),function(){i.removeEventListener("mousedown",c),i.ownerDocument.removeEventListener("mouseup",u),i.ownerDocument.removeEventListener("mousemove",d),o()}}}),[e])}(ue,fe,(function(e){Ie((function(t){return t+e}))})),(0,p.Z)((function(){function e(e){var t=Je&&e.detail<0,n=Qe&&e.detail>0;!le||t||n||e.preventDefault()}var t=fe.current;return t.addEventListener("wheel",dt,{passive:!1}),t.addEventListener("DOMMouseScroll",ht,{passive:!0}),t.addEventListener("MozMousePixelScroll",e,{passive:!1}),function(){t.removeEventListener("wheel",dt),t.removeEventListener("DOMMouseScroll",ht),t.removeEventListener("MozMousePixelScroll",e)}}),[le,Je,Qe]),(0,p.Z)((function(){if(j){var e=ot(ke);Se(e),at({x:e})}}),[qe.width,j]);var pt=function(){var e,t;null===(e=Ve.current)||void 0===e||e.delayHidden(),null===(t=Ge.current)||void 0===t||t.delayHidden()},ft=function(e,t,n,i,s,l,c,u){var d=f.useRef(),h=f.useState(null),m=(0,o.Z)(h,2),g=m[0],v=m[1];return(0,p.Z)((function(){if(g&&g.times<10){if(!e.current)return void v((function(e){return(0,a.Z)({},e)}));l();var r=g.targetAlign,o=g.originAlign,u=g.index,d=g.offset,h=e.current.clientHeight,p=!1,f=r,m=null;if(h){for(var b=r||o,y=0,_=0,w=0,x=Math.min(t.length-1,u),k=0;k<=x;k+=1){var S=s(t[k]);_=y;var E=n.get(S);y=w=_+(void 0===E?i:E)}for(var C="top"===b?d:h-d,T=x;T>=0;T-=1){var A=s(t[T]),M=n.get(A);if(void 0===M){p=!0;break}if((C-=M)<=0)break}switch(b){case"top":m=_-d;break;case"bottom":m=w-h+d;break;default:var L=e.current.scrollTop;_<L?f="top":w>L+h&&(f="bottom")}null!==m&&c(m),m!==g.lastTop&&(p=!0)}p&&v((0,a.Z)((0,a.Z)({},g),{},{times:g.times+1,targetAlign:f,lastTop:m}))}}),[g,e.current]),function(e){if(null!=e){if(_.Z.cancel(d.current),"number"==typeof e)c(e);else if(e&&"object"===(0,r.Z)(e)){var n,i=e.align;n="index"in e?e.index:t.findIndex((function(t){return s(t)===e.key}));var a=e.offset;v({times:0,index:n,offset:void 0===a?0:a,originAlign:i})}}else u()}}(fe,pe,se,S,te,(function(){return ae(!0)}),Ie,pt);f.useImperativeHandle(t,(function(){return{nativeElement:ge.current,getScrollInfo:it,scrollTo:function(e){var t;(t=e)&&"object"===(0,r.Z)(t)&&("left"in t||"top"in t)?(void 0!==e.left&&Se(ot(e.left)),ft(e.top)):ft(e)}}})),(0,p.Z)((function(){if(Z){var e=pe.slice(Fe,ze+1);Z(e,pe)}}),[Fe,ze,pe]);var mt=function(e,t,n,i){var r=f.useMemo((function(){return[new Map,[]]}),[e,n.id,i]),a=(0,o.Z)(r,2),s=a[0],l=a[1];return function(r){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,o=s.get(r),c=s.get(a);if(void 0===o||void 0===c)for(var u=e.length,d=l.length;d<u;d+=1){var h,p=e[d],f=t(p);s.set(f,d);var m=null!==(h=n.get(f))&&void 0!==h?h:i;if(l[d]=(l[d-1]||0)+m,f===r&&(o=d),f===a&&(c=d),void 0!==o&&void 0!==c)break}return{top:l[o-1]||0,bottom:l[c]}}}(pe,te,se,S),gt=null==Y?void 0:Y({start:Fe,end:ze,virtual:ue,offsetX:ke,offsetY:Ke,rtl:de,getSize:mt}),vt=function(e,t,n,i,r,a,s,o){var l=o.getKey;return e.slice(t,n+1).map((function(e,n){var o=s(e,t+n,{style:{width:i},offsetX:r}),c=l(e);return f.createElement(b,{key:c,setRef:function(t){return a(e,t)}},o)}))}(pe,Fe,ze,j,ke,re,F,De),bt=null;w&&(bt=(0,a.Z)((0,s.Z)({},N?"height":"maxHeight",w),O),le&&(bt.overflowY="hidden",j&&(bt.overflowX="hidden"),Te&&(bt.pointerEvents="none")));var yt={};return de&&(yt.dir="rtl"),f.createElement("div",(0,i.Z)({ref:ge,style:(0,a.Z)((0,a.Z)({},B),{},{position:"relative"}),className:he},yt,ee),f.createElement(d.Z,{onResize:function(e){He({width:e.offsetWidth,height:e.offsetHeight})}},f.createElement(H,{className:"".concat(c,"-holder"),style:bt,ref:fe,onScroll:function(e){var t=e.currentTarget.scrollTop;t!==ye&&Ie(t),null==V||V(e),at()},onMouseEnter:pt},f.createElement(v,{prefixCls:c,height:$e,offsetX:ke,offsetY:Ke,scrollWidth:j,onInnerResize:ae,ref:me,innerProps:W,rtl:de,extra:gt},vt))),ue&&$e>w&&f.createElement(D,{ref:Ve,prefixCls:c,scrollOffset:ye,scrollRange:$e,rtl:de,onScroll:st,onStartMove:Me,onStopMove:Le,spinSize:We,containerSize:qe.height,style:null==X?void 0:X.verticalScrollBar,thumbStyle:null==X?void 0:X.verticalScrollBarThumb,showScrollBar:Q}),ue&&j>qe.width&&f.createElement(D,{ref:Ge,prefixCls:c,scrollOffset:ke,scrollRange:j,rtl:de,onScroll:st,onStartMove:Me,onStopMove:Le,spinSize:Ze,containerSize:qe.width,horizontal:!0,style:null==X?void 0:X.horizontalScrollBar,thumbStyle:null==X?void 0:X.horizontalScrollBarThumb,showScrollBar:Q}))}var B=f.forwardRef(N);B.displayName="List";var $=B},93314:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAACaCAYAAADl9acYAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXQd4U1Ubfs/NaJtO9kzLahFQEJkiUBBFUFFkCCjiAAVFERT5FREQQQXBBcpysWRP2RtkKRsEOphNodCZdDfjnv85CU2TZt2bhABNDw9PmtzvrO+c957xLQIP0pkz1yrQIEmwwcDzHhTj91klEo7jpcG5zetWUJdmRjmPvTM9GI9JgSGvadOoLE9KJJ5kPp2YXLtZdO1kT8ooz2vigCNelvPYezPEG7z0CDAn4pJqPvJA5A3vdcl/S3LEy3Iee29OeIOX5YDx3nh4VFI5YDxin6DM5YARxKb7g6gcMHd+nMoBc+d57LKGhCQ1ZURBCoVL2nKCO8sBZWW50x1TOWDuLP8FlV4OGEFs8glROWB8wmbPKikHjGf882bucsB4k5t3qKxywNwhxrpRbJkGTOx0ehlA3d9e5VEtzA3ulGe55zmg1QOfrCVo34BgQGvr5rLDRl4RRZG+5NjBESBc4FHw1LlrCAuPsCo0JjKi7J5hYqfTXADBq4byCJLf82Nf3kA3OfD9LgKdgeCzZ4CUTJ1VKQFyKQgpmeMSjiKvQC+oplspN/wOMDcBVFv0Bo+KwYJ4VE50H3Jg7j6CWzkEX74A3MrSgTfeKZpSaBCHcAVn/JunBHlFPDR5BkG9LMjPt7mZLOtbskQADea9wqOW9coqiGHlRPcHBxYcJriQQvB9P+v2cqCwWFxgoOJk6JeTNX4HmJMAHv6xP4/6VXw/+OxNx/bM/pIohdUE9VW/VxwjOHiJYO5A6xolpGSpYW3jIW4w/A8wM+h+UHSY2pvHgzV9NXymeor0wPc7Cf7XzWJ/4Nsm+Ly2LzZx+OwZ3yuVbzhNsPEMwcI3rM8wMikHiURi5gNbbQoKrc84zpjkj2eYzQC6f96DomUd305ctrp8tp5gSk/f1utzlFhUOHYthy9f8D1gdpwnWHiEYOVQ6zNM6QM/AY+CImHnF9YtfwTMCgB9P+5G0SHa9xP3bk2gT9cBU3r6Hjp95nBYNcz3gDlwkRhX843vlfS59PmFHfjFzgC/2pJ1nEEnEIpIAG+834Wia2Ox7PJ8wt0twLz7J8Gsl3zf316zCVYPsz5oe85F1yUcu0YwcQPBjlElZyjL8wsrQeyBn+XxK8DETqefgyACFCPe6kjxfDPfT6C7BpilBLMG+L6/A34h+P1VikCZ60nuTYpzN4AxqznjCqPOMZ1RSp9f2OVLYZH1lbOrNvjVlswIGEAKYOyrj1K82NL3E+huAWbEMnbFSn1+Qzd4AcE3fajPZV6X04D3lnHGM4xOawKFJwLLYiD5H2AoCkHwJQMLA42v090CzJjVBBN7UCh8rN3AgDrqCYq6lX3L6RQ1MGQRhwWvA7UrALbnFzCJjOhG+d2WjFCkUYKZPZpSDIv1PWDGrycY34NCahI0+yxN/Ivg3c4UlUN8VqWxok/XEfRrSdG0tm/rzcoHBv7KYc5AILqqLWDcOb/45RmGEFyhFL8/0Yga33y+Tl9uJhjxOEVIoG9rnrqVKSJSRFb0fb3tG1A81sC39TLRSu85HL57Eaii0Bm3oqEKqZXSJaUURUxTU0Tyuy0ZAc5SYCUbxE+6+x4w3+0kGNiWooqP3/Qz9xB0bUTRsLqI2eEFUlbvA9WBJxv5ltdMit9jFocpLwB1InQIkBEQTmLUHStOBoMBOr24K2+/AwwPHOKArS2iKCY9VzKIg34jyMgTv6f1wpwqL8JLHKgUTLHwjZIxZTKg0V2Bzg2tLzvYBYA75xe/25J1mkEnGAzYyXE40KQmMK23uLeLN8b1j0ME7epTxFTzRmnCy/jzXyCqIny+NVryDzFeKfd+xLcrDOMMO8MMfgx45iFrOZA7AstiTvvVoZ91usM3tClHcLpeZWDmAN8DZtlRgkY1KJr5+BC87hQQLAeebCwcZN6gXH6MgG2P+rfyDmD+WLoV8xZugkIRiNh2TTHghcfRoF4tFBZpkXgpGQ81rmdu9puLOLzwMPBYPR1Cgzw/v7CC/WpLxjrc/jtaT2LApRrhwC+DfA+Y9aeI0dKzbT3vTCChk3r7eaBABzzfTGgO79CtPUmM9b7U2jv9bf3kOyjSlihLcoSg93MdkZ2Th227j2Hoq8/inTeeNzZ+xFIOsTHAsw/pAeL5+cUvAdPuG1pVRnArQgEsGex7wGw7RxAgBTo19M4EEjqtD1wEkrPYm15oDu/QbfkPSM0hHsu8du0/gSnfLkFGVrbThjFLynULJ6FOZHUw2RNbyd/qUJLFHZV+ywr9aksWO4Ou0BK8KueRz/bVq++CUuD+RGbhB3R/0LeAOZEEnFIRvPGYb+vdGw+cvU7w3uOe1dv+mfeRk5svCMUfvz8AA3o9jgkbCJQVgPe7lGTz5MDvj4f+VXs/JH1ip1PmAkHy17u8z42bjl4lxjf9C809m0CCZo4FUVwKsDPOJLz0ZTp6Fdh6jtnWe1bvuCm/4q/tRwQ1/b03e2LIwGfw1RaCkADg425AOvPkYCHZd0cG43dbsk4zaDFgWHiHcG85wjBQoEhnMhAzf5r/Jihkf9/+fjXDtDXqGA108+Eqcy0DYAfwMU95NnEFzVgLovibwK8HCab19qze61s24Pf5K7A5KwB5vHM1CblMij9m/Q87rtc1jsek54CMPIBayGD0BgP0ImUw/gwYFiqjllhHGAcvAkuPcijU8cgv0KGgSGv8LNJqweu1MOh14A3ss+S78W+Dzuo3RsPoTy0YgIjQALFz0C36tBzg570EE3p4NnHFVn5TA0zaSPDzy57Vu2bIS6jF67BDHYBHgnVI0kow+6ZjLyZNm9RD+35jkZINfNO7ZIVhEn+e16NQ6157/OqWjJ1h9n1IXoydTi8AeGD+KzxqinCEsfkswfBJC2HQacXOG7v0B+e9CGXVUK+U5aoQdm5iE3eqh296R/XoDEBu0e3/hcz3FzF+Z292trI91Zgav7N2tKrDrrfFTdgTI4dAl61BipZDDXYINRCMvBrusNvBikAMHT8LTM3/pwElK4xMAuQV6uBuKK4yA5hEVfY8SvmmHCETGyjDtzqbQLHf0KMgaCnWEcaW/whGT1mAHHZP6oW09bueaFy3khdKcl0EO+y+v4xgphs2MWxbs+K46bLCDIoi6+9iVLKY4PbTp8UB5t8h/UB53qimz1aJA9lyLExz7H1vyMCnUa15L/x9EfhtkIk/nh74y9ShPz5JnUGA26qFZIdcTofWqR5xxd5Uip1O9wDoJNYRxs4LBB9PXYxUdaHrGSqAYuWUp9GmSQ0BlN4h8cTq8qVfOGgKStpBeAoJb4DEYPrPsU89b/5e/LvEYPubLCIQX06NEtWpfwa/yA4h0FEgqVCK71OCUeTARdLLfbpg9PAXsfGsBBtOA0uHmKpyV0PZsqFl5lo5QaXWgRqNw4pTHiEYGa2M+KX0yMROpxsA9BDrCGNvAsG4GcuQdMt45eJx+nXsk3iyNbOY9k161wOry8/GqZCr1t4GBA/O3T0Nm7gSDl/89IBRHiU0nRk3CgU3knEmT4pZN51rrjI5TN2oGmCOMP44BKx7B8jINemP8ZRCK2Y5LNXAMrMlS0hSpwKw9TRGME+XHf5ekybEfPCInU7/BDBArCOMw5cIPvt+JRJUGqHj7JRu2rsd0P+JGBuanELTTVpwwO3/cnjFxNcTwMz95hquxud5pd+skIEfR6NJA+F2y6o1S3Fj4xpj/X9lBmK7OsDuChMUKMf+v36AXC4Fc4QxYwew/X0gM8/k5VKvN0BvcF9gfc8CJuGWuh4twgoQnJSBzK+nDP+3eLTsBahJSNL8DdD29kaUAFsDSU4vpVJp3FTETqdzAbwl1hHGySSCCTPX41RimlcmzthBrTCsV1Obss5cJ2hWXQupTIoiHUW+1nRYZkcn5kRbTzlIOQq5hBmimfRu2RwoeU4gl5rAFiI3Odpmb/NRK0zXu+zgKzZtWZWK/VvTxWZzSP/EK5HoEivcxsFQWIBzk8caVxmWmMT+g6thNlfMg/p1xYfv9DXSMEcYEzYAu247wnBXQ9myE/fslixRpf6FUgw2N5bgDChmk6Lw33MMqkqlg8JeVKmn8hRjHI0QIdgbiJynGWhiZ9AZoPhgaEeK50Q4wmDCvwmzt+HwGe8EcH67V1N8MshWV4UBpnlNLQID3Lcn5nkKrZ6iUEex4azEqC08di0BW1XDgsTP+2NHsrH6F+/0m9Xetns1PN9b3IWHPi8XyetXIOPoEeg1WbhYKMGK9CCoiiSoWq0SnuvWzqhLVuyoz+wI411mmi3epZI9Lt2zgElIUht9INtpdDJPMUsSGf59NCFFxc8TknI6AoZ9LqbCmj+V4X33zMAEAOMHtaXoJ0KLVpUJjJuzD3v+vSh+xtnJ0ffxaMwY0dHuCtO8pg6BAcK3LI4axCTai/4hRsBM3kww5DGK6o5vYx32S52pw9QxbEi8k6o2DMeoj2q5VVhqNnB29JsI0TP5M6Dj5Gg7dwmkpVZOsyOMtyg4joDyBhRq3d+Osbru3S2ZSp0LCmf+9ZM5CUY3qBWx3LREUy5RpbkKQOl0FAimvrksPAME08Q6wmD74DGz/8H2A/+5NdClM8U2r4VFE7rZBcwjtXQIkHsOGLbSLP7XBJhvdxD0fJiinhs+pVk5n41IBM/UFryQSHggvpxRooovpsgdFwjoD8MQri3ZIso/XYzm9a2FwDfUAFPxX/AaRYSCeCR/KW7fvQuYJE0RQF3vSQh2UQn3bsOaYXEJSZrPADrJBfP5BceCVx+4LO0r1hGG3gC8//Np/LXrmJjxdUhbv1YE9vzU22eAmbOPBRmieNCNFzvP8/jhaxVSL3vn4M9zBJN/bgSZgJsyplZ0KQ24oSZgq8vmE4V4+9hrkNIS8O5uPhbNOz+CprWpWRhd7Ahj9svMYM871rT38pbM/q2XvelHoeU4bpxBgt+Jjr8MAqfi80NXZEW/H1UEuOMIY/zCRPyxZr9XABMSJMP5pbelahYlsjNMi1p6402Pp8lyhWEhIBpVp2hdV1yp6nwgPAhYvzQF/+zOEpfZCfXgz6LRIMrxKsq0B5YcKsL6UxRFvBygelBdLjhZGMCx/RfTKWMCUGZzbAClvJEmtiGH97oEGLdhzBHGjL4UDyvLOmBUmn9AaamAay7GimAXgdErzG1RlX36k9el+PlgsPFtK9YRxtwtNzBl7havTZoLywYhuJRbSCNgauvBlAg9TQYDjyVHOeOWbOVxoEoo0Mn2JttpNZvOcmhfn0KTXoTr8TlITSnCrRSt8TMvV7gj79KVPDskCo+1tb/rZkLScavzcTlTARBrZUu+MB1coHNHZ8rQXEzvH4T+8yWY9DzQrj6QptFDzzRlPUj37JbM5pZMeCfZK5CNgsPt3PlbEny3LwSlHWEIqWLzcTWGfbFaCKkgml0zeyNaaa3QdqcAs+msSa2k+4OCmmYm2nyWQ98W9idabo4eqSla3EopMn6m3mRgKkJ6KlM6dV5Plz418ES3CjZE7Ar9w2X5UGXbv3bmC1NBAiqBEOf34zFhKlzLq40PuxK0i8qFutBzRdd7FjDx1zSDCKELxA2tmZoyyztqqc9tUdDlDAm+2hUCdxxhHIwrwOAJy5EvIkSCsz78Nq4rnmhpfU/BANOytgEydwQmpSpjQro/b68we+JNArzej4jjKouz0q+luDwGAzWCxnI1Kr0qPfpEZTzXv6pVwUzf6+MVBTiX6vi+hxoKQfUF4AJswWZZGF+UCUN2IsYMaINnbcVd4jp0m/qePcNcvJlTldcaUm5vVN3qnKNM1zUcJm4LhTuOMP65qMWYGWtxJcU76jGT3nwUrz1j7ZnCCBilAbLS96RucIFJtv88ZpLD/HMZSEgFXmkrrqANp2yjEYsroYRar6f44I3zxh9qNwnH8FHWNxBLj2ix6F85SKltmGV9lBrAF6RConCuh8fotCn7MSC2Fob3ELkPddDBexYwrL2JSZqtFPQpdwfHUT7mf+zjTWFwxxHG8St6zPhtCw6cZXcSnqdhLzTF2FethZcMMK2UBki9DBgmbz18mYAJbMUk5shiYBsxORzT5ucZ8PHbcUaC4OpBGDe55AbiShqP9/40gHLOt058UZbxXMPJnQuUKK+DLi8DEs0R/PJBLIIVwjULHPXgnt2SsQbHq7JeIJSYFIi8mNgeeeT6cFRQAItFOsL4L5li0do9WLrLriK06FZ2e7QO5v3PwugcgDcBo9MbsPT2CnMxFcYwdiNFuMhlKjcs/J23AMMEoONHJhj5JA2T44tvS2TTo5cX4kKqY5X9YuYacq9CEhzlMngmr8uGQasFLUpDPcUV/DCiKwrcNBwrrvueBsyKFVTSvG32aQraRPRMdJKBWaa+vSrcqNAo1hEGsyD8Y/1R/LzmjFea1EBZAbtn9rIqywiYSB5Siecey3U6A5YeN23JmCCPORIcK8IWhV0ps1Wpj8hzjyPmsDPN5P+ZNCWInMOXPz9g/PtgohZfbpEZ3SE5TxSGXBUkIa61vPnCDLCzFEuGrOMY1q02Xunq2VS6p7dkrKOJ17N7UAPP1PG9moatCoOBJ9go0hEGe+P+vC4e3yw84JX2VAoLxMmFL9sApnUkD4kXAKPV6bHsuNQIGDb5p28nmCwixmZSJnA5jeCZh1x3NzfpKi7M/xlFGRmo0qoNqnfohPAG1mcH1dUCfDP+sqkwjuCreY2Mf478swiJGa6V3Az518EFVgHhXMu0DYUZ4G8Dhuqy0Sg0EfM+8myHf88DhjEzIUmzAaA9XA+ZcIqR60KRp+XgjiOM3Sdu4s0vtyAkSIrgQCmCg6QIYZ+BMuPf7Dfzs9vP2bPi34ICZTh2szJ6NM41HuyrV7f2G8tWmNZRPCSc5yuMJWCYGcjHawm+7Sv8DPPfdSBfS9C5oWveHhg+GFqNyfRBEhgIeWgY2kz7AZysRDh5KT4fP0y5vZ0lwBdzGoO9FwbOK4S6KMDpCkP1eaD6fCNghCSDNhe8zmTsVznrMD59XIGa7Wx194SUVUxzT2/JihuZmJJThWoNZ0HgNY/EH28MRUY+B7GOMFibcrJzkJuXB3Z1zXHc7U9ivNlh0mX2aXpm/7ekLA57E6R44zHm5slWAs0A0ybKpDDoaWLhHJafMK0wLIm1ujx0iYD56WgrQO3ryuplSN6xzajkqM83+RCr1aUrol95A5zUJIT971QO5n2bZPybXYRNntsYvx4guLJrL1qkbsD2moOQHP6wlUskRkt5PfiCm5AEC/exa9DmgNcVoVL2KQy59RsqhAQg6tPvwAU5U1F0zvH7AjCsC4mqnE6UGpitvsfSJ0IIHb8lmNzIlkCsIwxPJzDLf10NrDtJMNyBjzDvAkaH5SdkbgOGOf5oVAN4sKawnl+YOwspf+81EzPIh9VvgCbvfoDAKlVx9JAai+ZcNz4PVBBE9W+M07uPo9/laeBgknSeC22ObbVeQ06QCRzselivuQhZBNveCX+JGAoyEZEThyE3fkIYNa00yh69UPdF6y2wsJ6ZqO6LLZl5pUlW9wHFMkrh6mTokgdf7QzG5UwpxDrCcFmwAAImPPztIMHorva3RkbA1GEhGoRPDkfVMj/EVoARaabM2vliCxj9QQtJ1GDAtU3rcGPXDmjVWWDfWWJbtHp9BiCwRScU6KQICJRg4VEp4g8ex4tXvrFSpGT0JxXNsKraIEgVFaHLuQ5ZSE1wAeLsEioRFZ5PnAVlTok5hiQwCG1+mAupwr1V5r4CDGNkgkrzEij93Znqi5CB/XafAhduySDWEYaQsl3RFGiB6Tsce4NkgGlbx+WtqatqjM9ZlOAVJ0tWmPeWEvzYX3gYcOY9cuKzsLE1EVK5oagQJ7/4DDlXS67gZTVqI6dlXxwNaIXrJ06j75UZkFhoHbNyK7Zqh2E3usHAlCupDgFhtSAJEmdsxsqJqZSHevmJaHPoC6vm1nvpNdTu7t6R+L4DjAk06t7M+tKuDb+QkQTw00EFTl2XQawjDIHFOyVj6h+frSeY4uC2it1MRVXgIeUIpBLTWcjdxMJArDgpN2/JPlpF8PlzwoPDjl9v0vZ1N2k1apz+ehJyVaZzS3HimUMKIoWUWrusqtDqUTR46308/bUKekghU1QBkbq+PbPXPkNuEog8DAOS5+ABzVEzSWj9GDSf+JVbXbovAcNs+oODFYSjsp8oqCm2gcj06z9BOHJNbjTZ7RDt/oQQWa2ZXEw0ZWY1yYzYGdCYuj5L7AJNwgBlvHRgj3mjnfvtx0YlS/Zcp9dj6wU5nmpiysccdLMYm5UECr3HruHwQ3/P+KPLzcWZ6VOQfdG5xWbVzl0R9fJgEI7DjO0Eu85rQSTuH1lbV45HbmYSzl1OR+2im4g0ZEJpyETdAC26zpnv1tDdt4AptulPNJ1rplMKUY6uFh8PxL5LARDrCMMtLtvJJAYw3qqTlcOCw7JYLUoBwWHZWWvBIYJxz3jeAiZxv7R0AZJ3bIetdT1B7T4voebTPc0VMbe2G08Wur26sII+6JyD5x4JQU6+FkfOp+DA2es4fO4GsvO1qFk5BE3qVEaTupWNn9G1K0AmILT1fQ8YxhhKqfTi9ewBoPQjSiFAxAasOh2AbfGBRr0qMY4wPJ86phLuFmBm7ibo2oSioYAL+uPXgKvpBIMe9VavgctnE5C7fyuyz58Bc2oRVKMWaj7XBxVbWGuELjxMsOxIAYjUtaqMo9Z90CkHz7WwXkoNPMXZy2k4ePYGDvx3HVdSTHIjBqCVn7verJQJwBQzjKnzJyRlPcZJuJ6UxwsAHEoP/joXgA3nAiHWEYa3ps7dAgyTeTwSRdHcuecDYzdXHCN4oBrwaH3v9Fqr55GWmY2ICNe3XWtOEvyy17MVZmRsLnq2dH4bdv5qBt6Ytg3d29TDOAFvhjIFmNLDGp+c1UxCycs8xTu3jcrMJDvi5VhxOghiHWF4Z+rcvRXGGBy2EvCYABB8sZHggycpqoa6f+lgya/MXC20RUUIDXV9gGJueb/d5tkZ5r0OOejd2nldm/+5gkkLDuOzQe3QrY1r2+0yDZjiwbp4PUNJeelKSqlZSX3/ZRkWHVNArCMMbwFm/AaC8c9Qt65rPWkDCw7Lggw9YVLhcprWnCCoH5qKGmHUaC4tl8sgl0kgl7FPqWhdt6upuQiWc1AoXN96MSd849ez62/31YPeeSwHL7Z1DpixvxzA7hNJWP9lL1RmjgtcJL8ADOOBSkWDCqiGaQoYlYn+TZJh/hEF3HGE4YqpQp7/sC0PrzRPhYxPg9yQjmCkoTA/HUV5aZDq0wBZBQQ0my6kKFE028/BGODpOYHBYfPy8qDT6aDT6Y2flolpUxeDhznscAWkfxKzEFNDAbncteIk8xIzYinxSBj1VrtcvPSo4y0Zs0Z96qPVqFpBgcXjnhXEx/saMCZfZNmTQCjTmZCAEC0oUglPU3iOnDEYtCcb16nCrDaN6ZxKU1HK0xOEIOrMDSlmHnDPEYZLzhoKAW0aivLSQXRpCKRp4HTpKMxNAy1KN36XE+cRAHjKIb/pckhk7h967bXz70STao47wWHZ9bZebwJOMYDY38Zrb4vEtKwZeAKMq5IJSDKZFOuPpqFr8yqCNBjYDd3AXwwgnPu+2Qa3zccrjzleNY7G3cR7P+7G8+2jMWaAMH8r9zVg4pKynudA1jmawExnjKf8fwRkAwF+j46MuJSoyupEKdkdnyoh0/e65wjDUX1c3MdA3hUEEO+YL6fU+BwRNUQa07tAM7v5OpNM8LoXg8PqDXrotHrojUDSQafXgXmrKZ3i0uV4vKkwiT2TJ/WcqYWBBLp8PzkieK1NIV5r71iO8/2qE1i2O8542GeHfiHpvgbMRVX2RzzlpwnpKCGEOa76i5dynxCeTriaTvpP2RnqliMMhwC9MBaBBaeFNEcQTU7FvpDWeU0QrVCiCynA7jjHip9Cy3FFxxz/mVYi0//sPD2u5wWgXUOBSmkAXvtVj7R819s3R215ta0Orz/m2FVVnwkbkJyWa7xOZtfKQtJ9DZiEpKzXAfKbkI6W0JAiQrDyZjZ5adyWUM4dRxiO6qOqRVCkLRPXHCfUt2gjhLXw7jmGBYdl18Uf+Tg47K4LBCz0uZh6P1oJnL/p/qH/5dYGvNnBfv5rN7PRb9JGVAoLwoavrC1enQ3gfQ2YC1ey6kil3CV2lhE7S7MKuMIxf4UGuuMIw1FdhszjCLk6XmxTHNLrqRT5TVdAJnNfPaR04cbgsPsIJjzrmbqL2E4evgxsPy+uXubM7+Vfmbss9661X2lDMdhuABRgyc4LmLnmJGKbKfHlW8KNyu5rwLBBS0zSbKBuWGOyWCoj1rrnCMPRZNEX5SLk3ACmVih2PjmkV9WYiso1RHrec1I7i1HJ5Ct3Kjiso6rPXgeY9P6bPsKB2uSRWKSlZbjNy3FjhuOTD5kIzja9891OnEhMxVs9muHVbsL5e98DJu5ydkNOxh934enfhmPsUDl0ZRgCZUS0IwyHWzJmqPPfcATorrk9yKUzZld5DTKlKUCQNxLr98jlJhV/X6ZrmcBXmwnmDBReb2R0CxQWmiOaiG5uj+5dsOyPH23yMd2ybmNWg6nJfDv8cbRpLDzO6H0PGMaN2zYyi8Q6/Ru+Ogw6A8FfIh1hOBs5evE7KLJ3ih5cRxluSR5FWLNxXiuPFeRJ6D53G5KWC3y4gmDhG8IAw7Ssa9Vlpsrup8jaNXHh+A6bAnYcu4bPfjto/H3z1D4IZ5JcgalMAIb1NVGlHkwpmQ1QwRf3H6wPRU6Re44wHPHXcGMTQm7+LJD9rsnU+soIaO2ux1z75Yu163fdStcUuYXA6wsIVg4VBpjMLDUeaOrgAOK6OjNFcvwhVCiluzbh90PYdvQqqlcMxuovSjSkhRRbZgDDOnsxOaczpYaFlEKQp4Sxm0KQlidxyxGGI+Zqs+IRfuUDIbwXTJMWsxghIc79CAsu7C6Ndg0lAAAdVklEQVStMEws88Jsgg3DhQEmSXUdLdt55hLJuIKs/g2x7UvcdrJtWPcxq40q/h2bKfGViAM/K69MAYZ16NKlzHCDlHwBwr0FUKdr7efbQpCs8a4jjMKCfITHDQRH3d97l578qmqTUblWczGYcErLzjDT+/hej63HLA5r32YOCl135dyFeHTuahtsynVOa4qvPv8II4aVyLJOXUzFsG9NW+bXuz+EISK9lJc5wBSz69KNzEheLxlFQVnEIrvmUlN3B+NiuncdYWi1OsjjP0KQznvxIDVVh0Bem1kreCcZg8N2pwhzX4juVkN6zebwx+u8oHr/OXoCPXrZBpsSW/GAvj3wy6yvzdl+WnsKi3aYnKFPHtIBnZu79qBpWWeZBUxxJ69coYE6ae4zlOqfIyBPM59uxc++36/AuZvedYTBJNz6+OkIL3AVn1b40N8K6oawRu8Jz+CCcvImgiEdKKoLF7p7pe4B8zl8148XVO+uPQcwYNAwj+tt0iga/+4t0Z4a8MUms9HY0vE9ECnUHc7tlpR5wFhyfA+l0lqq7L4A/QlAhTmHgnA8We51Rxh5FxejcvZSjwe7uIAk/cOo0nqK18qbsYPghebUGO7Dl+n1Pzh89iwvqN71G7fhzbc/9Lh5LALCzr+PQVMkR2w0Na4u566m49J1tVElRqyDEb8CTDH3LyblPMhTw67fjwZVPXTV+44wspP2oVq6IBU3QRPiprYWwtvOE0QrhGj2PoKO0dSoR+fL9O5SDm/H8oLq/XP5Gowc7R2tic9/XIlNyU2wY5RH1gJGVvklYFjHL6k0Ty85EbhxV6KceNsRRuatS6h1fYTX5mK+IQR5TZcbDb+8kVhw2MY1KFrV8UZpwsv4ZC3BCw8LC0o7/7fF+HRCydnDWS1FOSmQh1S363aX5XtlxGTEBfbCxveAIMFCB/s1+i1gGDsGL9Cvvpgm6eVtRxgZGZmomTQYHNUKn01OKHlIcEG5AfWE+eB2WefKY0DVMCDWO0G5XNZXTMDOTu3qUzxuinDhNH0/cx6+nGYrpS+diflxLkhPgFRRGfIQ+wzq9OxA5DUei5VDgYruObw0V+vXgOn8LR3L85jibUcY6iw1KiV9CLnhpqt5Ieg5DxkOV16PRyKFyTBcFbrxDPNZJj44rKtyXT1nvsYaVqeC4k1OmfoDfpjl2ncYb9CiMOOS0edyUOVoEGM4cuvUuGkrBHdbgIVvALWs4++6arLNc78GTOx0yq6efvS2I4zs7ByEJY1HkNYUactZ4kkg9FwE9JIKMEgijH8bjN/Z36bftCQcudLaeKC6q9KEPd8dB2Tliw8OK6x0x1Q/7SWoGkrRt4XrksZN/Brzfl3skpB59S9IN13hy0KrQxZkK+ANCQ1Do7ePYO5AoIF1DFqX5Zcm8G/AfENfB8Fv3naEkZubi6CkbxCou2yc9CZARJgBwcCRVlgZV3KC0aSmAhwnQYBcYowHI5FIwIN9MjPfkt/shcUQPdq3Mxy5DLDwfQNFBod1t77ifMyxuVxCBdX7wZgJWLzUdXh3Zh7NtmSgPCQBIQgIt+8/qtmw3fj5zep4yDoGregu+TVgOk2nTNl8pbcdYeTnFyA9U2MMDhQYIIFcwoGTSGCgnHHLECTnIJVIMG2H1BjywtcCRBYc9shlgrdEBocVPbtKZVjyDwGLLyqk3mHvjsGa9ZtdV0k4FGZdBa/NM/JbUcX+wSy692z8PDoWAjwpOa3TvwEzjXajHLa0b0DxSXfvnA9cj3AJxfe7TG5bq4aKyeU5bWIqsOkswcguvu3zyuPE6IBDSL2DBr+Hrdv3uOxshVqNkZqwH7q8NCNtYKUG4CS2V2G1OozE7ClvoZOHFx3+DZjptD0F/m4RRTHpOd9OHja4c/cRdHuQGh3r+TKxScuMuXz9kmDRmM/dgKB6+wwYgv0HjrhkS6+Bb2PlbzNQpDbZILEtGdualU4VH3gaX0/92ii89HZSVpY7NQllzvOLfYG7W7d7Nqe3a/NGA1hR7WfQZhKKU0yAN62396wkhTKFyUPa1qVo6KXDvNB62YH/2x0EXzzv/cnjrA07zhPsT4SgepkeGdMnc5V++nE6Phz/PTITmEIlhSykOmQK24M/W3mmzV2Lpxp7f5z9BjCPT6P1DRwuetMRhqsBtnzOnFHEVAMeVvp24hbpmata4lHcFzH9LKZl8TJXn4Cgep98+kWcPmtSknSWVi/7BZNmrsc/G2eC1xVAqqgEeYjtVRjhpPji1wN49qE7x+uYyAi7C4E3XvA+XWFU6Vo1ABsP2MzJwvDlMnjTEYarAbZ8zrYoVUKBR+vduUF01J67YUR2OhmYs49g9suu+9uhy/OIT2DyFedpz/bVWLXtFL77/F3o8zMhCQxHQJh9nZ/RU5diYJc7p95QZgCTnKHLppTaHK3Zm3bwYhkqKIDFg72/VLsabLZFYbYhnRu6nkCuyhL7/G4AJuEWwKT9QsyUWz3WDdeSkl1268zR3ThwLgtDBzyFIo0KnDwYgRH2VfYrP/jCzKTdX3pPZ8ll60wE990Kk5yhi6OU2kSaZx5OBy2UIkDqPUcYAnloJDtwkSC7AHj6Dm4THK4wIoPDiumXI1pVJjBqBcGqYa5fEA+16IxbqaabL2cp+dJJ3MqRoGXL1si7cRKcNAiBFe2vIopqDZemn133kqsyvf38fgTMJkops4WxSUOWSFGoI9joRUcYQhl+SgUkZZK7EtBp3DpgsjhzdqHdckiXlQcMWcReTq4Bw+z5mV2/sxQcrMCVuH+NoQof7DwESf/+aTz4B1WyH8tDHl7zhDpxlwA9A4+7alXAfQcYVYb2V1C8YY8N7y6XQl1AsGoojyD3vZK6zWHm9siDmK9u13u3Mgrtb71GbZCbm+e0mbVq1cDJIyavMK99OAvrfp0IfVEOFJWj7earUKUG9mxZ45WuOzqv2Cv8vgNMcqZuCuXpWHudGb1GipvZxKuOMLwyIn5eSGSDR8AiQDtLDzZ+ALu3rTKSzPrzAMa//xK0OSlQVLHZfd8uhuDQ/p1QKDyPiFCmAaNK17KD3g/2mP/ZXxJcyeAw/xUeNT3UZPXzOe7V7tes2wx6vcFpme3btcaa5SbX2gfP56Dnk62NipiKqo7tB1at+BMPPdjE47a6kr1YVnD/rTAZ+r6U8ivscWnyVgnibnL4sT+P+l6yN/F4NMoLQLXIh2zizpRmy9PduuCP+ab3YE4h8OCjzyMzfrvDMwyjm/rVZPR8vofHHC7TgLmRpetoMFC7Ximm75TgVDJn1G96srHrw6jHnC4vQBAHqipd+zvu/2JP/Dhjsrm8zv0n4sSWHx3KYRjh0DcH44NRnt8sl2nApGTROnqD7oq9kZq1T4IjV0Q7/xc06OVE7nPg6DS2bXL+AqvW4hVEdvnEXEna2bW4uGY4pEGO99ZPPv4YZs3y3DNpmQYM42hyujaBAjbXJxvOcFhxggHGI+UD92dGeU67HDg6/SGAd36GqfHoMNTuULJaFGZexem5T4CTOL7ufCCmAf7dv0EQ11MyrWN6WmYq84C5lqEdyVF8J4hTlkQc+URZUSbMG4PowsVlSEhSO3zlBtm5+alR0UOPD+KaZ5fa0aQryM+3oi/d/ocfaYOCQudxQCeOHYUPRrxpLocZk8U0i8Wt1HSHLQ+Qy3Hj0jFjzE1Xya8Bw4IuJWfoFgJ42RWjip8TQlbVqijtbwz3dw8kfwJM23YdkaXWOOX6tMljMWzIQCuawW9/hJVrNznNt37Fr+jc8VGXI+rXgCnmjipT353w/Es80IIALDAIM56QMFBQSpmkLAUEJzmeX1qrSuBfLrnqQwJ/AkyXJ7sh+bo5ALZdLs+cPgmvDuxj9ezPFesxbETJucZexrfeeAnTv3QdQqTMAyY5TdeZEspcjdjXjfDm5Ka4REDerF1F5tos0Ev1+hNger7QGxfiLzrl3PyfpqJfb+sr4vSMTDR4qCOYy15HSVmrJs4ddx3Dp8wDRpWhvQQKYfGjvTGJCS4rK8nvPDhvt9WfADPwlUE4etx5ROpFv/6A55950mYkn+zxMv45etLpCB/esw5NGjm3Vy77gEnX+lyQIua2xFOM+hNghg8fjp17Djhl2aolc9C1i21A1x9//h3jJn3jNO+EsaPwocWFgT3isg+Y8hXGatzv51uyTz75GGvWb3E66Teu+h0dLYIlFRNfuapCs7bOgzG1a9MCW9ezKI+OU5kHTPkZxnrw72fAfP3VFPy+yK42k7mTOzf+idYt7cfB7PBkH6cmzsz/29ULhxAe5thlT5kHjOV0SUzKfp6CLwkMAnIjJjLcyo3bRZV6Kk8xxpyPIjsmqiQgYkKS5jpAzfauBFzP6Miw9Z5urdzN709bsjmzZ+K7mb84ZdWBnavR9MFGdmm+/XE+Jn7pXOy2cP536NnD8UrkX4BRaSZQSieauUnIphhl+LNWoFJpFlFKSy7yCYmLUYabRyBBpdkISp8pzkMImRitDP/c3QnvaT5/AsyyJQswYcq3Tll29O+NaBht/45HyLZs0Et9MOvbSQ7r8DfArKOUPm/BjSkxkRFWl++JKvUuSvF4CSCwO1oZ0aX4e0KSmmn2fWoBmPXRynAf2ymW9MCfALNt8zqMGD3BKWDOHt2BKKVj36+du/XD8VNnHZZRu2YNnD+xqxwwjAOJKvU1SlHiDYGgT4wywspZb8I19QUQlBhPULokJqqCecVJUKl7g8JkocS0zQiSopURUZ6uFO7m9yfA/HtoL14Z8r5TViWe2Y9qVR2HUftp7kJ84iLGjLNVqsysMKcTk2s3i67t0KXIheTsSlJK0yilJRqVFPVjoiIuW59z1Ew5q8T9EsE3McoI85km4Zq6HgjMvn4IIVRPSJVGtcMy3J30nuTzJ8AkXjiJZ3uXRD+2xzdV/BGEhzsO1JlyMxWNHnncqRDzmymfYuhg+9pS3gKMq/kqZE54pBp85sy1CjRIEmww2BfnKoKC23NEsrzk/IKc/PycRjzTzrudQoLCAi3BwH6mlH6eV5Bjjo3HEUIUitALoDBfpfDU0C+/IM+5gEAIB9ygCVGEXXeUrawpX2bcvIx2jzuPHJ167SQCA5yHZevR9w3s+9uxy9mnn+qMZQtYyFPb5Awwaek3BcUBkEg4jhQY8po2jcpyY8gtprAnuV3kTVCpPwKFOcgkIdgbrYzobJntokrTgKfUKjY4B/RvEBlRAjTT1m4Ppehk0fIxMcoI51KxO9Q3f1phaFEmHmhuNWQ2XNWknHMYpq+YePGytXhnpPkYalNGSEgwkuIOQyq11V721grjjeng0QrjqgGJKs0SSqmF/ynyfUxk+CjLfAlJWR0BYmWFKZVyHevVDPvbmk7zHUBHFv9GCPkzWhkuWOPZVVvFPPcnwFQI5lE1qrlD9jA1/bSkUy7Zl52TiwYPdkBhUZFD2u0blqBta9u6/AcwSZrzFNR8PcxR8mqDqHCm2m9O8Uma/gTUKjY4R0h0A2W4lcbfxWuaQTyhC8yAAbkQHRne2OVI3QECfwIME7pWr9sC+QUFdjkZFhqK5MR/BHH5taEfOtUa+GT0u/hk9Ds2ZfkFYG7coIo8gyabUpiDHUqItGl9ZYjV/WJikmYUBbW66A+RhgfXrEmsLJsuqXIfMlD9mZIVBoZgSXhYaTpBI+chkb8BpknLJ6BKvmGXa1WrVMbFs/sFcXT7rv3o8/Iwh7SO1GT8AjCJydmPUp4/ZMGdwmhleCghRG+11VKpp4HiI4vfNDGRETbG4JRSaaJKk8Ni9ZhBw3HtomuHHRY0Wl4kEgsYL1bt9aJcWVyyCnv1HYBz5+x78K9Zswb27NwqqF16gwGxnZ9Eerr9y01mffnv4QNQKIIElceIfKl0y+q7Y2eY+CTNOwS05NqDkKMxyvDWpTmRqNIsppRanEXIhRgHW60ElYb5I21VXAYFGd4wMtxzTwqCh8dE6G+AGfzW2zhwwPLdV8KwunXqYOtm4VpKX0+bjt//cKxs+cu8n9Gh/WOCR6TMACZRlT2PUr7E0Jtw82KUYUNLcyL+mno3ISi5hiFkV4wy/Al7HEtQZc8F5d8q2ZZx86OVYebvgrnsIaG/Aeaj/43Fhr/smxs3bBiDDWtXCubohbg49OzVzyH9kMGv46MPzXc7LsstO4BJ0hyloC3Nkxt4JzoyYnZpDiRcU8eBwOxTlFK6uGFUhVfscSoxSf02BcwrCgE5Fh0Zbl5xXHLXSwRiAXM/ayuztn88/mv8PM/qrsbMyRbNH8KeLVYSAJdcZnKd/87H26Vr3uxB7NtmrR1d5s8w7LxxUZWdQ0Etzhvk0eja4TaSq4Qko4cFs5iYI9y0Bsqw/9kFTLKmLeWp+cxCQAobKMNszkUuR8xDAn8DzLTv5mDy1B/tcq1d25bYus4+mByxedacBRg7cardxxzH4VrcYSt1/zIPmMuqzKZ6ylnatRpCpPlhNWvWtLr5unmTBmdrNbmWnCOUjIqOCv/eHjdv3LihyNUrspmzjOLnUsI3q6esaL498xALgrL7G2B+W7gcI8fYVw5/PPYxrFvO3DcIT2npGWj4cGfo9Vb3P+YCmMSfSf6LU5kHTPy17FcJ4f8o2Y6R89GR4Taepy+pNNEGShOsAYN+0VERDi2WEpM05yioWf5CKfdaw6gws3xG+LC5T+lvgNmwaQcGDravgNm9a2csX2hfpcUZh/u/+i42b9ttl2T40Ffx1eclm4wyD5jEJM131FoqvyRaGW7tuMqo7pIVSynZa8k1Cr5jw8iKVlJ+y+elb9UIyPfRpbQH3IeCsJz+BphDR46jW0+7x0qj4RczABObNm7ZhZdef89uNmaMxozS/GaFSVSp91KKWAtufBQTGTG9NHcuXtf05w3WUn4CNIiOjHAYhTQhST0agFmHjBDsi1ZGlOiYiR05N+j9DTDxiZfRqoOVzZ+Za/369MD8WfbPI85Yq9Pp0fDhTmDumEondo5hZssRtzWgy/QKw1T5L6o0WZbq+pTiiYZRETYWQolJ2R9Q8DMsGRakDFcoCbGvhwEg/pq6CyEwO7MigKaBMrwCU/l3Y+67lcXfAMNC9tVp1M4ur159uQ9mznBsLemMwWMnTMOsueaduxXp0j9m4ZluJpvCMg2YxCR1fQqY9cDYRA4MC6usDCc2r5KEJDVbKdiKUZzUMZERFZwxWaXSVCwE0i1tbFytSm6hwkkmR4Cxp9rPirnfr5WZM75KymYwGGw99Qr1XmmPnefjEtG2k6UxbgmV5TmmbAMmWd2H8jBLsgjBtWhlhN1wuglJmiWAlTbz+Rg7lwOlmZ2oUl+lFGaLS8Khb3TtCLNFprcBUro8fwMM6z/zYpmaZutc/L23X8eUCZaaTeK437l7Pxw/aWu+3Oyhxvh7h2lIyzZgktRTKGCOY0kI1kUrI+xaICUkqZl715LzB8WumKgIu1J+y2FIVKnXUgqzTT8BvoyOjHBsbCFuDF1SiwWMywLvIoEQXTLWvB49+yAhwcpsydjqYUOHYNT79g/vQrq1bPkqTPj8CxtSdo759/DfCA1lLrcdp/te0p+g0myCRWhx5jGmYVQFu5f4CSpNHCg1S/kJIYuileGDXDE6/lrWBOY5xkxHyOYYZbjZq4yr/J4+90fAvPbGWzh8xFaNf8S772D4OzYaT4JZnJubi/Ydu9gNqTF39kx0irX1qGlZuM8Bc+PGZa86k8jVVzwGwOwRQQLD4CCpxq5LkFxDxXOgCC5mAOEwO5jLdHnlUqAP72KA5FcLxqWHSDPNajiCR8tNwlx9xav2sjo6w9ymTeCobjTR3bpjQlaDvLbddjnrptAV5oPRH2PTZlsPmLVrVv1q7+bf57rJSmO2Zu36TM3LLzArmAVWqo+qD/dD96c6Y1T3CiASx/F1JNpku9t9T9rjLO8d01a+Uw0uL/fucCCoSqPvCYGN9JJS8n5B2nn7ejMCmxpUpUl7TsL9HRHdBVWbD0CYspXRNZA+Lz394IQq91SI4HLACBxUfydTVGs8FpROseUDHZafGufRCtNxOh1nyM+YKFVUMqs86fLSaW7y0U1n5j/teahlLw5eOWC8yMyyXJSiWqMhoLBRGiOUvpaXFueRalLsdPongAGMfwUZl6G4sARtcw4e/XrXNhv7qbvN43sCMGcSUyy1Asw8aRpdw+gcw9FzMcwrLktMnnLaEg4oqjV8DpSzsRSjPAYUpF9Y5gmvOs2gbXke069tm8A9l7enaYNQWXCAhKMNK4ZFdl6yxqHfO0/qdDfvPQEYdxtfns93HIj9xpBm0BVUpgYteH0ReL0W1FAEWXDl/w5+VvEhIS1JSbli98VYnLdGjbr7furWZVGYXDawYlAAgmTSMY8vXn1XXGk56k+ZBYw3ViV7TLvXVipXk1DIRHZGwyYxex47nf4LwJ6xXuK+0cR5CDERjdjzWs8IXsvdvJRTGDDt7HXt9QLtmIJbF34QUcQdJS2zgLmjXPPHwmu2UCj0+SxYr1XiCN8l91a8fT19kXwqBv9Xg975fuHZaw9reZN6YLWqlfYe2rGoRO4motxiwIvI4pS0HDDe4qSflDPrqS5aA6UyAtAR23dz3u52gyffH3vj9HYWrcE0Nyl0lCOjC255dnXtrXaWA8ZbnPSTcna/3PsyBa0LILPLkjWVvN3tyk2emp+fljTEVC5N43j0zU2Ps/KM6u06xZRXDhgx3Cqnxe6Xe12gYKFJSF6XJaudK3qJ5xdRVG3ETNvZJcI5nqPPFt6ME629IL5a4TnKNGAopfLkbIRIDAgBj2BQnUJPiUIqQRD7JNSgAIgCBIGUkkCOIIAHH0gIFwBKAkH5QEogJwRyUCKn4OWEcDJCIQeBnFLIACoFAfOgLQX7TnH7O5UCHAdQCQjhQKkEIKbvAGf8m4DAFAqEEGIcCnLbbMH4m3FDAtDbtj70dtADCmb7w/6B8gB4gBiMfxNiAGW/se8sogLRg0IPYvyvA2D6DqIn7DuFlhJoKeV1BJwWhGophZZQaEG4QhBaSClfxIEr/HbR1mZrli2unp/8X6tcHW92bhJdv/6cLRvW/AIiyweHPIMEubXDkEsI0QqfhibK4KqNXqEA86hxOF9X1B1Zl5mDlHsq3dOASU2lIQYZKuv0usrgSCUJIRUBvgLlSQVKEMGBhPOgEaB8OEDCKBBGYAyJEUKBEAI2ocuTOxw4dfoMzp0/j/j4RJw5+x/i4uJZGBKbotq0boWFf9jGwKSAjgDMwUkuBXIIkA3QbBBOw4GoeVANoVATjmYBXJaB0syWrR79SSaX33rhuef7zpr2P/u+ad3pjBfz3BXAUEq5lCzUNhj0dQmhUQBRArQWBalBCGoAtBqlqAZAuM9QLzKlvCjgzaHDceCgydslc+Eqk8nNoSiYIRn7r9PpUCEiAn/vMxvAepN1BYTgFkBuUYoUApoCEBYcWEUpuSaRSK/UqIBkQghbZX2W7jhgKKWylCx9WwOPdoTQhylIE0IRbemzzGe9La+oTHGA+aWjBIkE9Byl5JSEw6EaFaRHCCFs+3lH0h0FTHK6bjIFhoNtm8pTOQd8wgGiJsBPtSvLrAIPe6vqOw8YguGg5YDx1oCVl+OCA4SoCb1PAcO6Zt6SAe0IpQ9TigcBRANwHhSxfGaUc8A1B1g4s0RC8B8l5JQE9/mWzFF/iw/9hOjrGkCiYKDmQz9AaxKCqpSSagAtP/S7njRllIIUEELZgT+VgqZwIDeMh34JUUlAr1FaRg/9noxm8bUy1esq6+1cK5vORiS8/FrZEy7fmbzOrpUBqgGImhCoCUqulaU8zSBSWbpEh/SqVYmVz+0700rxpd7RM4z45ng3hz3BJSREoadQSDkSZKBQgPIKUAeCS8IHMiElE16aBZeAnICTWQouCYHUJMQ0Ci9vCy6JlIJKOJOAkqNMcGkrwCTMFJdYCCwtBZilBZbsO5NWwiQPoaUFlsQouGQSS8oTkzCzRHAJGIWVtLTgEryOAtpiwSUTWjJhJqi14JKnKCKEFoKgEITLlxDk63laICXIh4Hme0Nw6d3RvzOl/R8AdGoXzom1qQAAAABJRU5ErkJggg=="},15360:function(e,t,n){"use strict";n.d(t,{ZP:function(){return Ro}});const i=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},r=Number.isSafeInteger||function(e){return"number"==typeof e&&Math.abs(e)<=a},a=Number.MAX_SAFE_INTEGER||9007199254740991;let s=function(e){return e.NETWORK_ERROR="networkError",e.MEDIA_ERROR="mediaError",e.KEY_SYSTEM_ERROR="keySystemError",e.MUX_ERROR="muxError",e.OTHER_ERROR="otherError",e}({}),o=function(e){return e.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",e.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",e.KEY_SYSTEM_NO_SESSION="keySystemNoSession",e.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",e.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",e.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",e.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",e.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",e.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",e.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",e.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",e.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",e.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",e.MANIFEST_LOAD_ERROR="manifestLoadError",e.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",e.MANIFEST_PARSING_ERROR="manifestParsingError",e.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",e.LEVEL_EMPTY_ERROR="levelEmptyError",e.LEVEL_LOAD_ERROR="levelLoadError",e.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",e.LEVEL_PARSING_ERROR="levelParsingError",e.LEVEL_SWITCH_ERROR="levelSwitchError",e.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",e.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",e.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",e.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",e.FRAG_LOAD_ERROR="fragLoadError",e.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",e.FRAG_DECRYPT_ERROR="fragDecryptError",e.FRAG_PARSING_ERROR="fragParsingError",e.FRAG_GAP="fragGap",e.REMUX_ALLOC_ERROR="remuxAllocError",e.KEY_LOAD_ERROR="keyLoadError",e.KEY_LOAD_TIMEOUT="keyLoadTimeOut",e.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",e.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",e.BUFFER_APPEND_ERROR="bufferAppendError",e.BUFFER_APPENDING_ERROR="bufferAppendingError",e.BUFFER_STALLED_ERROR="bufferStalledError",e.BUFFER_FULL_ERROR="bufferFullError",e.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",e.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",e.ASSET_LIST_LOAD_ERROR="assetListLoadError",e.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",e.ASSET_LIST_PARSING_ERROR="assetListParsingError",e.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",e.INTERNAL_EXCEPTION="internalException",e.INTERNAL_ABORTED="aborted",e.ATTACH_MEDIA_ERROR="attachMediaError",e.UNKNOWN="unknown",e}({}),l=function(e){return e.MEDIA_ATTACHING="hlsMediaAttaching",e.MEDIA_ATTACHED="hlsMediaAttached",e.MEDIA_DETACHING="hlsMediaDetaching",e.MEDIA_DETACHED="hlsMediaDetached",e.MEDIA_ENDED="hlsMediaEnded",e.STALL_RESOLVED="hlsStallResolved",e.BUFFER_RESET="hlsBufferReset",e.BUFFER_CODECS="hlsBufferCodecs",e.BUFFER_CREATED="hlsBufferCreated",e.BUFFER_APPENDING="hlsBufferAppending",e.BUFFER_APPENDED="hlsBufferAppended",e.BUFFER_EOS="hlsBufferEos",e.BUFFERED_TO_END="hlsBufferedToEnd",e.BUFFER_FLUSHING="hlsBufferFlushing",e.BUFFER_FLUSHED="hlsBufferFlushed",e.MANIFEST_LOADING="hlsManifestLoading",e.MANIFEST_LOADED="hlsManifestLoaded",e.MANIFEST_PARSED="hlsManifestParsed",e.LEVEL_SWITCHING="hlsLevelSwitching",e.LEVEL_SWITCHED="hlsLevelSwitched",e.LEVEL_LOADING="hlsLevelLoading",e.LEVEL_LOADED="hlsLevelLoaded",e.LEVEL_UPDATED="hlsLevelUpdated",e.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",e.LEVELS_UPDATED="hlsLevelsUpdated",e.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",e.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",e.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",e.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",e.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",e.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",e.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",e.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",e.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",e.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",e.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",e.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",e.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",e.CUES_PARSED="hlsCuesParsed",e.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",e.INIT_PTS_FOUND="hlsInitPtsFound",e.FRAG_LOADING="hlsFragLoading",e.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",e.FRAG_LOADED="hlsFragLoaded",e.FRAG_DECRYPTED="hlsFragDecrypted",e.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",e.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",e.FRAG_PARSING_METADATA="hlsFragParsingMetadata",e.FRAG_PARSED="hlsFragParsed",e.FRAG_BUFFERED="hlsFragBuffered",e.FRAG_CHANGED="hlsFragChanged",e.FPS_DROP="hlsFpsDrop",e.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",e.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",e.ERROR="hlsError",e.DESTROYING="hlsDestroying",e.KEY_LOADING="hlsKeyLoading",e.KEY_LOADED="hlsKeyLoaded",e.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",e.BACK_BUFFER_REACHED="hlsBackBufferReached",e.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",e.ASSET_LIST_LOADING="hlsAssetListLoading",e.ASSET_LIST_LOADED="hlsAssetListLoaded",e.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",e.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",e.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",e.INTERSTITIAL_STARTED="hlsInterstitialStarted",e.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",e.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",e.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",e.INTERSTITIAL_ENDED="hlsInterstitialEnded",e.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",e.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",e.EVENT_CUE_ENTER="hlsEventCueEnter",e}({});var c="manifest",u="level",d="audioTrack",h="subtitleTrack",p="main",f="audio",m="subtitle";class g{constructor(e,t=0,n=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=n}sample(e,t){const n=Math.pow(this.alpha_,e);this.estimate_=t*(1-n)+n*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class v{constructor(e,t,n,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new g(e),this.fast_=new g(t),this.defaultTTFB_=i,this.ttfb_=new g(e)}update(e,t){const{slow_:n,fast_:i,ttfb_:r}=this;n.halfLife!==e&&(this.slow_=new g(e,n.getEstimate(),n.getTotalWeight())),i.halfLife!==t&&(this.fast_=new g(t,i.getEstimate(),i.getTotalWeight())),r.halfLife!==e&&(this.ttfb_=new g(e,r.getEstimate(),r.getTotalWeight()))}sample(e,t){const n=(e=Math.max(e,this.minDelayMs_))/1e3,i=8*t/n;this.fast_.sample(n,i),this.slow_.sample(n,i)}sampleTTFB(e){const t=e/1e3,n=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(n,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function b(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},y.apply(null,arguments)}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}class x{constructor(e,t){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const n=`[${e}]:`;this.trace=k,this.debug=t.debug.bind(null,n),this.log=t.log.bind(null,n),this.warn=t.warn.bind(null,n),this.info=t.info.bind(null,n),this.error=t.error.bind(null,n)}}const k=function(){},S={trace:k,debug:k,log:k,warn:k,info:k,error:k};function E(){return y({},S)}function C(e,t,n){return t[e]?t[e].bind(t):function(e,t){const n=self.console[e];return n?n.bind(self.console,`${t?"["+t+"] ":""}[${e}] >`):k}(e,n)}const T=E();const A=T;function M(e=!0){if("undefined"==typeof self)return;return(e||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function L(e,t){const n=Object.keys(e),i=Object.keys(t),r=n.length,a=i.length;return!r||!a||r===a&&!n.some((e=>-1===i.indexOf(e)))}function D(e,t=!1){if("undefined"!=typeof TextDecoder){const n=new TextDecoder("utf-8").decode(e);if(t){const e=n.indexOf("\0");return-1!==e?n.substring(0,e):n}return n.replace(/\0/g,"")}const n=e.length;let i,r,a,s="",o=0;for(;o<n;){if(i=e[o++],0===i&&t)return s;if(0!==i&&3!==i)switch(i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:s+=String.fromCharCode(i);break;case 12:case 13:r=e[o++],s+=String.fromCharCode((31&i)<<6|63&r);break;case 14:r=e[o++],a=e[o++],s+=String.fromCharCode((15&i)<<12|(63&r)<<6|(63&a)<<0)}}return s}const I=function(e){let t="";for(let n=0;n<e.length;n++){let i=e[n].toString(16);i.length<2&&(i="0"+i),t+=i}return t};function R(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var P,O={exports:{}};var N,B,$,F,z,K=(P||(P=1,N=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,B=/^(?=([^\/?#]*))\1([^]*)$/,$=/(?:\/|^)\.(?=\/)/g,F=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,O.exports=z={buildAbsoluteURL:function(e,t,n){if(n=n||{},e=e.trim(),!(t=t.trim())){if(!n.alwaysNormalize)return e;var i=z.parseURL(e);if(!i)throw new Error("Error trying to parse base URL.");return i.path=z.normalizePath(i.path),z.buildURLFromParts(i)}var r=z.parseURL(t);if(!r)throw new Error("Error trying to parse relative URL.");if(r.scheme)return n.alwaysNormalize?(r.path=z.normalizePath(r.path),z.buildURLFromParts(r)):t;var a=z.parseURL(e);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&"/"!==a.path[0]){var s=B.exec(a.path);a.netLoc=s[1],a.path=s[2]}a.netLoc&&!a.path&&(a.path="/");var o={scheme:a.scheme,netLoc:r.netLoc,path:null,params:r.params,query:r.query,fragment:r.fragment};if(!r.netLoc&&(o.netLoc=a.netLoc,"/"!==r.path[0]))if(r.path){var l=a.path,c=l.substring(0,l.lastIndexOf("/")+1)+r.path;o.path=z.normalizePath(c)}else o.path=a.path,r.params||(o.params=a.params,r.query||(o.query=a.query));return null===o.path&&(o.path=n.alwaysNormalize?z.normalizePath(r.path):r.path),z.buildURLFromParts(o)},parseURL:function(e){var t=N.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace($,"");e.length!==(e=e.replace(F,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}}),O.exports);class U{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var j="audio",q="video",H="audiovideo";class V{constructor(e){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,"string"==typeof e&&(e={url:e}),this.base=e,function(e,t){const n=Y(e,t);n&&(n.enumerable=!0,Object.defineProperty(e,t,n))}(this,"stats")}setByteRange(e,t){const n=e.split("@",2);let i;i=1===n.length?(null==t?void 0:t.byteRangeEndOffset)||0:parseInt(n[1]),this._byteRange=[i,parseInt(n[0])+i]}get baseurl(){return this.base.url}get byteRange(){return null===this._byteRange?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return null===this._streams&&(this._streams={[j]:null,[q]:null,[H]:null}),this._streams}set elementaryStreams(e){this._streams=e}get hasStats(){return null!==this._stats}get hasStreams(){return null!==this._streams}get stats(){return null===this._stats&&(this._stats=new U),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=K.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[j]=null,e[q]=null,e[H]=null}}function G(e){return"initSegment"!==e.sn}class Z extends V{constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){const e=this.stats.total;if(e)return e}if(this.byteRange){const e=this.byteRange[0],t=this.byteRange[1];if(i(e)&&i(t))return t-e}return null}get bitrate(){return this.byteLength?8*this.byteLength/this.duration:this._bitrate?this._bitrate:null}set bitrate(e){this._bitrate=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const e=this.levelkeys.identity;if(e)this._decryptdata=e.getDecryptData(this.sn);else{const e=Object.keys(this.levelkeys);if(1===e.length)return this._decryptdata=this.levelkeys[e[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(null===this.programDateTime)return null;const e=i(this.duration)?this.duration:0;return this.programDateTime+1e3*e}get encrypted(){var e;if(null!=(e=this._decryptdata)&&e.encrypted)return!0;if(this.levelkeys){const e=Object.keys(this.levelkeys),t=e.length;if(t>1||1===t&&this.levelkeys[e[0]].encrypted)return!0}return!1}get programDateTime(){return null===this._programDateTime&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){i(e)?this._programDateTime=e:this._programDateTime=this.rawProgramDateTime=null}get ref(){return G(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(e){this.setStart(this.start+e)}setStart(e){this.start=e,this._ref&&(this._ref.start=e)}setDuration(e){this.duration=e,this._ref&&(this._ref.duration=e)}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;null==(e=this.loader)||e.abort(),null==(t=this.keyLoader)||t.abort()}setElementaryStreamInfo(e,t,n,i,r,a=!1){const{elementaryStreams:s}=this,o=s[e];o?(o.startPTS=Math.min(o.startPTS,t),o.endPTS=Math.max(o.endPTS,n),o.startDTS=Math.min(o.startDTS,i),o.endDTS=Math.max(o.endDTS,r)):s[e]={startPTS:t,endPTS:n,startDTS:i,endDTS:r,partial:a}}}class W extends V{constructor(e,t,n,i,r){super(n),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=i;const a=e.enumeratedString("BYTERANGE");a&&this.setByteRange(a,r),r&&(this.fragOffset=r.fragOffset+r.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}function Y(e,t){const n=Object.getPrototypeOf(e);if(n){const e=Object.getOwnPropertyDescriptor(n,t);return e||Y(n,t)}}const X=Math.pow(2,32)-1,J=[].push,Q={video:1,audio:2,id3:3,text:4};function ee(e){return String.fromCharCode.apply(null,e)}function te(e,t){const n=e[t]<<8|e[t+1];return n<0?65536+n:n}function ne(e,t){const n=re(e,t);return n<0?4294967296+n:n}function ie(e,t){let n=ne(e,t);return n*=Math.pow(2,32),n+=ne(e,t+4),n}function re(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function ae(e,t,n){e[t]=n>>24,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n}function se(e,t){const n=[];if(!t.length)return n;const i=e.byteLength;for(let r=0;r<i;){const a=ne(e,r),s=a>1?r+a:i;if(ee(e.subarray(r+4,r+8))===t[0])if(1===t.length)n.push(e.subarray(r+8,s));else{const i=se(e.subarray(r+8,s),t.slice(1));i.length&&J.apply(n,i)}r=s}return n}function oe(e){const t=[],n=e[0];let i=8;const r=ne(e,i);i+=4;let a=0,s=0;0===n?(a=ne(e,i),s=ne(e,i+4),i+=8):(a=ie(e,i),s=ie(e,i+8),i+=16),i+=2;let o=e.length+s;const l=te(e,i);i+=2;for(let n=0;n<l;n++){let n=i;const a=ne(e,n);n+=4;const s=2147483647&a;if(1===(2147483648&a)>>>31)return A.warn("SIDX has hierarchical references (not supported)"),null;const l=ne(e,n);n+=4,t.push({referenceSize:s,subsegmentDuration:l,info:{duration:l/r,start:o,end:o+s-1}}),o+=s,n+=4,i=n}return{earliestPresentationTime:a,timescale:r,version:n,referencesCount:l,references:t}}function le(e){const t=[],n=se(e,["moov","trak"]);for(let e=0;e<n.length;e++){const i=n[e],r=se(i,["tkhd"])[0];if(r){let e=r[0];const n=ne(r,0===e?12:20),a=se(i,["mdia","mdhd"])[0];if(a){e=a[0];const r=ne(a,0===e?12:20),s=se(i,["mdia","hdlr"])[0];if(s){const e=ee(s.subarray(8,12)),a={soun:j,vide:q}[e],o=ce(se(i,["mdia","minf","stbl","stsd"])[0]);a?(t[n]={timescale:r,type:a,stsd:o},t[a]=w({timescale:r,id:n},o)):t[n]={timescale:r,type:e,stsd:o}}}}}return se(e,["moov","mvex","trex"]).forEach((e=>{const n=ne(e,4),i=t[n];i&&(i.default={duration:ne(e,12),flags:ne(e,20)})})),t}function ce(e){const t=e.subarray(8),n=t.subarray(86),i=ee(t.subarray(4,8));let r,a=i;const s="enca"===i||"encv"===i;if(s){const e=se(t,[i])[0];se(e.subarray("enca"===i?28:78),["sinf"]).forEach((e=>{const t=se(e,["schm"])[0];if(t){const n=ee(t.subarray(4,8));if("cbcs"===n||"cenc"===n){const t=se(e,["frma"])[0];t&&(a=ee(t))}}}))}const o=a;switch(a){case"avc1":case"avc2":case"avc3":case"avc4":{const e=se(n,["avcC"])[0];e&&e.length>3&&(a+="."+he(e[1])+he(e[2])+he(e[3]),r=ue("avc1"===o?"dva1":"dvav",n));break}case"mp4a":{const e=se(t,[i])[0],n=se(e.subarray(28),["esds"])[0];if(n&&n.length>7){let e=4;if(3!==n[e++])break;e=de(n,e),e+=2;const t=n[e++];if(128&t&&(e+=2),64&t&&(e+=n[e++]),4!==n[e++])break;e=de(n,e);const i=n[e++];if(64!==i)break;if(a+="."+he(i),e+=12,5!==n[e++])break;e=de(n,e);const r=n[e++];let s=(248&r)>>3;31===s&&(s+=1+((7&r)<<3)+((224&n[e])>>5)),a+="."+s}break}case"hvc1":case"hev1":{const e=se(n,["hvcC"])[0];if(e&&e.length>12){const t=e[1],n=["","A","B","C"][t>>6],i=31&t,r=ne(e,2),s=(32&t)>>5?"H":"L",o=e[12],l=e.subarray(6,12);a+="."+n+i,a+="."+function(e){let t=0;for(let n=0;n<32;n++)t|=(e>>n&1)<<31-n;return t>>>0}(r).toString(16).toUpperCase(),a+="."+s+o;let c="";for(let e=l.length;e--;){const t=l[e];if(t||c){c="."+t.toString(16).toUpperCase()+c}}a+=c}r=ue("hev1"==o?"dvhe":"dvh1",n);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":a=ue(a,n)||a;break;case"vp09":{const e=se(n,["vpcC"])[0];if(e&&e.length>6){const t=e[4],n=e[5],i=e[6]>>4&15;a+="."+pe(t)+"."+pe(n)+"."+pe(i)}break}case"av01":{const e=se(n,["av1C"])[0];if(e&&e.length>2){const t=e[1]>>>5,i=31&e[1],s=e[2]>>>7?"H":"M",o=(64&e[2])>>6,l=(32&e[2])>>5,c=2===t&&o?l?12:10:o?10:8,u=(16&e[2])>>4,d=(8&e[2])>>3,h=(4&e[2])>>2,p=3&e[2],f=1,m=1,g=1,v=0;a+="."+t+"."+pe(i)+s+"."+pe(c)+"."+u+"."+d+h+p+"."+pe(f)+"."+pe(m)+"."+pe(g)+"."+v,r=ue("dav1",n)}break}}return{codec:a,encrypted:s,supplemental:r}}function ue(e,t){const n=se(t,["dvvC"]),i=n.length?n[0]:se(t,["dvcC"])[0];if(i){const t=i[2]>>1&127,n=i[2]<<5&32|i[3]>>3&31;return e+"."+pe(t)+"."+pe(n)}}function de(e,t){const n=t+5;for(;128&e[t++]&&t<n;);return t}function he(e){return("0"+e.toString(16).toUpperCase()).slice(-2)}function pe(e){return(e<10?"0":"")+e}function fe(e){const t=se(e,["schm"])[0];if(t){const n=ee(t.subarray(4,8));if("cbcs"===n||"cenc"===n)return se(e,["schi","tenc"])[0]}return null}function me(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function ge(e,t){const n=[],i=t.samples,r=t.timescale,a=t.id;let s=!1;return se(i,["moof"]).map((o=>{const l=o.byteOffset-8;se(o,["traf"]).map((o=>{const c=se(o,["tfdt"]).map((e=>{const t=e[0];let n=ne(e,4);return 1===t&&(n*=Math.pow(2,32),n+=ne(e,8)),n/r}))[0];return void 0!==c&&(e=c),se(o,["tfhd"]).map((c=>{const u=ne(c,4),d=16777215&ne(c,0);let h=0;const p=0!=(16&d);let f=0;const m=0!=(32&d);let g=8;u===a&&(0!=(1&d)&&(g+=8),0!=(2&d)&&(g+=4),0!=(8&d)&&(h=ne(c,g),g+=4),p&&(f=ne(c,g),g+=4),m&&(g+=4),"video"===t.type&&(s=ve(t.codec)),se(o,["trun"]).map((a=>{const o=a[0],c=16777215&ne(a,0),u=0!=(1&c);let d=0;const p=0!=(4&c),m=0!=(256&c);let g=0;const v=0!=(512&c);let b=0;const y=0!=(1024&c),_=0!=(2048&c);let w=0;const x=ne(a,4);let k=8;u&&(d=ne(a,k),k+=4),p&&(k+=4);let S=d+l;for(let l=0;l<x;l++){if(m?(g=ne(a,k),k+=4):g=h,v?(b=ne(a,k),k+=4):b=f,y&&(k+=4),_&&(w=0===o?ne(a,k):re(a,k),k+=4),t.type===q){let t=0;for(;t<b;){const a=ne(i,S);if(S+=4,be(s,i[S])){ye(i.subarray(S,S+a),s?2:1,e+w/r,n)}S+=a,t+=a+4}}e+=g/r}})))}))}))})),n}function ve(e){if(!e)return!1;const t=e.substring(0,4);return"hvc1"===t||"hev1"===t||"dvh1"===t||"dvhe"===t}function be(e,t){if(e){const e=t>>1&63;return 39===e||40===e}return 6===(31&t)}function ye(e,t,n,i){const r=_e(e);let a=0;a+=t;let s=0,o=0,l=0;for(;a<r.length;){s=0;do{if(a>=r.length)break;l=r[a++],s+=l}while(255===l);o=0;do{if(a>=r.length)break;l=r[a++],o+=l}while(255===l);const e=r.length-a;let t=a;if(o<e)a+=o;else if(o>e){A.error(`Malformed SEI payload. ${o} is too small, only ${e} bytes left to parse.`);break}if(4===s){if(181===r[t++]){const e=te(r,t);if(t+=2,49===e){const e=ne(r,t);if(t+=4,1195456820===e){const e=r[t++];if(3===e){const a=r[t++],o=64&a,l=o?2+3*(31&a):0,c=new Uint8Array(l);if(o){c[0]=a;for(let e=1;e<l;e++)c[e]=r[t++]}i.push({type:e,payloadType:s,pts:n,bytes:c})}}}}}else if(5===s&&o>16){const e=[];for(let n=0;n<16;n++){const i=r[t++].toString(16);e.push(1==i.length?"0"+i:i),3!==n&&5!==n&&7!==n&&9!==n||e.push("-")}const a=o-16,l=new Uint8Array(a);for(let e=0;e<a;e++)l[e]=r[t++];i.push({payloadType:s,pts:n,uuid:e.join(""),userData:D(l),userDataBytes:l})}}}function _e(e){const t=e.byteLength,n=[];let i=1;for(;i<t-2;)0===e[i]&&0===e[i+1]&&3===e[i+2]?(n.push(i+2),i+=2):i++;if(0===n.length)return e;const r=t-n.length,a=new Uint8Array(r);let s=0;for(i=0;i<r;s++,i++)s===n[0]&&(s++,n.shift()),a[i]=e[s];return a}function we(e,t,n){if(16!==e.byteLength)throw new RangeError("Invalid system id");let i,r,a;i=0,r=new Uint8Array,a=new Uint8Array;const s=new Uint8Array(4);return n&&n.byteLength>0&&new DataView(s.buffer).setUint32(0,n.byteLength,!1),function(e,...t){const n=t.length;let i=8,r=n;for(;r--;)i+=t[r].byteLength;const a=new Uint8Array(i);for(a[0]=i>>24&255,a[1]=i>>16&255,a[2]=i>>8&255,a[3]=255&i,a.set(e,4),r=0,i=8;r<n;r++)a.set(t[r],i),i+=t[r].byteLength;return a}([112,115,115,104],new Uint8Array([0,0,0,0]),e,a,r,s,n||new Uint8Array)}function xe(e){const t=e.getUint32(0),n=e.byteOffset,i=e.byteLength;if(i<t)return{offset:n,size:i};if(1886614376!==e.getUint32(4))return{offset:n,size:t};const r=e.getUint32(8)>>>24;if(0!==r&&1!==r)return{offset:n,size:t};const a=e.buffer,s=I(new Uint8Array(a,n+12,16)),o=e.getUint32(28);let l=null,c=null;if(0===r){if(t-32<o||o<22)return{offset:n,size:t};c=new Uint8Array(a,n+32,o)}else if(1===r){if(!o||i<n+32+16*o+16)return{offset:n,size:t};l=[];for(let e=0;e<o;e++)l.push(new Uint8Array(a,n+32+16*e,16))}return{version:r,systemId:s,kids:l,data:c,offset:n,size:t}}const ke=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),Se={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,dav1:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function Ee(e,t){const n=Se[t];return!!n&&!!n[e.slice(0,4)]}function Ce(e,t,n=!0){return!e.split(",").some((e=>!Te(e,t,n)))}function Te(e,t,n=!0){var i;const r=M(n);return null!=(i=null==r?void 0:r.isTypeSupported(Ae(e,t)))&&i}function Ae(e,t){return`${t}/mp4;codecs=${e}`}function Me(e){if(e){const t=e.substring(0,4);return Se.video[t]}return 2}function Le(e){const t=ke();return e.split(",").reduce(((e,n)=>{const i=t&&ve(n)?9:Se.video[n];return i?(2*i+e)/(e?3:2):(Se.audio[n]+e)/(e?2:1)}),0)}const De={};const Ie=/flac|opus|mp4a\.40\.34/i;function Re(e,t=!0){return e.replace(Ie,(e=>function(e,t=!0){if(De[e])return De[e];const n={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[e];for(let r=0;r<n.length;r++){var i;if(Te(n[r],"audio",t))return De[e]=n[r],n[r];if("mp3"===n[r]&&null!=(i=M(t))&&i.isTypeSupported("audio/mpeg"))return""}return e}(e.toLowerCase(),t)))}function Pe(e,t){if(e&&(e.length>4||-1!==["ac-3","ec-3","alac","fLaC","Opus"].indexOf(e)))return e;if(t){const n=t.split(",");if(n.length>1){if(e)for(let t=n.length;t--;)if(n[t].substring(0,4)===e.substring(0,4))return n[t];return n[0]}}return t||e}function Oe(e){if(e.startsWith("av01.")){const t=e.split("."),n=["0","111","01","01","01","0"];for(let e=t.length;e>4&&e<10;e++)t[e]=n[e-4];return t.join(".")}return e}function Ne(e){const t=M(e)||{isTypeSupported:()=>!1};return{mpeg:t.isTypeSupported("audio/mpeg"),mp3:t.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:t.isTypeSupported('audio/mp4; codecs="ac-3"')}}function Be(e){return e.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const $e={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function Fe(e,t){return{supported:!1,configurations:t,decodingInfoResults:[{supported:!1,smooth:!1,powerEfficient:!1}],error:e}}const ze={};function Ke(e,t,n,r,a,s){const o=e.audioCodec?e.audioGroups:null,l=null==s?void 0:s.audioCodec,c=null==s?void 0:s.channels,u=c?parseInt(c):l?1/0:2;let d=null;if(null!=o&&o.length)try{d=1===o.length&&o[0]?t.groups[o[0]].channels:o.reduce(((e,n)=>{if(n){const i=t.groups[n];if(!i)throw new Error(`Audio track group ${n} not found`);Object.keys(i.channels).forEach((t=>{e[t]=(e[t]||0)+i.channels[t]}))}return e}),{2:0})}catch(e){return!0}return void 0!==e.videoCodec&&(e.width>1920&&e.height>1088||e.height>1920&&e.width>1088||e.frameRate>Math.max(r,30)||"SDR"!==e.videoRange&&e.videoRange!==n||e.bitrate>Math.max(a,8e6))||!!d&&i(u)&&Object.keys(d).some((e=>parseInt(e)>u))}function Ue(e,t,n){const r=e.videoCodec,a=e.audioCodec;if(!r&&!a||!n)return Promise.resolve($e);const s=[];if(r){const t={width:e.width,height:e.height,bitrate:Math.ceil(Math.max(.9*e.bitrate,e.averageBitrate)),framerate:e.frameRate||30},n=e.videoRange;"SDR"!==n&&(t.transferFunction=n.toLowerCase());const i=r.split(","),a=navigator.userAgent;if(i.some((e=>ve(e)))&&ke())return Promise.resolve(Fe(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent sting: (${a})`),s));s.push.apply(s,i.map((e=>({type:"media-source",video:w(w({},t),{},{contentType:Ae(Oe(e),"video")})}))))}return a&&e.audioGroups&&e.audioGroups.forEach((e=>{var n;e&&(null==(n=t.groups[e])||n.tracks.forEach((t=>{if(t.groupId===e){const e=t.channels||"",n=parseFloat(e);i(n)&&n>2&&s.push.apply(s,a.split(",").map((e=>({type:"media-source",audio:{contentType:Ae(e,"audio"),channels:""+n}}))))}})))})),Promise.all(s.map((e=>{const t=function(e){const{audio:t,video:n}=e,i=n||t;if(i){const e=Be(i.contentType);if(n)return`r${n.height}x${n.width}f${Math.ceil(n.framerate)}${n.transferFunction||"sd"}_${e}_${Math.ceil(n.bitrate/1e5)}`;if(t)return`c${t.channels}${t.spatialRendering?"s":"n"}_${e}`}return""}(e);return ze[t]||(ze[t]=n.decodingInfo(e))}))).then((e=>({supported:!e.some((e=>!e.supported)),configurations:s,decodingInfoResults:e}))).catch((e=>({supported:!1,configurations:s,decodingInfoResults:[],error:e})))}const je=["NONE","TYPE-0","TYPE-1",null];const qe=["SDR","PQ","HLG"];var He="",Ve="YES",Ge="v2";function Ze(e){const{canSkipUntil:t,canSkipDateRanges:n,age:i}=e;return t&&i<t/2?n?Ge:Ve:He}class We{constructor(e,t,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=n}addDirectives(e){const t=new self.URL(e);return void 0!==this.msn&&t.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class Ye{constructor(e){if(this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.supplemental=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter((e=>!!e)).map((e=>e.substring(0,4))).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const n=null==(t=e.supplemental)?void 0:t.videoCodec;n&&n!==e.videoCodec&&(this.codecSet+=`,${n.substring(0,4)}`)}this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return Xe(this._audioGroups,e)}hasSubtitleGroup(e){return Xe(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t)if("audio"===e){let e=this._audioGroups;e||(e=this._audioGroups=[]),-1===e.indexOf(t)&&e.push(t)}else if("text"===e){let e=this._subtitleGroups;e||(e=this._subtitleGroups=[]),-1===e.indexOf(t)&&e.push(t)}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return null==(e=this.audioGroups)?void 0:e[0]}get textGroupId(){var e;return null==(e=this.subtitleGroups)?void 0:e[0]}addFallback(){}}function Xe(e,t){return!(!t||!e)&&-1!==e.indexOf(t)}function Je(e,t){let n=!1,i=[];if(e&&(n="SDR"!==e,i=[e]),t){i=t.allowedVideoRanges||qe.slice(0);const e="SDR"!==i.join("")&&!t.videoCodec;n=void 0!==t.preferHDR?t.preferHDR:e&&function(){if("function"==typeof matchMedia){const e=matchMedia("(dynamic-range: high)"),t=matchMedia("bad query");if(e.media!==t.media)return!0===e.matches}return!1}(),n||(i=["SDR"])}return{preferHDR:n,allowedVideoRanges:i}}const Qe=(e,t)=>JSON.stringify(e,(e=>{const t=new WeakSet;return(n,i)=>{if(e&&(i=e(n,i)),"object"==typeof i&&null!==i){if(t.has(i))return;t.add(i)}return i}})(t));function et(e,t){A.log(`[abr] start candidates with "${e}" ignored because ${t}`)}function tt(e){return e.reduce(((e,t)=>{let n=e.groups[t.groupId];n||(n=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),n.tracks.push(t);const i=t.channels||"2";return n.channels[i]=(n.channels[i]||0)+1,n.hasDefault=n.hasDefault||t.default,n.hasAutoSelect=n.hasAutoSelect||t.autoselect,n.hasDefault&&(e.hasDefaultAudio=!0),n.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e}),{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function nt(e){if(!e)return e;const{lang:t,assocLang:n,characteristics:i,channels:r,audioCodec:a}=e;return{lang:t,assocLang:n,characteristics:i,channels:r,audioCodec:a}}function it(e,t,n){if("attrs"in e){const n=t.indexOf(e);if(-1!==n)return n}for(let i=0;i<t.length;i++){if(rt(e,t[i],n))return i}return-1}function rt(e,t,n){const{groupId:i,name:r,lang:a,assocLang:s,default:o}=e,l=e.forced;return(void 0===i||t.groupId===i)&&(void 0===r||t.name===r)&&(void 0===a||function(e,t="--"){if(e.length===t.length)return e===t;return e.startsWith(t)||t.startsWith(e)}(a,t.lang))&&(void 0===a||t.assocLang===s)&&(void 0===o||t.default===o)&&(void 0===l||t.forced===l)&&(!("characteristics"in e)||function(e,t=""){const n=e.split(","),i=t.split(",");return n.length===i.length&&!n.some((e=>-1===i.indexOf(e)))}(e.characteristics||"",t.characteristics))&&(void 0===n||n(e,t))}function at(e,t){const{audioCodec:n,channels:i}=e;return!(void 0!==n&&(t.audioCodec||"").substring(0,4)!==n.substring(0,4)||void 0!==i&&i!==(t.channels||"2"))}function st(e,t,n){for(let i=t;i>-1;i--)if(n(e[i]))return i;for(let i=t+1;i<e.length;i++)if(n(e[i]))return i;return-1}function ot(e,t){var n;return!!e&&e!==(null==(n=t.loadLevelObj)?void 0:n.uri)}const lt=function(e,t){let n=0,i=e.length-1,r=null,a=null;for(;n<=i;){r=(n+i)/2|0,a=e[r];const s=t(a);if(s>0)n=r+1;else{if(!(s<0))return a;i=r-1}}return null};function ct(e,t,n=0,i=0,r=.005){let a=null;if(e){a=t[1+e.sn-t[0].sn]||null;const i=e.endDTS-n;i>0&&i<15e-7&&(n+=15e-7),a&&e.level!==a.level&&a.end<=e.end&&(a=t[2+e.sn-t[0].sn]||null)}else 0===n&&0===t[0].start&&(a=t[0]);if(a&&((!e||e.level===a.level)&&0===ut(n,i,a)||function(e,t,n){if(t&&0===t.start&&t.level<e.level&&(t.endPTS||0)>0){const i=t.tagList.reduce(((e,t)=>("INF"===t[0]&&(e+=parseFloat(t[1])),e)),n);return e.start<=i}return!1}(a,e,Math.min(r,i))))return a;const s=lt(t,ut.bind(null,n,i));return!s||s===e&&a?a:s}function ut(e=0,t=0,n){if(n.start<=e&&n.start+n.duration>e)return 0;const i=Math.min(t,n.duration+(n.deltaPTS?n.deltaPTS:0));return n.start+n.duration-i<=e?1:n.start-i>e&&n.start?-1:0}function dt(e,t,n){const i=1e3*Math.min(t,n.duration+(n.deltaPTS?n.deltaPTS:0));return(n.endProgramDateTime||0)-i>e}function ht(e,t,n){if(e&&e.startCC<=t&&e.endCC>=t){let i=e.fragments;const{fragmentHint:r}=e;let a;return r&&(i=i.concat(r)),lt(i,(e=>e.cc<t?1:e.cc>t?-1:(a=e,e.end<=n?1:e.start>n?-1:0))),a||null}return null}function pt(e){switch(e.details){case o.FRAG_LOAD_TIMEOUT:case o.KEY_LOAD_TIMEOUT:case o.LEVEL_LOAD_TIMEOUT:case o.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function ft(e,t){const n=pt(t);return e.default[(n?"timeout":"error")+"Retry"]}function mt(e,t){const n="linear"===e.backoff?1:Math.pow(2,t);return Math.min(n*e.retryDelayMs,e.maxRetryDelayMs)}function gt(e){return w(w({},e),{errorRetry:null,timeoutRetry:null})}function vt(e,t,n,i){if(!e)return!1;const r=null==i?void 0:i.code,a=t<e.maxNumRetry&&(function(e){return 0===e&&!1===navigator.onLine||!!e&&(e<400||e>499)}(r)||!!n);return e.shouldRetry?e.shouldRetry(e,t,n,i,a):a}var bt=0,yt=2,_t=3,wt=5,xt=0,kt=1,St=2;function Et(e){const t={action:bt,flags:xt};return e&&(t.resolved=!0),t}var Ct="NOT_LOADED",Tt="APPENDING",At="PARTIAL",Mt="OK";class Lt{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.BUFFER_APPENDED,this.onBufferAppended,this),e.on(l.FRAG_BUFFERED,this.onFragBuffered,this),e.on(l.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.BUFFER_APPENDED,this.onBufferAppended,this),e.off(l.FRAG_BUFFERED,this.onFragBuffered,this),e.off(l.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const n=this.activePartLists[t];if(n)for(let t=n.length;t--;){const i=n[t];if(!i)break;const r=i.end;if(i.start<=e&&null!==r&&e<=r)return i}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){return this.getFragAtPos(e,t,!0)}getFragAtPos(e,t,n){const{fragments:i}=this,r=Object.keys(i);for(let a=r.length;a--;){const s=i[r[a]];if((null==s?void 0:s.body.type)===t&&(!n||s.buffered)){const t=s.body;if(t.start<=e&&e<=t.end)return t}}return null}detectEvictedFragments(e,t,n,i,r){this.timeRanges&&(this.timeRanges[e]=t);const a=(null==i?void 0:i.fragment.sn)||-1;Object.keys(this.fragments).forEach((i=>{const s=this.fragments[i];if(!s)return;if(a>=s.body.sn)return;if(!s.buffered&&(!s.loaded||r))return void(s.body.type===n&&this.removeFragment(s.body));const o=s.range[e];o&&(0!==o.time.length?o.time.some((e=>{const n=!this.isTimeBuffered(e.startPTS,e.endPTS,t);return n&&this.removeFragment(s.body),n})):this.removeFragment(s.body))}))}detectPartialFragments(e){const t=this.timeRanges;if(!t||"initSegment"===e.frag.sn)return;const n=e.frag,i=It(n),r=this.fragments[i];if(!r||r.buffered&&n.gap)return;const a=!n.relurl;if(Object.keys(t).forEach((i=>{const s=n.elementaryStreams[i];if(!s)return;const o=t[i],l=a||!0===s.partial;r.range[i]=this.getBufferedTimes(n,e.part,l,o)})),r.loaded=null,Object.keys(r.range).length){r.buffered=!0;(r.body.endList=n.endList||r.body.endList)&&(this.endListFragments[r.body.type]=r),Dt(r)||this.removeParts(n.sn-1,n.type)}else this.removeFragment(r.body)}removeParts(e,t){const n=this.activePartLists[t];n&&(this.activePartLists[t]=Rt(n,(t=>t.fragment.sn>=e)))}fragBuffered(e,t){const n=It(e);let i=this.fragments[n];!i&&t&&(i=this.fragments[n]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),i&&(i.loaded=null,i.buffered=!0)}getBufferedTimes(e,t,n,i){const r={time:[],partial:n},a=e.start,s=e.end,o=e.minEndPTS||s,l=e.maxStartPTS||a;for(let e=0;e<i.length;e++){const t=i.start(e)-this.bufferPadding,n=i.end(e)+this.bufferPadding;if(l>=t&&o<=n){r.time.push({startPTS:Math.max(a,i.start(e)),endPTS:Math.min(s,i.end(e))});break}if(a<n&&s>t){const t=Math.max(a,i.start(e)),n=Math.min(s,i.end(e));n>t&&(r.partial=!0,r.time.push({startPTS:t,endPTS:n}))}else if(s<=t)break}return r}getPartialFragment(e){let t,n,i,r=null,a=0;const{bufferPadding:s,fragments:o}=this;return Object.keys(o).forEach((l=>{const c=o[l];c&&Dt(c)&&(n=c.body.start-s,i=c.body.end+s,e>=n&&e<=i&&(t=Math.min(e-n,i-e),a<=t&&(r=c.body,a=t)))})),r}isEndListAppended(e){const t=this.endListFragments[e];return void 0!==t&&(t.buffered||Dt(t))}getState(e){const t=It(e),n=this.fragments[t];return n?n.buffered?Dt(n)?At:Mt:Tt:Ct}isTimeBuffered(e,t,n){let i,r;for(let a=0;a<n.length;a++){if(i=n.start(a)-this.bufferPadding,r=n.end(a)+this.bufferPadding,e>=i&&t<=r)return!0;if(t<=i)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if("initSegment"===t.frag.sn||t.frag.bitrateTest)return;const n=t.frag,i=t.part?null:t,r=It(n);this.fragments[r]={body:n,appendedPTS:null,loaded:i,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:n,part:i,timeRanges:r,type:a}=t;if("initSegment"===n.sn)return;const s=n.type;if(i){let e=this.activePartLists[s];e||(this.activePartLists[s]=e=[]),e.push(i)}this.timeRanges=r;const o=r[a];this.detectEvictedFragments(a,o,s,i)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=It(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,n=Object.keys(t);if(!e)return n.length>0;for(let i=n.length;i--;){const r=t[n[i]];if((null==r?void 0:r.body.type)===e)return!0}return!1}hasParts(e){var t;return!(null==(t=this.activePartLists[e])||!t.length)}removeFragmentsInRange(e,t,n,i,r){i&&!this.hasGaps||Object.keys(this.fragments).forEach((a=>{const s=this.fragments[a];if(!s)return;const o=s.body;o.type!==n||i&&!o.gap||o.start<t&&o.end>e&&(s.buffered||r)&&this.removeFragment(o)}))}removeFragment(e){const t=It(e);e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const t=e.sn;this.activePartLists[e.type]=Rt(n,(e=>e.fragment.sn!==t))}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e,t;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const n=null==(e=this.hls)||null==(t=e.latestLevelDetails)?void 0:t.partList;n&&n.forEach((e=>e.clearElementaryStreamInfo()))}}function Dt(e){var t,n,i;return e.buffered&&(e.body.gap||(null==(t=e.range.video)?void 0:t.partial)||(null==(n=e.range.audio)?void 0:n.partial)||(null==(i=e.range.audiovideo)?void 0:i.partial))}function It(e){return`${e.type}_${e.level}_${e.sn}`}function Rt(e,t){return e.filter((e=>{const n=t(e);return n||e.clearElementaryStreamInfo(),n}))}var Pt=0,Ot=1;class Nt{constructor(e,t,n){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=n}decrypt(e,t){switch(this.aesMode){case Pt:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case Ot:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},t,e);default:throw new Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}}class Bt{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),n=new Uint32Array(4);for(let e=0;e<4;e++)n[e]=t.getUint32(4*e);return n}initTable(){const e=this.sBox,t=this.invSBox,n=this.subMix,i=n[0],r=n[1],a=n[2],s=n[3],o=this.invSubMix,l=o[0],c=o[1],u=o[2],d=o[3],h=new Uint32Array(256);let p=0,f=0,m=0;for(m=0;m<256;m++)h[m]=m<128?m<<1:m<<1^283;for(m=0;m<256;m++){let n=f^f<<1^f<<2^f<<3^f<<4;n=n>>>8^255&n^99,e[p]=n,t[n]=p;const o=h[p],m=h[o],g=h[m];let v=257*h[n]^16843008*n;i[p]=v<<24|v>>>8,r[p]=v<<16|v>>>16,a[p]=v<<8|v>>>24,s[p]=v,v=16843009*g^65537*m^257*o^16843008*p,l[n]=v<<24|v>>>8,c[n]=v<<16|v>>>16,u[n]=v<<8|v>>>24,d[n]=v,p?(p=o^h[h[h[g^o]]],f^=h[h[f]]):p=f=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let n=!0,i=0;for(;i<t.length&&n;)n=t[i]===this.key[i],i++;if(n)return;this.key=t;const r=this.keySize=t.length;if(4!==r&&6!==r&&8!==r)throw new Error("Invalid aes key size="+r);const a=this.ksRows=4*(r+6+1);let s,o;const l=this.keySchedule=new Uint32Array(a),c=this.invKeySchedule=new Uint32Array(a),u=this.sBox,d=this.rcon,h=this.invSubMix,p=h[0],f=h[1],m=h[2],g=h[3];let v,b;for(s=0;s<a;s++)s<r?v=l[s]=t[s]:(b=v,s%r==0?(b=b<<8|b>>>24,b=u[b>>>24]<<24|u[b>>>16&255]<<16|u[b>>>8&255]<<8|u[255&b],b^=d[s/r|0]<<24):r>6&&s%r==4&&(b=u[b>>>24]<<24|u[b>>>16&255]<<16|u[b>>>8&255]<<8|u[255&b]),l[s]=v=(l[s-r]^b)>>>0);for(o=0;o<a;o++)s=a-o,b=3&o?l[s]:l[s-4],c[o]=o<4||s<=4?b:p[u[b>>>24]]^f[u[b>>>16&255]]^m[u[b>>>8&255]]^g[u[255&b]],c[o]=c[o]>>>0}networkToHostOrderSwap(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24}decrypt(e,t,n){const i=this.keySize+6,r=this.invKeySchedule,a=this.invSBox,s=this.invSubMix,o=s[0],l=s[1],c=s[2],u=s[3],d=this.uint8ArrayToUint32Array_(n);let h=d[0],p=d[1],f=d[2],m=d[3];const g=new Int32Array(e),v=new Int32Array(g.length);let b,y,_,w,x,k,S,E,C,T,A,M,L,D;const I=this.networkToHostOrderSwap;for(;t<g.length;){for(C=I(g[t]),T=I(g[t+1]),A=I(g[t+2]),M=I(g[t+3]),x=C^r[0],k=M^r[1],S=A^r[2],E=T^r[3],L=4,D=1;D<i;D++)b=o[x>>>24]^l[k>>16&255]^c[S>>8&255]^u[255&E]^r[L],y=o[k>>>24]^l[S>>16&255]^c[E>>8&255]^u[255&x]^r[L+1],_=o[S>>>24]^l[E>>16&255]^c[x>>8&255]^u[255&k]^r[L+2],w=o[E>>>24]^l[x>>16&255]^c[k>>8&255]^u[255&S]^r[L+3],x=b,k=y,S=_,E=w,L+=4;b=a[x>>>24]<<24^a[k>>16&255]<<16^a[S>>8&255]<<8^a[255&E]^r[L],y=a[k>>>24]<<24^a[S>>16&255]<<16^a[E>>8&255]<<8^a[255&x]^r[L+1],_=a[S>>>24]<<24^a[E>>16&255]<<16^a[x>>8&255]<<8^a[255&k]^r[L+2],w=a[E>>>24]<<24^a[x>>16&255]<<16^a[k>>8&255]<<8^a[255&S]^r[L+3],v[t]=I(b^h),v[t+1]=I(w^p),v[t+2]=I(_^f),v[t+3]=I(y^m),h=C,p=T,f=A,m=M,t+=4}return v.buffer}}class $t{constructor(e,t,n){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=e,this.key=t,this.aesMode=n}expandKey(){const e=function(e){switch(e){case Pt:return"AES-CBC";case Ot:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${e}`)}}(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}class Ft{constructor(e,{removePKCS7Padding:t=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.enableSoftwareAES=void 0,this.enableSoftwareAES=e.enableSoftwareAES,this.removePKCS7Padding=t,t)try{const e=self.crypto;e&&(this.subtle=e.subtle||e.webkitSubtle)}catch(e){}this.useSoftware=!this.subtle}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:e,remainderData:t}=this;if(!e||t)return this.reset(),null;const n=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?function(e){const t=e.byteLength,n=t&&new DataView(e.buffer).getUint8(t-1);return n?e.slice(0,t-n):e}(n):n}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,n,i){return this.useSoftware?new Promise(((r,a)=>{const s=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(s,t,n,i);const o=this.flush();o?r(o.buffer):a(new Error("[softwareDecrypt] Failed to decrypt data"))})):this.webCryptoDecrypt(new Uint8Array(e),t,n,i)}softwareDecrypt(e,t,n,i){const{currentIV:r,currentResult:a,remainderData:s}=this;if(i!==Pt||16!==t.byteLength)return A.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),s&&(e=me(s,e),this.remainderData=null);const o=this.getValidChunk(e);if(!o.length)return null;r&&(n=r);let l=this.softwareDecrypter;l||(l=this.softwareDecrypter=new Bt),l.expandKey(t);const c=a;return this.currentResult=l.decrypt(o.buffer,0,n),this.currentIV=o.slice(-16).buffer,c||null}webCryptoDecrypt(e,t,n,i){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,n,i));this.key=t,this.fastAesKey=new $t(this.subtle,t,i)}return this.fastAesKey.expandKey().then((t=>{if(!this.subtle)return Promise.reject(new Error("web crypto not initialized"));this.logOnce("WebCrypto AES decrypt");return new Nt(this.subtle,new Uint8Array(n),i).decrypt(e.buffer,t)})).catch((r=>(A.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${r.name}: ${r.message}`),this.onWebCryptoError(e,t,n,i))))}onWebCryptoError(e,t,n,i){const r=this.enableSoftwareAES;if(r){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n,i);const r=this.flush();if(r)return r.buffer}throw new Error("WebCrypto"+(r?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let t=e;const n=e.length-e.length%16;return n!==e.length&&(t=e.slice(0,n),this.remainderData=e.slice(n)),t}logOnce(e){this.logEnabled&&(A.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const zt=Math.pow(2,17);class Kt{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,t){const n=e.url;if(!n)return Promise.reject(new qt({type:s.NETWORK_ERROR,details:o.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error("Fragment does not have a "+(n?"part list":"url")),networkDetails:null}));this.abort();const i=this.config,r=i.fLoader,a=i.loader;return new Promise(((l,c)=>{if(this.loader&&this.loader.destroy(),e.gap){if(e.tagList.some((e=>"GAP"===e[0])))return void c(jt(e));e.gap=!1}const u=this.loader=r?new r(i):new a(i),d=Ut(e);e.loader=u;const h=gt(i.fragLoadPolicy.default),p={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:"initSegment"===e.sn?1/0:zt};e.stats=u.stats;const f={onSuccess:(t,n,i,r)=>{this.resetLoader(e,u);let a=t.data;i.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(a.slice(0,16)),a=a.slice(16)),l({frag:e,part:null,payload:a,networkDetails:r})},onError:(t,i,r,a)=>{this.resetLoader(e,u),c(new qt({type:s.NETWORK_ERROR,details:o.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:w({url:n,data:void 0},t),error:new Error(`HTTP Error ${t.code} ${t.text}`),networkDetails:r,stats:a}))},onAbort:(t,n,i)=>{this.resetLoader(e,u),c(new qt({type:s.NETWORK_ERROR,details:o.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:i,stats:t}))},onTimeout:(t,n,i)=>{this.resetLoader(e,u),c(new qt({type:s.NETWORK_ERROR,details:o.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${p.timeout}ms`),networkDetails:i,stats:t}))}};t&&(f.onProgress=(n,i,r,a)=>t({frag:e,part:null,payload:r,networkDetails:a})),u.load(d,p,f)}))}loadPart(e,t,n){this.abort();const i=this.config,r=i.fLoader,a=i.loader;return new Promise(((l,c)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap)return void c(jt(e,t));const u=this.loader=r?new r(i):new a(i),d=Ut(e,t);e.loader=u;const h=gt(i.fragLoadPolicy.default),p={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:zt};t.stats=u.stats,u.load(d,p,{onSuccess:(i,r,a,s)=>{this.resetLoader(e,u),this.updateStatsFromPart(e,t);const o={frag:e,part:t,payload:i.data,networkDetails:s};n(o),l(o)},onError:(n,i,r,a)=>{this.resetLoader(e,u),c(new qt({type:s.NETWORK_ERROR,details:o.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:w({url:d.url,data:void 0},n),error:new Error(`HTTP Error ${n.code} ${n.text}`),networkDetails:r,stats:a}))},onAbort:(n,i,r)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,u),c(new qt({type:s.NETWORK_ERROR,details:o.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:r,stats:n}))},onTimeout:(n,i,r)=>{this.resetLoader(e,u),c(new qt({type:s.NETWORK_ERROR,details:o.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${p.timeout}ms`),networkDetails:r,stats:n}))}})}))}updateStatsFromPart(e,t){const n=e.stats,i=t.stats,r=i.total;if(n.loaded+=i.loaded,r){const i=Math.round(e.duration/t.duration),a=Math.min(Math.round(n.loaded/r),i),s=(i-a)*Math.round(n.loaded/a);n.total=n.loaded+s}else n.total=Math.max(n.loaded,n.total);const a=n.loading,s=i.loading;a.start?a.first+=s.first-s.start:(a.start=s.start,a.first=s.first),a.end=s.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function Ut(e,t=null){const n=t||e,r={frag:e,part:t,responseType:"arraybuffer",url:n.url,headers:{},rangeStart:0,rangeEnd:0},a=n.byteRangeStartOffset,s=n.byteRangeEndOffset;if(i(a)&&i(s)){var o;let t=a,n=s;if("initSegment"===e.sn&&("AES-128"===(l=null==(o=e.decryptdata)?void 0:o.method)||"AES-256"===l)){const e=s-a;e%16&&(n=s+(16-e%16)),0!==a&&(r.resetIV=!0,t=a-16)}r.rangeStart=t,r.rangeEnd=n}var l;return r}function jt(e,t){const n=new Error(`GAP ${e.gap?"tag":"attribute"} found`),i={type:s.MEDIA_ERROR,details:o.FRAG_GAP,fatal:!1,frag:e,error:n,networkDetails:null};return t&&(i.part=t),(t||e).stats.aborted=!0,new qt(i)}class qt extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Ht extends x{constructor(e,t){super(e,t),this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return!this._tickInterval&&(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)}clearNextTick(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)}tick(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}class Vt{constructor(e,t,n,i=0,r=-1,a=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing={start:0,executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}},this.level=e,this.sn=t,this.id=n,this.size=i,this.part=r,this.partial=a}}const Gt={length:0,start:()=>0,end:()=>0};class Zt{static isBuffered(e,t){if(e){const n=Zt.getBuffered(e);for(let e=n.length;e--;)if(t>=n.start(e)&&t<=n.end(e))return!0}return!1}static bufferedRanges(e){if(e){const t=Zt.getBuffered(e);return Zt.timeRangesToArray(t)}return[]}static timeRangesToArray(e){const t=[];for(let n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}static bufferInfo(e,t,n){if(e){const i=Zt.bufferedRanges(e);if(i.length)return Zt.bufferedInfo(i,t,n)}return{len:0,start:t,end:t,bufferedIndex:-1}}static bufferedInfo(e,t,n){t=Math.max(0,t),e.length>1&&e.sort(((e,t)=>e.start-t.start||t.end-e.end));let i=-1,r=[];if(n)for(let a=0;a<e.length;a++){t>=e[a].start&&t<=e[a].end&&(i=a);const s=r.length;if(s){const t=r[s-1].end;e[a].start-t<n?e[a].end>t&&(r[s-1].end=e[a].end):r.push(e[a])}else r.push(e[a])}else r=e;let a,s=0,o=t,l=t;for(let e=0;e<r.length;e++){const c=r[e].start,u=r[e].end;if(-1===i&&t>=c&&t<=u&&(i=e),t+n>=c&&t<u)o=c,l=u,s=l-t;else if(t+n<c){a=c;break}}return{len:s,start:o||0,end:l||0,nextStart:a,buffered:e,bufferedIndex:i}}static getBuffered(e){try{return e.buffered||Gt}catch(e){return A.log("failed to get media.buffered",e),Gt}}}const Wt=/\{\$([a-zA-Z0-9-_]+)\}/g;function Yt(e){return Wt.test(e)}function Xt(e,t){if(null!==e.variableList||e.hasVariableRefs){const n=e.variableList;return t.replace(Wt,(t=>{const i=t.substring(2,t.length-1),r=null==n?void 0:n[i];return void 0===r?(e.playlistParsingError||(e.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),t):r}))}return t}function Jt(e,t,n){let i,r,a=e.variableList;if(a||(e.variableList=a={}),"QUERYPARAM"in t){i=t.QUERYPARAM;try{const e=new self.URL(n).searchParams;if(!e.has(i))throw new Error(`"${i}" does not match any query parameter in URI: "${n}"`);r=e.get(i)}catch(t){e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${t.message}`))}}else i=t.NAME,r=t.VALUE;i in a?e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):a[i]=r||""}function Qt(e,t,n){const i=t.IMPORT;if(n&&i in n){let t=e.variableList;t||(e.variableList=t={}),t[i]=n[i]}else e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${i}"`))}const en=/^(\d+)x(\d+)$/,tn=/(.+?)=(".*?"|.*?)(?:,|$)/g;class nn{constructor(e,t){"string"==typeof e&&(e=nn.parseAttrList(e,t)),y(this,e)}get clientAttrs(){return Object.keys(this).filter((e=>"X-"===e.substring(0,2)))}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;const n=new Uint8Array(t.length/2);for(let e=0;e<t.length/2;e++)n[e]=parseInt(t.slice(2*e,2*e+2),16);return n}return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const n=this[e];return n?parseFloat(n):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){const n=this[e];return(n?n.split(/[ ,]+/):[]).reduce(((e,t)=>(e[t.toLowerCase()]=!0,e)),t)}bool(e){return"YES"===this[e]}decimalResolution(e){const t=en.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let n;const i={};for(tn.lastIndex=0;null!==(n=tn.exec(e));){const r=n[1].trim();let a=n[2];const s=0===a.indexOf('"')&&a.lastIndexOf('"')===a.length-1;let o=!1;if(s)a=a.slice(1,-1);else switch(r){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":o=!0}if(t&&(s||o))a=Xt(t,a);else if(!o&&!s)switch(r){case"CLOSED-CAPTIONS":if("NONE"===a)break;case"ALLOWED-CPC":case"CLASS":case"ASSOC-LANGUAGE":case"AUDIO":case"BYTERANGE":case"CHANNELS":case"CHARACTERISTICS":case"CODECS":case"DATA-ID":case"END-DATE":case"GROUP-ID":case"ID":case"IMPORT":case"INSTREAM-ID":case"KEYFORMAT":case"KEYFORMATVERSIONS":case"LANGUAGE":case"NAME":case"PATHWAY-ID":case"QUERYPARAM":case"RECENTLY-REMOVED-DATERANGES":case"SERVER-URI":case"STABLE-RENDITION-ID":case"STABLE-VARIANT-ID":case"START-DATE":case"SUBTITLES":case"SUPPLEMENTAL-CODECS":case"URI":case"VALUE":case"VIDEO":case"X-ASSET-LIST":case"X-ASSET-URI":A.warn(`${e}: attribute ${r} is missing quotes`)}i[r]=a}return i}}function rn(e){return"SCTE35-OUT"===e||"SCTE35-IN"===e||"SCTE35-CMD"===e}class an{constructor(e,t,n=0){var r;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=(null==t?void 0:t.tagAnchor)||null,this.tagOrder=null!=(r=null==t?void 0:t.tagOrder)?r:n,t){const n=t.attr;for(const t in n)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==n[t]){A.warn(`DATERANGE tag attribute: "${t}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=t;break}e=y(new nn({}),n,e)}if(this.attr=e,t?(this._startDate=t._startDate,this._cue=t._cue,this._endDate=t._endDate,this._dateAtEnd=t._dateAtEnd):this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const e=(null==t?void 0:t.endDate)||new Date(this.attr["END-DATE"]);i(e.getTime())&&(this._endDate=e)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const e=this._cue;return void 0===e?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):e}get startTime(){const{tagAnchor:e}=this;return null===e||null===e.programDateTime?(A.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${e}`),NaN):e.start+(this.startDate.getTime()-e.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){const e=this._endDate||this._dateAtEnd;if(e)return e;const t=this.duration;return null!==t?this._dateAtEnd=new Date(this._startDate.getTime()+1e3*t):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(i(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isInterstitial(){return"com.apple.hls.interstitial"===this.class}get isValid(){return!!this.id&&!this._badValueForSameId&&i(this.startDate.getTime())&&(null===this.duration||this.duration>=0)&&(!this.endOnNext||!!this.class)&&(!this.attr.CUE||!this.cue.pre&&!this.cue.post||this.cue.pre!==this.cue.post)&&(!this.isInterstitial||"X-ASSET-URI"in this.attr||"X-ASSET-LIST"in this.attr)}}class sn{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.dateRangeTagCount=0,this.live=!0,this.requestScheduled=-1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.appliedTimelineOffset=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e)return this.advanced=!0,void(this.updated=!0);const t=this.lastPartSn-e.lastPartSn,n=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!n||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||0===t&&n>0,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1}get hasProgramDateTime(){return!!this.fragments.length&&i(this.fragments[this.fragments.length-1].programDateTime)}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||10}get drift(){const e=this.driftEndTime-this.driftStartTime;if(e>0){return 1e3*(this.driftEnd-this.driftStart)/e}return 1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return null!=(e=this.fragments)&&e.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){var e;return null!=(e=this.fragments)&&e.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const e=this.partList;if(e){const t=this.lastPartIndex;if(-1!==t){for(let n=e.length;n--;)if(e[n].index>t)return e[n].index;return t}}return 0}get lastPartSn(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const e=this.partEnd-this.fragmentStart;return this.age>Math.max(e,this.totalduration)+this.levelTargetDuration}return!1}}function on(e){return"AES-128"===e||"AES-256"===e||"AES-256-CTR"===e}function ln(e){switch(e){case"AES-128":case"AES-256":return Pt;case"AES-256-CTR":return Ot;default:throw new Error(`invalid full segment method ${e}`)}}function cn(e){return Uint8Array.from(atob(e),(e=>e.charCodeAt(0)))}function un(e){return Uint8Array.from(unescape(encodeURIComponent(e)),(e=>e.charCodeAt(0)))}function dn(e){const t=e.split(":");let n=null;if("data"===t[0]&&2===t.length){const e=t[1].split(";"),i=e[e.length-1].split(",");if(2===i.length){const t="base64"===i[0],r=i[1];t?(e.splice(-1,1),n=cn(r)):n=function(e){const t=un(e).subarray(0,16),n=new Uint8Array(16);return n.set(t,16-t.length),n}(r)}}return n}const hn="undefined"!=typeof self?self:void 0;var pn={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},fn="org.w3.clearkey",mn="com.apple.streamingkeydelivery",gn="com.microsoft.playready",vn="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";function bn(e){switch(e){case mn:return pn.FAIRPLAY;case gn:return pn.PLAYREADY;case vn:return pn.WIDEVINE;case fn:return pn.CLEARKEY}}var yn="1077efecc0b24d02ace33c1e52e2fb4b",_n="e2719d58a985b3c9781ab030af78d30e",wn="9a04f07998404286ab92e65be0885f95",xn="edef8ba979d64acea3c827dcd51d21ed";function kn(e){return e===xn?pn.WIDEVINE:e===wn?pn.PLAYREADY:e===yn||e===_n?pn.CLEARKEY:void 0}function Sn(e){switch(e){case pn.FAIRPLAY:return mn;case pn.PLAYREADY:return gn;case pn.WIDEVINE:return vn;case pn.CLEARKEY:return fn}}function En(e){const{drmSystems:t,widevineLicenseUrl:n}=e,i=t?[pn.FAIRPLAY,pn.WIDEVINE,pn.PLAYREADY,pn.CLEARKEY].filter((e=>!!t[e])):[];return!i[pn.WIDEVINE]&&n&&i.push(pn.WIDEVINE),i}const Cn=null!=hn&&null!=(Tn=hn.navigator)&&Tn.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;var Tn;function An(e){const t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),n=String.fromCharCode.apply(null,Array.from(t)),i=n.substring(n.indexOf("<"),n.length),r=(new DOMParser).parseFromString(i,"text/xml").getElementsByTagName("KID")[0];if(r){const e=r.childNodes[0]?r.childNodes[0].nodeValue:r.getAttribute("VALUE");if(e){const t=cn(e).subarray(0,16);return function(e){const t=function(e,t,n){const i=e[t];e[t]=e[n],e[n]=i};t(e,0,3),t(e,1,2),t(e,4,5),t(e,6,7)}(t),t}}return null}let Mn={};class Ln{static clearKeyUriToKeyIdMap(){Mn={}}constructor(e,t,n,i=[1],r=null){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=n,this.keyFormatVersions=i,this.iv=r,this.encrypted=!!e&&"NONE"!==e,this.isCommonEncryption=this.encrypted&&!on(e)}isSupported(){if(this.method){if(on(this.method)||"NONE"===this.method)return!0;if("identity"===this.keyFormat)return"SAMPLE-AES"===this.method;switch(this.keyFormat){case mn:case vn:case gn:case fn:return-1!==["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if(on(this.method)&&this.uri&&!this.iv){"number"!=typeof e&&(A.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const t=function(e){const t=new Uint8Array(16);for(let n=12;n<16;n++)t[n]=e>>8*(15-n)&255;return t}(e);return new Ln(this.method,this.uri,"identity",this.keyFormatVersions,t)}const t=dn(this.uri);if(t)switch(this.keyFormat){case vn:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case gn:{const e=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=we(e,0,t),this.keyId=An(t);break}default:{let e=t.subarray(0,16);if(16!==e.length){const t=new Uint8Array(16);t.set(e,16-e.length),e=t}this.keyId=e;break}}if(!this.keyId||16!==this.keyId.byteLength){let e=Mn[this.uri];if(!e){const t=Object.keys(Mn).length%Number.MAX_SAFE_INTEGER;e=new Uint8Array(16);new DataView(e.buffer,12,4).setUint32(0,t),Mn[this.uri]=e}this.keyId=e}return this}}const Dn=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,In=/#EXT-X-MEDIA:(.*)/g,Rn=/^#EXT(?:INF|-X-TARGETDURATION):/m,Pn=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),On=new RegExp([/#EXT-X-(PROGRAM-DATE-TIME|BYTERANGE|DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class Nn{static findGroup(e,t){for(let n=0;n<e.length;n++){const i=e[n];if(i.id===t)return i}}static resolve(e,t){return K.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return Rn.test(e)}static parseMasterPlaylist(e,t){const n={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:Yt(e)},i=[];let r;for(Dn.lastIndex=0;null!=(r=Dn.exec(e));)if(r[1]){var a;const e=new nn(r[1],n),s=Xt(n,r[2]),o={attrs:e,bitrate:e.decimalInteger("BANDWIDTH")||e.decimalInteger("AVERAGE-BANDWIDTH"),name:e.NAME,url:Nn.resolve(s,t)},l=e.decimalResolution("RESOLUTION");l&&(o.width=l.width,o.height=l.height),Kn(e.CODECS,o);const c=e["SUPPLEMENTAL-CODECS"];c&&(o.supplemental={},Kn(c,o.supplemental)),null!=(a=o.unknownCodecs)&&a.length||i.push(o),n.levels.push(o)}else if(r[3]){const e=r[3],i=r[4];switch(e){case"SESSION-DATA":{const e=new nn(i,n),t=e["DATA-ID"];t&&(null===n.sessionData&&(n.sessionData={}),n.sessionData[t]=e);break}case"SESSION-KEY":{const e=Fn(i,t,n);e.encrypted&&e.isSupported()?(null===n.sessionKeys&&(n.sessionKeys=[]),n.sessionKeys.push(e)):A.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${i}"`);break}case"DEFINE":Jt(n,new nn(i,n),t);break;case"CONTENT-STEERING":{const e=new nn(i,n);n.contentSteering={uri:Nn.resolve(e["SERVER-URI"],t),pathwayId:e["PATHWAY-ID"]||"."};break}case"START":n.startTimeOffset=zn(i)}}const s=i.length>0&&i.length<n.levels.length;return n.levels=s?i:n.levels,0===n.levels.length&&(n.playlistParsingError=new Error("no levels found in manifest")),n}static parseMasterPlaylistMedia(e,t,n){let i;const r={},a=n.levels,s={AUDIO:a.map((e=>({id:e.attrs.AUDIO,audioCodec:e.audioCodec}))),SUBTITLES:a.map((e=>({id:e.attrs.SUBTITLES,textCodec:e.textCodec}))),"CLOSED-CAPTIONS":[]};let o=0;for(In.lastIndex=0;null!==(i=In.exec(e));){const e=new nn(i[1],n),a=e.TYPE;if(a){const n=s[a],i=r[a]||[];r[a]=i;const l=e.LANGUAGE,c=e["ASSOC-LANGUAGE"],u=e.CHANNELS,d=e.CHARACTERISTICS,h=e["INSTREAM-ID"],p={attrs:e,bitrate:0,id:o++,groupId:e["GROUP-ID"]||"",name:e.NAME||l||"",type:a,default:e.bool("DEFAULT"),autoselect:e.bool("AUTOSELECT"),forced:e.bool("FORCED"),lang:l,url:e.URI?Nn.resolve(e.URI,t):""};if(c&&(p.assocLang=c),u&&(p.channels=u),d&&(p.characteristics=d),h&&(p.instreamId=h),null!=n&&n.length){const e=Nn.findGroup(n,p.groupId)||n[0];Un(p,e,"audioCodec"),Un(p,e,"textCodec")}i.push(p)}}return r}static parseLevelPlaylist(e,t,n,r,a,s){var o;const l={url:t},c=new sn(t),u=c.fragments,d=[];let h,p,f,m,g=null,v=0,b=0,_=0,w=0,x=0,k=null,S=new Z(r,l),E=-1,C=!1,T=null;if(Pn.lastIndex=0,c.m3u8=e,c.hasVariableRefs=Yt(e),"#EXTM3U"!==(null==(o=Pn.exec(e))?void 0:o[0]))return c.playlistParsingError=new Error("Missing format identifier #EXTM3U"),c;for(;null!==(h=Pn.exec(e));){C&&(C=!1,S=new Z(r,l),S.playlistOffset=_,S.start=_,S.sn=v,S.cc=w,x&&(S.bitrate=x),S.level=n,g&&(S.initSegment=g,g.rawProgramDateTime&&(S.rawProgramDateTime=g.rawProgramDateTime,g.rawProgramDateTime=null),T&&(S.setByteRange(T),T=null)));const e=h[1];if(e){S.duration=parseFloat(e);const t=(" "+h[2]).slice(1);S.title=t||null,S.tagList.push(t?["INF",e,t]:["INF",e])}else if(h[3]){if(i(S.duration)){S.playlistOffset=_,S.start=_,f&&Hn(S,f,c),S.sn=v,S.level=n,S.cc=w,u.push(S);const e=(" "+h[3]).slice(1);S.relurl=Xt(c,e),jn(S,k,d),k=S,_+=S.duration,v++,b=0,C=!0}}else{if(h=h[0].match(On),!h){A.warn("No matches on slow regex match for level playlist!");continue}for(p=1;p<h.length&&void 0===h[p];p++);const e=(" "+h[p]).slice(1),a=(" "+h[p+1]).slice(1),o=h[p+2]?(" "+h[p+2]).slice(1):null;switch(e){case"BYTERANGE":k?S.setByteRange(a,k):S.setByteRange(a);break;case"PROGRAM-DATE-TIME":S.rawProgramDateTime=a,S.tagList.push(["PROGRAM-DATE-TIME",a]),-1===E&&(E=u.length);break;case"PLAYLIST-TYPE":c.type&&Vn(c,e,h),c.type=a.toUpperCase();break;case"MEDIA-SEQUENCE":0!==c.startSN?Vn(c,e,h):u.length>0&&Gn(c,e,h),v=c.startSN=parseInt(a);break;case"SKIP":{c.skippedSegments&&Vn(c,e,h);const t=new nn(a,c),n=t.decimalInteger("SKIPPED-SEGMENTS");if(i(n)){c.skippedSegments+=n;for(let e=n;e--;)u.push(null);v+=n}const r=t.enumeratedString("RECENTLY-REMOVED-DATERANGES");r&&(c.recentlyRemovedDateranges=(c.recentlyRemovedDateranges||[]).concat(r.split("\t")));break}case"TARGETDURATION":0!==c.targetduration&&Vn(c,e,h),c.targetduration=Math.max(parseInt(a),1);break;case"VERSION":null!==c.version&&Vn(c,e,h),c.version=parseInt(a);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":c.live||Vn(c,e,h),c.live=!1;break;case"#":(a||o)&&S.tagList.push(o?[a,o]:[a]);break;case"DISCONTINUITY":w++,S.tagList.push(["DIS"]);break;case"GAP":S.gap=!0,S.tagList.push([e]);break;case"BITRATE":S.tagList.push([e,a]),x=1e3*parseInt(a),i(x)?S.bitrate=x:x=0;break;case"DATERANGE":{const e=new nn(a,c),t=new an(e,c.dateRanges[e.ID],c.dateRangeTagCount);c.dateRangeTagCount++,t.isValid||c.skippedSegments?c.dateRanges[t.id]=t:A.warn(`Ignoring invalid DATERANGE tag: "${a}"`),S.tagList.push(["EXT-X-DATERANGE",a]);break}case"DEFINE":{const e=new nn(a,c);"IMPORT"in e?Qt(c,e,s):Jt(c,e,t)}break;case"DISCONTINUITY-SEQUENCE":0!==c.startCC?Vn(c,e,h):u.length>0&&Gn(c,e,h),c.startCC=w=parseInt(a);break;case"KEY":{const e=Fn(a,t,c);if(e.isSupported()){if("NONE"===e.method){f=void 0;break}f||(f={}),f[e.keyFormat]&&(f=y({},f)),f[e.keyFormat]=e}else A.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${a}"`);break}case"START":c.startTimeOffset=zn(a);break;case"MAP":{const e=new nn(a,c);if(S.duration){const t=new Z(r,l);qn(t,e,n,f),g=t,S.initSegment=g,g.rawProgramDateTime&&!S.rawProgramDateTime&&(S.rawProgramDateTime=g.rawProgramDateTime)}else{const t=S.byteRangeEndOffset;if(t){const e=S.byteRangeStartOffset;T=`${t-e}@${e}`}else T=null;qn(S,e,n,f),g=S,C=!0}g.cc=w;break}case"SERVER-CONTROL":m&&Vn(c,e,h),m=new nn(a),c.canBlockReload=m.bool("CAN-BLOCK-RELOAD"),c.canSkipUntil=m.optionalFloat("CAN-SKIP-UNTIL",0),c.canSkipDateRanges=c.canSkipUntil>0&&m.bool("CAN-SKIP-DATERANGES"),c.partHoldBack=m.optionalFloat("PART-HOLD-BACK",0),c.holdBack=m.optionalFloat("HOLD-BACK",0);break;case"PART-INF":{c.partTarget&&Vn(c,e,h);const t=new nn(a);c.partTarget=t.decimalFloatingPoint("PART-TARGET");break}case"PART":{let e=c.partList;e||(e=c.partList=[]);const t=b>0?e[e.length-1]:void 0,n=b++,i=new nn(a,c),r=new W(i,S,l,n,t);e.push(r),S.duration+=r.duration;break}case"PRELOAD-HINT":{const e=new nn(a,c);c.preloadHint=e;break}case"RENDITION-REPORT":{const e=new nn(a,c);c.renditionReports=c.renditionReports||[],c.renditionReports.push(e);break}default:A.warn(`line parsed but not handled: ${h}`)}}}k&&!k.relurl?(u.pop(),_-=k.duration,c.partList&&(c.fragmentHint=k)):c.partList&&(jn(S,k,d),S.cc=w,c.fragmentHint=S,f&&Hn(S,f,c)),c.targetduration||(c.playlistParsingError=new Error("#EXT-X-TARGETDURATION is required"));const M=u.length,L=u[0],D=u[M-1];if(_+=c.skippedSegments*c.targetduration,_>0&&M&&D){c.averagetargetduration=_/M;const e=D.sn;c.endSN="initSegment"!==e?e:0,c.live||(D.endList=!0),L&&void 0===c.startCC&&(c.startCC=L.cc),E>0&&(!function(e,t){let n=e[t];for(let i=t;i--;){const t=e[i];if(!t)return;t.programDateTime=n.programDateTime-1e3*t.duration,n=t}}(u,E),L&&d.unshift(L))}else c.endSN=0,c.startCC=0;return c.fragmentHint&&(_+=c.fragmentHint.duration),c.totalduration=_,d.length&&c.dateRangeTagCount&&L&&Bn(d,c),c.endCC=w,c}}function Bn(e,t){const n=e.length;if(!n)return;const i=e[n-1],r=t.live?1/0:t.totalduration,a=Object.keys(t.dateRanges);for(let s=a.length;s--;){const o=t.dateRanges[a[s]],l=o.startDate.getTime();o.tagAnchor=i.ref;for(let i=n;i--;){const n=$n(t,l,e,i,r);if(-1!==n){o.tagAnchor=t.fragments[n].ref;break}}}}function $n(e,t,n,i,r){const a=n[i];if(a){const o=a.programDateTime;if(t>=o||0===i){var s;if(t<=o+1e3*(((null==(s=n[i+1])?void 0:s.start)||r)-a.start)){const r=n[i].sn-e.startSN,a=e.fragments;if(a.length>n.length){for(let s=(n[i+1]||a[a.length-1]).sn-e.startSN;s>r;s--){const e=a[s].programDateTime;if(t>=e&&t<e+1e3*a[s].duration)return s}}return r}}}return-1}function Fn(e,t,n){var i,r;const a=new nn(e,n),s=null!=(i=a.METHOD)?i:"",o=a.URI,l=a.hexadecimalInteger("IV"),c=a.KEYFORMATVERSIONS,u=null!=(r=a.KEYFORMAT)?r:"identity";o&&a.IV&&!l&&A.error(`Invalid IV: ${a.IV}`);const d=o?Nn.resolve(o,t):"",h=(c||"1").split("/").map(Number).filter(Number.isFinite);return new Ln(s,d,u,h,l)}function zn(e){const t=new nn(e).decimalFloatingPoint("TIME-OFFSET");return i(t)?t:null}function Kn(e,t){let n=(e||"").split(/[ ,]+/).filter((e=>e));["video","audio","text"].forEach((e=>{const i=n.filter((t=>Ee(t,e)));i.length&&(t[`${e}Codec`]=i.map((e=>e.split("/")[0])).join(","),n=n.filter((e=>-1===i.indexOf(e))))})),t.unknownCodecs=n}function Un(e,t,n){const i=t[n];i&&(e[n]=i)}function jn(e,t,n){e.rawProgramDateTime?n.push(e):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime)}function qn(e,t,n,i){e.relurl=t.URI,t.BYTERANGE&&e.setByteRange(t.BYTERANGE),e.level=n,e.sn="initSegment",i&&(e.levelkeys=i),e.initSegment=null}function Hn(e,t,n){e.levelkeys=t;const{encryptedFragments:i}=n;i.length&&i[i.length-1].levelkeys===t||!Object.keys(t).some((e=>t[e].isCommonEncryption))||i.push(e)}function Vn(e,t,n){e.playlistParsingError=new Error(`#EXT-X-${t} must not appear more than once (${n[0]})`)}function Gn(e,t,n){e.playlistParsingError=new Error(`#EXT-X-${t} must appear before the first Media Segment (${n[0]})`)}function Zn(e,t){const n=t.startPTS;if(i(n)){let i,r=0;t.sn>e.sn?(r=n-e.start,i=e):(r=e.start-n,i=t),i.duration!==r&&i.setDuration(r)}else if(t.sn>e.sn){e.cc===t.cc&&e.minEndPTS?t.setStart(e.start+(e.minEndPTS-e.start)):t.setStart(e.start+e.duration)}else t.setStart(Math.max(e.start-t.duration,0))}function Wn(e,t,n,r,a,s){r-n<=0&&(A.warn("Fragment should have a positive duration",t),r=n+t.duration,s=a+t.duration);let o=n,l=r;const c=t.startPTS,u=t.endPTS;if(i(c)){const e=Math.abs(c-n);i(t.deltaPTS)?t.deltaPTS=Math.max(e,t.deltaPTS):t.deltaPTS=e,o=Math.max(n,c),n=Math.min(n,c),a=Math.min(a,t.startDTS),l=Math.min(r,u),r=Math.max(r,u),s=Math.max(s,t.endDTS)}const d=n-t.start;0!==t.start&&t.setStart(n),t.setDuration(r-t.start),t.startPTS=n,t.maxStartPTS=o,t.startDTS=a,t.endPTS=r,t.minEndPTS=l,t.endDTS=s;const h=t.sn;if(!e||h<e.startSN||h>e.endSN)return 0;let p;const f=h-e.startSN,m=e.fragments;for(m[f]=t,p=f;p>0;p--)Zn(m[p],m[p-1]);for(p=f;p<m.length-1;p++)Zn(m[p],m[p+1]);return e.fragmentHint&&Zn(m[m.length-1],e.fragmentHint),e.PTSKnown=e.alignedSliding=!0,d}function Yn(e,t){if(e===t)return;let n=null;const r=e.fragments;for(let e=r.length-1;e>=0;e--){const t=r[e].initSegment;if(t){n=t;break}}let a;e.fragmentHint&&delete e.fragmentHint.endPTS,function(e,t,n){const i=t.skippedSegments,r=Math.max(e.startSN,t.startSN)-t.startSN,a=(e.fragmentHint?1:0)+(i?t.endSN:Math.min(e.endSN,t.endSN))-t.startSN,s=t.startSN-e.startSN,o=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments;for(let c=r;c<=a;c++){const r=l[s+c];let a=o[c];if(i&&!a&&r&&(a=t.fragments[c]=r),r&&a){if(n(r,a,c,o),r.url&&r.url!==a.url)return void(t.playlistParsingError=Xn(`media sequence mismatch ${a.sn}:`,e,t,r,a));if(r.cc!==a.cc)return void(t.playlistParsingError=Xn(`discontinuity sequence mismatch (${r.cc}!=${a.cc})`,e,t,r,a))}}}(e,t,((e,r,s,o)=>{if((!t.startCC||t.skippedSegments)&&r.cc!==e.cc){const n=e.cc-r.cc;for(let e=s;e<o.length;e++)o[e].cc+=n;t.endCC=o[o.length-1].cc}i(e.startPTS)&&i(e.endPTS)&&(r.setStart(r.startPTS=e.startPTS),r.startDTS=e.startDTS,r.maxStartPTS=e.maxStartPTS,r.endPTS=e.endPTS,r.endDTS=e.endDTS,r.minEndPTS=e.minEndPTS,r.setDuration(e.endPTS-e.startPTS),r.duration&&(a=r),t.PTSKnown=t.alignedSliding=!0),e.hasStreams&&(r.elementaryStreams=e.elementaryStreams),r.loader=e.loader,e.hasStats&&(r.stats=e.stats),e.initSegment&&(r.initSegment=e.initSegment,n=e.initSegment)}));const s=t.fragments,o=t.fragmentHint?s.concat(t.fragmentHint):s;if(n&&o.forEach((e=>{var t;!e||e.initSegment&&e.initSegment.relurl!==(null==(t=n)?void 0:t.relurl)||(e.initSegment=n)})),t.skippedSegments){if(t.deltaUpdateFailed=s.some((e=>!e)),t.deltaUpdateFailed){A.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let e=t.skippedSegments;e--;)s.shift();t.startSN=s[0].sn}else{t.canSkipDateRanges&&(t.dateRanges=function(e,t){const{dateRanges:n,recentlyRemovedDateranges:i}=t,r=y({},e);i&&i.forEach((e=>{delete r[e]}));const a=Object.keys(r).length;a&&Object.keys(n).forEach((e=>{const t=r[e],i=new an(n[e].attr,t);i.isValid?(r[e]=i,t||(i.tagOrder+=a)):A.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${Qe(n[e].attr)}"`)}));return r}(e.dateRanges,t));const n=e.fragments.filter((e=>e.rawProgramDateTime));if(e.hasProgramDateTime&&!t.hasProgramDateTime)for(let e=1;e<o.length;e++)null===o[e].programDateTime&&jn(o[e],o[e-1],n);Bn(n,t)}t.endCC=s[s.length-1].cc}if(!t.startCC){var l;const n=ti(e,t.startSN-1);t.startCC=null!=(l=null==n?void 0:n.cc)?l:s[0].cc}!function(e,t,n){if(e&&t){let i=0;for(let r=0,a=e.length;r<=a;r++){const a=e[r],s=t[r+i];a&&s&&a.index===s.index&&a.fragment.sn===s.fragment.sn?n(a,s):i--}}}(e.partList,t.partList,((e,t)=>{t.elementaryStreams=e.elementaryStreams,t.stats=e.stats})),a?Wn(t,a,a.startPTS,a.endPTS,a.startDTS,a.endDTS):Jn(e,t),s.length&&(t.totalduration=t.edge-s[0].start),t.driftStartTime=e.driftStartTime,t.driftStart=e.driftStart;const c=t.advancedDateTime;if(t.advanced&&c){const e=t.edge;t.driftStart||(t.driftStartTime=c,t.driftStart=e),t.driftEndTime=c,t.driftEnd=e}else t.driftEndTime=e.driftEndTime,t.driftEnd=e.driftEnd,t.advancedDateTime=e.advancedDateTime;-1===t.requestScheduled&&(t.requestScheduled=e.requestScheduled)}function Xn(e,t,n,i,r){return new Error(`${e} ${r.url}\nPlaylist starting @${t.startSN}\n${t.m3u8}\n\nPlaylist starting @${n.startSN}\n${n.m3u8}`)}function Jn(e,t,n=!0){const i=t.startSN+t.skippedSegments-e.startSN,r=e.fragments,a=i>=0;let s=0;if(a&&i<r.length)s=r[i].start;else if(a&&t.startSN===e.endSN+1)s=e.fragmentEnd;else if(a&&n)s=e.fragmentStart+i*t.levelTargetDuration;else{if(t.skippedSegments||0!==t.fragmentStart)return;s=e.fragmentStart}Qn(t,s)}function Qn(e,t){if(t){const n=e.fragments;for(let i=e.skippedSegments;i<n.length;i++)n[i].addStart(t);e.fragmentHint&&e.fragmentHint.addStart(t)}}function ei(e,t=1/0){let n=1e3*e.targetduration;if(e.updated){const i=e.fragments,r=4;if(i.length&&n*r>t){const e=1e3*i[i.length-1].duration;e<n&&(n=e)}}else n/=2;return Math.round(n)}function ti(e,t,n){if(!e)return null;let i=e.fragments[t-e.startSN];return i||(i=e.fragmentHint,i&&i.sn===t?i:t<e.startSN&&n&&n.sn===t?n:null)}function ni(e,t,n){return e?ii(e.partList,t,n):null}function ii(e,t,n){if(e)for(let i=e.length;i--;){const r=e[i];if(r.index===n&&r.fragment.sn===t)return r}return null}function ri(e){e.forEach(((e,t)=>{var n;null==(n=e.details)||n.fragments.forEach((e=>{e.level=t,e.initSegment&&(e.initSegment.level=t)}))}))}function ai(e,t){for(let i=0,r=e.length;i<r;i++){var n;if((null==(n=e[i])?void 0:n.cc)===t)return e[i]}return null}function si(e,t){if(e){const n=e.start+t;e.start=e.startPTS=n,e.endPTS=n+e.duration}}function oi(e,t){const n=t.fragments;for(let t=0,i=n.length;t<i;t++)si(n[t],e);t.fragmentHint&&si(t.fragmentHint,e),t.alignedSliding=!0}function li(e,t){if(!function(e,t){return!!(e&&t.startCC<e.endCC&&t.endCC>e.startCC)}(t,e))return;const n=Math.min(t.endCC,e.endCC),i=ai(t.fragments,n),r=ai(e.fragments,n);if(!i||!r)return;A.log(`Aligning playlist at start of dicontinuity sequence ${n}`);oi(i.start-r.start,e)}function ci(e,t){if(!e.hasProgramDateTime||!t.hasProgramDateTime)return;const n=e.fragments,i=t.fragments;if(!n.length||!i.length)return;let r,a;const s=Math.min(t.endCC,e.endCC);t.startCC<s&&e.startCC<s&&(r=ai(i,s),a=ai(n,s)),r&&a||(r=i[Math.floor(i.length/2)],a=ai(n,r.cc)||n[Math.floor(n.length/2)]);const o=r.programDateTime,l=a.programDateTime;if(!o||!l)return;oi((l-o)/1e3-(a.start-r.start),e)}const ui=function(e){let t="";const n=e.length;for(let i=0;i<n;i++)t+=`[${e.start(i).toFixed(3)}-${e.end(i).toFixed(3)}]`;return t},di="STOPPED",hi="IDLE",pi="KEY_LOADING",fi="FRAG_LOADING",mi="FRAG_LOADING_WAITING_RETRY",gi="WAITING_TRACK",vi="PARSING",bi="PARSED",yi="ENDED",_i="ERROR",wi="WAITING_INIT_PTS",xi="WAITING_LEVEL";class ki extends Ht{constructor(e,t,n,r,a){super(r,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=di,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.loadingParts=!1,this.loopSn=void 0,this.onMediaSeeking=()=>{const{config:e,fragCurrent:t,media:n,mediaBuffer:r,state:a}=this,s=n?n.currentTime:0,o=Zt.bufferInfo(r||n,s,e.maxBufferHole);if(this.log(`media seeking to ${i(s)?s.toFixed(3):s}, state: ${a}`),this.state===yi)this.resetLoadingState();else if(t){const n=e.maxFragLookUpTolerance,i=t.start-n,r=t.start+t.duration+n;if(!o.len||r<o.start||i>o.end){const e=s>r;(s<i||e)&&(e&&t.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),t.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(n){this.fragmentTracker.removeFragmentsInRange(s,1/0,this.playlistType,!0);if(s>this.lastCurrentTime&&(this.lastCurrentTime=s),!this.loadingParts){const e=Math.max(o.end,s),t=this.shouldLoadParts(this.getLevelDetails(),e);t&&(this.log(`LL-Part loading ON after seeking to ${s.toFixed(2)} with buffer @${e.toFixed(2)}`),this.loadingParts=t)}}this.hls.hasEnoughToStart||o.len||(this.log(`setting startPosition to ${s} because of seek before start`),this.nextLoadPosition=this.startPosition=s),this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=a,this.hls=e,this.fragmentLoader=new Kt(e.config),this.keyLoader=n,this.fragmentTracker=t,this.config=e.config,this.decrypter=new Ft(e.config)}registerListeners(){const{hls:e}=this;e.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(l.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(l.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===di)return;this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const e=this.fragCurrent;null!=e&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=di}get startPositionValue(){const{nextLoadPosition:e,startPosition:t}=this;return-1===t&&e?e:t}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(e,t){if(t.live||!this.media)return!1;const n=e.end||0,i=this.config.timelineOffset||0;if(n<=i)return!1;const r=e.buffered;this.config.maxBufferHole&&r&&r.length>1&&(e=Zt.bufferedInfo(r,e.start,0));const a=e.nextStart;if(a&&a>i&&a<t.edge)return!1;if(this.media.currentTime<e.start)return!1;const s=t.partList;if(null!=s&&s.length){const e=s[s.length-1];return Zt.isBuffered(this.media,e.start+e.duration/2)}const o=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(o)}getLevelDetails(){var e;if(this.levels&&null!==this.levelLastLoaded)return null==(e=this.levelLastLoaded)?void 0:e.details}get timelineOffset(){const e=this.config.timelineOffset;var t;return e?(null==(t=this.getLevelDetails())?void 0:t.appliedTimelineOffset)||e:0}onMediaAttached(e,t){const n=this.media=this.mediaBuffer=t.media;n.removeEventListener("seeking",this.onMediaSeeking),n.removeEventListener("ended",this.onMediaEnded),n.addEventListener("seeking",this.onMediaSeeking),n.addEventListener("ended",this.onMediaEnded);const i=this.config;this.levels&&i.autoStartLoad&&this.state===di&&this.startLoad(i.startPosition)}onMediaDetaching(e,t){const n=!!t.transferMedia,i=this.media;if(null!==i){if(i.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),i.removeEventListener("seeking",this.onMediaSeeking),i.removeEventListener("ended",this.onMediaEnded),this.keyLoader&&!n&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,n)return this.resetLoadingState(),void this.resetTransmuxer();this.loadingParts=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}}onManifestLoading(){this.initPTS=[],this.levels=this.levelLastLoaded=this.fragCurrent=null,this.lastCurrentTime=this.startPosition=0,this.startFragRequested=!1}onError(e,t){}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=di,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(e,t,n){this.startFragRequested=!0,this._loadFragForPlayback(e,t,n)}_loadFragForPlayback(e,t,n){this._doFragLoad(e,t,n,(e=>{const t=e.frag;if(this.fragContextChanged(t))return this.warn(`${t.type} sn: ${t.sn}${e.part?" part: "+e.part.index:""} of ${this.fragInfo(t,!1,e.part)}) was dropped during download.`),void this.fragmentTracker.removeFragment(t);t.stats.chunkCount++,this._handleFragmentLoadProgress(e)})).then((e=>{if(!e)return;const t=this.state,n=e.frag;this.fragContextChanged(n)?(t===fi||!this.fragCurrent&&t===vi)&&(this.fragmentTracker.removeFragment(n),this.state=hi):("payload"in e&&(this.log(`Loaded ${n.type} sn: ${n.sn} of ${this.playlistLabel()} ${n.level}`),this.hls.trigger(l.FRAG_LOADED,e)),this._handleFragmentLoadComplete(e))})).catch((t=>{this.state!==di&&this.state!==_i&&(this.warn(`Frag error: ${(null==t?void 0:t.message)||t}`),this.resetFragmentLoading(e))}))}clearTrackerIfNeeded(e){var t;const{fragmentTracker:n}=this;if(n.getState(e)===Tt){const t=e.type,i=this.getFwdBufferInfo(this.mediaBuffer,t),r=Math.max(e.duration,i?i.len:this.config.maxBufferLength),a=this.backtrackFragment;(1===(a?e.sn-a.sn:0)||this.reduceMaxBufferLength(r,e.duration))&&n.removeFragment(e)}else 0===(null==(t=this.mediaBuffer)?void 0:t.buffered.length)?n.removeAllFragments():n.hasParts(e.type)&&(n.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),n.getState(e)===At&&n.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}waitForLive(e){const t=e.details;return(null==t?void 0:t.live)&&"EVENT"!==t.type&&(this.levelLastLoaded!==e||t.expired)}flushMainBuffer(e,t,n=null){if(!(e-t))return;const i={startOffset:e,endOffset:t,type:n};this.hls.trigger(l.BUFFER_FLUSHING,i)}_loadInitSegment(e,t){this._doFragLoad(e,t).then((e=>{const t=null==e?void 0:e.frag;if(!t||this.fragContextChanged(t)||!this.levels)throw new Error("init load aborted");return e})).then((e=>{const{hls:t}=this,{frag:n,payload:i}=e,r=n.decryptdata;if(i&&i.byteLength>0&&null!=r&&r.key&&r.iv&&on(r.method)){const a=self.performance.now();return this.decrypter.decrypt(new Uint8Array(i),r.key.buffer,r.iv.buffer,ln(r.method)).catch((e=>{throw t.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:n}),e})).then((i=>{const r=self.performance.now();return t.trigger(l.FRAG_DECRYPTED,{frag:n,payload:i,stats:{tstart:a,tdecrypt:r}}),e.payload=i,this.completeInitSegmentLoad(e)}))}return this.completeInitSegmentLoad(e)})).catch((t=>{this.state!==di&&this.state!==_i&&(this.warn(t),this.resetFragmentLoading(e))}))}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const n=e.frag.stats;this.state!==di&&(this.state=hi),e.frag.data=new Uint8Array(e.payload),n.parsing.start=n.buffering.start=self.performance.now(),n.parsing.end=n.buffering.end=self.performance.now(),this.tick()}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){const n=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)} > buffer:${n?ui(Zt.getBuffered(n)):"(detached)"})`),G(e)){var i;if(e.type!==m){const t=e.elementaryStreams;if(!Object.keys(t).some((e=>!!t[e])))return void(this.state=hi)}const t=null==(i=this.levels)?void 0:i[e.level];null!=t&&t.fragmentError&&(this.log(`Resetting level fragment error count of ${t.fragmentError} on frag buffered`),t.fragmentError=0)}this.state=hi}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:n,part:i,partsLoaded:r}=e,a=!r||0===r.length||r.some((e=>!e)),s=new Vt(n.level,n.sn,n.stats.chunkCount+1,0,i?i.index:-1,!a);t.flush(s)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,r){var a;this.fragCurrent=e;const s=null==t?void 0:t.details;if(!this.levels||!s)throw new Error(`frag load aborted, missing level${s?"":" detail"}s`);let o=null;!e.encrypted||null!=(a=e.decryptdata)&&a.key?e.encrypted||(o=this.keyLoader.loadClear(e,s.encryptedFragments),o&&this.log("[eme] blocking frag load until media-keys acquired")):(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=pi,this.fragCurrent=e,o=this.keyLoader.load(e).then((e=>{if(!this.fragContextChanged(e.frag))return this.hls.trigger(l.KEY_LOADED,e),this.state===pi&&(this.state=hi),e})),this.hls.trigger(l.KEY_LOADING,{frag:e}),null===this.fragCurrent&&(o=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING"))));const c=this.fragPrevious;if(G(e)&&(!c||e.sn!==c.sn)){const n=this.shouldLoadParts(t.details,e.end);n!==this.loadingParts&&(this.log(`LL-Part loading ${n?"ON":"OFF"} loading sn ${null==c?void 0:c.sn}->${e.sn}`),this.loadingParts=n)}if(n=Math.max(e.start,n||0),this.loadingParts&&G(e)){const i=s.partList;if(i&&r){n>e.end&&s.fragmentHint&&(e=s.fragmentHint);const a=this.getNextPart(i,e,n);if(a>-1){const c=i[a];let u;return e=this.fragCurrent=c.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${c.index} (${a}/${i.length-1}) of ${this.fragInfo(e,!1,c)}) cc: ${e.cc} [${s.startSN}-${s.endSN}], target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=c.start+c.duration,this.state=fi,u=o?o.then((n=>!n||this.fragContextChanged(n.frag)?null:this.doFragPartsLoad(e,c,t,r))).catch((e=>this.handleFragLoadError(e))):this.doFragPartsLoad(e,c,t,r).catch((e=>this.handleFragLoadError(e))),this.hls.trigger(l.FRAG_LOADING,{frag:e,part:c,targetBufferTime:n}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):u}if(!e.url||this.loadedEndOfParts(i,n))return Promise.resolve(null)}}if(G(e)&&this.loadingParts)this.log(`LL-Part loading OFF after next part miss @${n.toFixed(2)}`),this.loadingParts=!1;else if(!e.url)return Promise.resolve(null);this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e,!1)}) cc: ${e.cc} ${s?"["+s.startSN+"-"+s.endSN+"]":""}, target: ${parseFloat(n.toFixed(3))}`),i(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=fi;const u=this.config.progressive;let d;return d=u&&o?o.then((t=>!t||this.fragContextChanged(null==t?void 0:t.frag)?null:this.fragmentLoader.load(e,r))).catch((e=>this.handleFragLoadError(e))):Promise.all([this.fragmentLoader.load(e,u?r:void 0),o]).then((([e])=>(!u&&e&&r&&r(e),e))).catch((e=>this.handleFragLoadError(e))),this.hls.trigger(l.FRAG_LOADING,{frag:e,targetBufferTime:n}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):d}doFragPartsLoad(e,t,n,i){return new Promise(((r,a)=>{var s;const o=[],c=null==(s=n.details)?void 0:s.partList,u=t=>{this.fragmentLoader.loadPart(e,t,i).then((i=>{o[t.index]=i;const a=i.part;this.hls.trigger(l.FRAG_LOADED,i);const s=ni(n.details,e.sn,t.index+1)||ii(c,e.sn,t.index+1);if(!s)return r({frag:e,part:a,partsLoaded:o});u(s)})).catch(a)};u(t)}))}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===o.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(l.ERROR,t)}else this.hls.trigger(l.ERROR,{type:s.OTHER_ERROR,details:o.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==vi)return void(this.fragCurrent||this.state===di||this.state===_i||(this.state=hi));const{frag:n,part:i,level:r}=t,a=self.performance.now();n.stats.parsing.end=a,i&&(i.stats.parsing.end=a);const s=this.getLevelDetails(),o=s&&n.sn>s.endSN||this.shouldLoadParts(s,n.end);o!==this.loadingParts&&(this.log(`LL-Part loading ${o?"ON":"OFF"} after parsing segment ending @${n.end.toFixed(2)}`),this.loadingParts=o),this.updateLevelTiming(n,i,r,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(null!=e&&e.partList){var n;const r=e.partList[0];if(t>=r.end+((null==(n=e.fragmentHint)?void 0:n.duration)||0)){var i;if((this.hls.hasEnoughToStart?(null==(i=this.media)?void 0:i.currentTime)||this.lastCurrentTime:this.getLoadPosition())>r.start-r.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:t,fragCurrent:n}=this,{level:i,sn:r,part:a}=e;if(null==t||!t[i])return this.warn(`Levels object was unset while buffering fragment ${r} of ${this.playlistLabel()} ${i}. The current chunk will not be buffered.`),null;const s=t[i],o=s.details,l=a>-1?ni(o,r,a):null,c=l?l.fragment:ti(o,r,n);return c?(n&&n!==c&&(c.stats=n.stats),{frag:c,part:l,level:s}):null}bufferFragmentData(e,t,n,i,r){var a;if(!e||this.state!==vi)return;const{data1:s,data2:o}=e;let c=s;if(s&&o&&(c=me(s,o)),null==(a=c)||!a.length)return;const u={type:e.type,frag:t,part:n,chunkMeta:i,parent:t.type,data:c};if(this.hls.trigger(l.BUFFER_APPENDING,u),e.dropped&&e.independent&&!n){if(r)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!Zt.isBuffered(t,t.currentTime))return void this.flushMainBuffer(0,e.start);const n=t.currentTime,i=Zt.bufferInfo(t,n,0),r=e.duration,a=Math.min(2*this.config.maxFragLookUpTolerance,.25*r),s=Math.max(Math.min(e.start-a,i.end-a),n+a);e.start-s>a&&this.flushMainBuffer(s,e.start)}getFwdBufferInfo(e,t){var n;const r=this.getLoadPosition();if(!i(r))return null;const a=this.lastCurrentTime>r||null!=(n=this.media)&&n.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,r,t,a)}getFwdBufferInfoAtPos(e,t,n,i){const r=Zt.bufferInfo(e,t,i);if(0===r.len&&void 0!==r.nextStart){const a=this.fragmentTracker.getBufferedFrag(t,n);if(a&&(r.nextStart<=a.end||a.gap)){const n=Math.max(Math.min(r.nextStart,a.end)-t,i);return Zt.bufferInfo(e,t,n)}}return r}getMaxBufferLength(e){const{config:t}=this;let n;return n=e?Math.max(8*t.maxBufferSize/e,t.maxBufferLength):t.maxBufferLength,Math.min(n,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){const n=this.config,i=Math.max(Math.min(e-t,n.maxBufferLength),t),r=Math.max(e-3*t,n.maxMaxBufferLength/2,i);return r>=i&&(n.maxMaxBufferLength=r,this.warn(`Reduce max buffer length to ${r}s`),!0)}getAppendedFrag(e,t=p){var n;const i=null==(n=this.fragmentTracker)?void 0:n.getAppendedFrag(e,t);return i&&"fragment"in i?i.fragment:i}getNextFragment(e,t){const n=t.fragments,i=n.length;if(!i)return null;const{config:r}=this,a=n[0].start,s=r.lowLatencyMode&&!!t.partList;let o=null;if(t.live){const n=r.initialLiveManifestSize;if(i<n)return this.warn(`Not enough fragments to start playback (have: ${i}, need: ${n})`),null;if(!t.PTSKnown&&!this.startFragRequested&&-1===this.startPosition||e<a){var l;s&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),o=this.getInitialLiveFragment(t);const n=this.hls.startPosition,i=this.hls.liveSyncPosition,r=o?(-1!==n&&n>=a?n:i)||o.start:e;this.log(`Setting startPosition to ${r} to match start frag at live edge. mainStart: ${n} liveSyncPosition: ${i} frag.start: ${null==(l=o)?void 0:l.start}`),this.startPosition=this.nextLoadPosition=r}}else e<=a&&(o=n[0]);if(!o){const n=this.loadingParts?t.partEnd:t.fragmentEnd;o=this.getFragmentAtPosition(e,n,t)}let c=this.filterReplacedPrimary(o,t);if(!c&&o){const e=o.sn-t.startSN;c=this.filterReplacedPrimary(n[e+1]||null,t)}return this.mapToInitFragWhenRequired(c)}isLoopLoading(e,t){const n=this.fragmentTracker.getState(e);return(n===Mt||n===At&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,n,i,r){let a=null;if(e.gap&&(a=this.getNextFragment(this.nextLoadPosition,t),a&&!a.gap&&n.nextStart)){const e=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,i,0);if(null!==e&&n.len+e.len>=r){const e=a.sn;return this.loopSn!==e&&(this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${e}`),this.loopSn=e),null}}return this.loopSn=void 0,a}get primaryPrefetch(){if(Si(this.hls.config)){var e,t;if(null==(e=this.hls.interstitialsManager)||null==(t=e.playingItem)?void 0:t.event)return!0}return!1}filterReplacedPrimary(e,t){if(!e)return e;if(Si(this.hls.config)&&e.type!==m){const n=this.hls.interstitialsManager,i=null==n?void 0:n.bufferingItem;if(i){const n=i.event;if(n){if(n.appendInPlace||Math.abs(e.start-i.start)>1||0===i.start)return null}else{if(e.end<=i.start&&!1===(null==t?void 0:t.live))return null;if(e.start>i.end&&i.nextEvent&&(i.nextEvent.appendInPlace||e.start-i.end>1))return null}}const r=null==n?void 0:n.playerQueue;if(r)for(let t=r.length;t--;){const n=r[t].interstitial;if(n.appendInPlace&&e.start>=n.startTime&&e.end<=n.resumeTime)return null}}return e}mapToInitFragWhenRequired(e){return null==e||!e.initSegment||null!=e&&e.initSegment.data||this.bitrateTest?e:e.initSegment}getNextPart(e,t,n){let i=-1,r=!1,a=!0;for(let s=0,o=e.length;s<o;s++){const o=e[s];if(a=a&&!o.independent,i>-1&&n<o.start)break;const l=o.loaded;l?i=-1:(r||o.independent||a)&&o.fragment===t&&(i=s),r=l}return i}loadedEndOfParts(e,t){const n=e[e.length-1];return n&&t>n.start&&n.loaded}getInitialLiveFragment(e){const t=e.fragments,n=this.fragPrevious;let r=null;if(n){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`),r=function(e,t,n){if(null===t||!Array.isArray(e)||!e.length||!i(t))return null;if(t<(e[0].programDateTime||0))return null;if(t>=(e[e.length-1].endProgramDateTime||0))return null;for(let i=0;i<e.length;++i){const r=e[i];if(dt(t,n,r))return r}return null}(t,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!r){const i=n.sn+1;if(i>=e.startSN&&i<=e.endSN){const a=t[i-e.startSN];n.cc===a.cc&&(r=a,this.log(`Live playlist, switching playlist, load frag with next SN: ${r.sn}`))}r||(r=ht(e,n.cc,n.end),r&&this.log(`Live playlist, switching playlist, load frag with same CC: ${r.sn}`))}}else{const t=this.hls.liveSyncPosition;null!==t&&(r=this.getFragmentAtPosition(t,this.bitrateTest?e.fragmentEnd:e.edge,e))}return r}getFragmentAtPosition(e,t,n){const{config:i}=this;let{fragPrevious:r}=this,{fragments:a,endSN:s}=n;const{fragmentHint:o}=n,{maxFragLookUpTolerance:l}=i,c=n.partList,u=!!(this.loadingParts&&null!=c&&c.length&&o);let d;if(u&&o&&!this.bitrateTest&&c[c.length-1].fragment.sn===o.sn&&(a=a.concat(o),s=o.sn),e<t){var h;d=ct(r,a,e,e<this.lastCurrentTime||e>t-l||null!=(h=this.media)&&h.paused||!this.startFragRequested?0:l)}else d=a[a.length-1];if(d){const e=d.sn-n.startSN,t=this.fragmentTracker.getState(d);if((t===Mt||t===At&&d.gap)&&(r=d),r&&d.sn===r.sn&&(!u||c[0].fragment.sn>d.sn||!n.live&&!u)){if(r&&d.level===r.level){const t=a[e+1];d=d.sn<s&&this.fragmentTracker.getState(t)!==Mt?t:null}}}return d}alignPlaylists(e,t,n){const r=e.fragments.length;if(!r)return this.warn("No fragments in live playlist"),0;const a=e.fragmentStart,s=!t,o=e.alignedSliding&&i(a);if(s||!o&&!a){!function(e,t){e&&(li(t,e),!t.alignedSliding&&e&&ci(t,e),t.alignedSliding||!e||t.skippedSegments||Jn(e,t,!1))}(n,e);const i=e.fragmentStart;return this.log(`Live playlist sliding: ${i.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${r}`),i}return a}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,3*e.partTarget)}setStartPosition(e,t){let n=this.startPosition;n<t&&(n=-1);const r=this.timelineOffset;if(-1===n){const a=null!==this.startTimeOffset,s=a?this.startTimeOffset:e.startTimeOffset;null!==s&&i(s)?(n=t+s,s<0&&(n+=e.edge),n=Math.min(Math.max(t,n),t+e.totalduration),this.log(`Setting startPosition to ${n} for start time offset ${s} found in ${a?"multivariant":"media"} playlist`),this.startPosition=n):e.live?(n=this.hls.liveSyncPosition||t,this.log(`Setting startPosition to -1 to start at live edge ${n}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=n=0),this.lastCurrentTime=n+r}this.nextLoadPosition=n+r}getLoadPosition(){var e;const{media:t}=this;let n=0;return null!=(e=this.hls)&&e.hasEnoughToStart&&t?n=t.currentTime:this.nextLoadPosition>=0&&(n=this.nextLoadPosition),n}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&G(e)&&e.stats.aborted&&(this.warn(`Fragment ${e.sn}${t?" part "+t.index:""} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){this.fragCurrent&&(this.fragContextChanged(e)||this.state===mi)||(this.state=hi)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const e=this.getCurrentContext(t.chunkMeta);e&&(t.frag=e.frag)}const n=t.frag;if(!n||n.type!==e||!this.levels)return;var i;if(this.fragContextChanged(n))return void this.warn(`Frag load error must match current frag to retry ${n.url} > ${null==(i=this.fragCurrent)?void 0:i.url}`);const r=t.details===o.FRAG_GAP;r&&this.fragmentTracker.fragBuffered(n,!0);const a=t.errorAction,{action:s,flags:l,retryCount:c=0,retryConfig:u}=a||{},d=!!a&&!!u,h=d&&s===wt,p=d&&!a.resolved&&l===kt;if(!h&&p&&G(n)&&!n.endList)this.resetFragmentErrors(e),this.treatAsGap(n),a.resolved=!0;else if((h||p)&&c<u.maxNumRetry){this.resetStartWhenNotLoaded(this.levelLastLoaded);const i=mt(u,c);this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${t.details}, retrying loading ${c+1}/${u.maxNumRetry} in ${i}ms`),a.resolved=!0,this.retryDate=self.performance.now()+i,this.state=mi}else if(u&&a){if(this.resetFragmentErrors(e),!(c<u.maxNumRetry))return void this.warn(`${t.details} reached or exceeded max retry (${c})`);r||s===_t||(a.resolved=!0)}else this.state=s===yt?xi:_i;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===vi||this.state===bi){const t=e.frag,n=e.parent,i=this.getFwdBufferInfo(this.mediaBuffer,n),r=i&&i.len>.5;r&&this.reduceMaxBufferLength(i.len,(null==t?void 0:t.duration)||10);const a=!r;return a&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${n} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),a}return!1}resetFragmentErrors(e){e===f&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==di&&(this.state=hi)}afterBufferFlushed(e,t,n){if(!e)return;const i=Zt.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,n),this.state===yi&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==di&&(this.state=hi)}resetStartWhenNotLoaded(e){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const t=e?e.details:null;null!=t&&t.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(t,t.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of ${this.playlistLabel()} ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,n,i){const r=n.details;if(!r)return void this.warn("level.details undefined");var a;if(!Object.keys(e.elementaryStreams).reduce(((t,a)=>{const s=e.elementaryStreams[a];if(s){const o=s.endPTS-s.startPTS;if(o<=0)return this.warn(`Could not parse fragment ${e.sn} ${a} duration reliably (${o})`),t||!1;const c=i?0:Wn(r,e,s.startPTS,s.endPTS,s.startDTS,s.endDTS);return this.hls.trigger(l.LEVEL_PTS_UPDATED,{details:r,level:n,drift:c,type:a,frag:e,start:s.startPTS,end:s.endPTS}),!0}return t}),!1)&&(0===n.fragmentError&&this.treatAsGap(e,n),null===(null==(a=this.transmuxer)?void 0:a.error))){const t=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(t.message),this.hls.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.FRAG_PARSING_ERROR,fatal:!1,error:t,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=bi,this.log(`Parsed ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(l.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===p?"level":"track"}fragInfo(e,t=!0,n){var i,r;return`${this.playlistLabel()} ${e.level} (${n?"part":"frag"}:[${(null!=(i=t&&!n?e.startPTS:(n||e).start)?i:NaN).toFixed(3)}-${(null!=(r=t&&!n?e.endPTS:(n||e).end)?r:NaN).toFixed(3)}]${n&&"main"===e.type?"INDEPENDENT="+(n.independent?"YES":"NO"):""}`}treatAsGap(e,t){t&&t.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)}resetTransmuxer(){var e;null==(e=this.transmuxer)||e.reset()}recoverWorkerError(e){"demuxerWorker"===e.event&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function Si(e){return!!e.interstitialsController&&!1!==e.enableInterstitialPlayback}class Ei{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let n;return e.length?(n=1===e.length?e[0]:function(e,t){const n=new Uint8Array(t);let i=0;for(let t=0;t<e.length;t++){const r=e[t];n.set(r,i),i+=r.length}return n}(e,t),this.reset(),n):new Uint8Array(0)}reset(){this.chunks.length=0,this.dataLength=0}}var Ci,Ti={exports:{}};var Ai=(Ci||(Ci=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function i(){}function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,i,a,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new r(i,a||e,s),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function o(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),o.prototype.eventNames=function(){var e,i,r=[];if(0===this._eventsCount)return r;for(i in e=this._events)t.call(e,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},o.prototype.listeners=function(e){var t=n?n+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,a=i.length,s=new Array(a);r<a;r++)s[r]=i[r].fn;return s},o.prototype.listenerCount=function(e){var t=n?n+e:e,i=this._events[t];return i?i.fn?1:i.length:0},o.prototype.emit=function(e,t,i,r,a,s){var o=n?n+e:e;if(!this._events[o])return!1;var l,c,u=this._events[o],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,i),!0;case 4:return u.fn.call(u.context,t,i,r),!0;case 5:return u.fn.call(u.context,t,i,r,a),!0;case 6:return u.fn.call(u.context,t,i,r,a,s),!0}for(c=1,l=new Array(d-1);c<d;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var h,p=u.length;for(c=0;c<p;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,i);break;case 4:u[c].fn.call(u[c].context,t,i,r);break;default:if(!l)for(h=1,l=new Array(d-1);h<d;h++)l[h-1]=arguments[h];u[c].fn.apply(u[c].context,l)}}return!0},o.prototype.on=function(e,t,n){return a(this,e,t,n,!1)},o.prototype.once=function(e,t,n){return a(this,e,t,n,!0)},o.prototype.removeListener=function(e,t,i,r){var a=n?n+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn!==t||r&&!o.once||i&&o.context!==i||s(this,a);else{for(var l=0,c=[],u=o.length;l<u;l++)(o[l].fn!==t||r&&!o[l].once||i&&o[l].context!==i)&&c.push(o[l]);c.length?this._events[a]=1===c.length?c[0]:c:s(this,a)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,e.exports=o}(Ti)),Ti.exports),Mi=R(Ai);const Li="1.6.5",Di={};function Ii(e,t){return t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}function Ri(e,t){return t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}function Pi(e,t){let n=0;return n=(127&e[t])<<21,n|=(127&e[t+1])<<14,n|=(127&e[t+2])<<7,n|=127&e[t+3],n}function Oi(e,t){const n=t;let i=0;for(;Ri(e,t);){i+=10;i+=Pi(e,t+6),Ii(e,t+10)&&(i+=10),t+=i}if(i>0)return e.subarray(n,n+i)}function Ni(e,t){return 255===e[t]&&240==(246&e[t+1])}function Bi(e,t){return 1&e[t+1]?7:9}function $i(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function Fi(e,t){return t+1<e.length&&Ni(e,t)}function zi(e,t){if(Fi(e,t)){const n=Bi(e,t);if(t+n>=e.length)return!1;const i=$i(e,t);if(i<=n)return!1;const r=t+i;return r===e.length||Fi(e,r)}return!1}function Ki(e,t,n,i,r){if(!e.samplerate){const a=function(e,t,n,i){const r=t[n+2],a=r>>2&15;if(a>12){const t=new Error(`invalid ADTS sampling index:${a}`);return void e.emit(l.ERROR,l.ERROR,{type:s.MEDIA_ERROR,details:o.FRAG_PARSING_ERROR,fatal:!0,error:t,reason:t.message})}const c=1+(r>>6&3),u=t[n+3]>>6&3|(1&r)<<2,d="mp4a.40."+c,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350][a];let p=a;5!==c&&29!==c||(p-=3);const f=[c<<3|(14&p)>>1,(1&p)<<7|u<<3];return A.log(`manifest codec:${i}, parsed codec:${d}, channels:${u}, rate:${h} (ADTS object type:${c} sampling index:${a})`),{config:f,samplerate:h,channelCount:u,codec:d,parsedCodec:d,manifestCodec:i}}(t,n,i,r);if(!a)return;y(e,a)}}function Ui(e){return 9216e4/e}function ji(e,t,n,i,r){const a=i+r*Ui(e.samplerate),s=function(e,t){const n=Bi(e,t);if(t+n<=e.length){const i=$i(e,t)-n;if(i>0)return{headerLength:n,frameLength:i}}}(t,n);let o;if(s){const{frameLength:i,headerLength:r}=s,l=r+i,c=Math.max(0,n+l-t.length);c?(o=new Uint8Array(l-r),o.set(t.subarray(n+r,t.length),0)):o=t.subarray(n+r,n+l);const u={unit:o,pts:a};return c||e.samples.push(u),{sample:u,length:l,missing:c}}const l=t.length-n;o=new Uint8Array(l),o.set(t.subarray(n,t.length),0);return{sample:{unit:o,pts:a},length:l,missing:-1}}function qi(e,t){return Ri(e,t)&&Pi(e,t+6)+10<=e.length-t}function Hi(e,t=0,n=1/0){return function(e,t,n,i){const r=function(e){return e instanceof ArrayBuffer?e:e.buffer}(e);let a=1;"BYTES_PER_ELEMENT"in i&&(a=i.BYTES_PER_ELEMENT);const s=(d=e,d&&d.buffer instanceof ArrayBuffer&&void 0!==d.byteLength&&void 0!==d.byteOffset?e.byteOffset:0),o=(s+e.byteLength)/a,l=(s+t)/a,c=Math.floor(Math.max(0,Math.min(l,o))),u=Math.floor(Math.min(c+Math.max(n,0),o));var d;return new i(r,c,u-c)}(e,t,n,Uint8Array)}function Vi(e){const t={key:e.type,description:"",data:"",mimeType:null,pictureType:null};if(e.size<2)return;if(3!==e.data[0])return void console.log("Ignore frame with unrecognized character encoding");const n=e.data.subarray(1).indexOf(0);if(-1===n)return;const i=D(Hi(e.data,1,n)),r=e.data[2+n],a=e.data.subarray(3+n).indexOf(0);if(-1===a)return;const s=D(Hi(e.data,3+n,a));let o;return o="--\x3e"===i?D(Hi(e.data,4+n+a)):function(e){return e instanceof ArrayBuffer?e:0==e.byteOffset&&e.byteLength==e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer}(e.data.subarray(4+n+a)),t.mimeType=i,t.pictureType=r,t.description=s,t.data=o,t}function Gi(e){return"PRIV"===e.type?function(e){if(e.size<2)return;const t=D(e.data,!0),n=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:n.buffer}}(e):"W"===e.type[0]?function(e){if("WXXX"===e.type){if(e.size<2)return;let t=1;const n=D(e.data.subarray(t),!0);t+=n.length+1;const i=D(e.data.subarray(t));return{key:e.type,info:n,data:i}}const t=D(e.data);return{key:e.type,info:"",data:t}}(e):"APIC"===e.type?Vi(e):function(e){if(e.size<2)return;if("TXXX"===e.type){let t=1;const n=D(e.data.subarray(t),!0);t+=n.length+1;const i=D(e.data.subarray(t));return{key:e.type,info:n,data:i}}const t=D(e.data.subarray(1));return{key:e.type,info:"",data:t}}(e)}function Zi(e){const t=String.fromCharCode(e[0],e[1],e[2],e[3]),n=Pi(e,4);return{type:t,size:n,data:e.subarray(10,10+n)}}function Wi(e){let t=0;const n=[];for(;Ri(e,t);){const i=Pi(e,t+6);e[t+5]>>6&1&&(t+=10),t+=10;const r=t+i;for(;t+10<r;){const i=Zi(e.subarray(t)),r=Gi(i);r&&n.push(r),t+=i.size+10}Ii(e,t)&&(t+=10)}return n}function Yi(e){return e&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info}function Xi(e){if(8===e.data.byteLength){const t=new Uint8Array(e.data),n=1&t[3];let i=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return i/=45,n&&(i+=47721858.84),Math.round(i)}}function Ji(e){const t=Wi(e);for(let e=0;e<t.length;e++){const n=t[e];if(Yi(n))return Xi(n)}}let Qi=function(e){return e.audioId3="org.id3",e.dateRange="com.apple.quicktime.HLS",e.emsg="https://aomedia.org/emsg/ID3",e.misbklv="urn:misb:KLV:bin:1910.1",e}({});function er(e="",t=9e4){return{type:e,id:-1,pid:-1,inputTimeScale:t,sequenceNumber:-1,samples:[],dropped:0}}class tr{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,t,n,i){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,n){}demux(e,t){this.cachedData&&(e=me(this.cachedData,e),this.cachedData=null);let n,r=Oi(e,0),a=r?r.length:0;const s=this._audioTrack,o=this._id3Track,l=r?Ji(r):void 0,c=e.length;for((null===this.basePTS||0===this.frameIndex&&i(l))&&(this.basePTS=nr(l,t,this.initPTS),this.lastPTS=this.basePTS),null===this.lastPTS&&(this.lastPTS=this.basePTS),r&&r.length>0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:Qi.audioId3,duration:Number.POSITIVE_INFINITY});a<c;){if(this.canParse(e,a)){const t=this.appendFrame(s,e,a);t?(this.frameIndex++,this.lastPTS=t.sample.pts,a+=t.length,n=a):a=c}else qi(e,a)?(r=Oi(e,a),o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:Qi.audioId3,duration:Number.POSITIVE_INFINITY}),a+=r.length,n=a):a++;if(a===c&&n!==c){const t=e.slice(n);this.cachedData?this.cachedData=me(this.cachedData,t):this.cachedData=t}}return{audioTrack:s,videoTrack:er(),id3Track:o,textTrack:er()}}demuxSampleAes(e,t,n){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){const t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:er(),id3Track:this._id3Track,textTrack:er()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const nr=(e,t,n)=>{if(i(e))return 90*e;return 9e4*t+(n?9e4*n.baseTime/n.timescale:0)};let ir=null;const rr=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],ar=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],sr=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],or=[0,1,1,4];function lr(e,t,n,i,r){if(n+24>t.length)return;const a=cr(t,n);if(a&&n+a.frameLength<=t.length){const s=i+r*(9e4*a.samplesPerFrame/a.sampleRate),o={unit:t.subarray(n,n+a.frameLength),pts:s,dts:s};return e.config=[],e.channelCount=a.channelCount,e.samplerate=a.sampleRate,e.samples.push(o),{sample:o,length:a.frameLength,missing:0}}}function cr(e,t){const n=e[t+1]>>3&3,i=e[t+1]>>1&3,r=e[t+2]>>4&15,a=e[t+2]>>2&3;if(1!==n&&0!==r&&15!==r&&3!==a){const s=e[t+2]>>1&1,o=e[t+3]>>6,l=1e3*rr[14*(3===n?3-i:3===i?3:4)+r-1],c=ar[3*(3===n?0:2===n?1:2)+a],u=3===o?1:2,d=sr[n][i],h=or[i],p=8*d*h,f=Math.floor(d*l/c+s)*h;if(null===ir){const e=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);ir=e?parseInt(e[1]):0}return!!ir&&ir<=87&&2===i&&l>=224e3&&0===o&&(e[t+3]=128|e[t+3]),{sampleRate:c,channelCount:u,frameLength:f,samplesPerFrame:p}}}function ur(e,t){return 255===e[t]&&224==(224&e[t+1])&&0!=(6&e[t+1])}function dr(e,t){return t+1<e.length&&ur(e,t)}function hr(e,t){if(t+1<e.length&&ur(e,t)){const n=4,i=cr(e,t);let r=n;null!=i&&i.frameLength&&(r=i.frameLength);const a=t+r;return a===e.length||dr(e,a)}return!1}const pr=(e,t)=>{let n=0,i=5;t+=i;const r=new Uint32Array(1),a=new Uint32Array(1),s=new Uint8Array(1);for(;i>0;){s[0]=e[t];const o=Math.min(i,8),l=8-o;a[0]=4278190080>>>24+l<<l,r[0]=(s[0]&a[0])>>l,n=n?n<<o|r[0]:r[0],t+=1,i-=o}return n};class fr extends tr{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,n){const i=mr(e,t,n,this.basePTS,this.frameIndex);if(-1!==i){return{sample:e.samples[e.samples.length-1],length:i,missing:0}}}static probe(e){if(!e)return!1;const t=Oi(e,0);if(!t)return!1;const n=t.length;return 11===e[n]&&119===e[n+1]&&void 0!==Ji(t)&&pr(e,n)<16}}function mr(e,t,n,i,r){if(n+8>t.length)return-1;if(11!==t[n]||119!==t[n+1])return-1;const a=t[n+4]>>6;if(a>=3)return-1;const s=[48e3,44100,32e3][a],o=63&t[n+4],l=2*[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][3*o+a];if(n+l>t.length)return-1;const c=t[n+6]>>5;let u=0;2===c?u+=2:(1&c&&1!==c&&(u+=2),4&c&&(u+=2));const d=(t[n+6]<<8|t[n+7])>>12-u&1,h=[2,1,2,3,3,4,4,5][c]+d,p=t[n+5]>>3,f=7&t[n+5],m=new Uint8Array([a<<6|p<<1|f>>2,(3&f)<<6|c<<3|d<<2|o>>4,o<<4&224]),g=i+r*(1536/s*9e4),v=t.subarray(n,n+l);return e.config=m,e.channelCount=h,e.samplerate=s,e.samples.push({unit:v,pts:g}),l}const gr=/\/emsg[-/]ID3/i;function vr(e,t){return i(e.presentationTime)?e.presentationTime/e.timeScale:t+e.presentationTimeDelta/e.timeScale}class br{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new Ft(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,Pt)}decryptAacSample(e,t,n){const i=e[t].unit;if(i.length<=16)return;const r=i.subarray(16,i.length-i.length%16),a=r.buffer.slice(r.byteOffset,r.byteOffset+r.length);this.decryptBuffer(a).then((r=>{const a=new Uint8Array(r);i.set(a,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)}))}decryptAacSamples(e,t,n){for(;;t++){if(t>=e.length)return void n();if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=16*Math.floor((e.length-48)/160)+16,n=new Int8Array(t);let i=0;for(let t=32;t<e.length-16;t+=160,i+=16)n.set(e.subarray(t,t+16),i);return n}getAvcDecryptedUnit(e,t){const n=new Uint8Array(t);let i=0;for(let t=32;t<e.length-16;t+=160,i+=16)e.set(n.subarray(i,i+16),t);return e}decryptAvcSample(e,t,n,i,r){const a=_e(r.data),s=this.getAvcEncryptedData(a);this.decryptBuffer(s.buffer).then((s=>{r.data=this.getAvcDecryptedUnit(a,s),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,i)}))}decryptAvcSamples(e,t,n,i){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,n=0){if(t>=e.length)return void i();const r=e[t].units;for(;!(n>=r.length);n++){const a=r[n];if(!(a.data.length<=48||1!==a.type&&5!==a.type||(this.decryptAvcSample(e,t,n,i,a),this.decrypter.isSync())))return}}}}class yr{constructor(){this.VideoSample=null}createVideoSample(e,t,n){return{key:e,frame:!1,pts:t,dts:n,units:[],length:0}}getLastNalUnit(e){var t;let n,i=this.VideoSample;if(i&&0!==i.units.length||(i=e[e.length-1]),null!=(t=i)&&t.units){const e=i.units;n=e[e.length-1]}return n}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(void 0===e.pts){const n=t.samples,i=n.length;if(!i)return void t.dropped++;{const t=n[i-1];e.pts=t.pts,e.dts=t.dts}}t.samples.push(e)}}parseNALu(e,t,n){const i=t.byteLength;let r=e.naluState||0;const a=r,s=[];let o,l,c,u=0,d=-1,h=0;for(-1===r&&(d=0,h=this.getNALuType(t,0),r=0,u=1);u<i;)if(o=t[u++],r)if(1!==r)if(o)if(1===o){if(l=u-r-1,d>=0){const e={data:t.subarray(d,l),type:h};s.push(e)}else{const n=this.getLastNalUnit(e.samples);n&&(a&&u<=4-a&&n.state&&(n.data=n.data.subarray(0,n.data.byteLength-a)),l>0&&(n.data=me(n.data,t.subarray(0,l)),n.state=0))}u<i?(c=this.getNALuType(t,u),d=u,h=c,r=0):r=-1}else r=0;else r=3;else r=o?0:2;else r=o?0:1;if(d>=0&&r>=0){const e={data:t.subarray(d,i),type:h,state:r};s.push(e)}if(0===s.length){const n=this.getLastNalUnit(e.samples);n&&(n.data=me(n.data,t))}return e.naluState=r,s}}class _r{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,n=e.byteLength-t,i=new Uint8Array(4),r=Math.min(4,t);if(0===r)throw new Error("no bytes available");i.set(e.subarray(n,n+r)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=8*r,this.bytesAvailable-=r}skipBits(e){let t;e=Math.min(e,8*this.bytesAvailable+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(t=(e-=this.bitsAvailable)>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const n=this.word>>>32-t;if(e>32&&A.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else{if(!(this.bytesAvailable>0))throw new Error("no bits available");this.loadWord()}return t=e-t,t>0&&this.bitsAvailable?n<<t|this.readBits(t):n}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(0!=(this.word&2147483648>>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return 1===this.readBits(1)}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}}class wr extends yr{parsePES(e,t,n,i){const r=this.parseNALu(e,n.data,i);let a,s=this.VideoSample,o=!1;n.data=null,s&&r.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),r.forEach((i=>{var r,l;switch(i.type){case 1:{let t=!1;a=!0;const r=i.data;if(o&&r.length>4){const e=this.readSliceType(r);2!==e&&4!==e&&7!==e&&9!==e||(t=!0)}var c;if(t)null!=(c=s)&&c.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null);s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.frame=!0,s.key=t;break}case 5:a=!0,null!=(r=s)&&r.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 6:a=!0,ye(i.data,1,n.pts,t.samples);break;case 7:{var u,d;a=!0,o=!0;const t=i.data,n=this.readSPS(t);if(!e.sps||e.width!==n.width||e.height!==n.height||(null==(u=e.pixelRatio)?void 0:u[0])!==n.pixelRatio[0]||(null==(d=e.pixelRatio)?void 0:d[1])!==n.pixelRatio[1]){e.width=n.width,e.height=n.height,e.pixelRatio=n.pixelRatio,e.sps=[t];const i=t.subarray(1,4);let r="avc1.";for(let e=0;e<3;e++){let t=i[e].toString(16);t.length<2&&(t="0"+t),r+=t}e.codec=r}break}case 8:a=!0,e.pps=[i.data];break;case 9:a=!0,e.audFound=!0,null!=(l=s)&&l.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;case 12:a=!0;break;default:a=!1}if(s&&a){s.units.push(i)}})),i&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}getNALuType(e,t){return 31&e[t]}readSliceType(e){const t=new _r(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let n,i=8,r=8;for(let a=0;a<e;a++)0!==r&&(n=t.readEG(),r=(i+n+256)%256),i=0===r?i:r}readSPS(e){const t=new _r(e);let n,i,r,a=0,s=0,o=0,l=0;const c=t.readUByte.bind(t),u=t.readBits.bind(t),d=t.readUEG.bind(t),h=t.readBoolean.bind(t),p=t.skipBits.bind(t),f=t.skipEG.bind(t),m=t.skipUEG.bind(t),g=this.skipScalingList.bind(this);c();const v=c();if(u(5),p(3),c(),m(),100===v||110===v||122===v||244===v||44===v||83===v||86===v||118===v||128===v){const e=d();if(3===e&&p(1),m(),m(),p(1),h())for(i=3!==e?8:12,r=0;r<i;r++)h()&&g(r<6?16:64,t)}m();const b=d();if(0===b)d();else if(1===b)for(p(1),f(),f(),n=d(),r=0;r<n;r++)f();m(),p(1);const y=d(),_=d(),w=u(1);0===w&&p(1),p(1),h()&&(a=d(),s=d(),o=d(),l=d());let x=[1,1];if(h()&&h()){switch(c()){case 1:x=[1,1];break;case 2:x=[12,11];break;case 3:x=[10,11];break;case 4:x=[16,11];break;case 5:x=[40,33];break;case 6:x=[24,11];break;case 7:x=[20,11];break;case 8:x=[32,11];break;case 9:x=[80,33];break;case 10:x=[18,11];break;case 11:x=[15,11];break;case 12:x=[64,33];break;case 13:x=[160,99];break;case 14:x=[4,3];break;case 15:x=[3,2];break;case 16:x=[2,1];break;case 255:x=[c()<<8|c(),c()<<8|c()]}}return{width:Math.ceil(16*(y+1)-2*a-2*s),height:(2-w)*(_+1)*16-(w?2:4)*(o+l),pixelRatio:x}}}class xr extends yr{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,n,i){const r=this.parseNALu(e,n.data,i);let a,s=this.VideoSample,o=!1;n.data=null,s&&r.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),r.forEach((i=>{var r,l;switch(i.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),s.frame=!0,a=!0;break;case 16:case 17:case 18:case 21:var c;if(a=!0,o)null!=(c=s)&&c.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null);s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 19:case 20:a=!0,null!=(r=s)&&r.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 39:a=!0,ye(i.data,2,n.pts,t.samples);break;case 32:a=!0,e.vps||("object"!=typeof e.params&&(e.params={}),e.params=y(e.params,this.readVPS(i.data)),this.initVPS=i.data),e.vps=[i.data];break;case 33:if(a=!0,o=!0,void 0===e.vps||e.vps[0]===this.initVPS||void 0===e.sps||this.matchSPS(e.sps[0],i.data)||(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const t=this.readSPS(i.data);e.width=t.width,e.height=t.height,e.pixelRatio=t.pixelRatio,e.codec=t.codecString,e.sps=[],"object"!=typeof e.params&&(e.params={});for(const n in t.params)e.params[n]=t.params[n]}this.pushParameterSet(e.sps,i.data,e.vps),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0;break;case 34:if(a=!0,"object"==typeof e.params){if(!e.pps){e.pps=[];const t=this.readPPS(i.data);for(const n in t)e.params[n]=t[n]}this.pushParameterSet(e.pps,i.data,e.vps)}break;case 35:a=!0,e.audFound=!0,null!=(l=s)&&l.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;default:a=!1}if(s&&a){s.units.push(i)}})),i&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}pushParameterSet(e,t,n){(n&&n[0]===this.initVPS||!n&&!e.length)&&e.push(t)}getNALuType(e,t){return(126&e[t])>>>1}ebsp2rbsp(e){const t=new Uint8Array(e.byteLength);let n=0;for(let i=0;i<e.byteLength;i++)i>=2&&3===e[i]&&0===e[i-1]&&0===e[i-2]||(t[n]=e[i],n++);return new Uint8Array(t.buffer,0,n)}pushAccessUnit(e,t){super.pushAccessUnit(e,t),this.initVPS&&(this.initVPS=null)}readVPS(e){const t=new _r(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);return{numTemporalLayers:t.readBits(3)+1,temporalIdNested:t.readBoolean()}}readSPS(e){const t=new _r(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const n=t.readBits(3);t.readBoolean();const i=t.readBits(2),r=t.readBoolean(),a=t.readBits(5),s=t.readUByte(),o=t.readUByte(),l=t.readUByte(),c=t.readUByte(),u=t.readUByte(),d=t.readUByte(),h=t.readUByte(),p=t.readUByte(),f=t.readUByte(),m=t.readUByte(),g=t.readUByte(),v=[],b=[];for(let e=0;e<n;e++)v.push(t.readBoolean()),b.push(t.readBoolean());if(n>0)for(let e=n;e<8;e++)t.readBits(2);for(let e=0;e<n;e++)v[e]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),b[e]&&t.readUByte();t.readUEG();const y=t.readUEG();3==y&&t.skipBits(1);const _=t.readUEG(),w=t.readUEG(),x=t.readBoolean();let k=0,S=0,E=0,C=0;x&&(k+=t.readUEG(),S+=t.readUEG(),E+=t.readUEG(),C+=t.readUEG());const T=t.readUEG(),A=t.readUEG(),M=t.readUEG();for(let e=t.readBoolean()?0:n;e<=n;e++)t.skipUEG(),t.skipUEG(),t.skipUEG();t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG();if(t.readBoolean()){if(t.readBoolean())for(let e=0;e<4;e++)for(let n=0;n<(3===e?2:6);n++){if(t.readBoolean()){const n=Math.min(64,1<<4+(e<<1));e>1&&t.readEG();for(let e=0;e<n;e++)t.readEG()}else t.readUEG()}}t.readBoolean(),t.readBoolean();t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const L=t.readUEG();let D=0;for(let e=0;e<L;e++){let n=!1;if(0!==e&&(n=t.readBoolean()),n){e===L&&t.readUEG(),t.readBoolean(),t.readUEG();let n=0;for(let e=0;e<=D;e++){const e=t.readBoolean();let i=!1;e||(i=t.readBoolean()),(e||i)&&n++}D=n}else{const e=t.readUEG(),n=t.readUEG();D=e+n;for(let n=0;n<e;n++)t.readUEG(),t.readBoolean();for(let e=0;e<n;e++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const e=t.readUEG();for(let n=0;n<e;n++){for(let e=0;e<M+4;e++)t.readBits(1);t.readBits(1)}}let I=0,R=1,P=1,O=!0,N=1,B=0;t.readBoolean(),t.readBoolean();let $=!1;if(t.readBoolean()){if(t.readBoolean()){const e=t.readUByte();e>0&&e<16?(R=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][e-1],P=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][e-1]):255===e&&(R=t.readBits(16),P=t.readBits(16))}t.readBoolean()&&t.readBoolean();if(t.readBoolean()){t.readBits(3),t.readBoolean();t.readBoolean()&&(t.readUByte(),t.readUByte(),t.readUByte())}t.readBoolean()&&(t.readUEG(),t.readUEG()),t.readBoolean(),t.readBoolean(),t.readBoolean(),$=t.readBoolean(),$&&(k+=t.readUEG(),S+=t.readUEG(),E+=t.readUEG(),C+=t.readUEG());if(t.readBoolean()){N=t.readBits(32),B=t.readBits(32);t.readBoolean()&&t.readUEG();if(t.readBoolean()){const e=t.readBoolean(),i=t.readBoolean();let r=!1;(e||i)&&(r=t.readBoolean(),r&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),r&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let a=0;a<=n;a++){O=t.readBoolean();let n=!1;O||t.readBoolean()?t.readEG():n=t.readBoolean();const a=n?1:t.readUEG()+1;if(e)for(let e=0;e<a;e++)t.readUEG(),t.readUEG(),r&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(i)for(let e=0;e<a;e++)t.readUEG(),t.readUEG(),r&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),I=t.readUEG())}let F=_,z=w;if(x||$){let e=1,t=1;1===y?e=t=2:2==y&&(e=2),F=_-e*S-e*k,z=w-t*C-t*E}const K=i?["A","B","C"][i]:"",U=s<<24|o<<16|l<<8|c;let j=0;for(let e=0;e<32;e++)j=(j|(U>>e&1)<<31-e)>>>0;let q=j.toString(16);1===a&&"2"===q&&(q="6");return{codecString:`hvc1.${K}${a}.${q}.${r?"H":"L"}${g}.B0`,params:{general_tier_flag:r,general_profile_idc:a,general_profile_space:i,general_profile_compatibility_flags:[s,o,l,c],general_constraint_indicator_flags:[u,d,h,p,f,m],general_level_idc:g,bit_depth:T+8,bit_depth_luma_minus8:T,bit_depth_chroma_minus8:A,min_spatial_segmentation_idc:I,chroma_format_idc:y,frame_rate:{fixed:O,fps:B/N}},width:F,height:z,pixelRatio:[R,P]}}readPPS(e){const t=new _r(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.skipUEG(),t.skipUEG(),t.skipBits(2),t.skipBits(3),t.skipBits(2),t.skipUEG(),t.skipUEG(),t.skipEG(),t.skipBits(2);t.readBoolean()&&t.skipUEG(),t.skipEG(),t.skipEG(),t.skipBits(4);const n=t.readBoolean(),i=t.readBoolean();let r=1;return i&&n?r=0:i?r=3:n&&(r=2),{parallelismType:r}}matchSPS(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)}}const kr=188;class Sr{constructor(e,t,n,i){this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.logger=i,this.videoParser=null}static probe(e,t){const n=Sr.syncOffset(e);return n>0&&t.warn(`MPEG2-TS detected but first sync word found @ offset ${n}`),-1!==n}static syncOffset(e){const t=e.length;let n=Math.min(940,t-kr)+1,i=0;for(;i<n;){let r=!1,a=-1,s=0;for(let o=i;o<t;o+=kr){if(71!==e[o]||t-o!==kr&&71!==e[o+kr]){if(s)return-1;break}if(s++,-1===a&&(a=o,0!==a&&(n=Math.min(a+18612,e.length-kr)+1)),r||(r=0===Er(e,o)),r&&s>1&&(0===a&&s>2||o+kr>n))return a}i++}return-1}static createTrack(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:Q[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===e?t:void 0}}resetInitSegment(e,t,n,i){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=Sr.createTrack("video"),this._videoTrack.duration=i,this._audioTrack=Sr.createTrack("audio",i),this._id3Track=Sr.createTrack("id3"),this._txtTrack=Sr.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=n}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:n}=this;e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,n=!1,i=!1){let r;n||(this.sampleAes=null);const a=this._videoTrack,s=this._audioTrack,o=this._id3Track,l=this._txtTrack;let c=a.pid,u=a.pesData,d=s.pid,h=o.pid,p=s.pesData,f=o.pesData,m=null,g=this.pmtParsed,v=this._pmtId,b=e.length;if(this.remainderData&&(b=(e=me(this.remainderData,e)).length,this.remainderData=null),b<kr&&!i)return this.remainderData=e,{audioTrack:s,videoTrack:a,id3Track:o,textTrack:l};const y=Math.max(0,Sr.syncOffset(e));b-=(b-y)%kr,b<e.byteLength&&!i&&(this.remainderData=new Uint8Array(e.buffer,b,e.buffer.byteLength-b));let _=0;for(let t=y;t<b;t+=kr)if(71===e[t]){const i=!!(64&e[t+1]),b=Er(e,t);let _;if((48&e[t+3])>>4>1){if(_=t+5+e[t+4],_===t+kr)continue}else _=t+4;switch(b){case c:if(i){if(u&&(r=Lr(u,this.logger))){if(null===this.videoParser)switch(a.segmentCodec){case"avc":this.videoParser=new wr;break;case"hevc":this.videoParser=new xr}null!==this.videoParser&&this.videoParser.parsePES(a,l,r,!1)}u={data:[],size:0}}u&&(u.data.push(e.subarray(_,t+kr)),u.size+=t+kr-_);break;case d:if(i){if(p&&(r=Lr(p,this.logger)))switch(s.segmentCodec){case"aac":this.parseAACPES(s,r);break;case"mp3":this.parseMPEGPES(s,r);break;case"ac3":this.parseAC3PES(s,r)}p={data:[],size:0}}p&&(p.data.push(e.subarray(_,t+kr)),p.size+=t+kr-_);break;case h:i&&(f&&(r=Lr(f,this.logger))&&this.parseID3PES(o,r),f={data:[],size:0}),f&&(f.data.push(e.subarray(_,t+kr)),f.size+=t+kr-_);break;case 0:i&&(_+=e[_]+1),v=this._pmtId=Cr(e,_);break;case v:{i&&(_+=e[_]+1);const r=Tr(e,_,this.typeSupported,n,this.observer,this.logger);c=r.videoPid,c>0&&(a.pid=c,a.segmentCodec=r.segmentVideoCodec),d=r.audioPid,d>0&&(s.pid=d,s.segmentCodec=r.segmentAudioCodec),h=r.id3Pid,h>0&&(o.pid=h),null===m||g||(this.logger.warn(`MPEG-TS PMT found at ${t} after unknown PID '${m}'. Backtracking to sync byte @${y} to parse all TS packets.`),m=null,t=y-188),g=this.pmtParsed=!0;break}case 17:case 8191:break;default:m=b}}else _++;_>0&&Ar(this.observer,new Error(`Found ${_} TS packet/s that do not start with 0x47`),void 0,this.logger),a.pesData=u,s.pesData=p,o.pesData=f;const w={audioTrack:s,videoTrack:a,id3Track:o,textTrack:l};return i&&this.extractRemainingSamples(w),w}flush(){const{remainderData:e}=this;let t;return this.remainderData=null,t=e?this.demux(e,-1,!1,!0):{videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:n,id3Track:i,textTrack:r}=e,a=n.pesData,s=t.pesData,o=i.pesData;let l;if(a&&(l=Lr(a,this.logger))){if(null===this.videoParser)switch(n.segmentCodec){case"avc":this.videoParser=new wr;break;case"hevc":this.videoParser=new xr}null!==this.videoParser&&(this.videoParser.parsePES(n,r,l,!0),n.pesData=null)}else n.pesData=a;if(s&&(l=Lr(s,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,l);break;case"mp3":this.parseMPEGPES(t,l);break;case"ac3":this.parseAC3PES(t,l)}t.pesData=null}else null!=s&&s.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=s;o&&(l=Lr(o,this.logger))?(this.parseID3PES(i,l),i.pesData=null):i.pesData=o}demuxSampleAes(e,t,n){const i=this.demux(e,n,!0,!this.config.progressive),r=this.sampleAes=new br(this.observer,this.config,t);return this.decrypt(i,r)}decrypt(e,t){return new Promise((n=>{const{audioTrack:i,videoTrack:r}=e;i.samples&&"aac"===i.segmentCodec?t.decryptAacSamples(i.samples,0,(()=>{r.samples?t.decryptAvcSamples(r.samples,0,0,(()=>{n(e)})):n(e)})):r.samples&&t.decryptAvcSamples(r.samples,0,0,(()=>{n(e)}))}))}destroy(){this.observer&&this.observer.removeAllListeners(),this.config=this.logger=this.observer=null,this.aacOverFlow=this.videoParser=this.remainderData=this.sampleAes=null,this._videoTrack=this._audioTrack=this._id3Track=this._txtTrack=void 0}parseAACPES(e,t){let n=0;const i=this.aacOverFlow;let r,a,s,o=t.data;if(i){this.aacOverFlow=null;const t=i.missing,r=i.sample.unit.byteLength;if(-1===t)o=me(i.sample.unit,o);else{const a=r-t;i.sample.unit.set(o.subarray(0,t),a),e.samples.push(i.sample),n=i.missing}}for(r=n,a=o.length;r<a-1&&!Fi(o,r);r++);if(r!==n){let e;const t=r<a-1;if(e=t?`AAC PES did not start with ADTS header,offset:${r}`:"No ADTS header found in AAC PES",Ar(this.observer,new Error(e),t,this.logger),!t)return}if(Ki(e,this.observer,o,r,this.audioCodec),void 0!==t.pts)s=t.pts;else{if(!i)return void this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");{const t=Ui(e.samplerate);s=i.sample.pts+t}}let l,c=0;for(;r<a;){if(l=ji(e,o,r,s,c),r+=l.length,l.missing){this.aacOverFlow=l;break}for(c++;r<a-1&&!Fi(o,r);r++);}}parseMPEGPES(e,t){const n=t.data,i=n.length;let r=0,a=0;const s=t.pts;if(void 0!==s)for(;a<i;)if(dr(n,a)){const t=lr(e,n,a,s,r);if(!t)break;a+=t.length,r++}else a++;else this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS")}parseAC3PES(e,t){{const n=t.data,i=t.pts;if(void 0===i)return void this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");const r=n.length;let a,s=0,o=0;for(;o<r&&(a=mr(e,n,o,i,s++))>0;)o+=a}}parseID3PES(e,t){if(void 0===t.pts)return void this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");const n=y({},t,{type:this._videoTrack?Qi.emsg:Qi.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function Er(e,t){return((31&e[t+1])<<8)+e[t+2]}function Cr(e,t){return(31&e[t+10])<<8|e[t+11]}function Tr(e,t,n,i,r,a){const s={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},o=t+3+((15&e[t+1])<<8|e[t+2])-4;for(t+=12+((15&e[t+10])<<8|e[t+11]);t<o;){const o=Er(e,t),l=(15&e[t+3])<<8|e[t+4];switch(e[t]){case 207:if(!i){Mr("ADTS AAC",a);break}case 15:-1===s.audioPid&&(s.audioPid=o);break;case 21:-1===s.id3Pid&&(s.id3Pid=o);break;case 219:if(!i){Mr("H.264",a);break}case 27:-1===s.videoPid&&(s.videoPid=o);break;case 3:case 4:n.mpeg||n.mp3?-1===s.audioPid&&(s.audioPid=o,s.segmentAudioCodec="mp3"):a.log("MPEG audio found, not supported in this browser");break;case 193:if(!i){Mr("AC-3",a);break}case 129:n.ac3?-1===s.audioPid&&(s.audioPid=o,s.segmentAudioCodec="ac3"):a.log("AC-3 audio found, not supported in this browser");break;case 6:if(-1===s.audioPid&&l>0){let i=t+5,r=l;for(;r>2;){if(106===e[i])!0!==n.ac3?a.log("AC-3 audio found, not supported in this browser for now"):(s.audioPid=o,s.segmentAudioCodec="ac3");const t=e[i+1]+2;i+=t,r-=t}}break;case 194:case 135:return Ar(r,new Error("Unsupported EC-3 in M2TS found"),void 0,a),s;case 36:-1===s.videoPid&&(s.videoPid=o,s.segmentVideoCodec="hevc",a.log("HEVC in M2TS found"))}t+=l+5}return s}function Ar(e,t,n,i){i.warn(`parsing error: ${t.message}`),e.emit(l.ERROR,l.ERROR,{type:s.MEDIA_ERROR,details:o.FRAG_PARSING_ERROR,fatal:!1,levelRetry:n,error:t,reason:t.message})}function Mr(e,t){t.log(`${e} with AES-128-CBC encryption found in unencrypted stream`)}function Lr(e,t){let n,i,r,a,s,o=0;const l=e.data;if(!e||0===e.size)return null;for(;l[0].length<19&&l.length>1;)l[0]=me(l[0],l[1]),l.splice(1,1);n=l[0];if(1===(n[0]<<16)+(n[1]<<8)+n[2]){if(i=(n[4]<<8)+n[5],i&&i>e.size-6)return null;const c=n[7];192&c&&(a=536870912*(14&n[9])+4194304*(255&n[10])+16384*(254&n[11])+128*(255&n[12])+(254&n[13])/2,64&c?(s=536870912*(14&n[14])+4194304*(255&n[15])+16384*(254&n[16])+128*(255&n[17])+(254&n[18])/2,a-s>54e5&&(t.warn(`${Math.round((a-s)/9e4)}s delta between PTS and DTS, align them`),a=s)):s=a),r=n[8];let u=r+9;if(e.size<=u)return null;e.size-=u;const d=new Uint8Array(e.size);for(let e=0,t=l.length;e<t;e++){n=l[e];let t=n.byteLength;if(u){if(u>t){u-=t;continue}n=n.subarray(u),t-=u,u=0}d.set(n,o),o+=t}return i&&(i-=r+3),{data:d,pts:a,dts:s,len:i}}return null}class Dr{static getSilentFrame(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}}}const Ir=Math.pow(2,32)-1;class Rr{static init(){let e;for(e in Rr.types={avc1:[],avcC:[],hvc1:[],hvcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},Rr.types)Rr.types.hasOwnProperty(e)&&(Rr.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),n=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);Rr.HDLR_TYPES={video:t,audio:n};const i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),r=new Uint8Array([0,0,0,0,0,0,0,0]);Rr.STTS=Rr.STSC=Rr.STCO=r,Rr.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Rr.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),Rr.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Rr.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const a=new Uint8Array([105,115,111,109]),s=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);Rr.FTYP=Rr.box(Rr.types.ftyp,a,o,a,s),Rr.DINF=Rr.box(Rr.types.dinf,Rr.box(Rr.types.dref,i))}static box(e,...t){let n=8,i=t.length;const r=i;for(;i--;)n+=t[i].byteLength;const a=new Uint8Array(n);for(a[0]=n>>24&255,a[1]=n>>16&255,a[2]=n>>8&255,a[3]=255&n,a.set(e,4),i=0,n=8;i<r;i++)a.set(t[i],n),n+=t[i].byteLength;return a}static hdlr(e){return Rr.box(Rr.types.hdlr,Rr.HDLR_TYPES[e])}static mdat(e){return Rr.box(Rr.types.mdat,e)}static mdhd(e,t){t*=e;const n=Math.floor(t/(Ir+1)),i=Math.floor(t%(Ir+1));return Rr.box(Rr.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i,85,196,0,0]))}static mdia(e){return Rr.box(Rr.types.mdia,Rr.mdhd(e.timescale||0,e.duration||0),Rr.hdlr(e.type),Rr.minf(e))}static mfhd(e){return Rr.box(Rr.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))}static minf(e){return"audio"===e.type?Rr.box(Rr.types.minf,Rr.box(Rr.types.smhd,Rr.SMHD),Rr.DINF,Rr.stbl(e)):Rr.box(Rr.types.minf,Rr.box(Rr.types.vmhd,Rr.VMHD),Rr.DINF,Rr.stbl(e))}static moof(e,t,n){return Rr.box(Rr.types.moof,Rr.mfhd(e),Rr.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=Rr.trak(e[t]);return Rr.box.apply(null,[Rr.types.moov,Rr.mvhd(e[0].timescale||0,e[0].duration||0)].concat(n).concat(Rr.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=Rr.trex(e[t]);return Rr.box.apply(null,[Rr.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(Ir+1)),i=Math.floor(t%(Ir+1)),r=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return Rr.box(Rr.types.mvhd,r)}static sdtp(e){const t=e.samples||[],n=new Uint8Array(4+t.length);let i,r;for(i=0;i<t.length;i++)r=t[i].flags,n[i+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return Rr.box(Rr.types.sdtp,n)}static stbl(e){return Rr.box(Rr.types.stbl,Rr.stsd(e),Rr.box(Rr.types.stts,Rr.STTS),Rr.box(Rr.types.stsc,Rr.STSC),Rr.box(Rr.types.stsz,Rr.STSZ),Rr.box(Rr.types.stco,Rr.STCO))}static avc1(e){let t,n,i,r=[],a=[];for(t=0;t<e.sps.length;t++)n=e.sps[t],i=n.byteLength,r.push(i>>>8&255),r.push(255&i),r=r.concat(Array.prototype.slice.call(n));for(t=0;t<e.pps.length;t++)n=e.pps[t],i=n.byteLength,a.push(i>>>8&255),a.push(255&i),a=a.concat(Array.prototype.slice.call(n));const s=Rr.box(Rr.types.avcC,new Uint8Array([1,r[3],r[4],r[5],255,224|e.sps.length].concat(r).concat([e.pps.length]).concat(a))),o=e.width,l=e.height,c=e.pixelRatio[0],u=e.pixelRatio[1];return Rr.box(Rr.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,o>>8&255,255&o,l>>8&255,255&l,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),s,Rr.box(Rr.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Rr.box(Rr.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,255&c,u>>24,u>>16&255,u>>8&255,255&u])))}static esds(e){const t=e.config;return new Uint8Array([0,0,0,0,3,25,0,1,0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,...t,6,1,2])}static audioStsd(e){const t=e.samplerate||0;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount||0,0,16,0,0,0,0,t>>8&255,255&t,0,0])}static mp4a(e){return Rr.box(Rr.types.mp4a,Rr.audioStsd(e),Rr.box(Rr.types.esds,Rr.esds(e)))}static mp3(e){return Rr.box(Rr.types[".mp3"],Rr.audioStsd(e))}static ac3(e){return Rr.box(Rr.types["ac-3"],Rr.audioStsd(e),Rr.box(Rr.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if("audio"===e.type){if("aac"===t)return Rr.box(Rr.types.stsd,Rr.STSD,Rr.mp4a(e));if("ac3"===t&&e.config)return Rr.box(Rr.types.stsd,Rr.STSD,Rr.ac3(e));if("mp3"===t&&"mp3"===e.codec)return Rr.box(Rr.types.stsd,Rr.STSD,Rr.mp3(e))}else{if(!e.pps||!e.sps)throw new Error("video track missing pps or sps");if("avc"===t)return Rr.box(Rr.types.stsd,Rr.STSD,Rr.avc1(e));if("hevc"===t&&e.vps)return Rr.box(Rr.types.stsd,Rr.STSD,Rr.hvc1(e))}throw new Error(`unsupported ${e.type} segment codec (${t}/${e.codec})`)}static tkhd(e){const t=e.id,n=(e.duration||0)*(e.timescale||0),i=e.width||0,r=e.height||0,a=Math.floor(n/(Ir+1)),s=Math.floor(n%(Ir+1));return Rr.box(Rr.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a,s>>24,s>>16&255,s>>8&255,255&s,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,255&i,0,0,r>>8&255,255&r,0,0]))}static traf(e,t){const n=Rr.sdtp(e),i=e.id,r=Math.floor(t/(Ir+1)),a=Math.floor(t%(Ir+1));return Rr.box(Rr.types.traf,Rr.box(Rr.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])),Rr.box(Rr.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,a>>24,a>>16&255,a>>8&255,255&a])),Rr.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,Rr.box(Rr.types.trak,Rr.tkhd(e),Rr.mdia(e))}static trex(e){const t=e.id;return Rr.box(Rr.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const n=e.samples||[],i=n.length,r=12+16*i,a=new Uint8Array(r);let s,o,l,c,u,d;for(t+=8+r,a.set(["video"===e.type?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,255&i,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0),s=0;s<i;s++)o=n[s],l=o.duration,c=o.size,u=o.flags,d=o.cts,a.set([l>>>24&255,l>>>16&255,l>>>8&255,255&l,c>>>24&255,c>>>16&255,c>>>8&255,255&c,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,61440&u.degradPrio,15&u.degradPrio,d>>>24&255,d>>>16&255,d>>>8&255,255&d],12+16*s);return Rr.box(Rr.types.trun,a)}static initSegment(e){Rr.types||Rr.init();const t=Rr.moov(e);return me(Rr.FTYP,t)}static hvc1(e){const t=e.params,n=[e.vps,e.sps,e.pps],i=new Uint8Array([1,t.general_profile_space<<6|(t.general_tier_flag?32:0)|t.general_profile_idc,t.general_profile_compatibility_flags[0],t.general_profile_compatibility_flags[1],t.general_profile_compatibility_flags[2],t.general_profile_compatibility_flags[3],t.general_constraint_indicator_flags[0],t.general_constraint_indicator_flags[1],t.general_constraint_indicator_flags[2],t.general_constraint_indicator_flags[3],t.general_constraint_indicator_flags[4],t.general_constraint_indicator_flags[5],t.general_level_idc,240|t.min_spatial_segmentation_idc>>8,255&t.min_spatial_segmentation_idc,252|t.parallelismType,252|t.chroma_format_idc,248|t.bit_depth_luma_minus8,248|t.bit_depth_chroma_minus8,0,parseInt(t.frame_rate.fps),3|t.temporal_id_nested<<2|t.num_temporal_layers<<3|(t.frame_rate.fixed?64:0),n.length]);let r=i.length;for(let e=0;e<n.length;e+=1){r+=3;for(let t=0;t<n[e].length;t+=1)r+=2+n[e][t].length}const a=new Uint8Array(r);a.set(i,0),r=i.length;const s=n.length-1;for(let e=0;e<n.length;e+=1){a.set(new Uint8Array([32+e|(e===s?128:0),0,n[e].length]),r),r+=3;for(let t=0;t<n[e].length;t+=1)a.set(new Uint8Array([n[e][t].length>>8,255&n[e][t].length]),r),r+=2,a.set(n[e][t],r),r+=n[e][t].length}const o=Rr.box(Rr.types.hvcC,a),l=e.width,c=e.height,u=e.pixelRatio[0],d=e.pixelRatio[1];return Rr.box(Rr.types.hvc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,255&l,c>>8&255,255&c,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,Rr.box(Rr.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Rr.box(Rr.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,255&u,d>>24,d>>16&255,d>>8&255,255&d])))}}Rr.types=void 0,Rr.HDLR_TYPES=void 0,Rr.STTS=void 0,Rr.STSC=void 0,Rr.STCO=void 0,Rr.STSZ=void 0,Rr.VMHD=void 0,Rr.SMHD=void 0,Rr.STSD=void 0,Rr.FTYP=void 0,Rr.DINF=void 0;function Pr(e,t,n=1,i=!1){const r=e*t*n;return i?Math.round(r):r}function Or(e,t=!1){return Pr(e,1e3,1/9e4,t)}let Nr,Br=null,$r=null;function Fr(e,t,n,i){return{duration:t,size:n,cts:i,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:e?2:1,isNonSync:e?0:1}}}class zr{constructor(e,t,n,i){if(this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.logger=i,this.ISGenerated=!1,null===Br){const e=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Br=e?parseInt(e[1]):0}if(null===$r){const e=navigator.userAgent.match(/Safari\/(\d+)/i);$r=e?parseInt(e[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){this.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const n=e[0].pts,i=e.reduce(((e,i)=>{let r=i.pts,a=r-e;return a<-4294967296&&(t=!0,r=Kr(r,n),a=r-e),a>0?e:r}),n);return t&&this.logger.debug("PTS rollover detected"),i}remux(e,t,n,i,r,a,s,o){let l,c,u,d,h,p,m=r,g=r;const v=e.pid>-1,b=t.pid>-1,y=t.samples.length,_=e.samples.length>0,w=s&&y>0||y>1;if((!v||_)&&(!b||w)||this.ISGenerated||s){if(this.ISGenerated){var x,k,S,E;const e=this.videoTrackConfig;(e&&(t.width!==e.width||t.height!==e.height||(null==(x=t.pixelRatio)?void 0:x[0])!==(null==(k=e.pixelRatio)?void 0:k[0])||(null==(S=t.pixelRatio)?void 0:S[1])!==(null==(E=e.pixelRatio)?void 0:E[1]))||!e&&w||null===this.nextAudioPts&&_)&&this.resetInitSegment()}this.ISGenerated||(u=this.generateIS(e,t,r,a));const n=this.isVideoContiguous;let i,s=-1;if(w&&(s=function(e){for(let t=0;t<e.length;t++)if(e[t].key)return t;return-1}(t.samples),!n&&this.config.forceKeyFrameOnDiscontinuity))if(p=!0,s>0){this.logger.warn(`[mp4-remuxer]: Dropped ${s} out of ${y} video samples due to a missing keyframe`);const e=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(s),t.dropped+=s,g+=(t.samples[0].pts-e)/t.inputTimeScale,i=g}else-1===s&&(this.logger.warn(`[mp4-remuxer]: No keyframe found out of ${y} video samples`),p=!1);if(this.ISGenerated){if(_&&w){const n=this.getVideoStartPts(t.samples),i=(Kr(e.samples[0].pts,n)-n)/t.inputTimeScale;m+=Math.max(0,i),g+=Math.max(0,-i)}if(_){if(e.samplerate||(this.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),u=this.generateIS(e,t,r,a)),c=this.remuxAudio(e,m,this.isAudioContiguous,a,b||w||o===f?g:void 0),w){const i=c?c.endPTS-c.startPTS:0;t.inputTimeScale||(this.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),u=this.generateIS(e,t,r,a)),l=this.remuxVideo(t,g,n,i)}}else w&&(l=this.remuxVideo(t,g,n,0));l&&(l.firstKeyFrame=s,l.independent=-1!==s,l.firstKeyFramePTS=i)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(h=Ur(n,r,this._initPTS,this._initDTS)),i.samples.length&&(d=jr(i,r,this._initPTS))),{audio:c,video:l,initSegment:u,independent:p,text:d,id3:h}}generateIS(e,t,n,i){const r=e.samples,a=t.samples,s=this.typeSupported,o={},l=this._initPTS;let c,u,d,h,p=!l||i,f="audio/mp4";if(p&&(c=u=1/0),e.config&&r.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":s.mpeg?(f="audio/mpeg",e.codec=""):s.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3"}o.audio={id:"audio",container:f,codec:e.codec,initSegment:"mp3"===e.segmentCodec&&s.mpeg?new Uint8Array(0):Rr.initSegment([e]),metadata:{channelCount:e.channelCount}},p&&(h=e.id,d=e.inputTimeScale,l&&d===l.timescale?p=!1:c=u=r[0].pts-Math.round(d*n))}if(t.sps&&t.pps&&a.length){if(t.timescale=t.inputTimeScale,o.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:Rr.initSegment([t]),metadata:{width:t.width,height:t.height}},p)if(h=t.id,d=t.inputTimeScale,l&&d===l.timescale)p=!1;else{const e=this.getVideoStartPts(a),t=Math.round(d*n);u=Math.min(u,Kr(a[0].dts,e)-t),c=Math.min(c,e-t)}this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(o).length)return this.ISGenerated=!0,p?(this._initPTS={baseTime:c,timescale:d},this._initDTS={baseTime:u,timescale:d}):c=d=void 0,{tracks:o,initPTS:c,timescale:d,trackId:h}}remuxVideo(e,t,n,i){const r=e.inputTimeScale,a=e.samples,c=[],u=a.length,d=this._initPTS;let h,p,f=this.nextAvcDts,m=8,g=this.videoSampleDuration,v=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,_=!1;if(!n||null===f){const e=t*r,i=a[0].pts-Kr(a[0].dts,a[0].pts);Br&&null!==f&&Math.abs(e-i-f)<15e3?n=!0:f=e-i}const w=d.baseTime*r/d.timescale;for(let e=0;e<u;e++){const t=a[e];t.pts=Kr(t.pts-w,f),t.dts=Kr(t.dts-w,f),t.dts<a[e>0?e-1:e].dts&&(_=!0)}_&&a.sort((function(e,t){const n=e.dts-t.dts,i=e.pts-t.pts;return n||i})),h=a[0].dts,p=a[a.length-1].dts;const x=p-h,k=x?Math.round(x/(u-1)):g||e.inputTimeScale/30;if(n){const n=h-f,i=n>k,r=n<-1;if((i||r)&&(i?this.logger.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Or(n,!0)} ms (${n}dts) hole between fragments detected at ${t.toFixed(3)}`):this.logger.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Or(-n,!0)} ms (${n}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!r||f>=a[0].pts||Br)){h=f;const e=a[0].pts-n;if(i)a[0].dts=h,a[0].pts=e;else{let t=!0;for(let i=0;i<a.length&&!(a[i].dts>e&&t);i++){const e=a[i].pts;if(a[i].dts-=n,a[i].pts-=n,i<a.length-1){const n=a[i+1].pts;t=n<=a[i].pts==n<=e}}}this.logger.log(`Video: Initial PTS/DTS adjusted: ${Or(e,!0)}/${Or(h,!0)}, delta: ${Or(n,!0)} ms`)}}h=Math.max(0,h);let S=0,E=0,C=h;for(let e=0;e<u;e++){const t=a[e],n=t.units,i=n.length;let r=0;for(let e=0;e<i;e++)r+=n[e].data.length;E+=r,S+=i,t.length=r,t.dts<C?(t.dts=C,C+=k/4|0||1):C=t.dts,v=Math.min(t.pts,v),b=Math.max(t.pts,b)}p=a[u-1].dts;const T=E+4*S+8;let A;try{A=new Uint8Array(T)}catch(e){return void this.observer.emit(l.ERROR,l.ERROR,{type:s.MUX_ERROR,details:o.REMUX_ALLOC_ERROR,fatal:!1,error:e,bytes:T,reason:`fail allocating video mdat ${T}`})}const M=new DataView(A.buffer);M.setUint32(0,T),A.set(Rr.types.mdat,4);let L=!1,D=Number.POSITIVE_INFINITY,I=Number.POSITIVE_INFINITY,R=Number.NEGATIVE_INFINITY,P=Number.NEGATIVE_INFINITY;for(let e=0;e<u;e++){const t=a[e],n=t.units;let s,o=0;for(let e=0,t=n.length;e<t;e++){const t=n[e],i=t.data,r=t.data.byteLength;M.setUint32(m,r),m+=4,A.set(i,m),m+=r,o+=4+r}if(e<u-1)g=a[e+1].dts-t.dts,s=a[e+1].pts-t.pts;else{const n=this.config,o=e>0?t.dts-a[e-1].dts:k;if(s=e>0?t.pts-a[e-1].pts:k,n.stretchShortVideoTrack&&null!==this.nextAudioPts){const e=Math.floor(n.maxBufferHole*r),a=(i?v+i*r:this.nextAudioPts)-t.pts;a>e?(g=a-o,g<0?g=o:L=!0,this.logger.log(`[mp4-remuxer]: It is approximately ${a/90} ms to the next segment; using duration ${g/90} ms for the last video frame.`)):g=o}else g=o}const l=Math.round(t.pts-t.dts);D=Math.min(D,g),R=Math.max(R,g),I=Math.min(I,s),P=Math.max(P,s),c.push(Fr(t.key,g,o,l))}if(c.length)if(Br){if(Br<70){const e=c[0].flags;e.dependsOn=2,e.isNonSync=0}}else if($r&&P-I<R-D&&k/R<.025&&0===c[0].cts){this.logger.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let e=h;for(let t=0,n=c.length;t<n;t++){const i=e+c[t].duration,r=e+c[t].cts;if(t<n-1){const e=i+c[t+1].cts;c[t].duration=e-r}else c[t].duration=t?c[t-1].duration:k;c[t].cts=0,e=i}}g=L||!g?k:g,this.nextAvcDts=f=p+g,this.videoSampleDuration=g,this.isVideoContiguous=!0;const O={data1:Rr.moof(e.sequenceNumber++,h,y(e,{samples:c})),data2:A,startPTS:v/r,endPTS:(b+g)/r,startDTS:h/r,endDTS:f/r,type:"video",hasAudio:!1,hasVideo:!0,nb:c.length,dropped:e.dropped};return e.samples=[],e.dropped=0,O}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return 1152;case"ac3":return 1536;default:return 1024}}remuxAudio(e,t,n,i,r){const a=e.inputTimeScale,c=a/(e.samplerate?e.samplerate:a),u=this.getSamplesPerFrame(e),d=u*c,h=this._initPTS,p="mp3"===e.segmentCodec&&this.typeSupported.mpeg,f=[],m=void 0!==r;let g=e.samples,v=p?0:8,b=this.nextAudioPts||-1;const _=t*a,w=h.baseTime*a/h.timescale;if(this.isAudioContiguous=n=n||g.length&&b>0&&(i&&Math.abs(_-b)<9e3||Math.abs(Kr(g[0].pts-w,_)-b)<20*d),g.forEach((function(e){e.pts=Kr(e.pts-w,_)})),!n||b<0){if(g=g.filter((e=>e.pts>=0)),!g.length)return;b=0===r?0:i&&!m?Math.max(0,_):g[0].pts}if("aac"===e.segmentCodec){const t=this.config.maxAudioFramesDrift;for(let n=0,i=b;n<g.length;n++){const r=g[n],s=r.pts,o=s-i,l=Math.abs(1e3*o/a);if(o<=-t*d&&m)0===n&&(this.logger.warn(`Audio frame @ ${(s/a).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*o/a)} ms.`),this.nextAudioPts=b=i=s);else if(o>=t*d&&l<1e4&&m){let t=Math.round(o/d);i=s-t*d,i<0&&(t--,i+=d),0===n&&(this.nextAudioPts=b=i),this.logger.warn(`[mp4-remuxer]: Injecting ${t} audio frame @ ${(i/a).toFixed(3)}s due to ${Math.round(1e3*o/a)} ms gap.`);for(let a=0;a<t;a++){const t=Math.max(i,0);let a=Dr.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);a||(this.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),a=r.unit.subarray()),g.splice(n,0,{unit:a,pts:t}),i+=d,n++}}r.pts=i,i+=d}}let x,k=null,S=null,E=0,C=g.length;for(;C--;)E+=g[C].unit.byteLength;for(let t=0,i=g.length;t<i;t++){const i=g[t],r=i.unit;let a=i.pts;if(null!==S){f[t-1].duration=Math.round((a-S)/c)}else{if(n&&"aac"===e.segmentCodec&&(a=b),k=a,!(E>0))return;E+=v;try{x=new Uint8Array(E)}catch(e){return void this.observer.emit(l.ERROR,l.ERROR,{type:s.MUX_ERROR,details:o.REMUX_ALLOC_ERROR,fatal:!1,error:e,bytes:E,reason:`fail allocating audio mdat ${E}`})}if(!p){new DataView(x.buffer).setUint32(0,E),x.set(Rr.types.mdat,4)}}x.set(r,v);const d=r.byteLength;v+=d,f.push(Fr(!0,u,d,0)),S=a}const T=f.length;if(!T)return;const A=f[f.length-1];this.nextAudioPts=b=S+c*A.duration;const M=p?new Uint8Array(0):Rr.moof(e.sequenceNumber++,k/c,y({},e,{samples:f}));e.samples=[];const L=k/a,D=b/a,I={data1:M,data2:x,startPTS:L,endPTS:D,startDTS:L,endDTS:D,type:"audio",hasAudio:!0,hasVideo:!1,nb:T};return this.isAudioContiguous=!0,I}}function Kr(e,t){let n;if(null===t)return e;for(n=t<e?-8589934592:8589934592;Math.abs(e-t)>4294967296;)e+=n;return e}function Ur(e,t,n,i){const r=e.samples.length;if(!r)return;const a=e.inputTimeScale;for(let s=0;s<r;s++){const r=e.samples[s];r.pts=Kr(r.pts-n.baseTime*a/n.timescale,t*a)/a,r.dts=Kr(r.dts-i.baseTime*a/i.timescale,t*a)/a}const s=e.samples;return e.samples=[],{samples:s}}function jr(e,t,n){const i=e.samples.length;if(!i)return;const r=e.inputTimeScale;for(let a=0;a<i;a++){const i=e.samples[a];i.pts=Kr(i.pts-n.baseTime*r/n.timescale,t*r)/r}e.samples.sort(((e,t)=>e.pts-t.pts));const a=e.samples;return e.samples=[],{samples:a}}function qr(e,t,n=!1){return void 0!==(null==e?void 0:e.start)?(e.start+(n?e.duration:0))/e.timescale:t}function Hr(e,t,n){const i=null==e?void 0:e.codec;if(i&&i.length>4)return i;if(t===j){if("ec-3"===i||"ac-3"===i||"alac"===i)return i;if("fLaC"===i||"Opus"===i){return Re(i,!1)}return n.warn(`Unhandled audio codec "${i}" in mp4 MAP`),i||"mp4a"}return n.warn(`Unhandled video codec "${i}" in mp4 MAP`),i||"avc1"}try{Nr=self.performance.now.bind(self.performance)}catch(e){Nr=Date.now}const Vr=[{demux:class{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,n,i){const r=this.videoTrack=er("video",1),a=this.audioTrack=er("audio",1),s=this.txtTrack=er("text",1);if(this.id3Track=er("id3",1),this.timeOffset=0,null==e||!e.byteLength)return;const o=le(e);if(o.video){const{id:e,timescale:t,codec:n,supplemental:i}=o.video;r.id=e,r.timescale=s.timescale=t,r.codec=n,r.supplemental=i}if(o.audio){const{id:e,timescale:t,codec:n}=o.audio;a.id=e,a.timescale=t,a.codec=n}s.id=Q.text,r.sampleDuration=0,r.duration=a.duration=i}resetContiguity(){this.remainderData=null}static probe(e){return function(e){const t=e.byteLength;for(let n=0;n<t;){const i=ne(e,n);if(i>8&&109===e[n+4]&&111===e[n+5]&&111===e[n+6]&&102===e[n+7])return!0;n=i>1?n+i:t}return!1}(e)}demux(e,t){this.timeOffset=t;let n=e;const i=this.videoTrack,r=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=me(this.remainderData,e));const t=function(e){const t={valid:null,remainder:null},n=se(e,["moof"]);if(n.length<2)return t.remainder=e,t;const i=n[n.length-1];return t.valid=e.slice(0,i.byteOffset-8),t.remainder=e.slice(i.byteOffset-8),t}(n);this.remainderData=t.remainder,i.samples=t.valid||new Uint8Array}else i.samples=n;const a=this.extractID3Track(i,t);return r.samples=ge(t,i),{videoTrack:i,audioTrack:this.audioTrack,id3Track:a,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,n=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const i=this.extractID3Track(t,this.timeOffset);return n.samples=ge(e,t),{videoTrack:t,audioTrack:er(),id3Track:i,textTrack:er()}}extractID3Track(e,t){const n=this.id3Track;if(e.samples.length){const i=se(e.samples,["emsg"]);i&&i.forEach((e=>{const i=function(e){const t=e[0];let n="",i="",a=0,s=0,o=0,l=0,c=0,u=0;if(0===t){for(;"\0"!==ee(e.subarray(u,u+1));)n+=ee(e.subarray(u,u+1)),u+=1;for(n+=ee(e.subarray(u,u+1)),u+=1;"\0"!==ee(e.subarray(u,u+1));)i+=ee(e.subarray(u,u+1)),u+=1;i+=ee(e.subarray(u,u+1)),u+=1,a=ne(e,12),s=ne(e,16),l=ne(e,20),c=ne(e,24),u=28}else if(1===t){u+=4,a=ne(e,u),u+=4;const t=ne(e,u);u+=4;const s=ne(e,u);for(u+=4,o=2**32*t+s,r(o)||(o=Number.MAX_SAFE_INTEGER,A.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),l=ne(e,u),u+=4,c=ne(e,u),u+=4;"\0"!==ee(e.subarray(u,u+1));)n+=ee(e.subarray(u,u+1)),u+=1;for(n+=ee(e.subarray(u,u+1)),u+=1;"\0"!==ee(e.subarray(u,u+1));)i+=ee(e.subarray(u,u+1)),u+=1;i+=ee(e.subarray(u,u+1)),u+=1}return{schemeIdUri:n,value:i,timeScale:a,presentationTime:o,presentationTimeDelta:s,eventDuration:l,id:c,payload:e.subarray(u,e.byteLength)}}(e);if(gr.test(i.schemeIdUri)){const e=vr(i,t);let r=4294967295===i.eventDuration?Number.POSITIVE_INFINITY:i.eventDuration/i.timeScale;r<=.001&&(r=Number.POSITIVE_INFINITY);const a=i.payload;n.samples.push({data:a,len:a.byteLength,dts:e,pts:e,type:Qi.emsg,duration:r})}else if(this.config.enableEmsgKLVMetadata&&i.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const e=vr(i,t);n.samples.push({data:i.payload,len:i.payload.byteLength,dts:e,pts:e,type:Qi.misbklv,duration:Number.POSITIVE_INFINITY})}}))}return n}demuxSampleAes(e,t,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){this.config=null,this.remainderData=null,this.videoTrack=this.audioTrack=this.id3Track=this.txtTrack=void 0}},remux:class{constructor(e,t,n,i){this.logger=void 0,this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.isVideoContiguous=!1,this.logger=i}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(e,t,n,i){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(function(e,t){if(!e||!t)return e;const n=t.keyId;n&&t.isCommonEncryption&&se(e,["moov","trak"]).forEach((e=>{const t=se(e,["mdia","minf","stbl","stsd"])[0].subarray(8);let i=se(t,["enca"]);const r=i.length>0;r||(i=se(t,["encv"])),i.forEach((e=>{se(r?e.subarray(28):e.subarray(78),["sinf"]).forEach((e=>{const t=fe(e);if(t){const e=t.subarray(8,24);e.some((e=>0!==e))||(A.log(`[eme] Patching keyId in 'enc${r?"a":"v"}>sinf>>tenc' box: ${I(e)} -> ${I(n)}`),t.set(n,8))}}))}))}));return e}(e,i)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:n}=this;if(null==e||!e.byteLength)return this.initTracks=void 0,void(this.initData=void 0);const i=this.initData=le(e);i.audio&&(t=Hr(i.audio,j,this.logger)),i.video&&(n=Hr(i.video,q,this.logger));const r={};i.audio&&i.video?r.audiovideo={container:"video/mp4",codec:t+","+n,supplemental:i.video.supplemental,initSegment:e,id:"main"}:i.audio?r.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:i.video?r.video={container:"video/mp4",codec:n,supplemental:i.video.supplemental,initSegment:e,id:"main"}:this.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r}remux(e,t,n,r,a,s){var o,l;let{initPTS:c,lastEndTime:u}=this;const d={audio:void 0,video:void 0,text:r,id3:n,initSegment:void 0};i(u)||(u=this.lastEndTime=a||0);const h=t.samples;if(null==h||!h.length)return d;const p={initPTS:void 0,timescale:void 0,trackId:void 0};let f=this.initData;if(null!=(o=f)&&o.length||(this.generateInitSegment(h),f=this.initData),null==(l=f)||!l.length)return this.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),d;this.emitInitSegment&&(p.tracks=this.initTracks,this.emitInitSegment=!1);const m=function(e,t,n){const r={},a=se(e,["moof","traf"]);for(let e=0;e<a.length;e++){const s=a[e],o=se(s,["tfhd"])[0],l=ne(o,4),c=t[l];if(!c)continue;const u=r[l]||(r[l]={start:NaN,duration:0,sampleCount:0,timescale:c.timescale,type:c.type}),d=se(s,["tfdt"])[0];if(d){const e=d[0];let t=ne(d,4);1===e&&(t===X?n.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(t*=X+1,t+=ne(d,8))),i(t)&&(!i(u.start)||t<u.start)&&(u.start=t)}const h=c.default,p=ne(o,0)|(null==h?void 0:h.flags);let f=(null==h?void 0:h.duration)||0;8&p&&(f=ne(o,2&p?12:8));const m=se(s,["trun"]);let g=u.start||0,v=0,b=f;for(let e=0;e<m.length;e++){const t=m[e],n=ne(t,4),i=u.sampleCount;u.sampleCount+=n;const r=1&t[3],a=4&t[3],s=1&t[2],o=2&t[2],l=4&t[2],c=8&t[2];let d=8,h=n;for(r&&(d+=4),a&&n&&(1&t[d+1]||void 0!==u.keyFrameIndex||(u.keyFrameIndex=i),d+=4,s?(b=ne(t,d),d+=4):b=f,o&&(d+=4),c&&(d+=4),g+=b,v+=b,h--);h--;)s?(b=ne(t,d),d+=4):b=f,o&&(d+=4),l&&(1&t[d+1]||void 0===u.keyFrameIndex&&(u.keyFrameIndex=u.sampleCount-(h+1),u.keyFrameStart=g),d+=4),c&&(d+=4),g+=b,v+=b;!v&&f&&(v+=f*n)}u.duration+=v}if(!Object.keys(r).some((e=>r[e].duration))){let t=1/0,n=0;const a=se(e,["sidx"]);for(let e=0;e<a.length;e++){const i=oe(a[e]);if(null!=i&&i.references){t=Math.min(t,i.earliestPresentationTime/i.timescale);const e=i.references.reduce(((e,t)=>e+t.info.duration||0),0);n=Math.max(n,e+i.earliestPresentationTime/i.timescale)}}n&&i(n)&&Object.keys(r).forEach((e=>{r[e].duration||(r[e].duration=n*r[e].timescale-r[e].start)}))}return r}(h,f,this.logger),g=f.audio?m[f.audio.id]:null,v=f.video?m[f.video.id]:null,b=qr(v,1/0),y=qr(g,1/0),_=qr(v,0,!0),w=qr(g,0,!0);let x,k=a,S=0;if(g&&(!v||!c&&y<b||c&&c.trackId===f.audio.id)?(p.trackId=f.audio.id,x=g,S=w-y):v&&(p.trackId=f.video.id,x=v,S=_-b),x){const e=x.timescale;k=x.start/e,p.timescale=e,c||(p.initPTS=x.start-a*e,this.initPTS=c={baseTime:p.initPTS,timescale:e,trackId:p.trackId})}!s&&c||!function(e,t,n,i){if(null===e)return!0;const r=Math.max(i,1),a=t-e.baseTime/e.timescale;return Math.abs(a-n)>r}(c,k,a,S)&&p.timescale===c.timescale||(p.initPTS=k-a,c&&1===c.timescale&&this.logger.warn(`Adjusting initPTS @${a} from ${c.baseTime/c.timescale} to ${p.initPTS}`),this.initPTS=c={baseTime:p.initPTS,timescale:1});const E=e?k-c.baseTime/c.timescale:u;!function(e,t,n){se(t,["moof","traf"]).forEach((t=>{se(t,["tfhd"]).forEach((i=>{const r=ne(i,4),a=e[r];if(!a)return;const s=a.timescale||9e4;se(t,["tfdt"]).forEach((e=>{const t=e[0],i=n*s;if(i){let n=ne(e,4);if(0===t)n-=i,n=Math.max(n,0),ae(e,4,n);else{n*=Math.pow(2,32),n+=ne(e,8),n-=i,n=Math.max(n,0);const t=Math.floor(n/(X+1)),r=Math.floor(n%(X+1));ae(e,4,t),ae(e,8,r)}}}))}))}))}(f,h,c.baseTime/c.timescale);const C=E+S;S>0?this.lastEndTime=C:(this.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const T=!!f.audio,A=!!f.video;let M="";T&&(M+="audio"),A&&(M+="video");const L={data1:h,startPTS:E,startDTS:E,endPTS:C,endDTS:C,type:M,hasAudio:T,hasVideo:A,nb:1,dropped:0};d.audio=T&&!A?L:void 0,d.video=A?L:void 0;const D=null==v?void 0:v.sampleCount;if(D){const e=v.keyFrameIndex,t=-1!==e;L.nb=D,L.dropped=0===e||this.isVideoContiguous?0:t?e:D,L.independent=t,L.firstKeyFrame=e,t&&v.keyFrameStart&&(L.firstKeyFramePTS=v.keyFrameStart-c.baseTime/c.timescale),this.isVideoContiguous||(d.independent=t),this.isVideoContiguous||(this.isVideoContiguous=t),L.dropped&&this.logger.warn(`fmp4 does not start with IDR: firstIDR ${e}/${D} dropped: ${L.dropped} pts: ${L.firstKeyFramePTS||"NA"}`)}return d.initSegment=p,d.id3=Ur(n,a,c,c),r.samples.length&&(d.text=jr(r,a,c)),d}}},{demux:Sr,remux:zr},{demux:class extends tr{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e,t){if(!e)return!1;const n=Oi(e,0);let i=(null==n?void 0:n.length)||0;if(hr(e,i))return!1;for(let n=e.length;i<n;i++)if(zi(e,i))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return function(e,t){return function(e,t){return t+5<e.length}(e,t)&&Ni(e,t)&&$i(e,t)<=e.length-t}(e,t)}appendFrame(e,t,n){Ki(e,this.observer,t,n,e.manifestCodec);const i=ji(e,t,n,this.basePTS,this.frameIndex);if(i&&0===i.missing)return i}},remux:zr},{demux:class extends tr{resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=Oi(e,0);let n=(null==t?void 0:t.length)||0;if(t&&11===e[n]&&119===e[n+1]&&void 0!==Ji(t)&&pr(e,n)<=16)return!1;for(let t=e.length;n<t;n++)if(hr(e,n))return A.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return function(e,t){return ur(e,t)&&4<=e.length-t}(e,t)}appendFrame(e,t,n){if(null!==this.basePTS)return lr(e,t,n,this.basePTS,this.frameIndex)}},remux:zr}];Vr.splice(2,0,{demux:fr,remux:zr});class Gr{constructor(e,t,n,i,r,a){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=n,this.id=r,this.logger=a}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,n,i){const r=n.transmuxing;r.executeStart=Nr();let a=new Uint8Array(e);const{currentTransmuxState:c,transmuxConfig:u}=this;i&&(this.currentTransmuxState=i);const{contiguous:d,discontinuity:h,trackSwitch:p,accurateTimeOffset:f,timeOffset:m,initSegmentChange:g}=i||c,{audioCodec:v,videoCodec:b,defaultInitPts:y,duration:_,initSegmentData:w}=u,x=function(e,t){let n=null;e.byteLength>0&&null!=(null==t?void 0:t.key)&&null!==t.iv&&null!=t.method&&(n=t);return n}(a,t);if(x&&on(x.method)){const e=this.getDecrypter(),t=ln(x.method);if(!e.isSync())return this.asyncResult=!0,this.decryptionPromise=e.webCryptoDecrypt(a,x.key.buffer,x.iv.buffer,t).then((e=>{const t=this.push(e,null,n);return this.decryptionPromise=null,t})),this.decryptionPromise;{let i=e.softwareDecrypt(a,x.key.buffer,x.iv.buffer,t);if(n.part>-1){const t=e.flush();i=t?t.buffer:t}if(!i)return r.executeEnd=Nr(),Zr(n);a=new Uint8Array(i)}}const k=this.needsProbing(h,p);if(k){const e=this.configureTransmuxer(a);if(e)return this.logger.warn(`[transmuxer] ${e.message}`),this.observer.emit(l.ERROR,l.ERROR,{type:s.MEDIA_ERROR,details:o.FRAG_PARSING_ERROR,fatal:!1,error:e,reason:e.message}),r.executeEnd=Nr(),Zr(n)}(h||p||g||k)&&this.resetInitSegment(w,v,b,_,t),(h||g||k)&&this.resetInitialTimestamp(y),d||this.resetContiguity();const S=this.transmux(a,x,m,f,n);this.asyncResult=Wr(S);const E=this.currentTransmuxState;return E.contiguous=!0,E.discontinuity=!1,E.trackSwitch=!1,r.executeEnd=Nr(),S}flush(e){const t=e.transmuxing;t.executeStart=Nr();const{decrypter:n,currentTransmuxState:i,decryptionPromise:r}=this;if(r)return this.asyncResult=!0,r.then((()=>this.flush(e)));const a=[],{timeOffset:s}=i;if(n){const t=n.flush();t&&a.push(this.push(t.buffer,null,e))}const{demuxer:o,remuxer:l}=this;if(!o||!l){t.executeEnd=Nr();const n=[Zr(e)];return this.asyncResult?Promise.resolve(n):n}const c=o.flush(s);return Wr(c)?(this.asyncResult=!0,c.then((t=>(this.flushRemux(a,t,e),a)))):(this.flushRemux(a,c,e),this.asyncResult?Promise.resolve(a):a)}flushRemux(e,t,n){const{audioTrack:i,videoTrack:r,id3Track:a,textTrack:s}=t,{accurateTimeOffset:o,timeOffset:l}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${n.sn}${n.part>-1?" part: "+n.part:""} of ${this.id===p?"level":"track"} ${n.level}`);const c=this.remuxer.remux(i,r,a,s,l,o,!0,this.id);e.push({remuxResult:c,chunkMeta:n}),n.transmuxing.executeEnd=Nr()}resetInitialTimestamp(e){const{demuxer:t,remuxer:n}=this;t&&n&&(t.resetTimeStamp(e),n.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;e&&t&&(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,n,i,r){const{demuxer:a,remuxer:s}=this;a&&s&&(a.resetInitSegment(e,t,n,i),s.resetInitSegment(e,t,n,r))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,n,i,r){let a;return a=t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(e,t,n,i,r):this.transmuxUnencrypted(e,n,i,r),a}transmuxUnencrypted(e,t,n,i){const{audioTrack:r,videoTrack:a,id3Track:s,textTrack:o}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,a,s,o,t,n,!1,this.id),chunkMeta:i}}transmuxSampleAes(e,t,n,i,r){return this.demuxer.demuxSampleAes(e,t,n).then((e=>({remuxResult:this.remuxer.remux(e.audioTrack,e.videoTrack,e.id3Track,e.textTrack,n,i,!1,this.id),chunkMeta:r})))}configureTransmuxer(e){const{config:t,observer:n,typeSupported:i}=this;let r;for(let t=0,n=Vr.length;t<n;t++){var a;if(null!=(a=Vr[t].demux)&&a.probe(e,this.logger)){r=Vr[t];break}}if(!r)return new Error("Failed to find demuxer by probing fragment data");const s=this.demuxer,o=this.remuxer,l=r.remux,c=r.demux;o&&o instanceof l||(this.remuxer=new l(n,t,i,this.logger)),s&&s instanceof c||(this.demuxer=new c(n,t,i,this.logger),this.probe=c.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new Ft(this.config)),e}}const Zr=e=>({remuxResult:{},chunkMeta:e});function Wr(e){return"then"in e&&e.then instanceof Function}class Yr{constructor(e,t,n,i,r){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=n,this.duration=i,this.defaultInitPts=r||null}}class Xr{constructor(e,t,n,i,r,a){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=n,this.trackSwitch=i,this.timeOffset=r,this.initSegmentChange=a}}let Jr=0;class Qr{constructor(e,t,n,i){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=Jr++,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.onWorkerMessage=e=>{const t=e.data,n=this.hls;if(n&&null!=t&&t.event&&t.instanceNo===this.instanceNo)switch(t.event){case"init":{var i;const e=null==(i=this.workerContext)?void 0:i.objectURL;e&&self.URL.revokeObjectURL(e);break}case"transmuxComplete":this.handleTransmuxComplete(t.data);break;case"flush":this.onFlush(t.data);break;case"workerLog":n.logger[t.data.logType]&&n.logger[t.data.logType](t.data.message);break;default:t.data=t.data||{},t.data.frag=this.frag,t.data.part=this.part,t.data.id=this.id,n.trigger(t.event,t.data)}},this.onWorkerError=e=>{if(!this.hls)return;const t=new Error(`${e.message} (${e.filename}:${e.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(l.ERROR,{type:s.OTHER_ERROR,details:o.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:t})};const r=e.config;this.hls=e,this.id=t,this.useWorker=!!r.enableWorker,this.onTransmuxComplete=n,this.onFlush=i;const a=(e,t)=>{(t=t||{}).frag=this.frag||void 0,e===l.ERROR&&(t.parent=this.id,t.part=this.part,this.error=t.error),this.hls.trigger(e,t)};this.observer=new Mi,this.observer.on(l.FRAG_DECRYPTED,a),this.observer.on(l.ERROR,a);const c=Ne(r.preferManagedMediaSource);if(this.useWorker&&"undefined"!=typeof Worker){const n=this.hls.logger;if(r.workerPath||"function"==typeof __HLS_WORKER_BUNDLE__){try{r.workerPath?(n.log(`loading Web Worker ${r.workerPath} for "${t}"`),this.workerContext=function(e){const t=Di[e];if(t)return t.clientCount++,t;const n=new self.URL(e,self.location.href).href,i={worker:new self.Worker(n),scriptURL:n,clientCount:1};return Di[e]=i,i}(r.workerPath)):(n.log(`injecting Web Worker for "${t}"`),this.workerContext=function(){const e=Di[Li];if(e)return e.clientCount++,e;const t=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),n=self.URL.createObjectURL(t),i={worker:new self.Worker(n),objectURL:n,clientCount:1};return Di[Li]=i,i}());const{worker:e}=this.workerContext;e.addEventListener("message",this.onWorkerMessage),e.addEventListener("error",this.onWorkerError),e.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:c,id:t,config:Qe(r)})}catch(i){n.warn(`Error setting up "${t}" Web Worker, fallback to inline`,i),this.terminateWorker(),this.error=null,this.transmuxer=new Gr(this.observer,c,r,"",t,e.logger)}return}}this.transmuxer=new Gr(this.observer,c,r,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=Jr++;const t=this.hls.config,n=Ne(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:n,id:this.id,config:Qe(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),function(e){const t=Di[e||Li];if(t&&1==t.clientCount--){const{worker:n,objectURL:i}=t;delete Di[e||Li],i&&self.URL.revokeObjectURL(i),n.terminate()}}(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(e,t,n,i,r,a,s,o,l,c){var u,d;l.transmuxing.start=self.performance.now();const{instanceNo:h,transmuxer:f}=this,m=a?a.start:r.start,g=r.decryptdata,v=this.frag,b=!(v&&r.cc===v.cc),y=!(v&&l.level===v.level),_=v?l.sn-v.sn:-1,w=this.part?l.part-this.part.index:-1,x=0===_&&l.id>1&&l.id===(null==v?void 0:v.stats.chunkCount),k=!y&&(1===_||0===_&&(1===w||x&&w<=0)),S=self.performance.now();(y||_||0===r.stats.parsing.start)&&(r.stats.parsing.start=S),!a||!w&&k||(a.stats.parsing.start=S);const E=!(v&&(null==(u=r.initSegment)?void 0:u.url)===(null==(d=v.initSegment)?void 0:d.url)),C=new Xr(b,k,o,y,m,E);if(!k||b||E){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${r.type} sn: ${l.sn}${l.part>-1?" part: "+l.part:""} ${this.id===p?"level":"track"}: ${l.level} id: ${l.id}\n discontinuity: ${b}\n trackSwitch: ${y}\n contiguous: ${k}\n accurateTimeOffset: ${o}\n timeOffset: ${m}\n initSegmentChange: ${E}`);const e=new Yr(n,i,t,s,c);this.configureTransmuxer(e)}if(this.frag=r,this.part=a,this.workerContext)this.workerContext.worker.postMessage({instanceNo:h,cmd:"demux",data:e,decryptdata:g,chunkMeta:l,state:C},e instanceof ArrayBuffer?[e]:[]);else if(f){const t=f.push(e,g,l,C);Wr(t)?t.then((e=>{this.handleTransmuxComplete(e)})).catch((e=>{this.transmuxerError(e,l,"transmuxer-interface push error")})):this.handleTransmuxComplete(t)}}flush(e){e.transmuxing.start=self.performance.now();const{instanceNo:t,transmuxer:n}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:t,cmd:"flush",chunkMeta:e});else if(n){const t=n.flush(e);Wr(t)?t.then((t=>{this.handleFlushResult(t,e)})).catch((t=>{this.transmuxerError(t,e,"transmuxer-interface flush error")})):this.handleFlushResult(t,e)}}transmuxerError(e,t,n){this.hls&&(this.error=e,this.hls.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:e,err:e,reason:n}))}handleFlushResult(e,t){e.forEach((e=>{this.handleTransmuxComplete(e)})),this.onFlush(t)}configureTransmuxer(e){const{instanceNo:t,transmuxer:n}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:t,cmd:"configure",config:e}):n&&n.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}class ea extends x{constructor(e,t){super(t,e.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){-1!==this.timer&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,n){const i=null==t?void 0:t.renditionReports;if(i){let r=-1;for(let n=0;n<i.length;n++){const a=i[n];let s;try{s=new self.URL(a.URI,t.url).href}catch(e){this.warn(`Could not construct new URL for Rendition Report: ${e}`),s=a.URI||""}if(s===e){r=n;break}s===e.substring(0,s.length)&&(r=n)}if(-1!==r){const e=i[r],a=parseInt(e["LAST-MSN"])||(null==t?void 0:t.lastPartSn);let s=parseInt(e["LAST-PART"])||(null==t?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const e=Math.min(t.age-t.partTarget,t.targetduration);s>=0&&e>t.partTarget&&(s+=1)}const o=n&&Ze(n);return new We(a,s>=0?s:void 0,o)}}}loadPlaylist(e){this.clearTimer()}loadingPlaylist(e,t){this.clearTimer()}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}getUrlWithDirectives(e,t){if(t)try{return t.addDirectives(e)}catch(e){this.warn(`Could not construct new URL with HLS Delivery Directives: ${e}`)}return e}playlistLoaded(e,t,n){const{details:i,stats:r}=t,a=self.performance.now(),c=r.loading.first?Math.max(0,a-r.loading.first):0;i.advancedDateTime=Date.now()-c;const u=this.hls.config.timelineOffset;if(u!==i.appliedTimelineOffset){const e=Math.max(u||0,0);i.appliedTimelineOffset=e,i.fragments.forEach((t=>{t.start=t.playlistOffset+e}))}if(i.live||null!=n&&n.live){const u="levelInfo"in t?t.levelInfo:t.track;if(i.reloaded(n),n&&i.fragments.length>0){Yn(n,i);const e=i.playlistParsingError;if(e){this.warn(e);const n=this.hls;if(!n.config.ignorePlaylistParsingErrors){var d;const{networkDetails:a}=t;return void n.trigger(l.ERROR,{type:s.NETWORK_ERROR,details:o.LEVEL_PARSING_ERROR,fatal:!1,url:i.url,error:e,reason:e.message,level:t.level||void 0,parent:null==(d=i.fragments[0])?void 0:d.type,networkDetails:a,stats:r})}i.playlistParsingError=null}}-1===i.requestScheduled&&(i.requestScheduled=r.loading.start);const h=this.hls.mainForwardBufferInfo,p=h?h.end-h.len:0,f=ei(i,1e3*(i.edge-p));if(i.requestScheduled+f<a?i.requestScheduled=a:i.requestScheduled+=f,this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),!this.canLoad||!i.live)return;let m,g,v;if(i.canBlockReload&&i.endSN&&i.advanced){const e=this.hls.config.lowLatencyMode,r=i.lastPartSn,s=i.endSN,o=i.lastPartIndex,l=r===s;-1!==o?l?(g=s+1,v=e?0:o):(g=r,v=e?o+1:i.maxPartIndex):g=s+1;const c=i.age,d=c+i.ageHeader;let h=Math.min(d-i.partTarget,1.5*i.targetduration);if(h>0){if(d>3*i.targetduration)this.log(`Playlist last advanced ${c.toFixed(2)}s ago. Omitting segment and part directives.`),g=void 0,v=void 0;else if(null!=n&&n.tuneInGoal&&d-i.partTarget>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${h} with playlist age: ${i.age}`),h=0;else{const e=Math.floor(h/i.targetduration);if(g+=e,void 0!==v){v+=Math.round(h%i.targetduration/i.partTarget)}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${c.toFixed(2)}s goal: ${h} skip sn ${e} to part ${v}`)}i.tuneInGoal=h}if(m=this.getDeliveryDirectives(i,t.deliveryDirectives,g,v),e||!l)return i.requestScheduled=a,void this.loadingPlaylist(u,m)}else(i.canBlockReload||i.canSkipUntil)&&(m=this.getDeliveryDirectives(i,t.deliveryDirectives,g,v));m&&void 0!==g&&i.canBlockReload&&(i.requestScheduled=r.loading.first+Math.max(f-2*c,f/2)),this.scheduleLoading(u,m,i)}else this.clearTimer()}scheduleLoading(e,t,n){const i=n||e.details;if(!i)return void this.loadingPlaylist(e,t);const r=self.performance.now(),a=i.requestScheduled;if(r>=a)return void this.loadingPlaylist(e,t);const s=a-r;this.log(`reload live playlist ${e.name||e.bitrate+"bps"} in ${Math.round(s)} ms`),this.clearTimer(),this.timer=self.setTimeout((()=>this.loadingPlaylist(e,t)),s)}getDeliveryDirectives(e,t,n,i){let r=Ze(e);return null!=t&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,i=t.part,r=He),new We(n,i,r)}checkRetry(e){const t=e.details,n=pt(e),i=e.errorAction,{action:r,retryCount:a=0,retryConfig:s}=i||{},o=!!i&&!!s&&(r===wt||!i.resolved&&r===yt);if(o){var l;if(a>=s.maxNumRetry)return!1;if(n&&null!=(l=e.context)&&l.deliveryDirectives)this.warn(`Retrying playlist loading ${a+1}/${s.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const e=mt(s,a);this.clearTimer(),this.timer=self.setTimeout((()=>this.loadPlaylist()),e),this.warn(`Retrying playlist loading ${a+1}/${s.maxNumRetry} after "${t}" in ${e}ms`)}e.levelRetry=!0,i.resolved=!0}return o}}function ta(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!na(e[n].attrs,t[n].attrs))return!1;return!0}function na(e,t,n){const i=e["STABLE-RENDITION-ID"];return i&&!n?i===t["STABLE-RENDITION-ID"]:!(n||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some((n=>e[n]!==t[n]))}function ia(e,t){return t.label.toLowerCase()===e.name.toLowerCase()&&(!t.language||t.language.toLowerCase()===(e.lang||"").toLowerCase())}class ra{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,t,n){if(null===this.queues||null===this.tracks)return;const i=this.queues[t];i.push(e),1!==i.length||n||this.executeNext(t)}appendBlocker(e){return new Promise((t=>{const n={label:"async-blocker",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(n,e)}))}prependBlocker(e){return new Promise((t=>{if(this.queues){const n={label:"async-blocker-prepend",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(n)}}))}removeBlockers(){null!==this.queues&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach((e=>{var t;const n=null==(t=e[0])?void 0:t.label;"async-blocker"!==n&&"async-blocker-prepend"!==n||(e[0].execute(),e.splice(0,1))}))}unblockAudio(e){if(null===this.queues)return;this.queues.audio[0]===e&&this.shiftAndExecuteNext("audio")}executeNext(e){if(null===this.queues||null===this.tracks)return;const t=this.queues[e];if(t.length){const i=t[0];try{i.execute()}catch(t){var n;if(i.onError(t),null===this.queues||null===this.tracks)return;const r=null==(n=this.tracks[e])?void 0:n.buffer;null!=r&&r.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){null!==this.queues&&(this.queues[e].shift(),this.executeNext(e))}current(e){var t;return(null==(t=this.queues)?void 0:t[e][0])||null}toString(){const{queues:e,tracks:t}=this;return null===e||null===t?"<destroyed>":`\n${this.list("video")}\n${this.list("audio")}\n${this.list("audiovideo")}}`}list(e){var t,n;return null!=(t=this.queues)&&t[e]||null!=(n=this.tracks)&&n[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:""}listSbInfo(e){var t;const n=null==(t=this.tracks)?void 0:t[e],i=null==n?void 0:n.buffer;return i?`SourceBuffer${i.updating?" updating":""}${n.ended?" ended":""}${n.ending?" ending":""}`:"none"}listOps(e){var t;return(null==(t=this.queues)?void 0:t[e].map((e=>e.label)).join(", "))||""}}const aa=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,sa="HlsJsTrackRemovedError";class oa extends Error{constructor(e){super(e),this.name=sa}}function la(e){const t=e.querySelectorAll("source");[].slice.call(t).forEach((t=>{e.removeChild(t)}))}function ca(e){return"audio"===e?1:0}class ua{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(l.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(l.MANIFEST_PARSED,this.onManifestParsed,this),e.on(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(l.BUFFER_CODECS,this.onBufferCodecs,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(l.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(l.MANIFEST_PARSED,this.onManifestParsed,this),e.off(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(l.BUFFER_CODECS,this.onBufferCodecs,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const n=this.hls.levels[t.droppedLevel];this.isLevelAllowed(n)&&this.restrictedLevels.push({bitrate:n.bitrate,height:n.height,width:n.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,t){const n=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,n.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&i(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping(),this.media=null}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0)return void(this.clientRect=null);const e=this.hls.levels;if(e.length){const t=this.hls,n=this.getMaxLevel(e.length-1);n!==this.autoLevelCapping&&t.logger.log(`Setting autoLevelCapping to ${n}: ${e[n].height}p@${e[n].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=n,t.autoLevelEnabled&&t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const n=t.filter(((t,n)=>this.isLevelAllowed(t)&&n<=e));return this.clientRect=null,ua.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const n=e.getBoundingClientRect();t.width=n.width,t.height=n.height,t.width||t.height||(t.width=n.right-n.left||e.width||0,t.height=n.bottom-n.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(e){}return Math.min(e,this.hls.config.maxDevicePixelRatio)}isLevelAllowed(e){return!this.restrictedLevels.some((t=>e.bitrate===t.bitrate&&e.width===t.width&&e.height===t.height))}static getMaxLevelByMediaSize(e,t,n){if(null==e||!e.length)return-1;let i=e.length-1;const r=Math.max(t,n);for(let t=0;t<e.length;t+=1){const n=e[t];if((n.width>=r||n.height>=r)&&(a=n,!(s=e[t+1])||a.width!==s.width||a.height!==s.height)){i=t;break}}var a,s;return i}}const da={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},ha={HLS:"h"},pa="CMCD-Request",fa={["CMCD-Object"]:["br","d","ot","tb"],[pa]:["bl","dl","mtp","nor","nrr","su"],["CMCD-Session"]:["cid","pr","sf","sid","st","v"],["CMCD-Status"]:["bs","rtp"]};class ma{constructor(e,t){Array.isArray(e)&&(e=e.map((e=>e instanceof ma?e:new ma(e)))),this.value=e,this.params=t}}function ga(e,t,n,i){return new Error(`failed to ${e} "${r=t,Array.isArray(r)?JSON.stringify(r):r instanceof Map?"Map{}":r instanceof Set?"Set{}":"object"==typeof r?JSON.stringify(r):String(r)}" as ${n}`,{cause:i});var r}function va(e,t,n){return ga("serialize",e,t,n)}class ba{constructor(e){this.description=e}}const ya="Bare Item";function _a(e){if(!1===ArrayBuffer.isView(e))throw va(e,"Byte Sequence");return`:${t=e,btoa(String.fromCharCode(...t))}:`;var t}function wa(e){if(function(e){return e<-999999999999999||999999999999999<e}(e))throw va(e,"Integer");return e.toString()}function xa(e,t){if(e<0)return-xa(-e,t);const n=Math.pow(10,t);if(Math.abs(e*n%1-.5)<Number.EPSILON){const t=Math.floor(e*n);return(t%2==0?t:t+1)/n}return Math.round(e*n)/n}function ka(e){const t=xa(e,3);if(Math.floor(Math.abs(t)).toString().length>12)throw va(e,"Decimal");const n=t.toString();return n.includes(".")?n:`${n}.0`}const Sa=/[\x00-\x1f\x7f]+/;function Ea(e){const t=(n=e).description||n.toString().slice(7,-1);var n;if(!1===/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(t))throw va(t,"Token");return t}function Ca(e){switch(typeof e){case"number":if(!i(e))throw va(e,ya);return Number.isInteger(e)?wa(e):ka(e);case"string":return function(e){if(Sa.test(e))throw va(e,"String");return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}(e);case"symbol":return Ea(e);case"boolean":return function(e){if("boolean"!=typeof e)throw va(e,"Boolean");return e?"?1":"?0"}(e);case"object":if(e instanceof Date)return function(e){return`@${wa(e.getTime()/1e3)}`}(e);if(e instanceof Uint8Array)return _a(e);if(e instanceof ba)return Ea(e);default:throw va(e,ya)}}function Ta(e){if(!1===/^[a-z*][a-z0-9\-_.*]*$/.test(e))throw va(e,"Key");return e}function Aa(e){return null==e?"":Object.entries(e).map((([e,t])=>!0===t?`;${Ta(e)}`:`;${Ta(e)}=${Ca(t)}`)).join("")}function Ma(e){return e instanceof ma?`${Ca(e.value)}${Aa(e.params)}`:Ca(e)}function La(e,t={whitespace:!0}){if("object"!=typeof e)throw va(e,"Dict");const n=e instanceof Map?e.entries():Object.entries(e),i=(null==t?void 0:t.whitespace)?" ":"";return Array.from(n).map((([e,t])=>{t instanceof ma==!1&&(t=new ma(t));let n=Ta(e);var i;return!0===t.value?n+=Aa(t.params):(n+="=",Array.isArray(t.value)?n+=`(${(i=t).value.map(Ma).join(" ")})${Aa(i.params)}`:n+=Ma(t)),n})).join(`,${i}`)}const Da=e=>Math.round(e),Ia=e=>100*Da(e/100),Ra={br:Da,d:Da,bl:Ia,dl:Ia,mtp:Ia,nor:(e,t)=>((null==t?void 0:t.baseUrl)&&(e=function(e,t){const n=new URL(e),i=new URL(t);if(n.origin!==i.origin)return e;const r=n.pathname.split("/").slice(1),a=i.pathname.split("/").slice(1,-1);for(;r[0]===a[0];)r.shift(),a.shift();for(;a.length;)a.shift(),r.unshift("..");return r.join("/")}(e,t.baseUrl)),encodeURIComponent(e)),rtp:Ia,tb:Da};function Pa(e,t){const n={};if(null==e||"object"!=typeof e)return n;const r=Object.keys(e).sort(),a=y({},Ra,null==t?void 0:t.formatters),s=null==t?void 0:t.filter;return r.forEach((r=>{if(null==s?void 0:s(r))return;let o=e[r];const l=a[r];l&&(o=l(o,t)),"v"===r&&1===o||"pr"==r&&1===o||function(e){return"number"==typeof e?i(e):null!=e&&""!==e&&!1!==e}(o)&&(function(e){return"ot"===e||"sf"===e||"st"===e}(r)&&"string"==typeof o&&(o=new ba(o)),n[r]=o)})),n}function Oa(e,t={}){return e?function(e,t){return La(e,t)}(Pa(e,t),y({whitespace:!1},t)):""}function Na(e,t,n){return y(e,function(e,t={}){const n={};if(!e)return n;const i=Object.entries(e),r=Object.entries(fa).concat(Object.entries((null==t?void 0:t.customHeaderMap)||{})),a=i.reduce(((e,t)=>{var n,i;const[a,s]=t,o=(null===(n=r.find((e=>e[1].includes(a))))||void 0===n?void 0:n[0])||pa;return null!==(i=e[o])&&void 0!==i||(e[o]={}),e[o][a]=s,e}),{});return Object.entries(a).reduce(((e,[n,i])=>(e[n]=Oa(i,t),e)),n)}(t,n))}const Ba=/CMCD=[^&#]+/;function $a(e,t,n){const i=function(e,t={}){if(!e)return"";const n=Oa(e,t);return`CMCD=${encodeURIComponent(n)}`}(t,n);if(!i)return e;if(Ba.test(e))return e.replace(Ba,i);const r=e.includes("?")?"&":"?";return`${e}${r}${i}`}function Fa(e,t,n,i){e&&Object.keys(t).forEach((r=>{const a=e.filter((e=>e.groupId===r)).map((e=>{const a=y({},e);return a.details=void 0,a.attrs=new nn(a.attrs),a.url=a.attrs.URI=za(e.url,e.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",n),a.groupId=a.attrs["GROUP-ID"]=t[r],a.attrs["PATHWAY-ID"]=i,a}));e.push(...a)}))}function za(e,t,n,i){const{HOST:r,PARAMS:a,[n]:s}=i;let o;t&&(o=null==s?void 0:s[t],o&&(e=o));const l=new self.URL(e);return r&&!o&&(l.host=r),a&&Object.keys(a).sort().forEach((e=>{e&&l.searchParams.set(e,a[e])})),l.href}function Ka(e,t,n){Ua(e,t,n),e.addEventListener(t,n)}function Ua(e,t,n){e.removeEventListener(t,n)}class ja extends x{constructor(e){super("eme",e.logger),this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.mediaKeys=null,this.setMediaKeysQueue=ja.CDMCleanupPromise?[ja.CDMCleanupPromise]:[],this.onMediaEncrypted=e=>{const{initDataType:t,initData:n}=e,i=`"${e.type}" event: init data type: "${t}"`;if(this.debug(i),null!==n){if(!this.keyFormatPromise){let e=Object.keys(this.keySystemAccessPromises);e.length||(e=En(this.config));const t=e.map(Sn).filter((e=>!!e));this.keyFormatPromise=this.getKeyFormatPromise(t)}this.keyFormatPromise.then((r=>{const a=bn(r);let s,o;if("sinf"===t){if(a!==pn.FAIRPLAY)return void this.warn(`Ignoring unexpected "${e.type}" event with init data type: "${t}" for selected key-system ${a}`);const r=ee(new Uint8Array(n));try{const e=fe(cn(JSON.parse(r).sinf));if(!e)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");s=new Uint8Array(e.subarray(8,24)),o=pn.FAIRPLAY}catch(e){return void this.warn(`${i} Failed to parse sinf: ${e}`)}}else{if(a!==pn.WIDEVINE&&a!==pn.PLAYREADY)return void this.warn(`Ignoring unexpected "${e.type}" event with init data type: "${t}" for selected key-system ${a}`);const r=function(e){const t=[];if(e instanceof ArrayBuffer){const n=e.byteLength;let i=0;for(;i+32<n;){const n=xe(new DataView(e,i));t.push(n),i+=n.size}}return t}(n),l=r.filter((e=>!!e.systemId&&kn(e.systemId)===a));l.length>1&&this.warn(`${i} Using first of ${l.length} pssh found for selected key-system ${a}`);const c=l[0];if(!c)return void(0===r.length||r.some((e=>!e.systemId))?this.warn(`${i} contains incomplete or invalid pssh data`):this.log(`ignoring ${i} for ${r.map((e=>kn(e.systemId))).join(",")} pssh data in favor of playlist keys`));if(o=kn(c.systemId),0===c.version&&c.data)if(o===pn.WIDEVINE){const e=c.data.length-22;s=new Uint8Array(c.data.subarray(e,e+16))}else o===pn.PLAYREADY&&(s=An(c.data))}if(!o||!s)return;const l=I(s),{keyIdToKeySessionPromise:c,mediaKeySessions:u}=this;let d=c[l];for(let e=0;e<u.length;e++){const i=u[e],r=i.decryptdata;if(!r.keyId)continue;const a=I(r.keyId);if(l===a||-1!==r.uri.replace(/-/g,"").indexOf(l)){if(d=c[a],r.pssh)break;delete c[a],r.pssh=new Uint8Array(n),r.keyId=s,d=c[l]=d.then((()=>this.generateRequestWithPreferredKeySession(i,t,n,"encrypted-event-key-match"))),d.catch((e=>this.handleError(e)));break}}if(!d){if(o!==a)return void this.log(`Ignoring "${e.type}" event with ${o} init data for selected key-system ${a}`);d=c[l]=this.getKeySystemSelectionPromise([o]).then((({keySystem:e,mediaKeys:i})=>{var r;this.throwIfDestroyed();const a=new Ln("ISO-23001-7",l,null!=(r=Sn(e))?r:"");return a.pssh=new Uint8Array(n),a.keyId=s,this.attemptSetMediaKeys(e,i).then((()=>{this.throwIfDestroyed();const r=this.createMediaKeySessionContext({decryptdata:a,keySystem:e,mediaKeys:i});return this.generateRequestWithPreferredKeySession(r,t,n,"encrypted-event-no-match")}))})),d.catch((e=>this.handleError(e)))}}))}},this.onWaitingForKey=e=>{this.log(`"${e.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.onDestroying(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(l.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(l.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(l.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(l.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(l.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(l.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(l.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(l.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:n}=this.config,i=t[e];return i?i.licenseUrl:e===pn.WIDEVINE&&n?n:void 0}getLicenseServerUrlOrThrow(e){const t=this.getLicenseServerUrl(e);if(void 0===t)throw new Error(`no license server URL configured for key-system "${e}"`);return t}getServerCertificateUrl(e){const{drmSystems:t}=this.config,n=t[e];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,n=(e,t,n)=>!!e&&n.indexOf(e)===t,i=t.map((e=>e.audioCodec)).filter(n),r=t.map((e=>e.videoCodec)).filter(n);return i.length+r.length===0&&r.push("avc1.42e01e"),new Promise(((t,n)=>{const a=e=>{const l=e.shift();this.getMediaKeysPromise(l,i,r).then((e=>t({keySystem:l,mediaKeys:e}))).catch((t=>{e.length?a(e):n(t instanceof qa?t:new qa({type:s.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_NO_ACCESS,error:t,fatal:!0},t.message))}))};a(e)}))}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if("function"!=typeof n){let e=`Configured requestMediaKeySystemAccess is not a function ${n}`;return null===Cn&&"http:"===self.location.protocol&&(e=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(e))}return n(e,t)}getMediaKeysPromise(e,t,n){const i=function(e,t,n,i){let r;switch(e){case pn.FAIRPLAY:r=["cenc","sinf"];break;case pn.WIDEVINE:case pn.PLAYREADY:r=["cenc"];break;case pn.CLEARKEY:r=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${e}`)}return function(e,t,n,i){return[{initDataTypes:e,persistentState:i.persistentState||"optional",distinctiveIdentifier:i.distinctiveIdentifier||"optional",sessionTypes:i.sessionTypes||[i.sessionType||"temporary"],audioCapabilities:t.map((e=>({contentType:`audio/mp4; codecs=${e}`,robustness:i.audioRobustness||"",encryptionScheme:i.audioEncryptionScheme||null}))),videoCapabilities:n.map((e=>({contentType:`video/mp4; codecs=${e}`,robustness:i.videoRobustness||"",encryptionScheme:i.videoEncryptionScheme||null})))}]}(r,t,n,i)}(e,t,n,this.config.drmSystemOptions),r=this.keySystemAccessPromises[e];let a=null==r?void 0:r.keySystemAccess;if(!a){this.log(`Requesting encrypted media "${e}" key-system access with config: ${Qe(i)}`),a=this.requestMediaKeySystemAccess(e,i);const t=this.keySystemAccessPromises[e]={keySystemAccess:a};return a.catch((t=>{this.log(`Failed to obtain access to key-system "${e}": ${t}`)})),a.then((n=>{this.log(`Access for key-system "${n.keySystem}" obtained`);const i=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),t.mediaKeys=n.createMediaKeys().then((n=>(this.log(`Media-keys created for "${e}"`),t.hasMediaKeys=!0,i.then((t=>t?this.setMediaKeysServerCertificate(n,e,t):n))))),t.mediaKeys.catch((t=>{this.error(`Failed to create media-keys for "${e}"}: ${t}`)})),t.mediaKeys}))}return a.then((()=>r.mediaKeys))}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${I(e.keyId||[])}`);const i=n.createSession(),r={decryptdata:e,keySystem:t,mediaKeys:n,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(r),r}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const n=this.createMediaKeySessionContext(e),i=this.getKeyIdString(t),r="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(n,r,t.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(null===e.keyId)throw new Error("keyId is null");return I(e.keyId)}updateKeySession(e,t){var n;const i=e.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyID ${I((null==(n=e.decryptdata)?void 0:n.keyId)||[])}\n } (data length: ${t?t.byteLength:t})`),i.update(t)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map((e=>({keySystem:e,hasMediaKeys:this.keySystemAccessPromises[e].hasMediaKeys}))).filter((({hasMediaKeys:e})=>!!e)).map((({keySystem:e})=>Sn(e))).filter((e=>!!e))}getKeySystemAccess(e){return this.getKeySystemSelectionPromise(e).then((({keySystem:e,mediaKeys:t})=>this.attemptSetMediaKeys(e,t)))}selectKeySystem(e){return new Promise(((t,n)=>this.getKeySystemSelectionPromise(e).then((({keySystem:e})=>{const i=Sn(e);i?t(i):n(new Error(`Unable to find format for key-system "${e}"`))})).catch(n)))}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){const t=En(this.config),n=e.map(bn).filter((e=>!!e&&-1!==t.indexOf(e)));return this.selectKeySystem(n)}loadKey(e){const t=e.keyInfo.decryptdata,n=this.getKeyIdString(t),i=`(keyId: ${n} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${i}`);let r=this.keyIdToKeySessionPromise[n];if(!r){r=this.getKeySystemForKeyPromise(t).then((({keySystem:n,mediaKeys:r})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(n,r).then((()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:n,mediaKeys:r,decryptdata:t})))))));(this.keyIdToKeySessionPromise[n]=r.then((e=>{const n=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(e,"cenc",n,"playlist-key")}))).catch((e=>this.handleError(e)))}return r}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof qa?this.hls.trigger(l.ERROR,e.data):this.hls.trigger(l.ERROR,{type:s.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),n=this.keyIdToKeySessionPromise[t];if(!n){const t=bn(e.keyFormat),n=t?[t]:En(this.config);return this.attemptKeySystemAccess(n)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=En(this.config)),0===e.length)throw new qa({type:s.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${Qe({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){if(this.mediaKeys===t)return Promise.resolve();const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(n).then((()=>{if(!this.media)throw this.mediaKeys=null,new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)}));return this.mediaKeys=t,this.setMediaKeysQueue.push(i),i.then((()=>{this.log(`Media-keys set for "${e}"`),n.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter((e=>-1===n.indexOf(e)))}))}generateRequestWithPreferredKeySession(e,t,n,i){var r,a;const l=null==(r=this.config.drmSystems)||null==(a=r[e.keySystem])?void 0:a.generateRequest;if(l)try{const i=l.call(this.hls,t,n,e);if(!i)throw new Error("Invalid response from configured generateRequest filter");t=i.initDataType,n=i.initData?i.initData:null,e.decryptdata.pssh=n?new Uint8Array(n):null}catch(e){var c;if(this.warn(e.message),null!=(c=this.hls)&&c.config.debug)throw e}if(null===n)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const u=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${i}": ${u} (init data type: ${t} length: ${n?n.byteLength:null})`);const d=new Mi,h=e._onmessage=t=>{const n=e.mediaKeysSession;if(!n)return void d.emit("error",new Error("invalid state"));const{messageType:i,message:r}=t;this.log(`"${i}" message event for session "${n.sessionId}" message size: ${r.byteLength}`),"license-request"===i||"license-renewal"===i?this.renewLicense(e,r).catch((e=>{d.eventNames().length?d.emit("error",e):this.handleError(e)})):"license-release"===i?e.keySystem===pn.FAIRPLAY&&(this.updateKeySession(e,un("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${i}"`)},p=e._onkeystatuseschange=t=>{if(!e.mediaKeysSession)return void d.emit("error",new Error("invalid state"));this.onKeyStatusChange(e);const n=e.keyStatus;d.emit("keyStatus",n),"expired"===n&&(this.warn(`${e.keySystem} expired for key ${u}`),this.renewKeySession(e))};Ka(e.mediaKeysSession,"message",h),Ka(e.mediaKeysSession,"keystatuseschange",p);const f=new Promise(((e,t)=>{d.on("error",t),d.on("keyStatus",(n=>{n.startsWith("usable")?e():"output-restricted"===n?t(new qa({type:s.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):"internal-error"===n?t(new qa({type:s.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${n}"`)):"expired"===n?t(new Error("key expired while generating request")):this.warn(`unhandled key status change "${n}"`)}))}));return e.mediaKeysSession.generateRequest(t,n).then((()=>{var t;this.log(`Request generated for key-session "${null==(t=e.mediaKeysSession)?void 0:t.sessionId}" keyId: ${u}`)})).catch((e=>{throw new qa({type:s.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_NO_SESSION,error:e,fatal:!1},`Error generating key-session request: ${e}`)})).then((()=>f)).catch((t=>{throw d.removeAllListeners(),this.removeSession(e),t})).then((()=>(d.removeAllListeners(),e)))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach(((t,n)=>{if("string"==typeof n&&"object"==typeof t){const e=n;n=t,t=e}this.log(`key status change "${t}" for keyStatuses keyId: ${I("buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n))} session keyId: ${I(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t}))}fetchServerCertificate(e){const t=this.config,n=new(0,t.loader)(t),i=this.getServerCertificateUrl(e);return i?(this.log(`Fetching server certificate for "${e}"`),new Promise(((r,a)=>{const l={responseType:"arraybuffer",url:i},c=t.certLoadPolicy.default,u={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},d={onSuccess:(e,t,n,i)=>{r(e.data)},onError:(t,n,r,c)=>{a(new qa({type:s.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:r,response:w({url:l.url,data:void 0},t)},`"${e}" certificate request failed (${i}). Status: ${t.code} (${t.text})`))},onTimeout:(t,n,r)=>{a(new qa({type:s.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:r,response:{url:l.url,data:void 0}},`"${e}" certificate request timed out (${i})`))},onAbort:(e,t,n)=>{a(new Error("aborted"))}};n.load(l,u,d)}))):Promise.resolve()}setMediaKeysServerCertificate(e,t,n){return new Promise(((i,r)=>{e.setServerCertificate(n).then((r=>{this.log(`setServerCertificate ${r?"success":"not supported by CDM"} (${null==n?void 0:n.byteLength}) on "${t}"`),i(e)})).catch((e=>{r(new qa({type:s.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:e,fatal:!0},e.message))}))}))}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then((t=>this.updateKeySession(e,new Uint8Array(t)).catch((e=>{throw new qa({type:s.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:e,fatal:!0},e.message)}))))}unpackPlayReadyKeyMessage(e,t){const n=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!n.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const i=(new DOMParser).parseFromString(n,"application/xml"),r=i.querySelectorAll("HttpHeader");if(r.length>0){let t;for(let n=0,i=r.length;n<i;n++){var a,s;t=r[n];const i=null==(a=t.querySelector("name"))?void 0:a.textContent,o=null==(s=t.querySelector("value"))?void 0:s.textContent;i&&o&&e.setRequestHeader(i,o)}}const o=i.querySelector("Challenge"),l=null==o?void 0:o.textContent;if(!l)throw new Error("Cannot find <Challenge> in key message");return un(atob(l))}setupLicenseXHR(e,t,n,i){const r=this.config.licenseXhrSetup;return r?Promise.resolve().then((()=>{if(!n.decryptdata)throw new Error("Key removed");return r.call(this.hls,e,t,n,i)})).catch((a=>{if(!n.decryptdata)throw a;return e.open("POST",t,!0),r.call(this.hls,e,t,n,i)})).then((n=>{e.readyState||e.open("POST",t,!0);return{xhr:e,licenseChallenge:n||i}})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:i}))}requestLicense(e,t){const n=this.config.keyLoadPolicy.default;return new Promise(((i,r)=>{const a=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${a}`);const l=new XMLHttpRequest;l.responseType="arraybuffer",l.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return r(new Error("invalid state"));if(4===l.readyState)if(200===l.status){this._requestLicenseFailureCount=0;let t=l.response;this.log(`License received ${t instanceof ArrayBuffer?t.byteLength:t}`);const n=this.config.licenseResponseCallback;if(n)try{t=n.call(this.hls,l,a,e)}catch(e){this.error(e)}i(t)}else{const c=n.errorRetry,u=c?c.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>u||l.status>=400&&l.status<500)r(new qa({type:s.KEY_SYSTEM_ERROR,details:o.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:l,response:{url:a,data:void 0,code:l.status,text:l.statusText}},`License Request XHR failed (${a}). Status: ${l.status} (${l.statusText})`));else{const n=u-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${n} attempts left`),this.requestLicense(e,t).then(i,r)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=l,this.setupLicenseXHR(l,a,e,t).then((({xhr:t,licenseChallenge:n})=>{e.keySystem==pn.PLAYREADY&&(n=this.unpackPlayReadyKeyMessage(t,n)),t.send(n)}))}))}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const n=t.media;this.media=n,Ka(n,"encrypted",this.onMediaEncrypted),Ka(n,"waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media;e&&(Ua(e,"encrypted",this.onMediaEncrypted),Ua(e,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var e;if(this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},!this.mediaKeys&&!this.mediaKeySessions.length)return;const t=this.media,n=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,Ln.clearKeyUriToKeyIdMap();const i=n.length;ja.CDMCleanupPromise=Promise.all(n.map((e=>this.removeSession(e))).concat(null==t||null==(e=t.setMediaKeys(null))?void 0:e.catch((e=>{var t;this.log(`Could not clear media keys: ${e}`),null==(t=this.hls)||t.trigger(l.ERROR,{type:s.OTHER_ERROR,details:o.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${e}`)})})))).catch((e=>{var t;this.log(`Could not close sessions and clear media keys: ${e}`),null==(t=this.hls)||t.trigger(l.ERROR,{type:s.OTHER_ERROR,details:o.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${e}`)})})).then((()=>{i&&this.log("finished closing key sessions and clearing media keys")}))}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(t&&this.config.emeEnabled&&!this.keyFormatPromise){const e=t.reduce(((e,t)=>(-1===e.indexOf(t.keyFormat)&&e.push(t.keyFormat),e)),[]);this.log(`Selecting key-system from session-keys ${e.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(e)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:n}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const i=this.mediaKeySessions.indexOf(e);i>-1&&this.mediaKeySessions.splice(i,1);const{drmSystemOptions:r}=this.config,a=function(e){var t;return"persistent-license"===e.sessionType||!(null==(t=e.sessionTypes)||!t.some((e=>"persistent-license"===e)))}(r)?new Promise(((e,n)=>{self.setTimeout((()=>n(new Error("MediaKeySession.remove() timeout"))),8e3),t.remove().then(e)})):Promise.resolve();return a.catch((e=>{var t;this.log(`Could not remove session: ${e}`),null==(t=this.hls)||t.trigger(l.ERROR,{type:s.OTHER_ERROR,details:o.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${e}`)})})).then((()=>t.close())).catch((e=>{var t;this.log(`Could not close session: ${e}`),null==(t=this.hls)||t.trigger(l.ERROR,{type:s.OTHER_ERROR,details:o.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${e}`)})}))}}}ja.CDMCleanupPromise=void 0;class qa extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}function Ha(e,t){let n;try{n=new Event("addtrack")}catch(e){n=document.createEvent("Event"),n.initEvent("addtrack",!1,!1)}n.track=e,t.dispatchEvent(n)}function Va(e,t){const n=e.mode;if("disabled"===n&&(e.mode="hidden"),e.cues&&!e.cues.getCueById(t.id))try{if(e.addCue(t),!e.cues.getCueById(t.id))throw new Error(`addCue is failed for: ${t}`)}catch(n){A.debug(`[texttrack-utils]: ${n}`);try{const n=new self.TextTrackCue(t.startTime,t.endTime,t.text);n.id=t.id,e.addCue(n)}catch(e){A.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${e}`)}}"disabled"===n&&(e.mode=n)}function Ga(e,t){const n=e.mode;if("disabled"===n&&(e.mode="hidden"),e.cues)for(let n=e.cues.length;n--;)t&&e.cues[n].removeEventListener("enter",t),e.removeCue(e.cues[n]);"disabled"===n&&(e.mode=n)}function Za(e,t,n,i){const r=e.mode;if("disabled"===r&&(e.mode="hidden"),e.cues&&e.cues.length>0){const r=function(e,t,n){const i=[],r=function(e,t){if(t<=e[0].startTime)return 0;const n=e.length-1;if(t>e[n].endTime)return-1;let i,r=0,a=n;for(;r<=a;)if(i=Math.floor((a+r)/2),t<e[i].startTime)a=i-1;else{if(!(t>e[i].startTime&&r<n))return i;r=i+1}return e[r].startTime-t<t-e[a].startTime?r:a}(e,t);if(r>-1)for(let a=r,s=e.length;a<s;a++){const r=e[a];if(r.startTime>=t&&r.endTime<=n)i.push(r);else if(r.startTime>n)return i}return i}(e.cues,t,n);for(let t=0;t<r.length;t++)i&&!i(r[t])||e.removeCue(r[t])}"disabled"===r&&(e.mode=r)}function Wa(e){const t=[];for(let n=0;n<e.length;n++){const i=e[n];"subtitles"!==i.kind&&"captions"!==i.kind||!i.label||t.push(e[n])}return t}function Ya(e){let t=5381,n=e.length;for(;n;)t=33*t^e.charCodeAt(--n);return(t>>>0).toString()}const Xa=.025;let Ja=function(e){return e[e.Point=0]="Point",e[e.Range=1]="Range",e}({});function Qa(e,t,n){return`${e.identifier}-${n+1}-${Ya(t)}`}class es{constructor(e,t){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=t,this.dateRange=e,this.setDateRange(e)}setDateRange(e){this.dateRange=e,this.resumeOffset=e.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=e.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=e.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=e.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var e;this.appendInPlaceStarted=!1,null==(e=this.assetListLoader)||e.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(e){var t;if(e>0&&e>=this.assetList.length)return!0;const n=this.playoutLimit;if(e<=0||isNaN(n))return!1;if(0===n)return!0;return((null==(t=this.assetList[e])?void 0:t.startOffset)||0)>n}findAssetIndex(e){return this.assetList.indexOf(e)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const e=this.dateRange.startTime;if(this.snapOptions.out){const t=this.dateRange.tagAnchor;if(t)return ts(e,t)}return e}get startOffset(){return this.cue.pre?0:this.startTime}get startIsAligned(){if(0===this.startTime||this.snapOptions.out)return!0;const e=this.dateRange.tagAnchor;if(e){const t=this.dateRange.startTime;return t-ts(t,e)<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=i(e)?e:this.duration;return this.cumulativeDuration+t}get resumeTime(){const e=this.startOffset+this.resumptionOffset;if(this.snapOptions.in){const t=this.resumeAnchor;if(t)return ts(e,t)}return e}get appendInPlace(){return!!this.appendInPlaceStarted||!this.appendInPlaceDisabled&&!(this.cue.once||this.cue.pre||!this.startIsAligned||!(isNaN(this.playoutLimit)&&isNaN(this.resumeOffset)||this.resumeOffset&&this.duration&&Math.abs(this.resumeOffset-this.duration)<Xa))}set appendInPlace(e){this.appendInPlaceStarted?this.resetOnResume=!e:this.appendInPlaceDisabled=!e}get timelineStart(){return null!==this._timelineStart?this._timelineStart:this.startTime}set timelineStart(e){this._timelineStart=e}get duration(){const e=this.playoutLimit;let t;return t=null!==this._duration?this._duration:this.dateRange.duration?this.dateRange.duration:this.dateRange.plannedDuration||0,!isNaN(e)&&e<t&&(t=e),t}set duration(e){this._duration=e}get cue(){return this.dateRange.cue}get timelineOccupancy(){return"RANGE"===this.dateRange.attr["X-TIMELINE-OCCUPIES"]?Ja.Range:Ja.Point}get supplementsPrimary(){return"PRIMARY"===this.dateRange.attr["X-TIMELINE-STYLE"]}get contentMayVary(){return"NO"!==this.dateRange.attr["X-CONTENT-MAY-VARY"]}get assetUrl(){return this.dateRange.attr["X-ASSET-URI"]}get assetListUrl(){return this.dateRange.attr["X-ASSET-LIST"]}get baseUrl(){return this.base.url}get assetListLoaded(){return this.assetList.length>0||null!==this.assetListResponse}toString(){return`["${(e=this).identifier}" ${e.cue.pre?"<pre>":e.cue.post?"<post>":""}${e.timelineStart.toFixed(2)}-${e.resumeTime.toFixed(2)}]`;var e}}function ts(e,t){return e-t.start<t.duration/2&&!(Math.abs(e-(t.start+t.duration))<Xa)?t.start:t.start+t.duration}function ns(e,t,n){const i=new self.URL(e,n);return"data:"!==i.protocol&&i.searchParams.set("_HLS_primary_id",t),i}function is(e,t){for(;null!=(n=e.assetList[++t])&&n.error;)var n;return t}function rs(e){const t=e.timelineStart,n=e.duration||0;return`["${e.identifier}" ${t.toFixed(2)}-${(t+n).toFixed(2)}]`}class as{constructor(e,t,n,i){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{this.reachedPlayout(this.currentTime)&&this.hls.trigger(l.PLAYOUT_LIMIT_REACHED,{})};const r=this.hls=new e(t);this.interstitial=n,this.assetItem=i;let a=i.uri;try{a=ns(a,t.primarySessionId).href}catch(e){}r.loadSource(a);const s=()=>{this.hasDetails=!0};r.once(l.LEVEL_LOADED,s),r.once(l.AUDIO_TRACK_LOADED,s),r.once(l.SUBTITLE_TRACK_LOADED,s),r.on(l.MEDIA_ATTACHING,((e,{media:t})=>{this.removeMediaListeners(),this.mediaAttached=t;this.interstitial.playoutLimit&&(t.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&r.on(l.BUFFER_APPENDED,(()=>{const e=this.bufferedEnd;this.reachedPlayout(e)&&(this._bufferedEosTime=e,r.trigger(l.BUFFERED_TO_END,void 0))})))}))}get appendInPlace(){var e;return(null==(e=this.interstitial)?void 0:e.appendInPlace)||!1}bufferedInPlaceToEnd(e){var t;if(!this.appendInPlace)return!1;if(null!=(t=this.hls)&&t.bufferedToEnd)return!0;if(!e||!this._bufferedEosTime)return!1;const n=this.timelineOffset,i=Zt.bufferInfo(e,n,0);return this.getAssetTime(i.end)>=this._bufferedEosTime-.02}reachedPlayout(e){const t=this.interstitial.playoutLimit;return this.startOffset+e>=t}get destroyed(){var e;return!(null!=(e=this.hls)&&e.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var e;return(null==(e=this.hls)?void 0:e.media)||null}get bufferedEnd(){const e=this.media||this.mediaAttached;if(!e)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const t=Zt.bufferInfo(e,e.currentTime,.001);return this.getAssetTime(t.end)}get currentTime(){const e=this.media||this.mediaAttached;return e?this.getAssetTime(e.currentTime):this._currentTime||0}get duration(){const e=this.assetItem.duration;return e||0}get remaining(){const e=this.duration;return e?Math.max(0,e-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var e;return(null==(e=this.hls)?void 0:e.config.timelineOffset)||0}set timelineOffset(e){const t=this.timelineOffset;if(e!==t){const n=e-t;if(Math.abs(n)>1/9e4){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=e}}}getAssetTime(e){const t=this.timelineOffset,n=this.duration;return Math.min(Math.max(0,e-t),n)}removeMediaListeners(){const e=this.mediaAttached;e&&(this._currentTime=e.currentTime,this.bufferSnapShot(),e.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){var e;this.mediaAttached&&(null!=(e=this.hls)&&e.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd))}destroy(){this.removeMediaListeners(),this.hls.destroy(),this.hls=this.interstitial=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){this.hls.attachMedia(e)}detachMedia(){this.removeMediaListeners(),this.mediaAttached=null,this.hls.detachMedia()}resumeBuffering(){this.hls.resumeBuffering()}pauseBuffering(){this.hls.pauseBuffering()}transferMedia(){return this.bufferSnapShot(),this.hls.transferMedia()}resetDetails(){const e=this.hls;if(this.hasDetails){e.stopLoad();const t=e=>delete e.details;e.levels.forEach(t),e.allAudioTracks.forEach(t),e.allSubtitleTracks.forEach(t),this.hasDetails=!1}}on(e,t,n){this.hls.on(e,t)}once(e,t,n){this.hls.once(e,t)}off(e,t,n){this.hls.off(e,t)}toString(){var e;return`HlsAssetPlayer: ${rs(this.assetItem)} ${null==(e=this.hls)?void 0:e.sessionId} ${this.appendInPlace?"append-in-place":""}`}}class ss extends x{constructor(e,t){super("interstitials-sched",t),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=e}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={},this.setDurations(0,0,0),this.events&&this.events.forEach((e=>e.reset())),this.events=this.items=null}resetErrorsInRange(e,t){return this.events?this.events.reduce(((n,i)=>e<=i.startOffset&&t>i.startOffset?(delete i.error,n+1):n),0):0}get duration(){const e=this.items;return e?e[e.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(e){return e&&this.eventMap[e]||null}hasEvent(e){return e in this.eventMap}findItemIndex(e,t){if(e.event)return this.findEventIndex(e.event.identifier);let n=-1;e.nextEvent?n=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(n=this.findEventIndex(e.previousEvent.identifier)+1);const i=this.items;if(i)for(i[n]||(void 0===t&&(t=e.start),n=this.findItemIndexAtTime(t));n>=0&&null!=(r=i[n])&&r.event;){var r;n--}return n}findItemIndexAtTime(e,t){const n=this.items;if(n)for(let i=0;i<n.length;i++){let r=n[i];if(t&&"primary"!==t&&(r=r[t]),e===r.start||e>r.start&&e<r.end)return i}return-1}findJumpRestrictedIndex(e,t){const n=this.items;if(n)for(let i=e;i<=t&&n[i];i++){const e=n[i].event;if(null!=e&&e.restrictions.jump&&!e.appendInPlace)return i}return-1}findEventIndex(e){const t=this.items;if(t)for(let i=t.length;i--;){var n;if((null==(n=t[i].event)?void 0:n.identifier)===e)return i}return-1}findAssetIndex(e,t){const n=e.assetList,i=n.length;if(i>1)for(let e=0;e<i;e++){const i=n[e];if(!i.error){const n=i.timelineStart;if(t===n||t>n&&t<n+(i.duration||0))return e}}return 0}get assetIdAtEnd(){var e,t;const n=null==(e=this.items)||null==(t=e[this.length-1])?void 0:t.event;if(n){const e=n.assetList,t=e[e.length-1];if(t)return t.identifier}return null}parseInterstitialDateRanges(e,t){const n=e.main.details,{dateRanges:i}=n,r=this.events,a=this.parseDateRanges(i,{url:n.url},t),s=Object.keys(i),o=r?r.filter((e=>!s.includes(e.identifier))):[];a.length&&a.sort(((e,t)=>{const n=e.cue.pre,i=e.cue.post,r=t.cue.pre,a=t.cue.post;if(n&&!r)return-1;if(r&&!n)return 1;if(i&&!a)return 1;if(a&&!i)return-1;if(!(n||r||i||a)){const n=e.startTime,i=t.startTime;if(n!==i)return n-i}return e.dateRange.tagOrder-t.dateRange.tagOrder})),this.events=a,o.forEach((e=>{this.removeEvent(e)})),this.updateSchedule(e,o)}updateSchedule(e,t=[]){const n=this.events||[];if(n.length||t.length||this.length<2){const i=this.items,r=this.parseSchedule(n,e);(t.length||(null==i?void 0:i.length)!==r.length||r.some(((e,t)=>Math.abs(e.playout.start-i[t].playout.start)>.005||Math.abs(e.playout.end-i[t].playout.end)>.005)))&&(this.items=r,this.onScheduleUpdate(t,i))}}parseDateRanges(e,t,n){const i=[],r=Object.keys(e);for(let a=0;a<r.length;a++){const s=r[a],o=e[s];if(o.isInterstitial){let e=this.eventMap[s];e?e.setDateRange(o):(e=new es(o,t),this.eventMap[s]=e,!1===n&&(e.appendInPlace=n)),i.push(e)}}return i}parseSchedule(e,t){const n=[],i=t.main.details,r=i.live?1/0:i.edge;let a=0;if((e=e.filter((e=>!(e.error||e.cue.once&&e.hasPlayed)))).length){this.resolveOffsets(e,t);let i=0,o=0;if(e.forEach(((t,s)=>{const l=t.cue.pre,c=t.cue.post,u=e[s-1]||null,d=t.appendInPlace,h=c?r:t.startOffset,p=t.duration,f=t.timelineOccupancy===Ja.Range?p:0,m=t.resumptionOffset,g=(null==u?void 0:u.startTime)===h,v=h+t.cumulativeDuration;let b=d?v+p:h+m;if(l||!c&&h<=0){const e=o;o+=f,t.timelineStart=v;const i=a;a+=p,n.push({event:t,start:v,end:b,playout:{start:i,end:a},integrated:{start:e,end:o}})}else{if(!(h<=r))return;{if(!g){const r=h-i;if(r>.033){const l=i,c=o;o+=r;const u=a;a+=r;const d={previousEvent:e[s-1]||null,nextEvent:t,start:l,end:l+r,playout:{start:u,end:a},integrated:{start:c,end:o}};n.push(d)}else r>0&&u&&(u.cumulativeDuration+=r,n[n.length-1].end=h)}c&&(b=v),t.timelineStart=v;const r=o;o+=f;const l=a;a+=p,n.push({event:t,start:v,end:b,playout:{start:l,end:a},integrated:{start:r,end:o}})}}const y=t.resumeTime;i=c||y>r?r:y})),i<r){var s;const e=i,t=o,l=r-i;o+=l;const c=a;a+=l,n.push({previousEvent:(null==(s=n[n.length-1])?void 0:s.event)||null,nextEvent:null,start:i,end:e+l,playout:{start:c,end:a},integrated:{start:t,end:o}})}this.setDurations(r,a,o)}else{const e=0;n.push({previousEvent:null,nextEvent:null,start:e,end:r,playout:{start:e,end:r},integrated:{start:e,end:r}}),this.setDurations(r,r,r)}return n}setDurations(e,t,n){this.durations={primary:e,playout:t,integrated:n}}resolveOffsets(e,t){const n=t.main.details,r=n.live?1/0:n.edge;let a=0,s=-1;e.forEach(((o,l)=>{const c=o.cue.pre,u=o.cue.post,d=c?0:u?r:o.startTime;this.updateAssetDurations(o);if(s===d?o.cumulativeDuration=a:(a=0,s=d),!u&&o.snapOptions.in&&(o.resumeAnchor=ct(null,n.fragments,o.startOffset+o.resumptionOffset,0,0)||void 0),o.appendInPlace&&!o.appendInPlaceStarted){this.primaryCanResumeInPlaceAt(o,t)||(o.appendInPlace=!1)}if(!o.appendInPlace&&l+1<e.length){e[l+1].startTime-e[l].resumeTime<.033&&(e[l+1].appendInPlace=!1,e[l+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${o}`))}const h=i(o.resumeOffset)?o.resumeOffset:o.duration;a+=h}))}primaryCanResumeInPlaceAt(e,t){const n=e.resumeTime,i=e.startTime+e.resumptionOffset;if(Math.abs(n-i)>Xa)return this.log(`"${e.identifier}" resumption ${n} not aligned with estimated timeline end ${i}`),!1;if(!t)return this.log(`"${e.identifier}" resumption ${n} can not be aligned with media (none selected)`),!1;return!Object.keys(t).some((i=>{const r=t[i].details,a=r.edge;if(n>=a)return this.log(`"${e.identifier}" resumption ${n} past ${i} playlist end ${a}`),!1;const s=ct(null,r.fragments,n);if(!s)return this.log(`"${e.identifier}" resumption ${n} does not align with any fragments in ${i} playlist (${r.fragStart}-${r.fragmentEnd})`),!0;const o="audio"===i?.175:0;return!(Math.abs(s.start-n)<Xa+o||Math.abs(s.end-n)<Xa+o)&&(this.log(`"${e.identifier}" resumption ${n} not aligned with ${i} fragment bounds (${s.start}-${s.end} sn: ${s.sn} cc: ${s.cc})`),!0)}))}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let n=0,i=!1,r=!1;e.assetList.forEach(((e,a)=>{const s=t+n;e.startOffset=n,e.timelineStart=s,i||(i=null===e.duration),r||(r=!!e.error);const o=e.error?0:e.duration||0;n+=o})),e.duration=i&&!r?Math.max(n,e.duration):n}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function os(e){return`[${e.event?'"'+e.event.identifier+'"':"primary"}: ${e.start.toFixed(2)}-${e.end.toFixed(2)}]`}class ls{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const n=e.assetListUrl;let i;try{i=ns(n,this.hls.sessionId,e.baseUrl)}catch(t){const i=this.assignAssetListError(e,o.ASSET_LIST_LOAD_ERROR,t,n);return void this.hls.trigger(l.ERROR,i)}t&&"data:"!==i.protocol&&i.searchParams.set("_HLS_start_offset",""+t);const r=this.hls.config,a=new(0,r.loader)(r),s={responseType:"json",url:i.href},c=r.interstitialAssetListLoadPolicy.default,u={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},d={onSuccess:(t,n,i,r)=>{const a=t.data,s=null==a?void 0:a.ASSETS;if(Array.isArray(s))e.assetListResponse=a,this.hls.trigger(l.ASSET_LIST_LOADED,{event:e,assetListResponse:a,networkDetails:r});else{const t=this.assignAssetListError(e,o.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),i.url,n,r);this.hls.trigger(l.ERROR,t)}},onError:(t,n,i,r)=>{const a=this.assignAssetListError(e,o.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${t.code} ${t.text} (${n.url})`),n.url,r,i);this.hls.trigger(l.ERROR,a)},onTimeout:(t,n,i)=>{const r=this.assignAssetListError(e,o.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${n.url})`),n.url,t,i);this.hls.trigger(l.ERROR,r)}};return a.load(s,u,d),this.hls.trigger(l.ASSET_LIST_LOADING,{event:e}),a}assignAssetListError(e,t,n,i,r,a){return e.error=n,{type:s.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:i,error:n,networkDetails:a,stats:r}}}function cs(e){null==e||e.play().catch((()=>{}))}class us{constructor(e){this.buffered=void 0;const t=(t,n,i)=>{if((n>>>=0)>i-1)throw new DOMException(`Failed to execute '${t}' on 'TimeRanges': The index provided (${n}) is greater than the maximum bound (${i})`);return e[n][t]};this.buffered={get length(){return e.length},end(n){return t("end",n,e.length)},start(n){return t("start",n,e.length)}}}}const ds={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},hs=e=>String.fromCharCode(ds[e]||e),ps=15,fs=100,ms={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},gs={17:2,18:4,21:6,22:8,23:10,19:13,20:15},vs={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},bs={25:2,26:4,29:6,30:8,31:10,27:13,28:15},ys=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class _s{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n="function"==typeof t?t():t;A.log(`${this.time} [${e}] ${n}`)}}}const ws=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].toString(16));return t};class xs{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const t=["foreground","underline","italics","background","flash"];for(let n=0;n<t.length;n++){const i=t[n];e.hasOwnProperty(i)&&(this[i]=e[i])}}isDefault(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class ks{constructor(){this.uchar=" ",this.penState=new xs}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return" "===this.uchar&&this.penState.isDefault()}}class Ss{constructor(e){this.chars=[],this.pos=0,this.currPenState=new xs,this.cueStartTime=null,this.logger=void 0;for(let e=0;e<fs;e++)this.chars.push(new ks);this.logger=e}equals(e){for(let t=0;t<fs;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<fs;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<fs;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>fs&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=fs)}moveCursor(e){const t=this.pos+e;if(e>1)for(let e=this.pos+1;e<t+1;e++)this.chars[e].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(e){e>=144&&this.backSpace();const t=hs(e);this.pos>=fs?this.logger.log(0,(()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!")):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))}clearFromPos(e){let t;for(t=e;t<fs;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let n=0;n<fs;n++){const i=this.chars[n].uchar;" "!==i&&(t=!1),e.push(i)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e);this.chars[this.pos].setPenState(this.currPenState)}}class Es{constructor(e){this.rows=[],this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<ps;t++)this.rows.push(new Ss(e));this.logger=e}reset(){for(let e=0;e<ps;e++)this.rows[e].clear();this.currRow=14}equals(e){let t=!0;for(let n=0;n<ps;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<ps;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<ps;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,"setCursor: "+e);this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,(()=>"pacData = "+Qe(e)));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let e=0;e<ps;e++)this.rows[e].clear();const e=this.currRow+1-this.nrRollUpRows,n=this.lastOutputScreen;if(n){const i=n.rows[e].cueStartTime,r=this.logger.time;if(null!==i&&null!==r&&i<r)for(let i=0;i<this.nrRollUpRows;i++)this.rows[t-this.nrRollUpRows+i+1].copy(n.rows[e+i])}}this.currRow=t;const n=this.rows[this.currRow];if(null!==e.indent){const t=e.indent,i=Math.max(t-1,0);n.setCursor(e.indent),e.color=n.chars[i].penState.foreground}const i={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(i)}setBkgData(e){this.logger.log(2,(()=>"bkgData = "+Qe(e))),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(null===this.nrRollUpRows)return void this.logger.log(3,"roll_up but nrRollUpRows not set yet");this.logger.log(1,(()=>this.getDisplayText()));const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let n="",i=-1;for(let n=0;n<ps;n++){const r=this.rows[n].getTextString();r&&(i=n+1,e?t.push("Row "+i+": '"+r+"'"):t.push(r.trim()))}return t.length>0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n}getTextAndFormat(){return this.rows}}class Cs{constructor(e,t,n){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new Es(n),this.nonDisplayedMemory=new Es(n),this.lastOutputScreen=new Es(n),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=n}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,(()=>"MODE="+e)),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,(()=>t+": "+this.writeScreen.getDisplayText(!0))),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(this.logger.log(1,(()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0))),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,(()=>"DISP: "+this.displayedMemory.getDisplayText()))}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{const n=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[n]}this.logger.log(2,"MIDROW: "+Qe(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class Ts{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory={a:null,b:null},this.logger=void 0;const i=this.logger=new _s;this.channels=[null,new Cs(e,t,i),new Cs(e+1,n,i)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let e=0;e<t.length;e+=2){const n=127&t[e],i=127&t[e+1];let r=!1,a=null;if(0===n&&0===i)continue;this.logger.log(3,(()=>"["+ws([t[e],t[e+1]])+"] -> ("+ws([n,i])+")"));const s=this.cmdHistory;if(n>=16&&n<=31){if(Ms(n,i,s)){As(null,null,s),this.logger.log(3,(()=>"Repeated command ("+ws([n,i])+") is dropped"));continue}As(n,i,this.cmdHistory),r=this.parseCmd(n,i),r||(r=this.parseMidrow(n,i)),r||(r=this.parsePAC(n,i)),r||(r=this.parseBackgroundAttributes(n,i))}else As(null,null,s);if(!r&&(a=this.parseChars(n,i),a)){const e=this.currentChannel;if(e&&e>0){this.channels[e].insertChars(a)}else this.logger.log(2,"No channel found yet. TEXT-MODE?")}r||a||this.logger.log(2,(()=>"Couldn't parse cleaned data "+ws([n,i])+" orig: "+ws([t[e],t[e+1]])))}}parseCmd(e,t){if(!((20===e||28===e||21===e||29===e)&&t>=32&&t<=47)&&!((23===e||31===e)&&t>=33&&t<=35))return!1;const n=20===e||21===e||23===e?1:2,i=this.channels[n];return 20===e||21===e||28===e||29===e?32===t?i.ccRCL():33===t?i.ccBS():34===t?i.ccAOF():35===t?i.ccAON():36===t?i.ccDER():37===t?i.ccRU(2):38===t?i.ccRU(3):39===t?i.ccRU(4):40===t?i.ccFON():41===t?i.ccRDC():42===t?i.ccTR():43===t?i.ccRTD():44===t?i.ccEDM():45===t?i.ccCR():46===t?i.ccENM():47===t&&i.ccEOC():i.ccTO(t-32),this.currentChannel=n,!0}parseMidrow(e,t){let n=0;if((17===e||25===e)&&t>=32&&t<=47){if(n=17===e?1:2,n!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const i=this.channels[n];return!!i&&(i.ccMIDROW(t),this.logger.log(3,(()=>"MIDROW ("+ws([e,t])+")")),!0)}return!1}parsePAC(e,t){let n;if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127)&&!((16===e||24===e)&&t>=64&&t<=95))return!1;const i=e<=23?1:2;n=t>=64&&t<=95?1===i?ms[e]:vs[e]:1===i?gs[e]:bs[e];const r=this.channels[i];return!!r&&(r.setPAC(this.interpretPAC(n,t)),this.currentChannel=i,!0)}interpretPAC(e,t){let n;const i={color:null,italics:!1,indent:null,underline:!1,row:e};return n=t>95?t-96:t-64,i.underline=1==(1&n),n<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(i.italics=!0,i.color="white"):i.indent=4*Math.floor((n-16)/2),i}parseChars(e,t){let n,i=null,r=null;if(e>=25?(n=2,r=e-8):(n=1,r=e),r>=17&&r<=19){let e;e=17===r?t+80:18===r?t+112:t+144,this.logger.log(2,(()=>"Special char '"+hs(e)+"' in channel "+n)),i=[e]}else e>=32&&e<=127&&(i=0===t?[e]:[e,t]);return i&&this.logger.log(3,(()=>"Char codes = "+ws(i).join(","))),i}parseBackgroundAttributes(e,t){if(!((16===e||24===e)&&t>=32&&t<=47)&&!((23===e||31===e)&&t>=45&&t<=47))return!1;let n;const i={};16===e||24===e?(n=Math.floor((t-32)/2),i.background=ys[n],t%2==1&&(i.background=i.background+"_semi")):45===t?i.background="transparent":(i.foreground="black",47===t&&(i.underline=!0));const r=e<=23?1:2;return this.channels[r].setBkgData(i),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}As(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const n=this.channels[t];n&&n.cueSplitAtTime(e)}}}function As(e,t,n){n.a=e,n.b=t}function Ms(e,t,n){return n.a===e&&n.b===t}var Ls=function(){if(null!=hn&&hn.VTTCue)return self.VTTCue;const e=["","lr","rl"],t=["start","middle","end","left","right"];function n(e,t){if("string"!=typeof t)return!1;if(!Array.isArray(e))return!1;const n=t.toLowerCase();return!!~e.indexOf(n)&&n}function i(e){return n(t,e)}function r(e,...t){let n=1;for(;n<arguments.length;n++){const t=arguments[n];for(const n in t)e[n]=t[n]}return e}function a(t,a,s){const o=this,l={enumerable:!0};o.hasBeenReset=!1;let c="",u=!1,d=t,h=a,p=s,f=null,m="",g=!0,v="auto",b="start",y=50,_="middle",w=50,x="middle";Object.defineProperty(o,"id",r({},l,{get:function(){return c},set:function(e){c=""+e}})),Object.defineProperty(o,"pauseOnExit",r({},l,{get:function(){return u},set:function(e){u=!!e}})),Object.defineProperty(o,"startTime",r({},l,{get:function(){return d},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");d=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"endTime",r({},l,{get:function(){return h},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");h=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"text",r({},l,{get:function(){return p},set:function(e){p=""+e,this.hasBeenReset=!0}})),Object.defineProperty(o,"region",r({},l,{get:function(){return f},set:function(e){f=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"vertical",r({},l,{get:function(){return m},set:function(t){const i=function(t){return n(e,t)}(t);if(!1===i)throw new SyntaxError("An invalid or illegal string was specified.");m=i,this.hasBeenReset=!0}})),Object.defineProperty(o,"snapToLines",r({},l,{get:function(){return g},set:function(e){g=!!e,this.hasBeenReset=!0}})),Object.defineProperty(o,"line",r({},l,{get:function(){return v},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("An invalid number or illegal string was specified.");v=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"lineAlign",r({},l,{get:function(){return b},set:function(e){const t=i(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");b=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"position",r({},l,{get:function(){return y},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");y=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",r({},l,{get:function(){return _},set:function(e){const t=i(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");_=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",r({},l,{get:function(){return w},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");w=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",r({},l,{get:function(){return x},set:function(e){const t=i(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");x=t,this.hasBeenReset=!0}})),o.displayState=void 0}return a.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},a}();class Ds{decode(e,t){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function Is(e){function t(e,t,n,i){return 3600*(0|e)+60*(0|t)+(0|n)+parseFloat(i||0)}const n=e.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return n?parseFloat(n[2])>59?t(n[2],n[3],0,n[4]):t(n[1],n[2],n[3],n[4]):null}class Rs{constructor(){this.values=Object.create(null)}set(e,t){this.get(e)||""===t||(this.values[e]=t)}get(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,n){for(let i=0;i<n.length;++i)if(t===n[i]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const n=parseFloat(t);if(n>=0&&n<=100)return this.set(e,n),!0}return!1}}function Ps(e,t,n,i){const r=i?e.split(i):[e];for(const e in r){if("string"!=typeof r[e])continue;const i=r[e].split(n);if(2!==i.length)continue;t(i[0],i[1])}}const Os=new Ls(0,0,""),Ns="middle"===Os.align?"middle":"center";function Bs(e,t,n){const i=e;function r(){const t=Is(e);if(null===t)throw new Error("Malformed timestamp: "+i);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function a(){e=e.replace(/^\s+/,"")}if(a(),t.startTime=r(),a(),"--\x3e"!==e.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+i);e=e.slice(3),a(),t.endTime=r(),a(),function(e,t){const i=new Rs;Ps(e,(function(e,t){let r;switch(e){case"region":for(let r=n.length-1;r>=0;r--)if(n[r].id===t){i.set(e,n[r].region);break}break;case"vertical":i.alt(e,t,["rl","lr"]);break;case"line":r=t.split(","),i.integer(e,r[0]),i.percent(e,r[0])&&i.set("snapToLines",!1),i.alt(e,r[0],["auto"]),2===r.length&&i.alt("lineAlign",r[1],["start",Ns,"end"]);break;case"position":r=t.split(","),i.percent(e,r[0]),2===r.length&&i.alt("positionAlign",r[1],["start",Ns,"end","line-left","line-right","auto"]);break;case"size":i.percent(e,t);break;case"align":i.alt(e,t,["start",Ns,"end","left","right"])}}),/:/,/\s/),t.region=i.get("region",null),t.vertical=i.get("vertical","");let r=i.get("line","auto");"auto"===r&&-1===Os.line&&(r=-1),t.line=r,t.lineAlign=i.get("lineAlign","start"),t.snapToLines=i.get("snapToLines",!0),t.size=i.get("size",100),t.align=i.get("align",Ns);let a=i.get("position","auto");"auto"===a&&50===Os.position&&(a="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=a}(e,t)}function $s(e){return e.replace(/<br(?: \/)?>/gi,"\n")}class Fs{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new Ds,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;function n(){let e=t.buffer,n=0;for(e=$s(e);n<e.length&&"\r"!==e[n]&&"\n"!==e[n];)++n;const i=e.slice(0,n);return"\r"===e[n]&&++n,"\n"===e[n]&&++n,t.buffer=e.slice(n),i}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{let e="";if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;e=n();const i=e.match(/^()?WEBVTT([ \t].*)?$/);if(null==i||!i[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let i=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(i?i=!1:e=n(),t.state){case"HEADER":/:/.test(e)?Ps(e,(function(e,t){}),/:/):e||(t.state="ID");continue;case"NOTE":e||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(e)){t.state="NOTE";break}if(!e)continue;if(t.cue=new Ls(0,0,""),t.state="CUE",-1===e.indexOf("--\x3e")){t.cue.id=e;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{Bs(e,t.cue,t.regionList)}catch(e){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const n=-1!==e.indexOf("--\x3e");if(!e||n&&(i=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(null===t.cue)continue;t.cue.text&&(t.cue.text+="\n"),t.cue.text+=e}continue;case"BADCUE":e||(t.state="ID")}}}catch(e){"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state||"BADWEBVTT"===e.state)throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const zs=/\r\n|\n\r|\n|\r/g,Ks=function(e,t,n=0){return e.slice(n,n+t.length)===t};function Us(e,t,n){return Ya(e.toString())+Ya(t.toString())+Ya(n)}function js(e,t,n,r,a,s,o){const l=new Fs,c=D(new Uint8Array(e)).trim().replace(zs,"\n").split("\n"),u=[],d=t?function(e,t=1){return Pr(e,9e4,1/t)}(t.baseTime,t.timescale):0;let h,p="00:00.000",f=0,m=0,g=!0;l.oncue=function(e){const i=n[r];let s=n.ccOffset;const o=(f-d)/9e4;if(null!=i&&i.new&&(void 0!==m?s=n.ccOffset=i.start:function(e,t,n){let i=e[t],r=e[i.prevCC];if(!r||!r.new&&i.new)return e.ccOffset=e.presentationOffset=i.start,void(i.new=!1);for(;null!=(a=r)&&a.new;){var a;e.ccOffset+=i.start-r.start,i.new=!1,i=r,r=e[i.prevCC]}e.presentationOffset=n}(n,r,o)),o){if(!t)return void(h=new Error("Missing initPTS for VTT MPEGTS"));s=o-n.presentationOffset}const l=e.endTime-e.startTime,c=Kr(9e4*(e.startTime+s-m),9e4*a)/9e4;e.startTime=Math.max(c,0),e.endTime=Math.max(c+l,0);const p=e.text.trim();e.text=decodeURIComponent(encodeURIComponent(p)),e.id||(e.id=Us(e.startTime,e.endTime,p)),e.endTime>0&&u.push(e)},l.onparsingerror=function(e){h=e},l.onflush=function(){h?o(h):s(u)},c.forEach((e=>{if(g){if(Ks(e,"X-TIMESTAMP-MAP=")){g=!1,e.slice(16).split(",").forEach((e=>{Ks(e,"LOCAL:")?p=e.slice(6):Ks(e,"MPEGTS:")&&(f=parseInt(e.slice(7)))}));try{m=function(e){let t=parseInt(e.slice(-3));const n=parseInt(e.slice(-6,-4)),r=parseInt(e.slice(-9,-7)),a=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!(i(t)&&i(n)&&i(r)&&i(a)))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=6e4*r,t+=36e5*a,t}(p)/1e3}catch(e){h=e}return}""===e&&(g=!1)}l.parse(e+"\n")})),l.flush()}const qs="stpp.ttml.im1t",Hs=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Vs=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,Gs={left:"start",center:"center",right:"end",start:"start",end:"end"};function Zs(e,t,n,i){const r=se(new Uint8Array(e),["mdat"]);if(0===r.length)return void i(new Error("Could not parse IMSC1 mdat"));const a=r.map((e=>D(e))),s=function(e,t,n=1,i=!1){return Pr(e,t,1/n,i)}(t.baseTime,1,t.timescale);try{a.forEach((e=>n(function(e,t){const n=(new DOMParser).parseFromString(e,"text/xml"),i=n.getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},a=Object.keys(r).reduce(((e,t)=>(e[t]=i.getAttribute(`ttp:${t}`)||r[t],e)),{}),s="preserve"!==i.getAttribute("xml:space"),o=Ys(Ws(i,"styling","style")),l=Ys(Ws(i,"layout","region")),c=Ws(i,"body","[begin]");return[].map.call(c,(e=>{const n=Xs(e,s);if(!n||!e.hasAttribute("begin"))return null;const i=eo(e.getAttribute("begin"),a),r=eo(e.getAttribute("dur"),a);let c=eo(e.getAttribute("end"),a);if(null===i)throw Qs(e);if(null===c){if(null===r)throw Qs(e);c=i+r}const u=new Ls(i-t,c-t,n);u.id=Us(u.startTime,u.endTime,u.text);const d=function(e,t,n){const i="http://www.w3.org/ns/ttml#styling";let r=null;const a=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],s=null!=e&&e.hasAttribute("style")?e.getAttribute("style"):null;s&&n.hasOwnProperty(s)&&(r=n[s]);return a.reduce(((n,a)=>{const s=Js(t,i,a)||Js(e,i,a)||Js(r,i,a);return s&&(n[a]=s),n}),{})}(l[e.getAttribute("region")],o[e.getAttribute("style")],o),{textAlign:h}=d;if(h){const e=Gs[h];e&&(u.lineAlign=e),u.align=h}return y(u,d),u})).filter((e=>null!==e))}(e,s))))}catch(e){i(e)}}function Ws(e,t,n){const i=e.getElementsByTagName(t)[0];return i?[].slice.call(i.querySelectorAll(n)):[]}function Ys(e){return e.reduce(((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e}),{})}function Xs(e,t){return[].slice.call(e.childNodes).reduce(((e,n,i)=>{var r;return"br"===n.nodeName&&i?e+"\n":null!=(r=n.childNodes)&&r.length?Xs(n,t):t?e+n.textContent.trim().replace(/\s+/g," "):e+n.textContent}),"")}function Js(e,t,n){return e&&e.hasAttributeNS(t,n)?e.getAttributeNS(t,n):null}function Qs(e){return new Error(`Could not parse ttml timestamp ${e}`)}function eo(e,t){if(!e)return null;let n=Is(e);return null===n&&(Hs.test(e)?n=function(e,t){const n=Hs.exec(e),i=(0|n[4])+(0|n[5])/t.subFrameRate;return 3600*(0|n[1])+60*(0|n[2])+(0|n[3])+i/t.frameRate}(e,t):Vs.test(e)&&(n=function(e,t){const n=Vs.exec(e),i=Number(n[1]);switch(n[2]){case"h":return 3600*i;case"m":return 60*i;case"ms":return 1e3*i;case"f":return i/t.frameRate;case"t":return i/t.tickRate}return i}(e,t))),n}class to{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,n){(null===this.startTime||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}function no(e){return e.characteristics&&/transcribes-spoken-dialog/gi.test(e.characteristics)&&/describes-music-and-sound/gi.test(e.characteristics)?"captions":"subtitles"}function io(e,t){return!!e&&e.kind===no(t)&&ia(t,e)}const ro=/\s/,ao={newCue(e,t,n,i){const r=[];let a,s,o,l,c;const u=self.VTTCue||self.TextTrackCue;for(let h=0;h<i.rows.length;h++)if(a=i.rows[h],o=!0,l=0,c="",!a.isEmpty()){var d;for(let e=0;e<a.chars.length;e++)ro.test(a.chars[e].uchar)&&o?l++:(c+=a.chars[e].uchar,o=!1);a.cueStartTime=t,t===n&&(n+=1e-4),l>=16?l--:l++;const i=$s(c.trim()),p=Us(t,n,i);null!=e&&null!=(d=e.cues)&&d.getCueById(p)||(s=new u(t,n,i),s.id=p,s.line=h+1,s.align="left",s.position=10+Math.min(80,10*Math.floor(8*l/32)),r.push(s))}return e&&r.length&&(r.sort(((e,t)=>"auto"===e.line||"auto"===t.line?0:e.line>8&&t.line>8?t.line-e.line:e.line-t.line)),r.forEach((t=>Va(e,t)))),r}};const so=/(\d+)-(\d+)\/(\d+)/;class oo{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||lo,this.controller=new self.AbortController,this.stats=new U}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,n){const r=this.stats;if(r.loading.start)throw new Error("Loader can only be used once.");r.loading.start=self.performance.now();const a=function(e,t){const n={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(y({},e.headers))};e.rangeEnd&&n.headers.set("Range","bytes="+e.rangeStart+"-"+String(e.rangeEnd-1));return n}(e,this.controller.signal),s="arraybuffer"===e.responseType,o=s?"byteLength":"length",{maxTimeToFirstByteMs:l,maxLoadTimeMs:c}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,a),self.clearTimeout(this.requestTimeout),t.timeout=l&&i(l)?l:c,this.requestTimeout=self.setTimeout((()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(r,e,this.response))}),t.timeout);(Wr(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then((n=>{var a;this.response=this.loader=n;const o=Math.max(self.performance.now(),r.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=c,this.requestTimeout=self.setTimeout((()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(r,e,this.response))}),c-(o-r.loading.start)),!n.ok){const{status:e,statusText:t}=n;throw new co(t||"fetch, bad network response",e,n)}r.loading.first=o,r.total=function(e){const t=e.get("Content-Range");if(t){const e=function(e){const t=so.exec(e);if(t)return parseInt(t[2])-parseInt(t[1])+1}(t);if(i(e))return e}const n=e.get("Content-Length");if(n)return parseInt(n)}(n.headers)||r.total;const l=null==(a=this.callbacks)?void 0:a.onProgress;return l&&i(t.highWaterMark)?this.loadProgressively(n,r,e,t.highWaterMark,l):s?n.arrayBuffer():"json"===e.responseType?n.json():n.text()})).then((n=>{var a,s;const l=this.response;if(!l)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),r.loading.end=Math.max(self.performance.now(),r.loading.first);const c=n[o];c&&(r.loaded=r.total=c);const u={url:l.url,data:n,code:l.status},d=null==(a=this.callbacks)?void 0:a.onProgress;d&&!i(t.highWaterMark)&&d(r,e,n,l),null==(s=this.callbacks)||s.onSuccess(u,r,e,l)})).catch((t=>{var n;if(self.clearTimeout(this.requestTimeout),r.aborted)return;const i=t&&t.code||0,a=t?t.message:null;null==(n=this.callbacks)||n.onError({code:i,text:a},e,t?t.details:null,r)}))}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,n,i=0,r){const a=new Ei,s=e.body.getReader(),o=()=>s.read().then((s=>{if(s.done)return a.dataLength&&r(t,n,a.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const l=s.value,c=l.length;return t.loaded+=c,c<i||a.dataLength?(a.push(l),a.dataLength>=i&&r(t,n,a.flush().buffer,e)):r(t,n,l.buffer,e),o()})).catch((()=>Promise.reject()));return o()}}function lo(e,t){return new self.Request(e.url,t)}class co extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const uo=/^age:\s*[\d.]+\s*$/im;class ho{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new U,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,4!==e.readyState&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=n,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const n=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const r=this.xhrSetup;r?Promise.resolve().then((()=>{if(this.loader===n&&!this.stats.aborted)return r(n,t.url)})).catch((e=>{if(this.loader===n&&!this.stats.aborted)return n.open("GET",t.url,!0),r(n,t.url)})).then((()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,t,e)})).catch((e=>{var r;null==(r=this.callbacks)||r.onError({code:n.status,text:e.message},t,n,i)})):this.openAndSendXhr(n,t,e)}openAndSendXhr(e,t,n){e.readyState||e.open("GET",t.url,!0);const r=t.headers,{maxTimeToFirstByteMs:a,maxLoadTimeMs:s}=n.loadPolicy;if(r)for(const t in r)e.setRequestHeader(t,r[t]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=a&&i(a)?a:s,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:n}=this;if(!e||!t)return;const i=t.readyState,r=this.config;if(!n.aborted&&i>=2&&(0===n.loading.first&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),r.timeout!==r.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),r.timeout=r.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),4===i)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const i=t.status,l="text"===t.responseType?t.responseText:null;if(i>=200&&i<300){const r=null!=l?l:t.response;if(null!=r){var a,s;n.loading.end=Math.max(self.performance.now(),n.loading.first);const o="arraybuffer"===t.responseType?r.byteLength:r.length;n.loaded=n.total=o,n.bwEstimate=8e3*n.total/(n.loading.end-n.loading.first);const l=null==(a=this.callbacks)?void 0:a.onProgress;l&&l(n,e,r,t);const c={url:t.responseURL,data:r,code:i};return void(null==(s=this.callbacks)||s.onSuccess(c,n,e,t))}}const c=r.loadPolicy.errorRetry;var o;if(vt(c,n.retry,!1,{url:e.url,data:void 0,code:i}))this.retry(c);else A.error(`${i} while loading ${e.url}`),null==(o=this.callbacks)||o.onError({code:i,text:t.statusText},e,t,n)}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry;if(vt(e,this.stats.retry,!0))this.retry(e);else{var t;A.warn(`timeout while loading ${null==(t=this.context)?void 0:t.url}`);const e=this.callbacks;e&&(this.abortInternal(),e.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:n}=this;this.retryDelay=mt(e,n.retry),n.retry++,A.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${null==t?void 0:t.url}, retrying ${n.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&uo.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}const po=w(w({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:6e7,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:"edge",liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:ho,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:class extends x{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.bwEstimator=void 0,this._abandonRulesCheck=e=>{var t;const{fragCurrent:n,partCurrent:r,hls:a}=this,{autoLevelEnabled:s,media:o}=a;if(!n||!o)return;const c=performance.now(),u=r?r.stats:n.stats,d=r?r.duration:n.duration,h=c-u.loading.start,p=a.minAutoLevel,f=n.level,m=this._nextAutoLevel;if(u.aborted||u.loaded&&u.loaded===u.total||f<=p)return this.clearTimer(),void(this._nextAutoLevel=-1);if(!s)return;const g=m>-1&&m!==f,v=!!e||g;if(!v&&(o.paused||!o.playbackRate||!o.readyState))return;const b=a.mainForwardBufferInfo;if(!v&&null===b)return;const y=this.bwEstimator.getEstimateTTFB(),_=Math.abs(o.playbackRate);if(h<=Math.max(y,d/(2*_)*1e3))return;const w=b?b.len/_:0,x=u.loading.first?u.loading.first-u.loading.start:-1,k=u.loaded&&x>-1,S=this.getBwEstimate(),E=a.levels,C=E[f],T=Math.max(u.loaded,Math.round(d*(n.bitrate||C.averageBitrate)/8));let A=k?h-x:h;A<1&&k&&(A=Math.min(h,8*u.loaded/S));const M=k?1e3*u.loaded/A:0,L=y/1e3,D=M?(T-u.loaded)/M:8*T/S+L;if(D<=w)return;const I=M?8*M:S,R=!0===(null==(t=(null==e?void 0:e.details)||this.hls.latestLevelDetails)?void 0:t.live),P=this.hls.config.abrBandWidthUpFactor;let O,N=Number.POSITIVE_INFINITY;for(O=f-1;O>p;O--){const e=E[O].maxBitrate,t=!E[O].details||R;if(N=this.getTimeToLoadFrag(L,I,d*e,t),N<Math.min(w,d+L))break}if(N>=D)return;if(N>10*d)return;k?this.bwEstimator.sample(h-Math.min(y,x),u.loaded):this.bwEstimator.sampleTTFB(h);const B=E[O].maxBitrate;this.getBwEstimate()*P>B&&this.resetEstimator(B);const $=this.findBestLevel(B,p,O,0,w,1,1);$>-1&&(O=$),this.warn(`Fragment ${n.sn}${r?" part "+r.index:""} of level ${f} is loading too slowly;\n Fragment duration: ${n.duration.toFixed(3)}\n Time to underbuffer: ${w.toFixed(3)} s\n Estimated load time for current fragment: ${D.toFixed(3)} s\n Estimated load time for down switch fragment: ${N.toFixed(3)} s\n TTFB estimate: ${0|x} ms\n Current BW estimate: ${i(S)?0|S:"Unknown"} bps\n New BW estimate: ${0|this.getBwEstimate()} bps\n Switching to level ${O} @ ${0|B} bps`),a.nextLoadLevel=a.nextAutoLevel=O,this.clearTimer();const F=()=>{if(this.clearTimer(),this.fragCurrent===n&&this.hls.loadLevel===O&&O>0){const e=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${O>0?"and switching down":""}\n Fragment duration: ${n.duration.toFixed(3)} s\n Time to underbuffer: ${e.toFixed(3)} s`),n.abortRequests(),this.fragCurrent=this.partCurrent=null,O>p){let t=this.findBestLevel(this.hls.levels[p].bitrate,p,O,0,e,1,1);-1===t&&(t=p),this.hls.nextLoadLevel=this.hls.nextAutoLevel=t,this.resetEstimator(this.hls.levels[t].bitrate)}}};g||D>2*N?F():this.timer=self.setInterval(F,1e3*N),a.trigger(l.FRAG_LOAD_EMERGENCY_ABORTED,{frag:n,part:r,stats:u})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(this.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new v(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.FRAG_LOADING,this.onFragLoading,this),e.on(l.FRAG_LOADED,this.onFragLoaded,this),e.on(l.FRAG_BUFFERED,this.onFragBuffered,this),e.on(l.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(l.LEVEL_LOADED,this.onLevelLoaded,this),e.on(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(l.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(l.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.FRAG_LOADING,this.onFragLoading,this),e.off(l.FRAG_LOADED,this.onFragLoaded,this),e.off(l.FRAG_BUFFERED,this.onFragBuffered,this),e.off(l.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(l.LEVEL_LOADED,this.onLevelLoaded,this),e.off(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(l.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(l.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const n=t.frag;if(!this.ignoreFragment(n)){var i;if(!n.bitrateTest)this.fragCurrent=n,this.partCurrent=null!=(i=t.part)?i:null;this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case o.BUFFER_ADD_CODEC_ERROR:case o.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case o.FRAG_LOAD_TIMEOUT:{const e=t.frag,{fragCurrent:n,partCurrent:i}=this;if(e&&n&&e.sn===n.sn&&e.level===n.level){const t=performance.now(),n=i?i.stats:e.stats,r=t-n.loading.start,a=n.loading.first?n.loading.first-n.loading.start:-1;if(n.loaded&&a>-1){const e=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(r-Math.min(e,a),n.loaded)}else this.bwEstimator.sampleTTFB(r)}break}}}getTimeToLoadFrag(e,t,n,i){return e+n/t+(i?e+this.lastLevelLoadSec:0)}onLevelLoaded(e,t){const n=this.hls.config,{loading:r}=t.stats,a=r.end-r.first;i(a)&&(this.lastLevelLoadSec=a/1e3),t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:n}){const i=n?n.stats:t.stats;if(t.type===p&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const e=n?n.duration:t.duration,r=this.hls.levels[t.level],a=(r.loaded?r.loaded.bytes:0)+i.loaded,s=(r.loaded?r.loaded.duration:0)+e;r.loaded={bytes:a,duration:s},r.realBitrate=Math.round(8*a/s)}if(t.bitrateTest){const e={stats:i,frag:t,part:n,id:t.type};this.onFragBuffered(l.FRAG_BUFFERED,e),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:n,part:i}=t,r=null!=i&&i.stats.loaded?i.stats:n.stats;if(r.aborted)return;if(this.ignoreFragment(n))return;const a=r.parsing.end-r.loading.start-Math.min(r.loading.first-r.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(a,r.loaded),r.bwEstimate=this.getBwEstimate(),n.bitrateTest?this.bitrateTestDelay=a/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==p||"initSegment"===e.sn}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,n=this.getBwEstimate(),i=this.hls.config.maxStarvationDelay,r=this.findBestLevel(n,t,e,0,i,1,1);if(r>-1)return r;const a=this.hls.firstLevel,s=Math.min(Math.max(a,t),e);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${a} clamped to ${s}`),s}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,t=this.bwEstimator.canEstimate(),n=this.lastLoadedFragLevel>-1;if(!(-1===e||t&&n&&this.nextAutoLevelKey!==this.getAutoLevelKey()))return e;const i=t&&n?this.getNextABRAutoLevel():this.firstAutoLevel;if(-1!==e){const t=this.hls.levels;if(t.length>Math.max(e,i)&&t[e].loadError<=t[i].loadError)return e}return this._nextAutoLevel=i,this.nextAutoLevelKey=this.getAutoLevelKey(),i}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:n}=this;if(n.levels.length<=1)return n.loadLevel;const{maxAutoLevel:i,config:r,minAutoLevel:a}=n,s=t?t.duration:e?e.duration:0,o=this.getBwEstimate(),l=this.getStarvationDelay();let c=r.abrBandWidthFactor,u=r.abrBandWidthUpFactor;if(l){const e=this.findBestLevel(o,a,i,l,0,c,u);if(e>=0)return this.rebufferNotice=-1,e}let d=s?Math.min(s,r.maxStarvationDelay):r.maxStarvationDelay;if(!l){const e=this.bitrateTestDelay;if(e){d=(s?Math.min(s,r.maxLoadingDelay):r.maxLoadingDelay)-e,this.info(`bitrate test took ${Math.round(1e3*e)}ms, set first fragment max fetchDuration to ${Math.round(1e3*d)} ms`),c=u=1}}const h=this.findBestLevel(o,a,i,l,d,c,u);if(this.rebufferNotice!==h&&(this.rebufferNotice=h,this.info(`${l?"rebuffering expected":"buffer is empty"}, optimal quality level ${h}`)),h>-1)return h;const p=n.levels[a],f=n.loadLevelObj;return f&&(null==p?void 0:p.bitrate)<f.bitrate?a:n.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const n=t&&0!==t.playbackRate?Math.abs(t.playbackRate):1,i=e.mainForwardBufferInfo;return(i?i.len:0)/n}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,n,r,a,s,o){var l;const c=r+a,u=this.lastLoadedFragLevel,d=-1===u?this.hls.firstLevel:u,{fragCurrent:h,partCurrent:p}=this,{levels:f,allAudioTracks:m,loadLevel:g,config:v}=this.hls;if(1===f.length)return 0;const b=f[d],y=!(null==(l=this.hls.latestLevelDetails)||!l.live),_=-1===g||-1===u;let w,x="SDR",k=(null==b?void 0:b.frameRate)||0;const{audioPreference:S,videoPreference:E}=v,C=this.audioTracksByGroup||(this.audioTracksByGroup=tt(m));let T=-1;if(_){if(-1!==this.firstSelection)return this.firstSelection;const r=this.codecTiers||(this.codecTiers=function(e,t,n,i){return e.slice(n,i+1).reduce(((e,n,i)=>{if(!n.codecSet)return e;const r=n.audioGroups;let a=e[n.codecSet];a||(e[n.codecSet]=a={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:i,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!r,fragmentError:0}),a.minBitrate=Math.min(a.minBitrate,n.bitrate);const s=Math.min(n.height,n.width);return a.minHeight=Math.min(a.minHeight,s),a.minFramerate=Math.min(a.minFramerate,n.frameRate),a.minIndex=Math.min(a.minIndex,i),a.maxScore=Math.max(a.maxScore,n.score),a.fragmentError+=n.fragmentError,a.videoRanges[n.videoRange]=(a.videoRanges[n.videoRange]||0)+1,r&&r.forEach((e=>{if(!e)return;const n=t.groups[e];n&&(a.hasDefaultAudio=a.hasDefaultAudio||t.hasDefaultAudio?n.hasDefault:n.hasAutoSelect||!t.hasDefaultAudio&&!t.hasAutoSelectAudio,Object.keys(n.channels).forEach((e=>{a.channels[e]=(a.channels[e]||0)+n.channels[e]})))})),e}),{})}(f,C,t,n)),a=function(e,t,n,r,a){const s=Object.keys(e),o=null==r?void 0:r.channels,l=null==r?void 0:r.audioCodec,c=null==a?void 0:a.videoCodec,u=o&&2===parseInt(o);let d=!1,h=!1,p=1/0,f=1/0,m=1/0,g=1/0,v=0,b=[];const{preferHDR:y,allowedVideoRanges:_}=Je(t,a);for(let t=s.length;t--;){const n=e[s[t]];d||(d=n.channels[2]>0),p=Math.min(p,n.minHeight),f=Math.min(f,n.minFramerate),m=Math.min(m,n.minBitrate),_.filter((e=>n.videoRanges[e]>0)).length>0&&(h=!0)}p=i(p)?p:0,f=i(f)?f:0;const w=Math.max(1080,p),x=Math.max(30,f);m=i(m)?m:n,n=Math.max(m,n),h||(t=void 0);const k=s.length>1;return{codecSet:s.reduce(((t,i)=>{const r=e[i];if(i===t)return t;if(b=h?_.filter((e=>r.videoRanges[e]>0)):[],k){if(r.minBitrate>n)return et(i,`min bitrate of ${r.minBitrate} > current estimate of ${n}`),t;if(!r.hasDefaultAudio)return et(i,"no renditions with default or auto-select sound found"),t;if(l&&i.indexOf(l.substring(0,4))%5!=0)return et(i,`audio codec preference "${l}" not found`),t;if(o&&!u){if(!r.channels[o])return et(i,`no renditions with ${o} channel sound found (channels options: ${Object.keys(r.channels)})`),t}else if((!l||u)&&d&&0===r.channels[2])return et(i,"no renditions with stereo sound found"),t;if(r.minHeight>w)return et(i,`min resolution of ${r.minHeight} > maximum of ${w}`),t;if(r.minFramerate>x)return et(i,`min framerate of ${r.minFramerate} > maximum of ${x}`),t;if(!b.some((e=>r.videoRanges[e]>0)))return et(i,`no variants with VIDEO-RANGE of ${Qe(b)} found`),t;if(c&&i.indexOf(c.substring(0,4))%5!=0)return et(i,`video codec preference "${c}" not found`),t;if(r.maxScore<v)return et(i,`max score of ${r.maxScore} < selected max of ${v}`),t}return t&&(Le(i)>=Le(t)||r.fragmentError>e[t].fragmentError)?t:(g=r.minIndex,v=r.maxScore,i)}),void 0),videoRanges:b,preferHDR:y,minFramerate:f,minBitrate:m,minIndex:g}}(r,x,e,S,E),{codecSet:s,videoRanges:o,minFramerate:l,minBitrate:c,minIndex:u,preferHDR:d}=a;T=u,w=s,x=d?o[o.length-1]:o[0],k=l,e=Math.max(e,c),this.log(`picked start tier ${Qe(a)}`)}else w=null==b?void 0:b.codecSet,x=null==b?void 0:b.videoRange;const A=p?p.duration:h?h.duration:0,M=this.bwEstimator.getEstimateTTFB()/1e3,L=[];for(let l=n;l>=t;l--){var D;const t=f[l],h=l>d;if(!t)continue;if(v.useMediaCapabilities&&!t.supportedResult&&!t.supportedPromise){const n=navigator.mediaCapabilities;"function"==typeof(null==n?void 0:n.decodingInfo)&&(Ke(t,C,x,k,e,S)||ve(t.videoCodec))?(t.supportedPromise=Ue(t,C,n),t.supportedPromise.then((e=>{if(!this.hls)return;t.supportedResult=e;const n=this.hls.levels,i=n.indexOf(t);e.error?this.warn(`MediaCapabilities decodingInfo error: "${e.error}" for level ${i} ${Qe(e)}`):e.supported||(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${i} ${Qe(e)}`),i>-1&&n.length>1&&(this.log(`Removing unsupported level ${i}`),this.hls.removeLevel(i),-1===this.hls.loadLevel&&(this.hls.nextLoadLevel=0)))}))):t.supportedResult=$e}if((w&&t.codecSet!==w||x&&t.videoRange!==x||h&&k>t.frameRate||!h&&k>0&&k<t.frameRate||t.supportedResult&&(null==(D=t.supportedResult.decodingInfoResults)||!D[0].smooth))&&(!_||l!==T)){L.push(l);continue}const m=t.details,b=(p?null==m?void 0:m.partTarget:null==m?void 0:m.averagetargetduration)||A;let E;E=h?o*e:s*e;const I=A&&r>=2*A&&0===a?t.averageBitrate:t.maxBitrate,R=this.getTimeToLoadFrag(M,E,I*b,void 0===m);if(E>=I&&(l===u||0===t.loadError&&0===t.fragmentError)&&(R<=M||!i(R)||y&&!this.bitrateTestDelay||R<c)){const e=this.forcedAutoLevel;return l===g||-1!==e&&e===g||(L.length&&this.trace(`Skipped level(s) ${L.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${f[L[0]].codecs}" ${f[L[0]].videoRange}; not compatible with "${w}" ${x}`),this.info(`switch candidate:${d}->${l} adjustedbw(${Math.round(E)})-bitrate=${Math.round(E-I)} ttfb:${M.toFixed(1)} avgDuration:${b.toFixed(1)} maxFetchDuration:${c.toFixed(1)} fetchDuration:${R.toFixed(1)} firstSelection:${_} codecSet:${t.codecSet} videoRange:${t.videoRange} hls.loadLevel:${g}`)),_&&(this.firstSelection=l),l}}return-1}set nextAutoLevel(e){const t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey="",this._nextAutoLevel=t)}deriveNextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:n}=this.hls;return Math.min(Math.max(e,n),t)}},bufferController:class extends x{constructor(e,t){var n;super("buffer-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.details=null,this._objectUrl=null,this.operationQueue=null,this.bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.blockedAudioAppend=null,this.lastVideoAppendEnd=0,this.appendSource=void 0,this.transferData=void 0,this.overrides=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.sourceBuffers=[[null,null],[null,null]],this._onEndStreaming=e=>{var t;this.hls&&"open"===(null==(t=this.mediaSource)?void 0:t.readyState)&&this.hls.pauseBuffering()},this._onStartStreaming=e=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=e=>{const{media:t,mediaSource:n}=this;e&&this.log("Media source opened"),t&&n&&(n.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(l.MEDIA_ATTACHED,{media:t,mediaSource:n}),null!==this.mediaSource&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:e,_objectUrl:t}=this;e!==t&&this.error(`Media element src was set while attaching MediaSource (${t} > ${e})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=(n=M(e.config.preferManagedMediaSource),"undefined"!=typeof self&&n===self.ManagedMediaSource),this.initTracks(),this.registerListeners()}hasSourceTypes(){return Object.keys(this.tracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.transferData=this.overrides=void 0,this.operationQueue&&(this.operationQueue.destroy(),this.operationQueue=null),this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose=null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null}registerListeners(){const{hls:e}=this;e.on(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.MANIFEST_PARSED,this.onManifestParsed,this),e.on(l.BUFFER_RESET,this.onBufferReset,this),e.on(l.BUFFER_APPENDING,this.onBufferAppending,this),e.on(l.BUFFER_CODECS,this.onBufferCodecs,this),e.on(l.BUFFER_EOS,this.onBufferEos,this),e.on(l.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(l.FRAG_PARSED,this.onFragParsed,this),e.on(l.FRAG_CHANGED,this.onFragChanged,this),e.on(l.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.MANIFEST_PARSED,this.onManifestParsed,this),e.off(l.BUFFER_RESET,this.onBufferReset,this),e.off(l.BUFFER_APPENDING,this.onBufferAppending,this),e.off(l.BUFFER_CODECS,this.onBufferCodecs,this),e.off(l.BUFFER_EOS,this.onBufferEos,this),e.off(l.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(l.FRAG_PARSED,this.onFragParsed,this),e.off(l.FRAG_CHANGED,this.onFragChanged,this),e.off(l.ERROR,this.onError,this)}transferMedia(){const{media:e,mediaSource:t}=this;if(!e)return null;const n={};if(this.operationQueue){const e=this.isUpdating();e||this.operationQueue.removeBlockers();const t=this.isQueued();(e||t)&&this.warn(`Transfering MediaSource with${t?" operations in queue":""}${e?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const i=this.transferData;return!this.sourceBufferCount&&i&&i.mediaSource===t?y(n,i.tracks):this.sourceBuffers.forEach((e=>{const[t]=e;t&&(n[t]=y({},this.tracks[t]),this.removeBuffer(t)),e[0]=e[1]=null})),{media:e,mediaSource:t,tracks:n}}initTracks(){this.sourceBuffers=[[null,null],[null,null]],this.tracks={},this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){var n;let i=2;(t.audio&&!t.video||!t.altAudio)&&(i=1),this.bufferCodecEventsTotal=i,this.log(`${i} bufferCodec event(s) expected.`),null!=(n=this.transferData)&&n.mediaSource&&this.sourceBufferCount&&i&&this.bufferCreated()}onMediaAttaching(e,t){const n=this.media=t.media,i=M(this.appendSource);if(this.transferData=this.overrides=void 0,n&&i){const e=!!t.mediaSource;(e||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);const r=this.mediaSource=t.mediaSource||new i;if(this.assignMediaSource(r),e)this._objectUrl=n.src,this.attachTransferred();else{const e=this._objectUrl=self.URL.createObjectURL(r);if(this.appendSource)try{n.removeAttribute("src");const t=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||t&&r instanceof t,la(n),function(e,t){const n=self.document.createElement("source");n.type="video/mp4",n.src=t,e.appendChild(n)}(n,e),n.load()}catch(t){n.src=e}else n.src=e}n.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var t,n;this.log(`${(null==(t=this.transferData)?void 0:t.mediaSource)===e?"transferred":"created"} media source: ${null==(n=e.constructor)?void 0:n.name}`),e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(e.addEventListener("startstreaming",this._onStartStreaming),e.addEventListener("endstreaming",this._onEndStreaming))}attachTransferred(){const e=this.media,t=this.transferData;if(!t||!e)return;const n=this.tracks,i=t.tracks,r=i?Object.keys(i):null,a=r?r.length:0,s=()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()};if(i&&r&&a){if(!this.tracksReady)return this.hls.config.startFragPrefetch=!0,void this.log("attachTransferred: waiting for SourceBuffer track info");if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal})\nrequired tracks: ${Qe(n,((e,t)=>"initSegment"===e?void 0:t))};\ntransfer tracks: ${Qe(i,((e,t)=>"initSegment"===e?void 0:t))}}`),!L(i,n)){t.mediaSource=null,t.tracks=void 0;const r=e.currentTime,a=this.details,s=Math.max(r,(null==a?void 0:a.fragments[0].start)||0);return s-r>1?void this.log(`attachTransferred: waiting for playback to reach new tracks start time ${r} -> ${s}`):(this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(i)}"->"${Object.keys(n)}") start time: ${s} currentTime: ${r}`),this.onMediaDetaching(l.MEDIA_DETACHING,{}),this.onMediaAttaching(l.MEDIA_ATTACHING,t),void(e.currentTime=s))}this.transferData=void 0,r.forEach((e=>{const t=e,n=i[t];if(n){const e=n.buffer;if(e){const i=this.fragmentTracker,r=n.id;if(i.hasFragments(r)||i.hasParts(r)){const n=Zt.getBuffered(e);i.detectEvictedFragments(t,n,r,null,!0)}const a=ca(t),s=[t,e];this.sourceBuffers[a]=s,e.updating&&this.operationQueue&&this.operationQueue.prependBlocker(t),this.trackSourceBuffer(t,n)}}})),s(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),s()}get mediaSourceOpenOrEnded(){var e;const t=null==(e=this.mediaSource)?void 0:e.readyState;return"open"===t||"ended"===t}onMediaDetaching(e,t){const n=!!t.transferMedia;this.transferData=this.overrides=void 0;const{media:i,mediaSource:r,_objectUrl:a}=this;if(r){if(this.log("media source "+(n?"transferring":"detaching")),n)this.sourceBuffers.forEach((([e])=>{e&&this.removeBuffer(e)})),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const e="open"===r.readyState;try{const t=r.sourceBuffers;for(let n=t.length;n--;)e&&t[n].abort(),r.removeSourceBuffer(t[n]);e&&r.endOfStream()}catch(e){this.warn(`onMediaDetaching: ${e.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}r.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("sourceended",this._onMediaSourceEnded),r.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(r.removeEventListener("startstreaming",this._onStartStreaming),r.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}i&&(i.removeEventListener("emptied",this._onMediaEmptied),n||(a&&self.URL.revokeObjectURL(a),this.mediaSrc===a?(i.removeAttribute("src"),this.appendSource&&la(i),i.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(l.MEDIA_DETACHED,t)}onBufferReset(){this.sourceBuffers.forEach((([e])=>{e&&this.resetBuffer(e)})),this.initTracks()}resetBuffer(e){var t;const n=null==(t=this.tracks[e])?void 0:t.buffer;if(this.removeBuffer(e),n)try{var i;null!=(i=this.mediaSource)&&i.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(n)}catch(t){this.warn(`onBufferReset ${e}`,t)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[ca(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new ra(this.tracks)}onBufferCodecs(e,t){const n=this.tracks,i=Object.keys(t);this.log(`BUFFER_CODECS: "${i}" (current SB count ${this.sourceBufferCount})`);const r="audiovideo"in t&&(n.audio||n.video)||n.audiovideo&&("audio"in t||"video"in t),a=!r&&this.sourceBufferCount&&this.media&&i.some((e=>!n[e]));r||a?this.warn(`Unsupported transition between "${Object.keys(n)}" and "${i}" SourceBuffers`):(i.forEach((e=>{var i,r,a;const s=t[e],{id:o,codec:l,levelCodec:c,container:u,metadata:d,supplemental:h}=s;let p=n[e];const f=null==(i=this.transferData)||null==(r=i.tracks)?void 0:r[e],m=null!=f&&f.buffer?f:p,g=(null==m?void 0:m.pendingCodec)||(null==m?void 0:m.codec),v=null==m?void 0:m.levelCodec;p||(p=n[e]={buffer:void 0,listeners:[],codec:l,supplemental:h,container:u,levelCodec:c,metadata:d,id:o});const b=Pe(g,v),y=null==b?void 0:b.replace(aa,"$1");let _=Pe(l,c);const w=null==(a=_)?void 0:a.replace(aa,"$1");_&&b&&y!==w&&("audio"===e.slice(0,5)&&(_=Re(_,this.appendSource)),this.log(`switching codec ${g} to ${_}`),_!==(p.pendingCodec||p.codec)&&(p.pendingCodec=_),p.container=u,this.appendChangeType(e,u,_))})),(this.tracksReady||this.sourceBufferCount)&&(t.tracks=this.sourceBufferTracks),this.sourceBufferCount||this.mediaSourceOpenOrEnded&&this.checkPendingTracks())}get sourceBufferTracks(){return Object.keys(this.tracks).reduce(((e,t)=>{const n=this.tracks[t];return e[t]={id:n.id,container:n.container,codec:n.codec,levelCodec:n.levelCodec},e}),{})}appendChangeType(e,t,n){const i=`${t};codecs=${n}`,r={label:`change-type=${i}`,execute:()=>{const r=this.tracks[e];if(r){const a=r.buffer;null!=a&&a.changeType&&(this.log(`changing ${e} sourceBuffer type to ${i}`),a.changeType(i),r.codec=n,r.container=t)}this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:t=>{this.warn(`Failed to change ${e} SourceBuffer type`,t)}};this.append(r,e,this.isPending(this.tracks[e]))}blockAudio(e){var t;const n=e.start,i=n+.05*e.duration;if(!0===(null==(t=this.fragmentTracker.getAppendedFrag(n,p))?void 0:t.gap))return;const r={label:"block-audio",execute:()=>{var e;const t=this.tracks.video;(this.lastVideoAppendEnd>i||null!=t&&t.buffer&&Zt.isBuffered(t.buffer,i)||!0===(null==(e=this.fragmentTracker.getAppendedFrag(i,p))?void 0:e.gap))&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:e=>{this.warn("Error executing block-audio operation",e)}};this.blockedAudioAppend={op:r,frag:e},this.append(r,"audio",!0)}unblockAudio(){const{blockedAudioAppend:e,operationQueue:t}=this;e&&t&&(this.blockedAudioAppend=null,t.unblockAudio(e.op))}onBufferAppending(e,t){const{tracks:n}=this,{data:i,type:r,parent:a,frag:c,part:u,chunkMeta:d}=t,h=d.buffering[r],p=c.sn,f=self.performance.now();h.start=f;const m=c.stats.buffering,g=u?u.stats.buffering:null;0===m.start&&(m.start=f),g&&0===g.start&&(g.start=f);const v=n.audio;let b=!1;"audio"===r&&"audio/mpeg"===(null==v?void 0:v.container)&&(b=!this.lastMpegAudioChunk||1===d.id||this.lastMpegAudioChunk.sn!==d.sn,this.lastMpegAudioChunk=d);const y=this.tracks.video,_=null==y?void 0:y.buffer;if(_&&"initSegment"!==p){const e=u||c,t=this.blockedAudioAppend;if("audio"!==r||"main"===a||this.blockedAudioAppend){if("video"===r){const n=e.end;if(t){const e=t.frag.start;(n>e||n<this.lastVideoAppendEnd||Zt.isBuffered(_,e))&&this.unblockAudio()}this.lastVideoAppendEnd=n}}else{const t=e.start+.05*e.duration,n=_.buffered,i=this.currentOp("video");n.length||i?!i&&!Zt.isBuffered(_,t)&&this.lastVideoAppendEnd<t&&this.blockAudio(e):this.blockAudio(e)}}const w=(u||c).start,x={label:`append-${r}`,execute:()=>{if(h.executeStart=self.performance.now(),b){const e=this.tracks[r];if(e){const t=e.buffer;if(t){const e=w-t.timestampOffset;Math.abs(e)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${w} (delta: ${e}) sn: ${p})`),t.timestampOffset=w)}}}this.appendExecutor(i,r)},onStart:()=>{},onComplete:()=>{const e=self.performance.now();h.executeEnd=h.end=e,0===m.first&&(m.first=e),g&&0===g.first&&(g.first=e);const t={};this.sourceBuffers.forEach((([e,n])=>{e&&(t[e]=Zt.getBuffered(n))})),this.appendErrors[r]=0,"audio"===r||"video"===r?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(l.BUFFER_APPENDED,{type:r,frag:c,part:u,chunkMeta:d,parent:c.type,timeRanges:t})},onError:e=>{var t;const n={type:s.MEDIA_ERROR,parent:c.type,details:o.BUFFER_APPEND_ERROR,sourceBufferName:r,frag:c,part:u,chunkMeta:d,error:e,err:e,fatal:!1},i=null==(t=this.media)?void 0:t.error;if(e.code===DOMException.QUOTA_EXCEEDED_ERR)n.details=o.BUFFER_FULL_ERROR;else if(e.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!i)n.errorAction=Et(!0);else if(e.name===sa&&0===this.sourceBufferCount)n.errorAction=Et(!0);else{const e=++this.appendErrors[r];this.warn(`Failed ${e}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${r}" sourceBuffer (${i||"no media error"})`),(e>=this.hls.config.appendErrorMaxRetry||i)&&(n.fatal=!0)}this.hls.trigger(l.ERROR,n)}};this.append(x,r,this.isPending(this.tracks[r]))}getFlushOp(e,t,n){return this.log(`queuing "${e}" remove ${t}-${n}`),{label:"remove",execute:()=>{this.removeExecutor(e,t,n)},onStart:()=>{},onComplete:()=>{this.hls.trigger(l.BUFFER_FLUSHED,{type:e})},onError:i=>{this.warn(`Failed to remove ${t}-${n} from "${e}" SourceBuffer`,i)}}}onBufferFlushing(e,t){const{type:n,startOffset:i,endOffset:r}=t;n?this.append(this.getFlushOp(n,i,r),n):this.sourceBuffers.forEach((([e])=>{e&&this.append(this.getFlushOp(e,i,r),e)}))}onFragParsed(e,t){const{frag:n,part:i}=t,r=[],a=i?i.elementaryStreams:n.elementaryStreams;a[H]?r.push("audiovideo"):(a[j]&&r.push("audio"),a[q]&&r.push("video"));0===r.length&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers((()=>{const e=self.performance.now();n.stats.buffering.end=e,i&&(i.stats.buffering.end=e);const t=i?i.stats:n.stats;this.hls.trigger(l.FRAG_BUFFERED,{frag:n,part:i,stats:t,id:n.type})}),r).catch((e=>{this.warn(`Fragment buffered callback ${e}`),this.stepOperationQueue(this.sourceBufferTypes)}))}onFragChanged(e,t){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some((([e])=>{var t,n;return e&&(!(null!=(t=this.tracks[e])&&t.ended)||(null==(n=this.tracks[e])?void 0:n.ending))}))}onBufferEos(e,t){var n;this.sourceBuffers.forEach((([e])=>{if(e){const n=this.tracks[e];t.type&&t.type!==e||(n.ending=!0,n.ended||(n.ended=!0,this.log(`${e} buffer reached EOS`)))}}));const i=!1!==(null==(n=this.overrides)?void 0:n.endOfStream);this.sourceBufferCount>0&&!this.sourceBuffers.some((([e])=>{var t;return e&&!(null!=(t=this.tracks[e])&&t.ended)}))&&(i?(this.log("Queueing EOS"),this.blockUntilOpen((()=>{this.tracksEnded();const{mediaSource:e}=this;e&&"open"===e.readyState?(this.log("Calling mediaSource.endOfStream()"),e.endOfStream(),this.hls.trigger(l.BUFFERED_TO_END,void 0)):e&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${e.readyState}`)}))):(this.tracksEnded(),this.hls.trigger(l.BUFFERED_TO_END,void 0)))}tracksEnded(){this.sourceBuffers.forEach((([e])=>{if(null!==e){const t=this.tracks[e];t&&(t.ending=!1)}}))}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.updateDuration())}updateDuration(){const e=this.getDurationAndRange();e&&this.blockUntilOpen((()=>this.updateMediaSource(e)))}onError(e,t){if(t.details===o.BUFFER_APPEND_ERROR&&t.frag){var n;const e=null==(n=t.errorAction)?void 0:n.nextAutoLevel;i(e)&&e!==t.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:e,details:t,media:n}=this;if(!n||null===t)return;if(!this.sourceBufferCount)return;const r=e.config,a=n.currentTime,s=t.levelTargetDuration,o=t.live&&null!==r.liveBackBufferLength?r.liveBackBufferLength:r.backBufferLength;if(i(o)&&o>=0){const e=Math.max(o,s),t=Math.floor(a/s)*s-e;this.flushBackBuffer(a,s,t)}if(i(r.frontBufferFlushThreshold)&&r.frontBufferFlushThreshold>0){const e=Math.max(r.maxBufferLength,r.frontBufferFlushThreshold),t=Math.max(e,s),n=Math.floor(a/s)*s+t;this.flushFrontBuffer(a,s,n)}}flushBackBuffer(e,t,n){this.sourceBuffers.forEach((([e,t])=>{if(t){const r=Zt.getBuffered(t);if(r.length>0&&n>r.start(0)){var i;this.hls.trigger(l.BACK_BUFFER_REACHED,{bufferEnd:n});const t=this.tracks[e];if(null!=(i=this.details)&&i.live)this.hls.trigger(l.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(null!=t&&t.ended)return void this.log(`Cannot flush ${e} back buffer while SourceBuffer is in ended state`);this.hls.trigger(l.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:e})}}}))}flushFrontBuffer(e,t,n){this.sourceBuffers.forEach((([t,i])=>{if(i){const r=Zt.getBuffered(i),a=r.length;if(a<2)return;const s=r.start(a-1),o=r.end(a-1);if(n>s||e>=s&&e<=o)return;this.hls.trigger(l.BUFFER_FLUSHING,{startOffset:s,endOffset:1/0,type:t})}}))}getDurationAndRange(){var e;const{details:t,mediaSource:n}=this;if(!t||!this.media||"open"!==(null==n?void 0:n.readyState))return null;const r=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&t.live&&n.setLiveSeekableRange){const e=Math.max(0,t.fragmentStart);return{duration:1/0,start:e,end:Math.max(e,r)}}return{duration:1/0}}const a=null==(e=this.overrides)?void 0:e.duration;if(a)return i(a)?{duration:a}:null;const s=this.media.duration;return r>(i(n.duration)?n.duration:0)&&r>s||!i(s)?{duration:r}:null}updateMediaSource({duration:e,start:t,end:n}){const r=this.mediaSource;this.media&&r&&"open"===r.readyState&&(r.duration!==e&&(i(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),r.duration=e),void 0!==t&&void 0!==n&&(this.log(`MediaSource duration is set to ${r.duration}. Setting seekable range to ${t}-${n}.`),r.setLiveSeekableRange(t,n)))}get tracksReady(){const e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:e,pendingTrackCount:t,tracks:n}=this;if(this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${Qe(n)}`),this.tracksReady){var i;const e=null==(i=this.transferData)?void 0:i.tracks;e&&Object.keys(e).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const e={};this.sourceBuffers.forEach((([t,n])=>{if(t){const i=this.tracks[t];e[t]={buffer:n,container:i.container,codec:i.codec,supplemental:i.supplemental,levelCodec:i.levelCodec,id:i.id,metadata:i.metadata}}})),this.hls.trigger(l.BUFFER_CREATED,{tracks:e}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach((([e])=>{this.executeNext(e)}))}else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}createSourceBuffers(){const{tracks:e,sourceBuffers:t,mediaSource:n}=this;if(!n)throw new Error("createSourceBuffers called when mediaSource was null");for(const r in e){const a=r,c=e[a];if(this.isPending(c)){const e=this.getTrackCodec(c,a),r=`${c.container};codecs=${e}`;c.codec=e,this.log(`creating sourceBuffer(${r})${this.currentOp(a)?" Queued":""} ${Qe(c)}`);try{const e=n.addSourceBuffer(r),i=ca(a),s=[a,e];t[i]=s,c.buffer=e}catch(e){var i;return this.error(`error while trying to add sourceBuffer: ${e.message}`),this.shiftAndExecuteNext(a),null==(i=this.operationQueue)||i.removeBlockers(),delete this.tracks[a],void this.hls.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:e,sourceBufferName:a,mimeType:r,parent:c.id})}this.trackSourceBuffer(a,c)}}this.bufferCreated()}getTrackCodec(e,t){const n=e.supplemental;let i=e.codec;n&&("video"===t||"audiovideo"===t)&&Ce(n,"video")&&(i=function(e,t){const n=[];if(e){const t=e.split(",");for(let e=0;e<t.length;e++)Ee(t[e],"video")||n.push(t[e])}return t&&n.push(t),n.join(",")}(i,n));const r=Pe(i,e.levelCodec);return r?"audio"===t.slice(0,5)?Re(r,this.appendSource):r:""}trackSourceBuffer(e,t){const n=t.buffer;if(!n)return;const i=this.getTrackCodec(t,e);this.tracks[e]={buffer:n,codec:i,container:t.container,levelCodec:t.levelCodec,supplemental:t.supplemental,metadata:t.metadata,id:t.id,listeners:[]},this.removeBufferListeners(e),this.addBufferListener(e,"updatestart",this.onSBUpdateStart),this.addBufferListener(e,"updateend",this.onSBUpdateEnd),this.addBufferListener(e,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(e,"bufferedchange",((e,t)=>{const n=t.removedRanges;null!=n&&n.length&&this.hls.trigger(l.BUFFER_FLUSHED,{type:e})}))}get mediaSrc(){var e,t;const n=(null==(e=this.media)||null==(t=e.querySelector)?void 0:t.call(e,"source"))||this.media;return null==n?void 0:n.src}onSBUpdateStart(e){const t=this.currentOp(e);t&&t.onStart()}onSBUpdateEnd(e){var t;if("closed"===(null==(t=this.mediaSource)?void 0:t.readyState))return void this.resetBuffer(e);const n=this.currentOp(e);n&&(n.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,t){var n;const i=new Error(`${e} SourceBuffer error. MediaSource readyState: ${null==(n=this.mediaSource)?void 0:n.readyState}`);this.error(`${i}`,t),this.hls.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:i,fatal:!1});const r=this.currentOp(e);r&&r.onError(i)}removeExecutor(e,t,n){const{media:r,mediaSource:a}=this,s=this.tracks[e],o=null==s?void 0:s.buffer;if(!r||!a||!o)return this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),void this.shiftAndExecuteNext(e);const l=i(r.duration)?r.duration:1/0,c=i(a.duration)?a.duration:1/0,u=Math.max(0,t),d=Math.min(n,l,c);d>u&&(!s.ending||s.ended)?(s.ended=!1,this.log(`Removing [${u},${d}] from the ${e} SourceBuffer`),o.remove(u,d)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const n=this.tracks[t],i=null==n?void 0:n.buffer;if(!i)throw new oa(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);n.ending=!1,n.ended=!1,i.appendBuffer(e)}blockUntilOpen(e){if(this.isUpdating()||this.isQueued())this.blockBuffers(e).catch((e=>{this.warn(`SourceBuffer blocked callback ${e}`),this.stepOperationQueue(this.sourceBufferTypes)}));else try{e()}catch(e){this.warn(`Callback run without blocking ${this.operationQueue} ${e}`)}}isUpdating(){return this.sourceBuffers.some((([e,t])=>e&&t.updating))}isQueued(){return this.sourceBuffers.some((([e])=>e&&!!this.currentOp(e)))}isPending(e){return!!e&&!e.buffer}blockBuffers(e,t=this.sourceBufferTypes){if(!t.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);const{operationQueue:n}=this,i=t.map((e=>this.appendBlocker(e)));return t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(i).then((t=>{n===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))}))}stepOperationQueue(e){e.forEach((e=>{var t;const n=null==(t=this.tracks[e])?void 0:t.buffer;n&&!n.updating&&this.shiftAndExecuteNext(e)}))}append(e,t,n){this.operationQueue&&this.operationQueue.append(e,t,n)}appendBlocker(e){if(this.operationQueue)return this.operationQueue.appendBlocker(e)}currentOp(e){return this.operationQueue?this.operationQueue.current(e):null}executeNext(e){e&&this.operationQueue&&this.operationQueue.executeNext(e)}shiftAndExecuteNext(e){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(e)}get pendingTrackCount(){return Object.keys(this.tracks).reduce(((e,t)=>e+(this.isPending(this.tracks[t])?1:0)),0)}get sourceBufferCount(){return this.sourceBuffers.reduce(((e,[t])=>e+(t?1:0)),0)}get sourceBufferTypes(){return this.sourceBuffers.map((([e])=>e)).filter((e=>!!e))}addBufferListener(e,t,n){const i=this.tracks[e];if(!i)return;const r=i.buffer;if(!r)return;const a=n.bind(this,e);i.listeners.push({event:t,listener:a}),r.addEventListener(t,a)}removeBufferListeners(e){const t=this.tracks[e];if(!t)return;const n=t.buffer;n&&(t.listeners.forEach((e=>{n.removeEventListener(e.event,e.listener)})),t.listeners.length=0)}},capLevelController:ua,errorController:class extends x{constructor(e){super("error-controller",e.logger),this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(l.ERROR,this.onError,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(l.ERROR,this.onError,this),e.off(l.ERROR,this.onErrorOut,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(null==e?void 0:e.type)===p?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var n;if(t.fatal)return;const i=this.hls,r=t.context;switch(t.details){case o.FRAG_LOAD_ERROR:case o.FRAG_LOAD_TIMEOUT:case o.KEY_LOAD_ERROR:case o.KEY_LOAD_TIMEOUT:return void(t.errorAction=this.getFragRetryOrSwitchAction(t));case o.FRAG_PARSING_ERROR:if(null!=(n=t.frag)&&n.gap)return void(t.errorAction=Et());case o.FRAG_GAP:case o.FRAG_DECRYPT_ERROR:return t.errorAction=this.getFragRetryOrSwitchAction(t),void(t.errorAction.action=yt);case o.LEVEL_EMPTY_ERROR:case o.LEVEL_PARSING_ERROR:{var a,l;const e=t.parent===p?t.level:i.loadLevel;t.details===o.LEVEL_EMPTY_ERROR&&null!=(a=t.context)&&null!=(l=a.levelDetails)&&l.live?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,e):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,e))}return;case o.LEVEL_LOAD_ERROR:case o.LEVEL_LOAD_TIMEOUT:return void("number"==typeof(null==r?void 0:r.level)&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.level)));case o.AUDIO_TRACK_LOAD_ERROR:case o.AUDIO_TRACK_LOAD_TIMEOUT:case o.SUBTITLE_LOAD_ERROR:case o.SUBTITLE_TRACK_LOAD_TIMEOUT:if(r){const e=i.loadLevelObj;if(e&&(r.type===d&&e.hasAudioGroup(r.groupId)||r.type===h&&e.hasSubtitleGroup(r.groupId)))return t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.loadLevel),t.errorAction.action=yt,void(t.errorAction.flags=kt)}return;case o.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const e=i.loadLevelObj,n=null==e?void 0:e.attrs["HDCP-LEVEL"];n?t.errorAction={action:yt,flags:St,hdcpLevel:n}:this.keySystemError(t)}return;case o.BUFFER_ADD_CODEC_ERROR:case o.REMUX_ALLOC_ERROR:case o.BUFFER_APPEND_ERROR:var c;if(!t.errorAction)t.errorAction=this.getLevelSwitchAction(t,null!=(c=t.level)?c:i.loadLevel);return;case o.INTERNAL_EXCEPTION:case o.BUFFER_APPENDING_ERROR:case o.BUFFER_FULL_ERROR:case o.LEVEL_SWITCH_ERROR:case o.BUFFER_STALLED_ERROR:case o.BUFFER_SEEK_OVER_HOLE:case o.BUFFER_NUDGE_ON_STALL:return void(t.errorAction=Et())}t.type===s.KEY_SYSTEM_ERROR&&this.keySystemError(t)}keySystemError(e){const t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}getPlaylistRetryOrSwitchAction(e,t){const n=ft(this.hls.config.playlistLoadPolicy,e),i=this.playlistError++;if(vt(n,i,pt(e),e.response))return{action:wt,flags:xt,retryConfig:n,retryCount:i};const r=this.getLevelSwitchAction(e,t);return n&&(r.retryConfig=n,r.retryCount=i),r}getFragRetryOrSwitchAction(e){const t=this.hls,n=this.getVariantLevelIndex(e.frag),i=t.levels[n],{fragLoadPolicy:r,keyLoadPolicy:a}=t.config,s=ft(e.details.startsWith("key")?a:r,e),l=t.levels.reduce(((e,t)=>e+t.fragmentError),0);if(i){e.details!==o.FRAG_GAP&&i.fragmentError++;if(vt(s,l,pt(e),e.response))return{action:wt,flags:xt,retryConfig:s,retryCount:l}}const c=this.getLevelSwitchAction(e,n);return s&&(c.retryConfig=s,c.retryCount=l),c}getLevelSwitchAction(e,t){const n=this.hls;null==t&&(t=n.loadLevel);const i=this.hls.levels[t];if(i){var r,a;const t=e.details;i.loadError++,t===o.BUFFER_APPEND_ERROR&&i.fragmentError++;let c=-1;const{levels:u,loadLevel:g,minAutoLevel:v,maxAutoLevel:b}=n;n.autoLevelEnabled||n.config.preserveManualLevelOnError||(n.loadLevel=-1);const y=null==(r=e.frag)?void 0:r.type,_=(y===f&&t===o.FRAG_PARSING_ERROR||"audio"===e.sourceBufferName&&(t===o.BUFFER_ADD_CODEC_ERROR||t===o.BUFFER_APPEND_ERROR))&&u.some((({audioCodec:e})=>i.audioCodec!==e)),w="video"===e.sourceBufferName&&(t===o.BUFFER_ADD_CODEC_ERROR||t===o.BUFFER_APPEND_ERROR)&&u.some((({codecSet:e,audioCodec:t})=>i.codecSet!==e&&i.audioCodec===t)),{type:x,groupId:k}=null!=(a=e.context)?a:{};for(let n=u.length;n--;){const r=(n+g)%u.length;if(r!==g&&r>=v&&r<=b&&0===u[r].loadError){var s,l;const n=u[r];if(t===o.FRAG_GAP&&y===p&&e.frag){const t=u[r].details;if(t){const n=ct(e.frag,t.fragments,e.frag.start);if(null!=n&&n.gap)continue}}else{if(x===d&&n.hasAudioGroup(k)||x===h&&n.hasSubtitleGroup(k))continue;if(y===f&&null!=(s=i.audioGroups)&&s.some((e=>n.hasAudioGroup(e)))||y===m&&null!=(l=i.subtitleGroups)&&l.some((e=>n.hasSubtitleGroup(e)))||_&&i.audioCodec===n.audioCodec||!_&&i.audioCodec!==n.audioCodec||w&&i.codecSet===n.codecSet)continue}c=r;break}}if(c>-1&&n.loadLevel!==c)return e.levelRetry=!0,this.playlistError=0,{action:yt,flags:xt,nextAutoLevel:c}}return{action:yt,flags:kt}}onErrorOut(e,t){var n;switch(null==(n=t.errorAction)?void 0:n.action){case bt:break;case yt:this.sendAlternateToPenaltyBox(t),t.errorAction.resolved||t.details===o.FRAG_GAP?/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError()):t.fatal=!0}t.fatal&&this.hls.stopLoad()}sendAlternateToPenaltyBox(e){const t=this.hls,n=e.errorAction;if(!n)return;const{flags:i,hdcpLevel:r,nextAutoLevel:a}=n;switch(i){case xt:this.switchLevel(e,a);break;case St:r&&(t.maxHdcpLevel=je[je.indexOf(r)-1],n.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`)}n.resolved||this.switchLevel(e,a)}switchLevel(e,t){if(void 0!==t&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel,e.details===o.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&"audiovideo"!==e.sourceBufferName)){const t=Be(e.mimeType),n=this.hls.levels;for(let i=n.length;i--;)n[i][`${e.sourceBufferName}Codec`]===t&&this.hls.removeLevel(i)}}},fpsController:class{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(l.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(l.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(l.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(l.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const n=this.hls.config;if(n.capLevelOnFPSDrop){const e=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=e,e&&"function"==typeof e.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,t,n){const i=performance.now();if(t){if(this.lastTime){const e=i-this.lastTime,r=n-this.lastDroppedFrames,a=t-this.lastDecodedFrames,s=1e3*r/e,o=this.hls;if(o.trigger(l.FPS_DROP,{currentDropped:r,currentDecoded:a,totalDroppedFrames:n}),s>0&&r>o.config.fpsDroppedMonitoringThreshold*a){let e=o.currentLevel;o.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+e),e>0&&(-1===o.autoLevelCapping||o.autoLevelCapping>=e)&&(e-=1,o.trigger(l.FPS_DROP_LEVEL_CAPPING,{level:e,droppedLevel:o.currentLevel}),o.autoLevelCapping=e,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=n,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}},stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:Cn,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,certLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null}},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},{cueHandler:ao,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:class extends ki{constructor(e,t,n){super(e,t,n,"subtitle-stream-controller",m),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(l.LEVEL_LOADED,this.onLevelLoaded,this),e.on(l.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(l.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(l.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(l.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(l.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(l.LEVEL_LOADED,this.onLevelLoaded,this),e.off(l.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(l.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(l.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(l.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(l.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=hi,this.setInterval(500),this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(e,t){this.tracksBuffered=[],super.onMediaDetaching(e,t)}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:n,success:i}=t;if(G(n)&&(this.fragPrevious=n),this.state=hi,!i)return;const r=this.tracksBuffered[this.currentTrackId];if(!r)return;let a;const s=n.start;for(let e=0;e<r.length;e++)if(s>=r[e].start&&s<=r[e].end){a=r[e];break}const o=n.start+n.duration;a?a.end=o:(a={start:s,end:o},r.push(a)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null),this.media&&this.tick()}onBufferFlushing(e,t){const{startOffset:n,endOffset:i}=t;if(0===n&&i!==Number.POSITIVE_INFINITY){const e=i-1;if(e<=0)return;t.endOffsetSubtitles=Math.max(0,e),this.tracksBuffered.forEach((t=>{for(let n=0;n<t.length;)if(t[n].end<=e)t.shift();else{if(!(t[n].start<e))break;t[n].start=e,n++}})),this.fragmentTracker.removeFragmentsInRange(n,e,m)}}onError(e,t){const n=t.frag;(null==n?void 0:n.type)===m&&(t.details===o.FRAG_GAP&&this.fragmentTracker.fragBuffered(n,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==di&&(this.state=hi))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){this.levels&&ta(this.levels,t)?this.levels=t.map((e=>new Ye(e))):(this.tracksBuffered=[],this.levels=t.map((e=>{const t=new Ye(e);return this.tracksBuffered[t.id]=[],t})),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,m),this.fragPrevious=null,this.mediaBuffer=null)}onSubtitleTrackSwitch(e,t){var n;if(this.currentTrackId=t.id,null==(n=this.levels)||!n.length||-1===this.currentTrackId)return void this.clearInterval();const i=this.levels[this.currentTrackId];null!=i&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.state!==di&&this.setInterval(500)}onSubtitleTrackLoaded(e,t){var n;const{currentTrackId:i,levels:r}=this,{details:a,id:s}=t;if(!r)return void this.warn(`Subtitle tracks were reset while loading level ${s}`);const o=r[s];if(s>=r.length||!o)return;this.log(`Subtitle track ${s} loaded [${a.startSN},${a.endSN}]${a.lastPartSn?`[part-${a.lastPartSn}-${a.lastPartIndex}]`:""},duration:${a.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let c=0;if(a.live||null!=(n=o.details)&&n.live){const e=this.mainDetails;if(a.deltaUpdateFailed||!e)return;const t=e.fragments[0];var u;if(o.details)c=this.alignPlaylists(a,o.details,null==(u=this.levelLastLoaded)?void 0:u.details),0===c&&t&&(c=t.start,Qn(a,c));else a.hasProgramDateTime&&e.hasProgramDateTime?(ci(a,e),c=a.fragmentStart):t&&(c=t.start,Qn(a,c))}if(o.details=a,this.levelLastLoaded=o,s===i&&(this.hls.trigger(l.SUBTITLE_TRACK_UPDATED,{details:a,id:s,groupId:t.groupId}),this.tick(),a.live&&!this.fragCurrent&&this.media&&this.state===hi)){ct(null,a.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),o.details=void 0)}}_handleFragmentLoadComplete(e){const{frag:t,payload:n}=e,i=t.decryptdata,r=this.hls;if(!this.fragContextChanged(t)&&n&&n.byteLength>0&&null!=i&&i.key&&i.iv&&on(i.method)){const e=performance.now();this.decrypter.decrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer,ln(i.method)).catch((e=>{throw r.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:t}),e})).then((n=>{const i=performance.now();r.trigger(l.FRAG_DECRYPTED,{frag:t,payload:n,stats:{tstart:e,tdecrypt:i}})})).catch((e=>{this.warn(`${e.name}: ${e.message}`),this.state=hi}))}}doTick(){if(this.media){if(this.state===hi){const{currentTrackId:e,levels:t}=this,n=null==t?void 0:t[e];if(!n||!t.length||!n.details)return;if(this.waitForLive(n))return;const{config:i}=this,r=this.getLoadPosition(),a=Zt.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,i.maxBufferHole),{end:s,len:o}=a,l=n.details;if(o>this.hls.maxBufferLength+l.levelTargetDuration)return;const c=l.fragments,u=c.length,d=l.edge;let h=null;const p=this.fragPrevious;if(s<d){const e=i.maxFragLookUpTolerance,t=s>d-e?0:e;h=ct(p,c,Math.max(c[0].start,s),t),!h&&p&&p.start<c[0].start&&(h=c[0])}else h=c[u-1];if(h=this.filterReplacedPrimary(h,n.details),!h)return;const f=c[h.sn-l.startSN-1];if(f&&f.cc===h.cc&&this.fragmentTracker.getState(f)===Ct&&(h=f),this.fragmentTracker.getState(h)===Ct){const e=this.mapToInitFragWhenRequired(h);e&&this.loadFragment(e,n,s)}}}else this.state=hi}loadFragment(e,t,n){G(e)?super.loadFragment(e,t,n):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new us(this.tracksBuffered[this.currentTrackId]||[])}},subtitleTrackController:class extends ea{constructor(e){super(e,"subtitle-track-controller"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let e=null;const t=Wa(this.media.textTracks);for(let n=0;n<t.length;n++)if("hidden"===t[n].mode)e=t[n];else if("showing"===t[n].mode){e=t[n];break}const n=this.findTrackForTextTrack(e);this.subtitleTrack!==n&&this.setSubtitleTrack(n)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.MANIFEST_PARSED,this.onManifestParsed,this),e.on(l.LEVEL_LOADING,this.onLevelLoading,this),e.on(l.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(l.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(l.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.MANIFEST_PARSED,this.onManifestParsed,this),e.off(l.LEVEL_LOADING,this.onLevelLoading,this),e.off(l.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(l.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(l.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(e,t){const n=this.media;if(!n)return;const i=!!t.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||n.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,i)return;Wa(n.textTracks).forEach((e=>{Ga(e)}))}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:n,groupId:i,details:r}=t,a=this.tracksInGroup[n];if(!a||a.groupId!==i)return void this.warn(`Subtitle track with id:${n} and group:${i} not found in active group ${null==a?void 0:a.groupId}`);const s=a.details;a.details=t.details,this.log(`Subtitle track ${n} "${a.name}" lang:${a.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,s)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.subtitleGroups||null,i=this.groupIds;let r=this.currentTrack;if(!n||(null==i?void 0:i.length)!==(null==n?void 0:n.length)||null!=n&&n.some((e=>-1===(null==i?void 0:i.indexOf(e))))){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const e=this.tracks.filter((e=>!n||-1!==n.indexOf(e.groupId)));if(e.length)this.selectDefaultTrack&&!e.some((e=>e.default))&&(this.selectDefaultTrack=!1),e.forEach(((e,t)=>{e.id=t}));else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=e;const t=this.hls.config.subtitlePreference;if(!r&&t){this.selectDefaultTrack=!1;const n=it(t,e);if(n>-1)r=e[n];else{const e=it(t,this.tracks);r=this.tracks[e]}}let i=this.findTrackId(r);-1===i&&r&&(i=this.findTrackId(null));const a={subtitleTracks:e};this.log(`Updating subtitle tracks, ${e.length} track(s) found in "${null==n?void 0:n.join(",")}" group-id`),this.hls.trigger(l.SUBTITLE_TRACKS_UPDATED,a),-1!==i&&-1===this.trackId&&this.setSubtitleTrack(i)}}findTrackId(e){const t=this.tracksInGroup,n=this.selectDefaultTrack;for(let i=0;i<t.length;i++){const r=t[i];if((!n||r.default)&&(n||e)&&(!e||rt(r,e)))return i}if(e){for(let n=0;n<t.length;n++){const i=t[n];if(na(e.attrs,i.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return n}for(let n=0;n<t.length;n++){const i=t[n];if(na(e.attrs,i.attrs,["LANGUAGE"]))return n}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){if(ia(t[n],e))return n}}return-1}onError(e,t){!t.fatal&&t.context&&(t.context.type!==h||t.context.id!==this.trackId||this.groupIds&&-1===this.groupIds.indexOf(t.context.groupId)||this.checkRetry(t))}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(e){this.selectDefaultTrack=!1,this.setSubtitleTrack(e)}setSubtitleOption(e){if(this.hls.config.subtitlePreference=e,e){if(-1===e.id)return this.setSubtitleTrack(-1),null;const t=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,t.length){const n=this.currentTrack;if(n&&rt(e,n))return n;const i=it(e,this.tracksInGroup);if(i>-1){const e=this.tracksInGroup[i];return this.setSubtitleTrack(i),e}if(n)return null;{const n=it(e,t);if(n>-1)return t[n]}}}return null}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,i=e.groupId,r=this.getUrlWithDirectives(e.url,t),a=e.details,s=null==a?void 0:a.age;this.log(`Loading subtitle ${n} "${e.name}" lang:${e.lang} group:${i}${void 0!==(null==t?void 0:t.msn)?" at sn "+t.msn+" part "+t.part:""}${s&&a.live?" age "+s.toFixed(1)+(a.type?" "+a.type||0:""):""} ${r}`),this.hls.trigger(l.SUBTITLE_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=Wa(e.textTracks),n=this.currentTrack;let i;if(n&&(i=t.filter((e=>ia(n,e)))[0],i||this.warn(`Unable to find subtitle TextTrack with name "${n.name}" and language "${n.lang}"`)),[].slice.call(t).forEach((e=>{"disabled"!==e.mode&&e!==i&&(e.mode="disabled")})),i){const e=this.subtitleDisplay?"showing":"hidden";i.mode!==e&&(i.mode=e)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media)return void(this.queuedDefaultTrack=e);if(e<-1||e>=t.length||!i(e))return void this.warn(`Invalid subtitle track id: ${e}`);this.selectDefaultTrack=!1;const n=this.currentTrack,r=t[e]||null;if(this.trackId=e,this.currentTrack=r,this.toggleTrackModes(),!r)return void this.hls.trigger(l.SUBTITLE_TRACK_SWITCH,{id:e});const a=!!r.details&&!r.details.live;if(e===this.trackId&&r===n&&a)return;this.log(`Switching to subtitle-track ${e}`+(r?` "${r.name}" lang:${r.lang} group:${r.groupId}`:""));const{id:s,groupId:o="",name:c,type:u,url:d}=r;this.hls.trigger(l.SUBTITLE_TRACK_SWITCH,{id:s,groupId:o,name:c,type:u,url:d});const h=this.switchParams(r.url,null==n?void 0:n.details,r.details);this.loadPlaylist(h)}},timelineController:class{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(l.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(l.FRAG_LOADING,this.onFragLoading,this),e.on(l.FRAG_LOADED,this.onFragLoaded,this),e.on(l.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(l.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(l.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(l.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(l.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(l.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(l.FRAG_LOADING,this.onFragLoading,this),e.off(l.FRAG_LOADED,this.onFragLoaded,this),e.off(l.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(l.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(l.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(l.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(l.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new to(this,"textTrack1"),t=new to(this,"textTrack2"),n=new to(this,"textTrack3"),i=new to(this,"textTrack4");this.cea608Parser1=new Ts(1,e,t),this.cea608Parser2=new Ts(3,n,i)}addCues(e,t,n,i,r){let a=!1;for(let e=r.length;e--;){const i=r[e],l=(s=i[0],o=i[1],c=t,u=n,Math.min(o,u)-Math.max(s,c));if(l>=0&&(i[0]=Math.min(i[0],t),i[1]=Math.max(i[1],n),a=!0,l/(n-t)>.5))return}var s,o,c,u;if(a||r.push([t,n]),this.config.renderTextTracksNatively){const r=this.captionsTracks[e];this.Cues.newCue(r,t,n,i)}else{const r=this.Cues.newCue(null,t,n,i);this.hls.trigger(l.CUES_PARSED,{type:"captions",cues:r,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r}){const{unparsedVttFrags:a}=this;n===p&&(this.initPTS[t.cc]={baseTime:i,timescale:r}),a.length&&(this.unparsedVttFrags=[],a.forEach((e=>{this.onFragLoaded(l.FRAG_LOADED,e)})))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let i=0;i<n.textTracks.length;i++){const r=n.textTracks[i];if(io(r,{name:e,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return r}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:n,media:i}=this,{label:r,languageCode:a}=t[e],s=this.getExistingTrack(r,a);if(s)n[e]=s,Ga(n[e]),Ha(n[e],i);else{const t=this.createTextTrack("captions",r,a);t&&(t[e]=!0,n[e]=t)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const n={_id:e,label:t.label,kind:"captions",default:!!t.media&&!!t.media.default,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=n,this.hls.trigger(l.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[n]})}createTextTrack(e,t,n){const i=this.media;if(i)return i.addTextTrack(e,t,n)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){const n=!!t.transferMedia;if(this.media=null,n)return;const{captionsTracks:i}=this;Object.keys(i).forEach((e=>{Ga(i[e]),delete i[e]})),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let e=0;e<t.length;e++)Ga(t[e])}onSubtitleTracksUpdated(e,t){const n=t.subtitleTracks||[],i=n.some((e=>e.textCodec===qs));if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(ta(this.tracks,n))return void(this.tracks=n);if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const e=this.media,t=e?Wa(e.textTracks):null;if(this.tracks.forEach(((e,n)=>{let i;if(t){let n=null;for(let i=0;i<t.length;i++)if(t[i]&&io(t[i],e)){n=t[i],t[i]=null;break}n&&(i=n)}if(i)Ga(i);else{const t=no(e);i=this.createTextTrack(t,e.name,e.lang),i&&(i.mode="disabled")}i&&this.textTracks.push(i)})),null!=t&&t.length){const e=t.filter((e=>null!==e)).map((e=>e.label));e.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${e.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const e=this.tracks.map((e=>({label:e.name,kind:e.type.toLowerCase(),default:e.default,subtitleTrack:e})));this.hls.trigger(l.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:e})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach((e=>{const t=/(?:CC|SERVICE)([1-4])/.exec(e.instreamId);if(!t)return;const n=`textTrack${t[1]}`,i=this.captionsProperties[n];i&&(i.label=e.name,e.lang&&(i.languageCode=e.lang),i.media=e)}))}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return null==t?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===p){var n,i;const{cea608Parser1:e,cea608Parser2:r,lastSn:a}=this,{cc:s,sn:o}=t.frag,l=null!=(n=null==(i=t.part)?void 0:i.index)?n:-1;e&&r&&(o!==a+1||o===a&&l!==this.lastPartIndex+1||s!==this.lastCc)&&(e.reset(),r.reset()),this.lastCc=s,this.lastSn=o,this.lastPartIndex=l}}onFragLoaded(e,t){const{frag:n,payload:i}=t;if(n.type===m)if(i.byteLength){const e=n.decryptdata,r="stats"in t;if(null==e||!e.encrypted||r){const e=this.tracks[n.level],r=this.vttCCs;r[n.cc]||(r[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),e&&e.textCodec===qs?this._parseIMSC1(n,i):this._parseVTTs(t)}}else this.hls.trigger(l.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const n=this.hls;Zs(t,this.initPTS[e.cc],(t=>{this._appendCues(t,e.level),n.trigger(l.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})}),(t=>{n.logger.log(`Failed to parse IMSC1: ${t}`),n.trigger(l.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:t})}))}_parseVTTs(e){var t;const{frag:n,payload:i}=e,{initPTS:r,unparsedVttFrags:a}=this,s=r.length-1;if(!r[n.cc]&&-1===s)return void a.push(e);const o=this.hls;js(null!=(t=n.initSegment)&&t.data?me(n.initSegment.data,new Uint8Array(i)).buffer:i,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,(e=>{this._appendCues(e,n.level),o.trigger(l.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})}),(t=>{const r="Missing initPTS for VTT MPEGTS"===t.message;r?a.push(e):this._fallbackToIMSC1(n,i),o.logger.log(`Failed to parse VTT cue: ${t}`),r&&s>n.cc||o.trigger(l.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:t})}))}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||Zs(t,this.initPTS[e.cc],(()=>{n.textCodec=qs,this._parseIMSC1(e,t)}),(()=>{n.textCodec="wvtt"}))}_appendCues(e,t){const n=this.hls;if(this.config.renderTextTracksNatively){const n=this.textTracks[t];if(!n||"disabled"===n.mode)return;e.forEach((e=>Va(n,e)))}else{const i=this.tracks[t];if(!i)return;const r=i.default?"default":"subtitles"+t;n.trigger(l.CUES_PARSED,{type:"subtitles",cues:e,track:r})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===m&&this.onFragLoaded(l.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:n,samples:i}=t;if(n.type!==p||"NONE"!==this.closedCaptionsForLevel(n))for(let e=0;e<i.length;e++){const t=i[e].bytes;if(t){this.cea608Parser1||this.initCea608Parsers();const n=this.extractCea608Data(t);this.cea608Parser1.addData(i[e].pts,n[0]),this.cea608Parser2.addData(i[e].pts,n[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:n,endOffsetSubtitles:i,type:r}){const{media:a}=this;if(a&&!(a.currentTime<n)){if(!r||"video"===r){const{captionsTracks:e}=this;Object.keys(e).forEach((i=>Za(e[i],t,n)))}if(this.config.renderTextTracksNatively&&0===t&&void 0!==i){const{textTracks:e}=this;Object.keys(e).forEach((n=>Za(e[n],t,i)))}}}extractCea608Data(e){const t=[[],[]],n=31&e[0];let i=2;for(let r=0;r<n;r++){const n=e[i++],r=127&e[i++],a=127&e[i++];if(0===r&&0===a)continue;if(0!=(4&n)){const e=3&n;0!==e&&1!==e||(t[e].push(r),t[e].push(a))}}return t}},audioStreamController:class extends ki{constructor(e,t,n){super(e,t,n,"audio-stream-controller",f),this.mainAnchor=null,this.mainFragLoading=null,this.audioOnly=!1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.resetItem()}resetItem(){this.mainDetails=this.mainAnchor=this.mainFragLoading=this.bufferedTrack=this.switchingTrack=this.waitingData=this.cachedTrackLoadedData=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(l.LEVEL_LOADED,this.onLevelLoaded,this),e.on(l.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(l.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(l.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(l.BUFFER_RESET,this.onBufferReset,this),e.on(l.BUFFER_CREATED,this.onBufferCreated,this),e.on(l.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(l.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(l.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(l.FRAG_LOADING,this.onFragLoading,this),e.on(l.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(l.LEVEL_LOADED,this.onLevelLoaded,this),e.off(l.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(l.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(l.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(l.BUFFER_RESET,this.onBufferReset,this),e.off(l.BUFFER_CREATED,this.onBufferCreated,this),e.off(l.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(l.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(l.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(l.FRAG_LOADING,this.onFragLoading,this),e.off(l.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r}){if(n===p){const e=t.cc,n=this.fragCurrent;if(this.initPTS[e]={baseTime:i,timescale:r},this.log(`InitPTS for cc: ${e} found from main: ${i}/${r}`),this.mainAnchor=t,this.state===wi){const n=this.waitingData;(!n&&!this.loadingParts||n&&n.frag.cc!==e)&&this.syncWithAnchor(t,null==n?void 0:n.frag)}else!this.hls.hasEnoughToStart&&n&&n.cc!==e?(n.abortRequests(),this.syncWithAnchor(t,n)):this.state===hi&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(e,t){var n;const i=(null==(n=this.mainFragLoading)?void 0:n.frag)||null;if(t&&(null==i?void 0:i.cc)===t.cc)return;const r=(i||e).cc,a=ht(this.getLevelDetails(),r,this.getLoadPosition());a&&(this.log(`Waiting fragment cc (${null==t?void 0:t.cc}) cancelled because video is at cc ${e.cc}`),this.startFragRequested=!1,this.nextLoadPosition=a.start,this.resetLoadingState(),this.state===hi&&this.doTickIdle())}startLoad(e,t){if(!this.levels)return this.startPosition=e,void(this.state=di);const n=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),n>0&&-1===e?(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n,this.state=hi):this.state=gi,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case hi:this.doTickIdle();break;case gi:{const{levels:e,trackId:t}=this,n=null==e?void 0:e[t],i=null==n?void 0:n.details;if(i&&!this.waitForLive(n)){if(this.waitForCdnTuneIn(i))break;this.state=wi}break}case mi:{var e;const t=performance.now(),n=this.retryDate;if(!n||t>=n||null!=(e=this.media)&&e.seeking){const{levels:e,trackId:t}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((null==e?void 0:e[t])||null),this.state=hi}break}case wi:{const e=this.waitingData;if(e){const{frag:t,part:n,cache:i,complete:r}=e,a=this.mainAnchor;if(void 0!==this.initPTS[t.cc]){this.waitingData=null,this.state=fi;const e={frag:t,part:n,payload:i.flush().buffer,networkDetails:null};this._handleFragmentLoadProgress(e),r&&super._handleFragmentLoadComplete(e)}else a&&a.cc!==e.frag.cc&&this.syncWithAnchor(a,e.frag)}else this.state=hi}}this.onTickEnd()}resetLoadingState(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null),super.resetLoadingState()}onTickEnd(){const{media:e}=this;null!=e&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){var e;const{hls:t,levels:n,media:i,trackId:r}=this,a=t.config;if(!this.buffering||!i&&!this.primaryPrefetch&&(this.startFragRequested||!a.startFragPrefetch)||null==n||!n[r])return;const s=n[r],o=s.details;if(!o||this.waitForLive(s)||this.waitForCdnTuneIn(o))return this.state=gi,void(this.startFragRequested=!1);const c=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&c&&(this.bufferFlushed=!1,this.afterBufferFlushed(c,j,f));const u=this.getFwdBufferInfo(c,f);if(null===u)return;if(!this.switchingTrack&&this._streamEnded(u,o))return t.trigger(l.BUFFER_EOS,{type:"audio"}),void(this.state=yi);const d=u.len,h=t.maxBufferLength,m=o.fragments,g=m[0].start,v=this.getLoadPosition(),b=this.flushing?v:u.end;if(this.switchingTrack&&i){const e=v;o.PTSKnown&&e<g&&(u.end>g||u.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),i.currentTime=g+.05)}if(d>=h&&!this.switchingTrack&&b<m[m.length-1].start)return;let y=this.getNextFragment(b,o);if(y&&this.isLoopLoading(y,b)&&(y=this.getNextFragmentLoopLoading(y,o,u,p,h)),!y)return void(this.bufferFlushed=!0);let _=(null==(e=this.mainFragLoading)?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&_&&G(y)&&!y.endList&&(!o.live||!this.loadingParts&&b<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(_)===Mt&&(this.mainFragLoading=_=null),_&&G(_))){if(y.start>_.end){const e=this.fragmentTracker.getFragAtPos(b,p);e&&e.end>_.end&&(_=e,this.mainFragLoading={frag:e,targetBufferTime:null})}if(y.start>_.end)return}this.loadFragment(y,s,b)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map((e=>new Ye(e)))}onAudioTrackSwitching(e,t){const n=!!t.url;this.trackId=t.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),n?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==di&&(this.setInterval(100),this.state=hi,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=t,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(e,t){this.mainDetails=t.details;const n=this.cachedTrackLoadedData;n&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(l.AUDIO_TRACK_LOADED,n))}onAudioTrackLoaded(e,t){var n;const{levels:i}=this,{details:r,id:a,groupId:s,track:o}=t;if(!i)return void this.warn(`Audio tracks reset while loading track ${a} "${o.name}" of "${s}"`);const c=this.mainDetails;if(!c||r.endCC>c.endCC||c.expired)return this.cachedTrackLoadedData=t,void(this.state!==di&&(this.state=gi));this.cachedTrackLoadedData=null,this.log(`Audio track ${a} "${o.name}" of "${s}" loaded [${r.startSN},${r.endSN}]${r.lastPartSn?`[part-${r.lastPartSn}-${r.lastPartIndex}]`:""},duration:${r.totalduration}`);const u=i[a];let d=0;if(r.live||null!=(n=u.details)&&n.live){if(this.checkLiveUpdate(r),r.deltaUpdateFailed)return;var h;if(u.details)d=this.alignPlaylists(r,u.details,null==(h=this.levelLastLoaded)?void 0:h.details);r.alignedSliding||(li(r,c),r.alignedSliding||ci(r,c),d=r.fragmentStart)}u.details=r,this.levelLastLoaded=u,this.startFragRequested||this.setStartPosition(c,d),this.hls.trigger(l.AUDIO_TRACK_UPDATED,{details:r,id:a,groupId:t.groupId}),this.state!==gi||this.waitForCdnTuneIn(r)||(this.state=hi),this.tick()}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:i,payload:r}=e,{config:a,trackId:s,levels:o}=this;if(!o)return void this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);const l=o[s];if(!l)return void this.warn("Audio track is undefined on fragment load progress");const c=l.details;if(!c)return this.warn("Audio track details undefined on fragment load progress"),void this.removeUnbufferedFrags(n.start);const u=a.defaultAudioCodec||l.audioCodec||"mp4a.40.2";let d=this.transmuxer;d||(d=this.transmuxer=new Qr(this.hls,f,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const h=this.initPTS[n.cc],p=null==(t=n.initSegment)?void 0:t.data;if(void 0!==h){const e=!1,t=i?i.index:-1,a=-1!==t,s=new Vt(n.level,n.sn,n.stats.chunkCount,r.byteLength,t,a);d.push(r,p,u,"",n,i,c.totalduration,e,s,h)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${c.startSN} ,${c.endSN}],track ${s}`);const{cache:e}=this.waitingData=this.waitingData||{frag:n,part:i,cache:new Ei,complete:!1};e.push(new Uint8Array(r)),this.state!==di&&(this.state=wi)}}_handleFragmentLoadComplete(e){this.waitingData?this.waitingData.complete=!0:super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(e,t){this.bufferFlushed=this.flushing=!1;const n=t.tracks.audio;n&&(this.mediaBuffer=n.buffer||null)}onFragLoading(e,t){!this.audioOnly&&t.frag.type===p&&G(t.frag)&&(this.mainFragLoading=t,this.state===hi&&this.tick())}onFragBuffered(e,t){const{frag:n,part:i}=t;if(n.type===f)if(this.fragContextChanged(n))this.warn(`Fragment ${n.sn}${i?" p: "+i.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);else{if(G(n)){this.fragPrevious=n;const e=this.switchingTrack;e&&(this.bufferedTrack=e,this.switchingTrack=null,this.hls.trigger(l.AUDIO_TRACK_SWITCHED,w({},e)))}this.fragBufferedComplete(n,i),this.media&&this.tick()}else this.audioOnly||n.type!==p||n.elementaryStreams.video||n.elementaryStreams.audiovideo||(this.audioOnly=!0,this.mainFragLoading=null)}onError(e,t){var n;if(t.fatal)this.state=_i;else switch(t.details){case o.FRAG_GAP:case o.FRAG_PARSING_ERROR:case o.FRAG_DECRYPT_ERROR:case o.FRAG_LOAD_ERROR:case o.FRAG_LOAD_TIMEOUT:case o.KEY_LOAD_ERROR:case o.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(f,t);break;case o.AUDIO_TRACK_LOAD_ERROR:case o.AUDIO_TRACK_LOAD_TIMEOUT:case o.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==gi||(null==(n=t.context)?void 0:n.type)!==d||(this.state=hi);break;case o.BUFFER_ADD_CODEC_ERROR:case o.BUFFER_APPEND_ERROR:if("audio"!==t.parent)return;this.resetLoadingState();break;case o.BUFFER_FULL_ERROR:if("audio"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case o.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}}onBufferFlushing(e,{type:t}){t!==q&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==q){this.flushing=!1,this.bufferFlushed=!0,this.state===yi&&(this.state=hi);const e=this.mediaBuffer||this.media;e&&(this.afterBufferFlushed(e,t,f),this.tick())}}_handleTransmuxComplete(e){var t;const n="audio",{hls:i}=this,{remuxResult:r,chunkMeta:a}=e,s=this.getCurrentContext(a);if(!s)return void this.resetWhenMissingContext(a);const{frag:o,part:c,level:u}=s,{details:d}=u,{audio:h,text:p,id3:f,initSegment:m}=r;if(!this.fragContextChanged(o)&&d){if(this.state=vi,this.switchingTrack&&h&&this.completeAudioSwitch(this.switchingTrack),null!=m&&m.tracks){const e=o.initSegment||o;this._bufferInitSegment(u,m.tracks,e,a),i.trigger(l.FRAG_PARSING_INIT_SEGMENT,{frag:e,id:n,tracks:m.tracks})}if(h){const{startPTS:e,endPTS:t,startDTS:n,endDTS:i}=h;c&&(c.elementaryStreams[j]={startPTS:e,endPTS:t,startDTS:n,endDTS:i}),o.setElementaryStreamInfo(j,e,t,n,i),this.bufferFragmentData(h,o,c,a)}if(null!=f&&null!=(t=f.samples)&&t.length){const e=y({id:n,frag:o,details:d},f);i.trigger(l.FRAG_PARSING_METADATA,e)}if(p){const e=y({id:n,frag:o,details:d},p);i.trigger(l.FRAG_PARSING_USERDATA,e)}}else this.fragmentTracker.removeFragment(o)}_bufferInitSegment(e,t,n,i){if(this.state!==vi)return;if(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio)return;const r=t.audio;r.id=f;const a=e.audioCodec;this.log(`Init audio buffer, container:${r.container}, codecs[level/parsed]=[${a}/${r.codec}]`),a&&1===a.split(",").length&&(r.levelCodec=a),this.hls.trigger(l.BUFFER_CODECS,t);const s=r.initSegment;if(null!=s&&s.byteLength){const e={type:"audio",frag:n,part:null,chunkMeta:i,parent:n.type,data:s};this.hls.trigger(l.BUFFER_APPENDING,e)}this.tickImmediate()}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);var r;if(this.switchingTrack||i===Ct||i===At)if(G(e))if(null!=(r=t.details)&&r.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=wi;const n=this.mainDetails;n&&n.fragmentStart!==t.details.fragmentStart&&ci(t.details,n)}else super.loadFragment(e,t,n);else this._loadInitSegment(e,t);else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){const{name:t,lang:n,assocLang:i,characteristics:r,audioCodec:a,channels:s}=this.bufferedTrack;rt({name:t,lang:n,assocLang:i,characteristics:r,audioCodec:a,channels:s},e,at)||(ot(e.url,this.hls)?(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null):this.bufferedTrack=e)}}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(l.AUDIO_TRACK_SWITCHED,w({},e))}},audioTrackController:class extends ea{constructor(e){super(e,"audio-track-controller"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.MANIFEST_PARSED,this.onManifestParsed,this),e.on(l.LEVEL_LOADING,this.onLevelLoading,this),e.on(l.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(l.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(l.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.MANIFEST_PARSED,this.onManifestParsed,this),e.off(l.LEVEL_LOADING,this.onLevelLoading,this),e.off(l.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(l.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(l.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:n,groupId:i,details:r}=t,a=this.tracksInGroup[n];if(!a||a.groupId!==i)return void this.warn(`Audio track with id:${n} and group:${i} not found in active group ${null==a?void 0:a.groupId}`);const s=a.details;a.details=t.details,this.log(`Audio track ${n} "${a.name}" lang:${a.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,s)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.audioGroups||null,i=this.groupIds;let r=this.currentTrack;if(!n||(null==i?void 0:i.length)!==(null==n?void 0:n.length)||null!=n&&n.some((e=>-1===(null==i?void 0:i.indexOf(e))))){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const e=this.tracks.filter((e=>!n||-1!==n.indexOf(e.groupId)));if(e.length)this.selectDefaultTrack&&!e.some((e=>e.default))&&(this.selectDefaultTrack=!1),e.forEach(((e,t)=>{e.id=t}));else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=e;const t=this.hls.config.audioPreference;if(!r&&t){const n=it(t,e,at);if(n>-1)r=e[n];else{const e=it(t,this.tracks);r=this.tracks[e]}}let i=this.findTrackId(r);-1===i&&r&&(i=this.findTrackId(null));const c={audioTracks:e};this.log(`Updating audio tracks, ${e.length} track(s) found in group(s): ${null==n?void 0:n.join(",")}`),this.hls.trigger(l.AUDIO_TRACKS_UPDATED,c);const u=this.trackId;if(-1!==i&&-1===u)this.setAudioTrack(i);else if(e.length&&-1===u){var a;const t=new Error(`No audio track selected for current audio group-ID(s): ${null==(a=this.groupIds)?void 0:a.join(",")} track count: ${e.length}`);this.warn(t.message),this.hls.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:t})}}}onError(e,t){!t.fatal&&t.context&&(t.context.type!==d||t.context.id!==this.trackId||this.groupIds&&-1===this.groupIds.indexOf(t.context.groupId)||this.checkRetry(t))}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const n=this.allAudioTracks;if(this.selectDefaultTrack=!1,n.length){const i=this.currentTrack;if(i&&rt(e,i,at))return i;const r=it(e,this.tracksInGroup,at);if(r>-1){const e=this.tracksInGroup[r];return this.setAudioTrack(r),e}if(i){let i=t.loadLevel;-1===i&&(i=t.firstAutoLevel);const r=function(e,t,n,i,r){const a=t[i],s=t.reduce(((e,t,n)=>{const i=t.uri;return(e[i]||(e[i]=[])).push(n),e}),{})[a.uri];s.length>1&&(i=Math.max.apply(Math,s));const o=a.videoRange,l=a.frameRate,c=a.codecSet.substring(0,4),u=st(t,i,(t=>{if(t.videoRange!==o||t.frameRate!==l||t.codecSet.substring(0,4)!==c)return!1;const i=t.audioGroups,a=n.filter((e=>!i||-1!==i.indexOf(e.groupId)));return it(e,a,r)>-1}));return u>-1?u:st(t,i,(t=>{const i=t.audioGroups,a=n.filter((e=>!i||-1!==i.indexOf(e.groupId)));return it(e,a,r)>-1}))}(e,t.levels,n,i,at);if(-1===r)return null;t.nextLoadLevel=r}if(e.channels||e.audioCodec){const t=it(e,n);if(t>-1)return n[t]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length)return void this.warn(`Invalid audio track id: ${e}`);this.selectDefaultTrack=!1;const n=this.currentTrack,i=t[e],r=i.details&&!i.details.live;if(e===this.trackId&&i===n&&r)return;if(this.log(`Switching to audio-track ${e} "${i.name}" lang:${i.lang} group:${i.groupId} channels:${i.channels}`),this.trackId=e,this.currentTrack=i,this.hls.trigger(l.AUDIO_TRACK_SWITCHING,w({},i)),r)return;const a=this.switchParams(i.url,null==n?void 0:n.details,i.details);this.loadPlaylist(a)}findTrackId(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const i=t[n];if((!this.selectDefaultTrack||i.default)&&(!e||rt(e,i,at)))return n}if(e){const{name:n,lang:i,assocLang:r,characteristics:a,audioCodec:s,channels:o}=e;for(let e=0;e<t.length;e++){if(rt({name:n,lang:i,assocLang:r,characteristics:a,audioCodec:s,channels:o},t[e],at))return e}for(let n=0;n<t.length;n++){const i=t[n];if(na(e.attrs,i.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return n}for(let n=0;n<t.length;n++){const i=t[n];if(na(e.attrs,i.attrs,["LANGUAGE"]))return n}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&ot(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,i=e.groupId,r=this.getUrlWithDirectives(e.url,t),a=e.details,s=null==a?void 0:a.age;this.log(`Loading audio-track ${n} "${e.name}" lang:${e.lang} group:${i}${void 0!==(null==t?void 0:t.msn)?" at sn "+t.msn+" part "+t.part:""}${s&&a.live?" age "+s.toFixed(1)+(a.type?" "+a.type||0:""):""} ${r}`),this.hls.trigger(l.AUDIO_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:t||null,track:e})}},emeController:ja,cmcdController:class{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=e=>{try{this.apply(e,{ot:da.MANIFEST,su:!this.initialized})}catch(e){this.hls.logger.warn("Could not generate manifest CMCD data.",e)}},this.applyFragmentData=e=>{try{const{frag:t,part:n}=e,i=this.hls.levels[t.level],r=this.getObjectType(t),a={d:1e3*(n||t).duration,ot:r};r!==da.VIDEO&&r!==da.AUDIO&&r!=da.MUXED||(a.br=i.bitrate/1e3,a.tb=this.getTopBandwidth(r)/1e3,a.bl=this.getBufferLength(r));const s=n?this.getNextPart(n):this.getNextFrag(t);null!=s&&s.url&&s.url!==t.url&&(a.nor=s.url),this.apply(e,a)}catch(e){this.hls.logger.warn("Could not generate segment CMCD data.",e)}},this.hls=e;const t=this.config=e.config,{cmcd:n}=t;null!=n&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||e.sessionId,this.cid=n.contentId,this.useHeaders=!0===n.useHeaders,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(l.MEDIA_DETACHED,this.onMediaDetached,this),e.on(l.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(l.MEDIA_DETACHED,this.onMediaDetached,this),e.off(l.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var n,i;this.audioBuffer=null==(n=t.tracks.audio)?void 0:n.buffer,this.videoBuffer=null==(i=t.tracks.video)?void 0:i.buffer}createData(){var e;return{v:1,sf:ha.HLS,sid:this.sid,cid:this.cid,pr:null==(e=this.media)?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){y(t,this.createData());const n=t.ot===da.INIT||t.ot===da.VIDEO||t.ot===da.MUXED;this.starved&&n&&(t.bs=!0,t.su=!0,this.starved=!1),null==t.su&&(t.su=this.buffering);const{includeKeys:i}=this;i&&(t=Object.keys(t).reduce(((e,n)=>(i.includes(n)&&(e[n]=t[n]),e)),{}));const r={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),Na(e.headers,t,r)):e.url=$a(e.url,t,r)}getNextFrag(e){var t;const n=null==(t=this.hls.levels[e.level])?void 0:t.details;if(n){const t=e.sn-n.startSN;return n.fragments[t+1]}}getNextPart(e){var t,n;const{index:i,fragment:r}=e,a=null==(t=this.hls.levels[r.level])||null==(n=t.details)?void 0:n.partList;if(a){const{sn:e}=r;for(let t=a.length-1;t>=0;t--){const n=a[t];if(n.index===i&&n.fragment.sn===e)return a[t+1]}}}getObjectType(e){const{type:t}=e;return"subtitle"===t?da.TIMED_TEXT:"initSegment"===e.sn?da.INIT:"audio"===t?da.AUDIO:"main"===t?this.hls.audioTracks.length?da.VIDEO:da.MUXED:void 0}getTopBandwidth(e){let t,n=0;const i=this.hls;if(e===da.AUDIO)t=i.audioTracks;else{const e=i.maxAutoLevel,n=e>-1?e+1:i.levels.length;t=i.levels.slice(0,n)}return t.forEach((e=>{e.bitrate>n&&(n=e.bitrate)})),n>0?n:NaN}getBufferLength(e){const t=this.media,n=e===da.AUDIO?this.audioBuffer:this.videoBuffer;if(!n||!t)return NaN;return 1e3*Zt.bufferInfo(n,t.currentTime,this.config.maxBufferHole).len}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,n=e||this.config.loader;return class{constructor(e){this.loader=void 0,this.loader=new n(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,n,i){t(e),this.loader.load(e,n,i)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,n=e||this.config.loader;return class{constructor(e){this.loader=void 0,this.loader=new n(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,n,i){t(e),this.loader.load(e,n,i)}}}},contentSteeringController:class extends x{constructor(e){super("content-steering",e.logger),this.hls=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this._pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(l.MANIFEST_PARSED,this.onManifestParsed,this),e.on(l.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(l.MANIFEST_PARSED,this.onManifestParsed,this),e.off(l.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce(((e,t)=>(-1===e.indexOf(t.pathwayId)&&e.push(t.pathwayId),e)),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(e){this.updatePathwayPriority(e)}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=1e3*this.timeToLoad-(performance.now()-this.updated);if(e>0)return void this.scheduleRefresh(this.uri,e)}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){-1!==this.reloadTimer&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter((t=>t!==e)))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:n}=t;null!==n&&(this.pathwayId=n.pathwayId,this.uri=n.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:n}=t;if((null==n?void 0:n.action)===yt&&n.flags===kt){const e=this.levels;let i=this._pathwayPriority,r=this.pathwayId;if(t.context){const{groupId:n,pathwayId:i,type:a}=t.context;n&&e?r=this.getPathwayForGroupId(n,a,r):i&&(r=i)}r in this.penalizedPathways||(this.penalizedPathways[r]=performance.now()),!i&&e&&(i=this.pathways()),i&&i.length>1&&(this.updatePathwayPriority(i),n.resolved=this.pathwayId!==r),n.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${r} levels: ${e?e.length:e} priorities: ${Qe(i)} penalized: ${Qe(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(0===t.length){const n=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${n}"`),t=this.getLevelsForPathway(n),this.pathwayId=n}return t.length!==e.length&&this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t}getLevelsForPathway(e){return null===this.levels?[]:this.levels.filter((t=>e===t.pathwayId))}updatePathwayPriority(e){let t;this._pathwayPriority=e;const n=this.penalizedPathways,i=performance.now();Object.keys(n).forEach((e=>{i-n[e]>3e5&&delete n[e]}));for(let i=0;i<e.length;i++){const r=e[i];if(r in n)continue;if(r===this.pathwayId)return;const a=this.hls.nextLoadLevel,s=this.hls.levels[a];if(t=this.getLevelsForPathway(r),t.length>0){this.log(`Setting Pathway to "${r}"`),this.pathwayId=r,ri(t),this.hls.trigger(l.LEVELS_UPDATED,{levels:t});const e=this.hls.levels[a];s&&e&&this.levels&&(e.attrs["STABLE-VARIANT-ID"]!==s.attrs["STABLE-VARIANT-ID"]&&e.bitrate!==s.bitrate&&this.log(`Unstable Pathways change from bitrate ${s.bitrate} to ${e.bitrate}`),this.hls.nextLoadLevel=a);break}}}getPathwayForGroupId(e,t,n){const i=this.getLevelsForPathway(n).concat(this.levels||[]);for(let n=0;n<i.length;n++)if(t===d&&i[n].hasAudioGroup(e)||t===h&&i[n].hasSubtitleGroup(e))return i[n].pathwayId;return n}clonePathways(e){const t=this.levels;if(!t)return;const n={},i={};e.forEach((e=>{const{ID:r,"BASE-ID":a,"URI-REPLACEMENT":s}=e;if(t.some((e=>e.pathwayId===r)))return;const o=this.getLevelsForPathway(a).map((e=>{const t=new nn(e.attrs);t["PATHWAY-ID"]=r;const a=t.AUDIO&&`${t.AUDIO}_clone_${r}`,o=t.SUBTITLES&&`${t.SUBTITLES}_clone_${r}`;a&&(n[t.AUDIO]=a,t.AUDIO=a),o&&(i[t.SUBTITLES]=o,t.SUBTITLES=o);const l=za(e.uri,t["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",s),c=new Ye({attrs:t,audioCodec:e.audioCodec,bitrate:e.bitrate,height:e.height,name:e.name,url:l,videoCodec:e.videoCodec,width:e.width});if(e.audioGroups)for(let t=1;t<e.audioGroups.length;t++)c.addGroupId("audio",`${e.audioGroups[t]}_clone_${r}`);if(e.subtitleGroups)for(let t=1;t<e.subtitleGroups.length;t++)c.addGroupId("text",`${e.subtitleGroups[t]}_clone_${r}`);return c}));t.push(...o),Fa(this.audioTracks,n,s,r),Fa(this.subtitleTracks,i,s,r)}))}loadSteeringManifest(e){const t=this.hls.config,n=t.loader;let i;this.loader&&this.loader.destroy(),this.loader=new n(t);try{i=new self.URL(e)}catch(t){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest URI: ${e}`)}if("data:"!==i.protocol){const e=0|(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate);i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+e)}const r={responseType:"json",url:i.href},a=t.steeringManifestLoadPolicy.default,s=a.errorRetry||a.timeoutRetry||{},o={loadPolicy:a,timeout:a.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},c={onSuccess:(e,t,n,r)=>{this.log(`Loaded steering manifest: "${i}"`);const a=e.data;if(1!==(null==a?void 0:a.VERSION))return void this.log(`Steering VERSION ${a.VERSION} not supported!`);this.updated=performance.now(),this.timeToLoad=a.TTL;const{"RELOAD-URI":s,"PATHWAY-CLONES":o,"PATHWAY-PRIORITY":c}=a;if(s)try{this.uri=new self.URL(s,i).href}catch(e){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest RELOAD-URI: ${s}`)}this.scheduleRefresh(this.uri||n.url),o&&this.clonePathways(o);const u={steeringManifest:a,url:i.toString()};this.hls.trigger(l.STEERING_MANIFEST_LOADED,u),c&&this.updatePathwayPriority(c)},onError:(e,t,n,i)=>{if(this.log(`Error loading steering manifest: ${e.code} ${e.text} (${t.url})`),this.stopLoad(),410===e.code)return this.enabled=!1,void this.log(`Steering manifest ${t.url} no longer available`);let r=1e3*this.timeToLoad;if(429!==e.code)this.scheduleRefresh(this.uri||t.url,r);else{const e=this.loader;if("function"==typeof(null==e?void 0:e.getResponseHeader)){const t=e.getResponseHeader("Retry-After");t&&(r=1e3*parseFloat(t))}this.log(`Steering manifest ${t.url} rate limited`)}},onTimeout:(e,t,n)=>{this.log(`Timeout loading steering manifest (${t.url})`),this.scheduleRefresh(this.uri||t.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(r,o,c)}scheduleRefresh(e,t=1e3*this.timeToLoad){this.clearTimeout(),this.reloadTimer=self.setTimeout((()=>{var t;const n=null==(t=this.hls)?void 0:t.media;!n||n.ended?this.scheduleRefresh(e,1e3*this.timeToLoad):this.loadSteeringManifest(e)}),t)}},interstitialsController:class extends x{constructor(e,t){super("interstitials",e.logger),this.HlsPlayerClass=void 0,this.hls=void 0,this.assetListLoader=void 0,this.mediaSelection=null,this.altSelection=null,this.media=null,this.detachedData=null,this.requiredTracks=null,this.manager=null,this.playerQueue=[],this.bufferedPos=-1,this.timelinePos=-1,this.schedule=void 0,this.playingItem=null,this.bufferingItem=null,this.waitingItem=null,this.endedItem=null,this.playingAsset=null,this.endedAsset=null,this.bufferingAsset=null,this.shouldPlay=!1,this.onPlay=()=>{this.shouldPlay=!0},this.onPause=()=>{this.shouldPlay=!1},this.onSeeking=()=>{const e=this.currentTime;if(void 0===e||this.playbackDisabled)return;const t=e-this.timelinePos;if(Math.abs(t)<1/7056e5)return;const n=t<=-.01;this.timelinePos=e,this.bufferedPos=e;const i=this.playingItem;if(!i)return void this.checkBuffer();if(n){this.schedule.resetErrorsInRange(e,e-t)&&this.updateSchedule()}if(this.checkBuffer(),n&&e<i.start||e>=i.end){var r;const e=this.schedule.findItemIndexAtTime(this.timelinePos);if(!this.isInterstitial(i)&&null!=(r=this.media)&&r.paused&&(this.shouldPlay=!1),!n){const t=this.findItemIndex(i);if(e>t){const n=this.schedule.findJumpRestrictedIndex(t+1,e);if(n>t)return void this.setSchedulePosition(n)}}return void this.setSchedulePosition(e)}const a=this.playingAsset;if(!a){if(this.playingLastItem&&this.isInterstitial(i)){const t=i.event.assetList[0];t&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(e,t))}return}const s=a.timelineStart,o=a.duration||0;(n&&e<s||e>=s+o)&&this.setScheduleToAssetAtTime(e,a)},this.onTimeupdate=()=>{const e=this.currentTime;if(void 0===e||this.playbackDisabled)return;if(!(e>this.timelinePos))return;this.timelinePos=e,e>this.bufferedPos&&this.checkBuffer();const t=this.playingItem;if(!t||this.playingLastItem)return;if(e>=t.end){this.timelinePos=t.end;const e=this.findItemIndex(t);this.setSchedulePosition(e+1)}const n=this.playingAsset;if(!n)return;e>=n.timelineStart+(n.duration||0)&&this.setScheduleToAssetAtTime(e,n)},this.onScheduleUpdate=(e,t)=>{const n=this.schedule,i=this.playingItem,r=n.events||[],a=n.items||[],s=n.durations,o=e.map((e=>e.identifier)),c=!(!r.length&&!o.length);(c||t)&&this.log(`INTERSTITIALS_UPDATED (${r.length}): ${r}\nSchedule: ${a.map((e=>os(e)))} pos: ${this.timelinePos}`),o.length&&this.log(`Removed events ${o}`),this.playerQueue.forEach((e=>{if(e.interstitial.appendInPlace){const t=e.assetItem.timelineStart,n=e.timelineOffset-t;if(n)try{e.timelineOffset=t}catch(i){Math.abs(n)>Xa&&this.warn(`${i} ("${e.assetId}" ${e.timelineOffset}->${t})`)}}}));let u=null;if(i){const e=this.updateItem(i,this.timelinePos);this.itemsMatch(i,e)&&(this.playingItem=e,this.waitingItem=this.endedItem=null,u=()=>this.trimInPlace(e,i))}else this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const d=this.bufferingItem;if(d){const e=this.updateItem(d,this.bufferedPos);this.itemsMatch(d,e)?(this.bufferingItem=e,u||(u=()=>this.trimInPlace(e,d))):d.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(d.event,null))}if(e.forEach((e=>{e.assetList.forEach((e=>{this.clearAssetPlayer(e.identifier,null)}))})),c||t){if(this.hls.trigger(l.INTERSTITIALS_UPDATED,{events:r.slice(0),schedule:a.slice(0),durations:s,removedIds:o}),this.isInterstitial(i)&&o.includes(i.event.identifier))return this.warn(`Interstitial "${i.event.identifier}" removed while playing`),void this.primaryFallback(i.event);u&&u(),this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new ls(e),this.schedule=new ss(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e.on(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(l.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(l.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(l.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(l.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(l.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(l.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(l.BUFFER_APPENDED,this.onBufferAppended,this),e.on(l.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(l.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(l.MEDIA_ENDED,this.onMediaEnded,this),e.on(l.ERROR,this.onError,this),e.on(l.DESTROYING,this.onDestroying,this)}unregisterListeners(){const e=this.hls;e&&(e.off(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(l.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(l.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(l.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(l.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(l.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(l.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(l.BUFFER_CODECS,this.onBufferCodecs,this),e.off(l.BUFFER_APPENDED,this.onBufferAppended,this),e.off(l.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(l.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(l.MEDIA_ENDED,this.onMediaEnded,this),e.off(l.ERROR,this.onError,this),e.off(l.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var e;null==(e=this.getBufferingPlayer())||e.resumeBuffering()}pauseBuffering(){var e;null==(e=this.getBufferingPlayer())||e.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.manager=null,this.hls=this.HlsPlayerClass=this.schedule=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const e=this.primaryMedia||this.media;e&&this.removeMediaListeners(e)}removeMediaListeners(e){Ua(e,"play",this.onPlay),Ua(e,"pause",this.onPause),Ua(e,"seeking",this.onSeeking),Ua(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const n=this.media=t.media;Ka(n,"seeking",this.onSeeking),Ka(n,"timeupdate",this.onTimeupdate),Ka(n,"play",this.onPlay),Ka(n,"pause",this.onPause)}onMediaAttached(e,t){const n=this.effectivePlayingItem,i=this.detachedData;if(this.detachedData=null,null===n)this.checkStart();else if(!i){this.clearScheduleState();const e=this.findItemIndex(n);this.setSchedulePosition(e)}}clearScheduleState(){this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){const n=!!t.transferMedia,i=this.media;if(this.media=null,!n&&(i&&this.removeMediaListeners(i),this.detachedData)){const e=this.getBufferingPlayer();e&&(this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,e.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.manager){if(!this.hls)return null;const e=this,t=()=>e.bufferingItem||e.waitingItem,n=t=>t?e.getAssetPlayer(t.identifier):t,i=(t,i,r,s,o)=>{if(t){let l=t[i].start;const c=t.event;if(c){if("playout"===i||c.timelineOccupancy!==Ja.Point){const e=n(r);(null==e?void 0:e.interstitial)===c&&(l+=e.assetItem.startOffset+e[o])}}else{l+=("bufferedPos"===s?a():e[s])-t.start}return l}return 0},r=(t,n)=>{if(0!==t&&"primary"!==n&&e.schedule.length){var i;const r=e.schedule.findItemIndexAtTime(t),a=null==(i=e.schedule.items)?void 0:i[r];if(a){return t+(a[n].start-a.start)}}return t},a=()=>{const t=e.bufferedPos;return t===Number.MAX_VALUE?s("primary"):Math.max(t,0)},s=t=>{var n;return null!=(n=e.primaryDetails)&&n.live?e.primaryDetails.edge:e.schedule.durations[t]},o=(t,r)=>{var a,s;const o=e.effectivePlayingItem;if(null!=o&&null!=(a=o.event)&&a.restrictions.skip)return;e.log(`seek to ${t} "${r}"`);const l=e.effectivePlayingItem,c=e.schedule.findItemIndexAtTime(t,r),u=null==(s=e.schedule.items)?void 0:s[c],d=e.getBufferingPlayer(),h=null==d?void 0:d.interstitial,p=null==h?void 0:h.appendInPlace,f=l&&e.itemsMatch(l,u);if(l&&(p||f)){const a=n(e.playingAsset),s=(null==a?void 0:a.media)||e.primaryMedia;if(s){const n="primary"===r?s.currentTime:i(l,r,e.playingAsset,"timelinePos","currentTime"),o=t-n,c=(p?n:s.currentTime)+o;if(c>=0&&(!a||p||c<=a.duration))return void(s.currentTime=c)}}if(u){let n=t;if("primary"!==r){const e=t-u[r].start;n=u.start+e}const i=!e.isInterstitial(u);if(e.isInterstitial(l)&&!l.event.appendInPlace||!i&&!u.event.appendInPlace){if(l){const a=e.findItemIndex(l);if(c>a){const t=e.schedule.findJumpRestrictedIndex(a+1,c);if(t>a)return void e.setSchedulePosition(t)}let s=0;if(i)e.timelinePos=n,e.checkBuffer();else{var m;const e=null==u||null==(m=u.event)?void 0:m.assetList;if(e){const n=t-(u[r]||u).start;for(let t=e.length;t--;){const i=e[t];if(i.duration&&n>=i.startOffset&&n<i.startOffset+i.duration){s=t;break}}}}e.setSchedulePosition(c,s)}}else{const t=e.media||(p?null==d?void 0:d.media:null);t&&(t.currentTime=n)}}},l=()=>{const n=e.effectivePlayingItem;if(e.isInterstitial(n))return n;const i=t();return e.isInterstitial(i)?i:null},c={get currentTime(){const t=l(),n=e.effectivePlayingItem;return n&&n===t?i(n,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-n.playout.start:0},set currentTime(t){const n=l(),i=e.effectivePlayingItem;i&&i===n&&o(t+i.playout.start,"playout")},get duration(){const e=l();return e?e.playout.end-e.playout.start:0},get assetPlayers(){var t;const n=null==(t=l())?void 0:t.event.assetList;return n?n.map((t=>e.getAssetPlayer(t.identifier))):[]},get playingIndex(){var t;const n=null==(t=l())?void 0:t.event;return n&&e.effectivePlayingAsset?n.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return l()}};this.manager={get events(){var t,n;return(null==(t=e.schedule)||null==(n=t.events)?void 0:n.slice(0))||[]},get schedule(){var t,n;return(null==(t=e.schedule)||null==(n=t.items)?void 0:n.slice(0))||[]},get interstitialPlayer(){return l()?c:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const n=t();return e.findItemIndex(n)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const t=e.effectivePlayingItem;return e.findItemIndex(t)},primary:{get bufferedEnd(){return a()},get currentTime(){const t=e.timelinePos;return t>0?t:0},set currentTime(e){o(e,"primary")},get duration(){return s("primary")},get seekableStart(){var t;return(null==(t=e.primaryDetails)?void 0:t.fragmentStart)||0}},integrated:{get bufferedEnd(){return i(t(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return i(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(e){o(e,"integrated")},get duration(){return s("integrated")},get seekableStart(){var t;return r((null==(t=e.primaryDetails)?void 0:t.fragmentStart)||0,"integrated")}},skip:()=>{const t=e.effectivePlayingItem,n=null==t?void 0:t.event;if(n&&!n.restrictions.skip){const i=e.findItemIndex(t);if(n.appendInPlace){const e=t.playout.start+t.event.duration;o(e+.001,"playout")}else e.advanceAfterAssetEnded(n,i,1/0)}}}}return this.manager}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var e;const t=this.playingItem,n=null==(e=this.schedule)?void 0:e.items;return!!(this.playbackStarted&&t&&n)&&this.findItemIndex(t)===n.length-1}get playbackStarted(){return null!==this.effectivePlayingItem}get currentTime(){var e,t,n;if(null===this.mediaSelection)return;const r=this.waitingItem||this.playingItem;if(this.isInterstitial(r)&&!r.event.appendInPlace)return;let a=this.media;!a&&null!=(e=this.bufferingItem)&&null!=(t=e.event)&&t.appendInPlace&&(a=this.primaryMedia);const s=null==(n=a)?void 0:n.currentTime;return void 0!==s&&i(s)?s:void 0}get primaryMedia(){var e;return this.media||(null==(e=this.detachedData)?void 0:e.media)||null}isInterstitial(e){return!(null==e||!e.event)}retreiveMediaSource(e,t){const n=this.getAssetPlayer(e);n&&this.transferMediaFromPlayer(n,t)}transferMediaFromPlayer(e,t){const n=e.interstitial.appendInPlace,i=e.media;if(n&&i===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&i)return void(this.detachedData={media:i});const n=e.transferMedia();this.log(`transfer MediaSource from ${e} ${Qe(n)}`),this.detachedData=n}else t&&i&&(this.shouldPlay||(this.shouldPlay=!i.paused))}transferMediaTo(e,t){var n,i;if(e.media===t)return;let r=null;const a=this.hls,s=e!==a,o=s&&e.interstitial.appendInPlace,l=null==(n=this.detachedData)?void 0:n.mediaSource;let c;if(a.media)o&&(r=a.transferMedia(),this.detachedData=r),c="Primary";else if(l){const e=this.getBufferingPlayer();e?(r=e.transferMedia(),c=`${e}`):c="detached MediaSource"}else c="detached media";if(!r)if(l)r=this.detachedData,this.log(`using detachedData: MediaSource ${Qe(r)}`);else if(!this.detachedData||a.media===t){const e=this.playerQueue;e.length>1&&e.forEach((e=>{if(s&&e.interstitial.appendInPlace!==o){const t=e.interstitial;this.clearInterstitial(e.interstitial,null),t.appendInPlace=!1,t.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${t}`)}})),this.hls.detachMedia(),this.detachedData={media:t}}const u=r&&"mediaSource"in r&&"closed"!==(null==(i=r.mediaSource)?void 0:i.readyState),d=u&&r?r:t;if(this.log(`${u?"transfering MediaSource":"attaching media"} to ${s?e:"Primary"} from ${c}`),d===r){const t=s&&e.assetId===this.schedule.assetIdAtEnd;d.overrides={duration:this.schedule.duration,endOfStream:!s||t,cueRemoval:!s}}e.attachMedia(d)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,t=e.events;if(!t||this.playbackDisabled||!this.media)return;-1===this.bufferedPos&&(this.bufferedPos=0);const n=this.timelinePos,i=this.effectivePlayingItem;if(-1===n){const n=this.hls.startPosition;if(this.timelinePos=n,t.length&&t[0].cue.pre){const n=e.findEventIndex(t[0].identifier);this.setSchedulePosition(n)}else if(n>=0||!this.primaryLive){const t=this.timelinePos=n>0?n:0,i=e.findItemIndexAtTime(t);this.setSchedulePosition(i)}}else if(i&&!this.playingItem){const t=e.findItemIndex(i);this.setSchedulePosition(t)}}advanceAfterAssetEnded(e,t,n){const i=is(e,n);if(e.isAssetPastPlayoutLimit(i)){const n=this.schedule.items;if(n){const i=t+1;if(i>=n.length)return void this.setSchedulePosition(-1);const r=e.resumeTime;this.timelinePos<r&&(this.timelinePos=r,this.checkBuffer()),this.setSchedulePosition(i)}}else this.setSchedulePosition(t,i)}setScheduleToAssetAtTime(e,t){const n=this.schedule,i=t.parentIdentifier,r=n.getEvent(i);if(r){const t=n.findEventIndex(i),a=n.findAssetIndex(r,e);this.advanceAfterAssetEnded(r,t,a-1)}}setSchedulePosition(e,t){const n=this.schedule.items;if(!n||this.playbackDisabled)return;this.log(`setSchedulePosition ${e}, ${t}`);const i=e>=0?n[e]:null,r=this.playingItem,a=this.playingLastItem;if(this.isInterstitial(r)){var s;const c=r.event,u=this.playingAsset,d=null==u?void 0:u.identifier,h=d?this.getAssetPlayer(d):null;if(h&&d&&(!this.eventItemsMatch(r,i)||void 0!==t&&d!==(null==(s=c.assetList)?void 0:s[t].identifier))){var o;const t=c.findAssetIndex(u);this.log(`INTERSTITIAL_ASSET_ENDED ${t+1}/${c.assetList.length} ${rs(u)}`),this.endedAsset=u,this.playingAsset=null,this.hls.trigger(l.INTERSTITIAL_ASSET_ENDED,{asset:u,assetListIndex:t,event:c,schedule:n.slice(0),scheduleIndex:e,player:h}),this.retreiveMediaSource(d,i),!h.media||null!=(o=this.detachedData)&&o.mediaSource||h.detachMedia()}if(!this.eventItemsMatch(r,i)&&(this.endedItem=r,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${c} ${os(r)}`),c.hasPlayed=!0,this.hls.trigger(l.INTERSTITIAL_ENDED,{event:c,schedule:n.slice(0),scheduleIndex:e}),c.cue.once)){this.updateSchedule();const e=this.schedule.items;if(i&&e){const n=this.schedule.findItemIndex(i);this.advanceSchedule(n,e,t,r,a)}return}}this.advanceSchedule(e,n,t,r,a)}advanceSchedule(e,t,n,i,r){const a=e>=0?t[e]:null,s=this.primaryMedia,o=this.playerQueue;if(o.length&&o.forEach((t=>{const n=t.interstitial,i=this.schedule.findEventIndex(n.identifier);(i<e||i>e+1)&&this.clearInterstitial(n,a)})),this.isInterstitial(a)){this.timelinePos=Math.min(Math.max(this.timelinePos,a.start),a.end);const r=a.event;if(void 0===n){const t=is(r,(n=this.schedule.findAssetIndex(r,this.timelinePos))-1);if(r.isAssetPastPlayoutLimit(t))return void this.advanceAfterAssetEnded(r,e,n);n=t}const o=this.waitingItem;this.assetsBuffered(a,s)||this.setBufferingItem(a);let c=this.preloadAssets(r,n);if(this.eventItemsMatch(a,o||i)||(this.waitingItem=a,this.log(`INTERSTITIAL_STARTED ${os(a)} ${r.appendInPlace?"append in place":""}`),this.hls.trigger(l.INTERSTITIAL_STARTED,{event:r,schedule:t.slice(0),scheduleIndex:e})),!r.assetListLoaded)return void this.log(`Waiting for ASSET-LIST to complete loading ${r}`);if(r.assetListLoader&&(r.assetListLoader.destroy(),r.assetListLoader=void 0),!s)return void this.log(`Waiting for attachMedia to start Interstitial ${r}`);this.waitingItem=this.endedItem=null,this.playingItem=a;const u=r.assetList[n];if(!u){const i=t[e+1],a=this.media;return i&&a&&!this.isInterstitial(i)&&a.currentTime<i.start&&(a.currentTime=this.timelinePos=i.start),void this.advanceAfterAssetEnded(r,e,n||0)}if(c||(c=this.getAssetPlayer(u.identifier)),null===c||c.destroyed){const e=r.assetList.length;this.warn(`asset ${n+1}/${e} player destroyed ${r}`),c=this.createAssetPlayer(r,u,n)}if(!this.eventItemsMatch(a,this.bufferingItem)&&r.appendInPlace&&this.isAssetBuffered(u))return;this.startAssetPlayer(c,n,t,e,s),this.shouldPlay&&cs(c.media)}else null!==a?(this.resumePrimary(a,e,i),this.shouldPlay&&cs(this.hls.media)):r&&this.isInterstitial(i)&&(this.endedItem=null,this.playingItem=i,i.event.appendInPlace||this.attachPrimary(this.schedule.durations.primary,null))}get playbackDisabled(){return!1===this.hls.config.enableInterstitialPlayback}get primaryDetails(){var e,t;return null==(e=this.mediaSelection)||null==(t=e.main)?void 0:t.details}get primaryLive(){var e;return!(null==(e=this.primaryDetails)||!e.live)}resumePrimary(e,t,n){var i;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${os(e)}`),null==(i=this.detachedData)||!i.mediaSource){let n=this.timelinePos;(n<e.start||n>=e.end)&&(n=this.getPrimaryResumption(e,t),this.timelinePos=n),this.attachPrimary(n,e)}if(!n)return;const r=this.schedule.items;r&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${os(e)}`),this.hls.trigger(l.INTERSTITIALS_PRIMARY_RESUMED,{schedule:r.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){const n=e.start;if(this.primaryLive){const e=this.primaryDetails;if(0===t)return this.hls.startPosition;if(e&&(n<e.fragmentStart||n>e.edge))return this.hls.liveSyncPosition||-1}return n}isAssetBuffered(e){const t=this.getAssetPlayer(e.identifier);if(null!=t&&t.hls)return t.hls.bufferedToEnd;return Zt.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)}attachPrimary(e,t,n){t?this.setBufferingItem(t):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const i=this.primaryMedia;if(!i)return;const r=this.hls;r.media?this.checkBuffer():(this.transferMediaTo(r,i),n&&this.startLoadingPrimaryAt(e,n)),n||(this.timelinePos=e,this.startLoadingPrimaryAt(e,n))}startLoadingPrimaryAt(e,t){var n;const i=this.hls;!i.loadingEnabled||!i.media||Math.abs(((null==(n=i.mainForwardBufferInfo)?void 0:n.start)||i.media.currentTime)-e)>.5?i.startLoad(e,t):i.bufferingEnabled||i.resumeBuffering()}onManifestLoading(){this.stopLoad(),this.schedule.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(l.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(l.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(-1===t.level)return;const n=this.hls.levels[t.level],i=w(w({},this.mediaSelection||this.altSelection),{},{main:n});this.mediaSelection=i,this.schedule.parseInterstitialDateRanges(i,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){const n=this.hls.audioTracks[t.id],i=this.mediaSelection;if(!i)return void(this.altSelection=w(w({},this.altSelection),{},{audio:n}));const r=w(w({},i),{},{audio:n});this.mediaSelection=r}onSubtitleTrackUpdated(e,t){const n=this.hls.subtitleTracks[t.id],i=this.mediaSelection;if(!i)return void(this.altSelection=w(w({},this.altSelection),{},{subtitles:n}));const r=w(w({},i),{},{subtitles:n});this.mediaSelection=r}onAudioTrackSwitching(e,t){const n=nt(t);this.playerQueue.forEach((e=>e.hls.setAudioOption(t)||e.hls.setAudioOption(n)))}onSubtitleTrackSwitch(e,t){const n=nt(t);this.playerQueue.forEach((e=>e.hls.setSubtitleOption(t)||-1!==t.id&&e.hls.setSubtitleOption(n)))}onBufferCodecs(e,t){const n=t.tracks;n&&(this.requiredTracks=n)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){const n=this.playingItem;if(n&&!this.itemsMatch(n,this.bufferingItem)&&!this.isInterstitial(n)){const e=this.timelinePos;this.bufferedPos=e,this.checkBuffer()}}onBufferedToEnd(e){const t=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&t){for(let e=0;e<t.length;e++){const i=t[e];if(i.cue.post){var n;const e=this.schedule.findEventIndex(i.identifier),t=null==(n=this.schedule.items)?void 0:n[e];this.isInterstitial(t)&&this.eventItemsMatch(t,this.bufferingItem)&&this.bufferedToItem(t,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(e){const t=this.playingItem;if(!this.playingLastItem&&t){const e=this.findItemIndex(t);this.setSchedulePosition(e+1)}else this.shouldPlay=!1}updateItem(e,t){const n=this.schedule.items;if(e&&n){return n[this.findItemIndex(e,t)]||null}return null}trimInPlace(e,t){if(this.isInterstitial(e)&&e.event.appendInPlace&&t.end-e.end>.25){e.event.assetList.forEach(((t,n)=>{e.event.isAssetPastPlayoutLimit(n)&&this.clearAssetPlayer(t.identifier,null)}));const t=e.end+.25,n=Zt.bufferInfo(this.primaryMedia,t,0);(n.end>t||(n.nextStart||0)>t)&&(this.attachPrimary(t,null),this.flushFrontBuffer(t))}}itemsMatch(e,t){return!!t&&(e===t||e.event&&t.event&&this.eventItemsMatch(e,t)||!e.event&&!t.event&&this.findItemIndex(e)===this.findItemIndex(t))}eventItemsMatch(e,t){var n;return!!t&&(e===t||e.event.identifier===(null==(n=t.event)?void 0:n.identifier))}findItemIndex(e,t){return e?this.schedule.findItemIndex(e,t):-1}updateSchedule(){const e=this.mediaSelection;e&&this.schedule.updateSchedule(e,[])}checkBuffer(e){const t=this.schedule.items;if(!t)return;const n=Zt.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=n.len<1),this.updateBufferedPos(n.end,t,e)}updateBufferedPos(e,t,n){const i=this.schedule,r=this.bufferingItem;if(this.bufferedPos>e)return;if(1===t.length&&this.itemsMatch(t[0],r))return void(this.bufferedPos=e);const a=this.playingItem,s=this.findItemIndex(a);let o=i.findItemIndexAtTime(e);if(this.bufferedPos<e){var l,c;const n=this.findItemIndex(r),i=Math.min(n+1,t.length-1),a=t[i];if((-1===o&&r&&e>=r.end||null!=(l=a.event)&&l.appendInPlace&&e+.01>=a.start)&&(o=i),i-s>1&&!1===(null==r||null==(c=r.event)?void 0:c.appendInPlace))return;if(this.bufferedPos=e,o>n&&o>s)this.bufferedToItem(a);else{const t=this.primaryDetails;this.primaryLive&&t&&e>t.edge-t.targetduration&&a.start<t.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(a)&&this.preloadAssets(a.event,0)}}else n&&a&&!this.itemsMatch(a,r)&&(o===s?this.bufferedToItem(a):o===s+1&&this.bufferedToItem(t[o]))}assetsBuffered(e,t){return 0!==e.event.assetList.length&&!e.event.assetList.some((e=>{const n=this.getAssetPlayer(e.identifier);return!(null!=n&&n.bufferedInPlaceToEnd(t))}))}setBufferingItem(e){const t=this.bufferingItem,n=this.schedule;if(this.itemsMatch(e,t))this.bufferingItem!==e&&(this.bufferingItem=e);else{const{items:i,events:r}=n;if(!i||!r)return t;const a=this.isInterstitial(e),s=this.getBufferingPlayer();this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos));const o=s?s.remaining:t?t.end-this.timelinePos:0;this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${os(e)}`+(t?` (${o.toFixed(2)} remaining)`:"")),this.playbackDisabled||(a?e.event.assetList.forEach((e=>{const t=this.getAssetPlayer(e.identifier);t&&t.resumeBuffering()})):(this.hls.resumeBuffering(),this.playerQueue.forEach((e=>e.pauseBuffering())))),this.hls.trigger(l.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:r.slice(0),schedule:i.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}return t}bufferedToItem(e,t=0){const n=this.setBufferingItem(e);if(!this.playbackDisabled)if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(null!==n){this.bufferingAsset=null;const t=this.detachedData;if(t)if(t.mediaSource){const t=!0;this.attachPrimary(e.start,e,t)}else this.preloadPrimary(e);else this.preloadPrimary(e)}}preloadPrimary(e){const t=this.findItemIndex(e),n=this.getPrimaryResumption(e,t);this.startLoadingPrimaryAt(n)}bufferedToEvent(e,t){const n=e.event,i=0===n.assetList.length&&!n.assetListLoader,r=n.cue.once;if(i||!r){const e=this.preloadAssets(n,t);if(null!=e&&e.interstitial.appendInPlace){const i=n.assetList[t],r=this.primaryMedia;i&&r&&this.bufferAssetPlayer(e,r)}}}preloadAssets(e,t){const n=e.assetUrl,i=e.assetList.length,r=0===i&&!e.assetListLoader,a=e.cue.once;if(r){const r=e.timelineStart;if(e.appendInPlace){var s;const t=this.playingItem;this.isInterstitial(t)||(null==t||null==(s=t.nextEvent)?void 0:s.identifier)!==e.identifier||this.flushFrontBuffer(r+.25)}let a,o=0;if(!this.playingItem&&this.primaryLive&&(o=this.hls.startPosition,-1===o&&(o=this.hls.liveSyncPosition||0)),o&&!e.cue.pre&&!e.cue.post){const e=o-r;e>0&&(a=Math.round(1e3*e)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${n?1:i} ${e}${a?` live-start: ${o} start-offset: ${a}`:""}`),n)return this.createAsset(e,0,0,r,e.duration,n);const l=this.assetListLoader.loadAssetList(e,a);l&&(e.assetListLoader=l)}else if(!a&&i){for(let n=t;n<i;n++){const t=e.assetList[n],i=this.getAssetPlayerQueueIndex(t.identifier);-1!==i&&!this.playerQueue[i].destroyed||t.error||this.createAssetPlayer(e,t,n)}return this.getAssetPlayer(e.assetList[t].identifier)}return null}flushFrontBuffer(e){const t=this.requiredTracks;if(!t)return;this.log(`Removing front buffer starting at ${e}`);Object.keys(t).forEach((t=>{this.hls.trigger(l.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:t})}))}getAssetPlayerQueueIndex(e){const t=this.playerQueue;for(let n=0;n<t.length;n++)if(e===t[n].assetId)return n;return-1}getAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);return this.playerQueue[t]||null}getBufferingPlayer(){const{playerQueue:e,primaryMedia:t}=this;if(t)for(let n=0;n<e.length;n++)if(e[n].media===t)return e[n];return null}createAsset(e,t,n,i,r,a){const s={parentIdentifier:e.identifier,identifier:Qa(e,a,t),duration:r,startOffset:n,timelineStart:i,uri:a};return this.createAssetPlayer(e,s,t)}createAssetPlayer(e,t,n){const i=this.hls,r=i.userConfig;let a=r.videoPreference;const c=i.loadLevelObj||i.levels[i.currentLevel];(a||c)&&(a=y({},a),c.videoCodec&&(a.videoCodec=c.videoCodec),c.videoRange&&(a.allowedVideoRanges=[c.videoRange]));const u=i.audioTracks[i.audioTrack],d=i.subtitleTracks[i.subtitleTrack];let h=0;if(this.primaryLive||e.appendInPlace){const e=this.timelinePos-t.timelineStart;if(e>1){const n=t.duration;n&&e<n&&(h=e)}}const p=t.identifier,f=w(w({},r),{},{autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:i.sessionId,assetPlayerId:p,abrEwmaDefaultEstimate:i.bandwidthEstimate,interstitialsController:void 0,startPosition:h,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:a,audioPreference:u||r.audioPreference,subtitlePreference:d||r.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(f.timelineOffset=t.timelineStart));const m=f.cmcd;null!=m&&m.sessionId&&m.contentId&&(f.cmcd=y({},m,{contentId:Ya(t.uri)})),this.getAssetPlayer(p)&&this.warn(`Duplicate date range identifier ${e} and asset ${p}`);const g=new as(this.HlsPlayerClass,f,e,t);this.playerQueue.push(g),e.assetList[n]=t;const v=i=>{if(i.live){const t=new Error(`Interstitials MUST be VOD assets ${e}`),i={fatal:!0,type:s.OTHER_ERROR,details:o.INTERSTITIAL_ASSET_ITEM_ERROR,error:t};return void this.handleAssetItemError(i,e,this.schedule.findEventIndex(e.identifier),n,t.message)}const r=i.edge-i.fragmentStart,a=t.duration;(null===a||r>a)&&(this.log(`Interstitial asset "${p}" duration change ${a} > ${r}`),t.duration=r,this.updateSchedule())};g.on(l.LEVEL_UPDATED,((e,{details:t})=>v(t))),g.on(l.LEVEL_PTS_UPDATED,((e,{details:t})=>v(t)));const b=(e,t)=>{const n=this.getAssetPlayer(p);if(n&&t.tracks){n.off(l.BUFFER_CODECS,b),n.tracks=t.tracks;const e=this.primaryMedia;this.bufferingAsset===n.assetItem&&e&&!n.media&&this.bufferAssetPlayer(n,e)}};g.on(l.BUFFER_CODECS,b);const _=()=>{var n;const i=this.getAssetPlayer(p);if(this.log(`buffered to end of asset ${i}`),!i)return;const r=this.schedule.findEventIndex(e.identifier),a=null==(n=this.schedule.items)?void 0:n[r];if(this.isInterstitial(a)){const n=e.findAssetIndex(t),i=is(e,n);if(e.isAssetPastPlayoutLimit(i)){var s;const e=null==(s=this.schedule.items)?void 0:s[r+1];e&&this.bufferedToItem(e)}else this.bufferedToItem(a,i)}};g.on(l.BUFFERED_TO_END,_);const x=t=>()=>{if(!this.getAssetPlayer(p))return;this.shouldPlay=!0;const n=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,n,t)};return g.once(l.MEDIA_ENDED,x(n)),g.once(l.PLAYOUT_LIMIT_REACHED,x(1/0)),g.on(l.ERROR,((t,i)=>{const r=this.getAssetPlayer(p);if(i.details!==o.BUFFER_STALLED_ERROR)this.handleAssetItemError(i,e,this.schedule.findEventIndex(e.identifier),n,`Asset player error ${i.error} ${e}`);else if(null!=r&&r.media){const t=r.currentTime,n=r.duration-t;t&&e.appendInPlace&&n/r.media.playbackRate<.5?(this.log(`Advancing buffer past end of asset ${p} ${e} at ${r.media.currentTime}`),_()):(this.warn(`Stalled at ${t} of ${t+n} in asset ${p} ${e}`),this.onTimeupdate(),this.checkBuffer(!0))}})),g.on(l.DESTROYING,(()=>{if(!this.getAssetPlayer(p))return;const t=new Error(`Asset player destroyed unexpectedly ${p}`),i={fatal:!0,type:s.OTHER_ERROR,details:o.INTERSTITIAL_ASSET_ITEM_ERROR,error:t};this.handleAssetItemError(i,e,this.schedule.findEventIndex(e.identifier),n,t.message)})),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${rs(t)}`),this.hls.trigger(l.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:n,event:e,player:g}),g}clearInterstitial(e,t){e.assetList.forEach((e=>{this.clearAssetPlayer(e.identifier,t)})),e.reset()}resetAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);if(-1!==t){this.log(`reset asset player "${e}" after error`);const n=this.playerQueue[t];this.transferMediaFromPlayer(n,null),n.resetDetails()}}clearAssetPlayer(e,t){const n=this.getAssetPlayerQueueIndex(e);if(-1!==n){this.log(`clear asset player "${e}" toSegment: ${t?os(t):t}`);const i=this.playerQueue[n];this.transferMediaFromPlayer(i,t),this.playerQueue.splice(n,1),i.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,t,n,i,r){const{interstitial:a,assetItem:s,assetId:o}=e,c=a.assetList.length,u=this.playingAsset;this.endedAsset=null,this.playingAsset=s,u&&u.identifier===o||(u&&(this.clearAssetPlayer(u.identifier,n[i]),delete u.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${c} ${rs(s)}`),this.hls.trigger(l.INTERSTITIAL_ASSET_STARTED,{asset:s,assetListIndex:t,event:a,schedule:n.slice(0),scheduleIndex:i,player:e})),this.bufferAssetPlayer(e,r)}bufferAssetPlayer(e,t){var n,i;const{interstitial:r,assetItem:a}=e,l=this.schedule.findEventIndex(r.identifier),c=null==(n=this.schedule.items)?void 0:n[l];if(!c)return;this.setBufferingItem(c),this.bufferingAsset=a;const u=this.getBufferingPlayer();if(u===e)return;const d=r.appendInPlace;if(d&&!1===(null==u?void 0:u.interstitial.appendInPlace))return;const h=(null==u?void 0:u.tracks)||(null==(i=this.detachedData)?void 0:i.tracks)||this.requiredTracks;if(d&&a!==this.playingAsset){if(!e.tracks)return;if(h&&!L(h,e.tracks)){const t=new Error(`Asset ${rs(a)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(h)}')`),n={fatal:!0,type:s.OTHER_ERROR,details:o.INTERSTITIAL_ASSET_ITEM_ERROR,error:t},i=r.findAssetIndex(a);return void this.handleAssetItemError(n,r,l,i,t.message)}}this.transferMediaTo(e,t)}handleAssetItemError(e,t,n,i,r){if(e.details===o.BUFFER_STALLED_ERROR)return;const a=t.assetList[i];this.warn(`INTERSTITIAL_ASSET_ERROR ${a?rs(a):a} ${e.error}`);const s=null==a?void 0:a.identifier,c=this.getAssetPlayerQueueIndex(s),u=this.playerQueue[c]||null,d=this.schedule.items,h=y({},e,{fatal:!1,errorAction:Et(!0),asset:a,assetListIndex:i,event:t,schedule:d,scheduleIndex:n,player:u});if(this.hls.trigger(l.INTERSTITIAL_ASSET_ERROR,h),!e.fatal)return;const p=this.playingAsset,f=new Error(r);if(a&&(this.clearAssetPlayer(s,null),a.error=f),t.assetList.some((e=>!e.error))){if(t.appendInPlace){for(let e=i;e<t.assetList.length;e++)this.resetAssetPlayer(t.assetList[e].identifier);this.updateSchedule()}}else t.error=f;t.error?this.primaryFallback(t):p&&p.identifier===s&&this.advanceAfterAssetEnded(t,n,i)}primaryFallback(e){const t=e.timelineStart,n=this.effectivePlayingItem;if(this.updateSchedule(),n){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${this.timelinePos} playing: ${n?os(n):"<none>"} error: ${e.error}`);let i=this.timelinePos;-1===i&&(i=this.hls.startPosition);const r=this.updateItem(n,i);this.itemsMatch(n,r)&&this.clearInterstitial(e,null),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t));const a=this.schedule.findItemIndexAtTime(i);this.setSchedulePosition(a)}else this.checkStart()}onAssetListLoaded(e,t){var n;const i=t.event,r=i.identifier,a=t.assetListResponse.ASSETS;if(!this.schedule.hasEvent(r))return;const s=i.timelineStart,o=i.duration;let l=0;a.forEach(((e,t)=>{const n=parseFloat(e.DURATION);this.createAsset(i,t,l,s+l,n,e.URI),l+=n})),i.duration=l,this.log(`Loaded asset-list with duration: ${l} (was: ${o}) ${i}`);const c=this.waitingItem,u=(null==c?void 0:c.event.identifier)===r;this.updateSchedule();const d=null==(n=this.bufferingItem)?void 0:n.event;if(u){var h;const e=this.schedule.findEventIndex(r),t=null==(h=this.schedule.items)?void 0:h[e];if(t){if(!this.playingItem&&this.timelinePos>t.end){if(this.schedule.findItemIndexAtTime(this.timelinePos)!==e)return i.error=new Error(`Interstitial no longer within playback range ${this.timelinePos} ${i}`),void this.primaryFallback(i)}this.setBufferingItem(t)}this.setSchedulePosition(e)}else if((null==d?void 0:d.identifier)===r&&d.appendInPlace){const e=i.assetList[0],t=this.getAssetPlayer(e.identifier),n=this.primaryMedia;e&&t&&n&&this.bufferAssetPlayer(t,n)}}onError(e,t){switch(t.details){case o.ASSET_LIST_PARSING_ERROR:case o.ASSET_LIST_LOAD_ERROR:case o.ASSET_LIST_LOAD_TIMEOUT:{const e=t.interstitial;e&&this.primaryFallback(e);break}case o.BUFFER_STALLED_ERROR:this.onTimeupdate(),this.checkBuffer(!0)}}}});function fo(e){return e&&"object"==typeof e?Array.isArray(e)?e.map(fo):Object.keys(e).reduce(((t,n)=>(t[n]=fo(e[n]),t)),{}):e}function mo(e,t){const n=e.loader;if(n!==oo&&n!==ho)t.log("[config]: Custom loader detected, cannot enable progressive streaming"),e.progressive=!1;else{(function(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(e){}return!1})()&&(e.loader=oo,e.progressive=!0,e.enableSoftwareAES=!0,t.log("[config]: Progressive streaming enabled, using FetchLoader"))}}class go extends Ht{constructor(e,t){super("gap-controller",e.logger),this.hls=null,this.fragmentTracker=null,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var e;null!=(e=this.media)&&e.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{var e;this.hls&&(this.ended=(null==(e=this.media)?void 0:e.currentTime)||1,this.hls.trigger(l.MEDIA_ENDED,{stalled:!1}))},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(e,t){this.setInterval(100),this.mediaSource=t.mediaSource;const n=this.media=t.media;Ka(n,"playing",this.onMediaPlaying),Ka(n,"waiting",this.onMediaWaiting),Ka(n,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:n}=this;n&&(Ua(n,"playing",this.onMediaPlaying),Ua(n,"waiting",this.onMediaWaiting),Ua(n,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(e,t){this.buffered=t.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var e;if(null==(e=this.media)||!e.readyState||!this.hasBuffered)return;const t=this.media.currentTime;this.poll(t,this.lastCurrentTime),this.lastCurrentTime=t}poll(e,t){var n,i;const r=null==(n=this.hls)?void 0:n.config;if(!r)return;const a=this.media;if(!a)return;const{seeking:s}=a,o=this.seeking&&!s,c=!this.seeking&&s,u=a.paused&&!s||a.ended||0===a.playbackRate;if(this.seeking=s,e!==t)return t&&(this.ended=0),this.moved=!0,s||(this.nudgeRetry=0,r.nudgeOnVideoHole&&!u&&e>t&&this.nudgeOnVideoHole(e,t)),void(0===this.waiting&&this.stallResolved(e));if(c||o)return void(o&&this.stallResolved(e));if(u)return this.nudgeRetry=0,this.stallResolved(e),void(!this.ended&&a.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(l.MEDIA_ENDED,{stalled:!1})));if(!Zt.getBuffered(a).length)return void(this.nudgeRetry=0);const d=Zt.bufferInfo(a,e,0),h=d.nextStart||0,p=this.fragmentTracker;if(s&&p&&this.hls){const t=vo(this.hls.inFlightFragments,e),n=d.len>2,i=!h||t||h-e>2&&!p.getPartialFragment(e);if(n||i)return;this.moved=!1}const f=null==(i=this.hls)?void 0:i.latestLevelDetails;if(!this.moved&&null!==this.stalled&&p){if(!(d.len>0)&&!h)return;const t=Math.max(h,d.start||0)-e,n=!(null==f||!f.live)?2*f.targetduration:2,i=p.getPartialFragment(e);if(t>0&&(t<=n||i))return void(a.paused||this._trySkipBufferHole(i))}const m=r.detectStallWithCurrentTimeMs,g=self.performance.now(),v=this.waiting;let b=this.stalled;if(null===b){if(!(v>0&&g-v<m))return void(this.stalled=g);b=this.stalled=v}const y=g-b;if(!s&&(y>=m||v)&&this.hls){var _;if("ended"===(null==(_=this.mediaSource)?void 0:_.readyState)&&(null==f||!f.live)&&Math.abs(e-((null==f?void 0:f.edge)||0))<1){if(this.ended)return;return this.ended=e||1,void this.hls.trigger(l.MEDIA_ENDED,{stalled:!0})}if(this._reportStall(d),!this.media||!this.hls)return}const w=Zt.bufferInfo(a,e,r.maxBufferHole);this._tryFixBufferStall(w,y,e)}stallResolved(e){const t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){const n=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(n)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(l.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var n;const i=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&null!=(n=this.buffered.audio)&&n.length&&i&&i.length>1&&e>i.end(0)){const n=Zt.bufferedInfo(Zt.timeRangesToArray(this.buffered.audio),e,0);if(n.len>1&&t>=n.start){const n=Zt.timeRangesToArray(i),r=Zt.bufferedInfo(n,t,0).bufferedIndex;if(r>-1&&r<n.length-1){const t=Zt.bufferedInfo(n,e,0).bufferedIndex,i=n[r].end,a=n[r+1].start;if((-1===t||t>r)&&a-i<1&&e-i<2){const n=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${i} -> ${a} buffered index: ${t}`);this.warn(n.message),this.media.currentTime+=1e-6;const r=this.fragmentTracker.getPartialFragment(e)||void 0,c=Zt.bufferInfo(this.media,e,0);this.hls.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:n,reason:n.message,frag:r,buffer:c.len,bufferInfo:c})}}}}}_tryFixBufferStall(e,t,n){var i,r;const{fragmentTracker:a,media:s}=this,o=null==(i=this.hls)?void 0:i.config;if(!s||!a||!o)return;const l=null==(r=this.hls)?void 0:r.latestLevelDetails,c=a.getPartialFragment(n);if(c||null!=l&&l.live&&n<l.fragmentStart){if(this._trySkipBufferHole(c)||!this.media)return}const u=e.buffered,d=this.adjacentTraversal(e,n);(u&&u.length>1&&e.len>o.maxBufferHole||e.nextStart&&(e.nextStart-n<o.maxBufferHole||d))&&(t>1e3*o.highBufferWatchdogPeriod||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}adjacentTraversal(e,t){const n=this.fragmentTracker,i=e.nextStart;if(n&&i){const e=n.getFragAtPos(t,p),r=n.getFragAtPos(i,p);if(e&&r)return r.sn-e.sn<2}return!1}_reportStall(e){const{hls:t,media:n,stallReported:i,stalled:r}=this;if(!i&&null!==r&&n&&t){this.stallReported=!0;const i=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${Qe(e)})`);this.warn(i.message),t.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.BUFFER_STALLED_ERROR,fatal:!1,error:i,buffer:e.len,bufferInfo:e,stalled:{start:r}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:n,media:i}=this,r=null==(t=this.hls)?void 0:t.config;if(!i||!n||!r)return 0;const a=i.currentTime,c=Zt.bufferInfo(i,a,0),u=a<c.start?c.start:c.nextStart;if(u&&this.hls){const t=c.len<=r.maxBufferHole,h=c.len>0&&c.len<1&&i.readyState<3,f=u-a;if(f>0&&(t||h)){if(f>r.maxBufferHole){let t=!1;if(0===a){const e=n.getAppendedFrag(0,p);e&&u<e.end&&(t=!0)}if(!t){const t=e||n.getAppendedFrag(a,p);if(t){var d;if(null==(d=this.hls.loadLevelObj)||!d.details)return 0;if(vo(this.hls.inFlightFragments,u))return 0;let e=!1,i=t.end;for(;i<u;){const t=n.getPartialFragment(i);if(!t){e=!0;break}i+=t.duration}if(e)return 0}}}const t=Math.max(u+.05,a+.1);if(this.warn(`skipping hole, adjusting currentTime from ${a} to ${t}`),this.moved=!0,i.currentTime=t,null==e||!e.gap){const n=new Error(`fragment loaded with buffer holes, seeking from ${a} to ${t}`);this.hls.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:n,reason:n.message,frag:e||void 0,buffer:c.len,bufferInfo:c})}return t}}return 0}_tryNudgeBuffer(e){const{hls:t,media:n,nudgeRetry:i}=this,r=null==t?void 0:t.config;if(!n||!r)return 0;const a=n.currentTime;if(this.nudgeRetry++,i<r.nudgeMaxRetry){const c=a+(i+1)*r.nudgeOffset,u=new Error(`Nudging 'currentTime' from ${a} to ${c}`);this.warn(u.message),n.currentTime=c,t.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.BUFFER_NUDGE_ON_STALL,error:u,fatal:!1,buffer:e.len,bufferInfo:e})}else{const n=new Error(`Playhead still not moving while enough data buffered @${a} after ${r.nudgeMaxRetry} nudges`);this.error(n.message),t.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.BUFFER_STALLED_ERROR,error:n,fatal:!0,buffer:e.len,bufferInfo:e})}}}function vo(e,t){const n=bo(e.main);if(n&&n.start<=t)return n;const i=bo(e.audio);return i&&i.start<=t?i:null}function bo(e){if(!e)return null;switch(e.state){case hi:case di:case yi:case _i:return null}return e.frag}function yo(){if("undefined"!=typeof self)return self.VTTCue||self.TextTrackCue}function _o(e,t,n,i,r){let a=new e(t,n,"");try{a.value=i,r&&(a.type=r)}catch(s){a=new e(t,n,Qe(r?w({type:r},i):i))}return a}const wo=(()=>{const e=yo();try{e&&new e(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class xo{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(l.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:e}=this;e.on(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(l.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(l.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(l.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(l.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(l.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}onMediaAttaching(e,t){var n;this.media=t.media,!1===(null==(n=t.overrides)?void 0:n.cueRemoval)&&(this.removeCues=!1)}onMediaAttached(){const e=this.hls.latestLevelDetails;e&&this.updateDateRangeCues(e)}onMediaDetaching(e,t){this.media=null;!!t.transferMedia||(this.id3Track&&(this.removeCues&&Ga(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const n=e[t];if("metadata"===n.kind&&"id3"===n.label)return Ha(n,this.media),n}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:n,enableID3MetadataCues:i}}}=this;if(!n&&!i)return;const{samples:r}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const a=yo();if(a)for(let e=0;e<r.length;e++){const t=r[e].type;if(t===Qi.emsg&&!n||!i)continue;const s=Wi(r[e].data);if(s){const n=r[e].pts;let i=n+r[e].duration;i>wo&&(i=wo);i-n<=0&&(i=n+.25);for(let e=0;e<s.length;e++){const r=s[e];if(!Yi(r)){this.updateId3CueEnds(n,t);const e=_o(a,n,i,r,t);e&&this.id3Track.addCue(e)}}}}}updateId3CueEnds(e,t){var n;const i=null==(n=this.id3Track)?void 0:n.cues;if(i)for(let n=i.length;n--;){const r=i[n];r.type===t&&r.startTime<e&&r.endTime===wo&&(r.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:n,type:i}){const{id3Track:r,hls:a}=this;if(!a)return;const{config:{enableEmsgMetadataCues:s,enableID3MetadataCues:o}}=a;if(r&&(s||o)){let e;e="audio"===i?e=>e.type===Qi.audioId3&&o:"video"===i?e=>e.type===Qi.emsg&&s:e=>e.type===Qi.audioId3&&o||e.type===Qi.emsg&&s,Za(r,t,n,e)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.media||!e.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{id3Track:n}=this,{dateRanges:r}=e,a=Object.keys(r);let s=this.dateRangeCuesAppended;var o;if(n&&t)if(null!=(o=n.cues)&&o.length){const e=Object.keys(s).filter((e=>!a.includes(e)));for(let t=e.length;t--;){const i=e[t],r=s[i].cues;delete s[i],Object.keys(r).forEach((e=>{try{const t=r[e];t.removeEventListener("enter",this.onEventCueEnter),n.removeCue(t)}catch(e){}}))}}else s=this.dateRangeCuesAppended={};const l=e.fragments[e.fragments.length-1];if(0===a.length||!i(null==l?void 0:l.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const c=yo();for(let e=0;e<a.length;e++){const t=a[e],n=r[t],i=n.startTime,o=s[t],l=(null==o?void 0:o.cues)||{};let h=(null==o?void 0:o.durationKnown)||!1,p=wo;const{duration:f,endDate:m}=n;if(m&&null!==f)p=i+f,h=!0;else if(n.endOnNext&&!h){const e=a.reduce(((e,t)=>{if(t!==n.id){const i=r[t];if(i.class===n.class&&i.startDate>n.startDate&&(!e||n.startDate<e.startDate))return i}return e}),null);e&&(p=e.startTime,h=!0)}const g=Object.keys(n.attr);for(let e=0;e<g.length;e++){const r=g[e];if("ID"===(d=r)||"CLASS"===d||"CUE"===d||"START-DATE"===d||"DURATION"===d||"END-DATE"===d||"END-ON-NEXT"===d)continue;const a=l[r];if(a)h&&!o.durationKnown?a.endTime=p:Math.abs(a.startTime-i)>.01&&(a.startTime=i,a.endTime=p);else if(c){let e=n.attr[r];rn(r)&&(u=e,e=Uint8Array.from(u.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer);const a=_o(c,i,p,{key:r,data:e},Qi.dateRange);a&&(a.id=t,this.id3Track.addCue(a),l[r]=a,this.hls.config.interstitialsController&&("X-ASSET-LIST"!==r&&"X-ASSET-URL"!==r||a.addEventListener("enter",this.onEventCueEnter)))}}s[t]={cues:l,dateRange:n,durationKnown:h}}var u,d}}class ko{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{const{media:e}=this,t=this.levelDetails;if(!e||!t)return;this.currentTime=e.currentTime;const n=this.computeLatency();if(null===n)return;this._latency=n;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:r}=this.config;if(!i||1===r||!t.live)return;const a=this.targetLatency;if(null===a)return;const s=n-a;if(s<Math.min(this.maxLatency,a+t.targetduration)&&s>.05&&this.forwardBufferLength>1){const t=Math.min(2,Math.max(1,r)),n=Math.round(2/(1+Math.exp(-.75*s-this.edgeStalled))*20)/20,i=Math.min(t,Math.max(1,n));this.changeMediaPlaybackRate(e,i)}else 1!==e.playbackRate&&0!==e.playbackRate&&this.changeMediaPlaybackRate(e,1)},this.hls=e,this.config=e.config,this.registerListeners()}get levelDetails(){var e;return(null==(e=this.hls)?void 0:e.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:e}=this;if(void 0!==e.liveMaxLatencyDuration)return e.liveMaxLatencyDuration;const t=this.levelDetails;return t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const e=this.levelDetails;if(null===e||null===this.hls)return null;const{holdBack:t,partHoldBack:n,targetduration:i}=e,{liveSyncDuration:r,liveSyncDurationCount:a,lowLatencyMode:s}=this.config,o=this.hls.userConfig;let l=s&&n||t;(this._targetLatencyUpdated||o.liveSyncDuration||o.liveSyncDurationCount||0===l)&&(l=void 0!==r?r:a*i);const c=i;return l+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,c)}set targetLatency(e){this.stallCount=0,this.config.liveSyncDuration=e,this._targetLatencyUpdated=!0}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency;if(null===e||null===t)return null;const n=this.levelDetails;if(null===n)return null;const i=n.edge,r=e-t-this.edgeStalled,a=i-n.totalduration,s=i-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(a,r),s)}get drift(){const e=this.levelDetails;return null===e?1:e.drift}get edgeStalled(){const e=this.levelDetails;if(null===e)return 0;const t=3*(this.config.lowLatencyMode&&e.partTarget||e.targetduration);return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;const n=e.buffered.length;return(n?e.buffered.end(n-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(l.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(l.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(l.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(l.ERROR,this.onError,this))}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.onTimeupdate)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){t.advanced&&this.onTimeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(e,t){var n;t.details===o.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&null!=(n=this.levelDetails)&&n.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var n,i;e.playbackRate!==t&&(null==(n=this.hls)||n.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${null==(i=this.targetLatency)?void 0:i.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}estimateLiveEdge(){const e=this.levelDetails;return null===e?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return null===e?null:e-this.currentTime}}class So extends ea{constructor(e,t){super(e,"level-controller"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(l.LEVEL_LOADED,this.onLevelLoaded,this),e.on(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(l.FRAG_BUFFERED,this.onFragBuffered,this),e.on(l.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(l.LEVEL_LOADED,this.onLevelLoaded,this),e.off(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(l.FRAG_BUFFERED,this.onFragBuffered,this),e.off(l.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach((e=>{e.loadError=0,e.fragmentError=0})),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const n=this.hls.config.preferManagedMediaSource,i=[],r={},a={};let s=!1,o=!1,l=!1;t.levels.forEach((e=>{const t=e.attrs;let{audioCodec:c,videoCodec:u}=e;c&&(e.audioCodec=c=Re(c,n)||void 0),u&&(u=e.videoCodec=function(e){const t=e.split(",");for(let e=0;e<t.length;e++){const n=t[e].split(".");n.length>2&&"avc1"===n[0]&&(t[e]=`avc1.${parseInt(n[1]).toString(16)}${("000"+parseInt(n[2]).toString(16)).slice(-4)}`)}return t.join(",")}(u));const{width:d,height:h,unknownCodecs:p}=e;let f=p?p.length:0;if(p)for(let t=f;t--;){const n=p[t];this.isAudioSupported(n)?(e.audioCodec=c=c?`${c},${n}`:n,f--,Se.audio[c.substring(0,4)]=2):this.isVideoSupported(n)&&(e.videoCodec=u=u?`${u},${n}`:n,f--,Se.video[u.substring(0,4)]=2)}if(s||(s=!(!d||!h)),o||(o=!!u),l||(l=!!c),f||c&&!this.isAudioSupported(c)||u&&!this.isVideoSupported(u))return void this.log(`Some or all CODECS not supported "${t.CODECS}"`);const{CODECS:m,"FRAME-RATE":g,"HDCP-LEVEL":v,"PATHWAY-ID":b,RESOLUTION:y,"VIDEO-RANGE":_}=t,w=`${`${b||"."}-`}${e.bitrate}-${y}-${g}-${m}-${_}-${v}`;if(r[w])if(r[w].uri===e.url||e.attrs["PATHWAY-ID"])r[w].addGroupId("audio",t.AUDIO),r[w].addGroupId("text",t.SUBTITLES);else{const t=a[w]+=1;e.attrs["PATHWAY-ID"]=new Array(t+1).join(".");const n=this.createLevel(e);r[w]=n,i.push(n)}else{const t=this.createLevel(e);r[w]=t,a[w]=1,i.push(t)}})),this.filterAndSortMediaOptions(i,t,s,o,l)}createLevel(e){const t=new Ye(e),n=e.supplemental;if(null!=n&&n.videoCodec&&!this.isVideoSupported(n.videoCodec)){const e=new Error(`SUPPLEMENTAL-CODECS not supported "${n.videoCodec}"`);this.log(e.message),t.supportedResult=Fe(e,[])}return t}isAudioSupported(e){return Ce(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return Ce(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,n,i,r){let a=[],c=[],u=e;if((n||i)&&r&&(u=u.filter((({videoCodec:e,videoRange:t,width:n,height:i})=>{return(!!e||!(!n||!i))&&(!!(r=t)&&qe.indexOf(r)>-1);var r}))),0===u.length)return void Promise.resolve().then((()=>{if(this.hls){let e="no level with compatible codecs found in manifest",n=e;t.levels.length&&(n=`one or more CODECS in variant not supported: ${Qe(t.levels.map((e=>e.attrs.CODECS)).filter(((e,t,n)=>n.indexOf(e)===t)))}`,this.warn(n),e+=` (${n})`);const i=new Error(e);this.hls.trigger(l.ERROR,{type:s.MEDIA_ERROR,details:o.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:i,reason:n})}}));t.audioTracks&&(a=t.audioTracks.filter((e=>!e.audioCodec||this.isAudioSupported(e.audioCodec))),Eo(a)),t.subtitles&&(c=t.subtitles,Eo(c));const d=u.slice(0);u.sort(((e,t)=>{if(e.attrs["HDCP-LEVEL"]!==t.attrs["HDCP-LEVEL"])return(e.attrs["HDCP-LEVEL"]||"")>(t.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&e.height!==t.height)return e.height-t.height;if(e.frameRate!==t.frameRate)return e.frameRate-t.frameRate;if(e.videoRange!==t.videoRange)return qe.indexOf(e.videoRange)-qe.indexOf(t.videoRange);if(e.videoCodec!==t.videoCodec){const n=Me(e.videoCodec),i=Me(t.videoCodec);if(n!==i)return i-n}if(e.uri===t.uri&&e.codecSet!==t.codecSet){const n=Le(e.codecSet),i=Le(t.codecSet);if(n!==i)return i-n}return e.averageBitrate!==t.averageBitrate?e.averageBitrate-t.averageBitrate:0}));let h=d[0];if(this.steering&&(u=this.steering.filterParsedLevels(u),u.length!==d.length))for(let e=0;e<d.length;e++)if(d[e].pathwayId===u[0].pathwayId){h=d[e];break}this._levels=u;for(let e=0;e<u.length;e++)if(u[e]===h){var p;this._firstLevel=e;const t=h.bitrate,n=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${u.length} level(s) found, first bitrate: ${t}`),void 0===(null==(p=this.hls.userConfig)?void 0:p.abrEwmaDefaultEstimate)){const e=Math.min(t,this.hls.config.abrEwmaDefaultEstimateMax);e>n&&n===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=e)}break}const f=r&&!i,m=this.hls.config,g=!(!m.audioStreamController||!m.audioTrackController),v={levels:u,audioTracks:a,subtitleTracks:c,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:r,video:i,altAudio:g&&!f&&a.some((e=>!!e.url))};this.hls.trigger(l.MANIFEST_PARSED,v)}get levels(){return 0===this._levels.length?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(0===t.length)return;if(e<0||e>=t.length){const n=new Error("invalid level idx"),i=e<0;if(this.hls.trigger(l.ERROR,{type:s.OTHER_ERROR,details:o.LEVEL_SWITCH_ERROR,level:e,fatal:i,error:n,reason:n.message}),i)return;e=Math.min(e,t.length-1)}const n=this.currentLevelIndex,i=this.currentLevel,r=i?i.attrs["PATHWAY-ID"]:void 0,a=t[e],c=a.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=a,n===e&&i&&r===c)return;this.log(`Switching to level ${e} (${a.height?a.height+"p ":""}${a.videoRange?a.videoRange+" ":""}${a.codecSet?a.codecSet+" ":""}@${a.bitrate})${c?" with Pathway "+c:""} from level ${n}${r?" with Pathway "+r:""}`);const u={level:e,attrs:a.attrs,details:a.details,bitrate:a.bitrate,averageBitrate:a.averageBitrate,maxBitrate:a.maxBitrate,realBitrate:a.realBitrate,width:a.width,height:a.height,codecSet:a.codecSet,audioCodec:a.audioCodec,videoCodec:a.videoCodec,audioGroups:a.audioGroups,subtitleGroups:a.subtitleGroups,loaded:a.loaded,loadError:a.loadError,fragmentError:a.fragmentError,name:a.name,id:a.id,uri:a.uri,url:a.url,urlId:0,audioGroupIds:a.audioGroupIds,textGroupIds:a.textGroupIds};this.hls.trigger(l.LEVEL_SWITCHING,u);const d=a.details;if(!d||d.live){const e=this.switchParams(a.uri,null==i?void 0:i.details,d);this.loadPlaylist(e)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(void 0===this._startLevel){const e=this.hls.config.startLevel;return void 0!==e?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(e){if(this.steering){const t=this.steering.pathways(),n=e.filter((e=>-1!==t.indexOf(e)));if(e.length<1)return void this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);this.steering.pathwayPriority=n}}onError(e,t){!t.fatal&&t.context&&t.context.type===u&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(void 0!==t&&t.type===p){const e=t.elementaryStreams;if(!Object.keys(e).some((t=>!!e[t])))return;const n=this._levels[t.level];null!=n&&n.loadError&&(this.log(`Resetting level error count of ${n.loadError} on frag buffered`),n.loadError=0)}}onLevelLoaded(e,t){var n;const{level:i,details:r}=t,a=t.levelInfo;var s;if(!a)return this.warn(`Invalid level index ${i}`),void(null!=(s=t.deliveryDirectives)&&s.skip&&(r.deltaUpdateFailed=!0));if(a===this.currentLevel||t.withoutMultiVariant){0===a.fragmentError&&(a.loadError=0);let e=a.details;e===t.details&&e.advanced&&(e=void 0),this.playlistLoaded(i,t,e)}else null!=(n=t.deliveryDirectives)&&n.skip&&(r.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=this.getUrlWithDirectives(e.uri,t),i=this.currentLevelIndex,r=e.attrs["PATHWAY-ID"],a=e.details,s=null==a?void 0:a.age;this.log(`Loading level index ${i}${void 0!==(null==t?void 0:t.msn)?" at sn "+t.msn+" part "+t.part:""}${r?" Pathway "+r:""}${s&&a.live?" age "+s.toFixed(1)+(a.type?" "+a.type||0:""):""} ${n}`),this.hls.trigger(l.LEVEL_LOADING,{url:n,level:i,levelInfo:e,pathwayId:e.attrs["PATHWAY-ID"],id:0,deliveryDirectives:t||null})}get nextLoadLevel(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;if(1===this._levels.length)return;const n=this._levels.filter(((t,n)=>n!==e||(this.steering&&this.steering.removeLevel(t),t===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,t.details&&t.details.fragments.forEach((e=>e.level=-1))),!1)));ri(n),this._levels=n,this.currentLevelIndex>-1&&null!=(t=this.currentLevel)&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const i=n.length-1;this._firstLevel=Math.min(this._firstLevel,i),this._startLevel&&(this._startLevel=Math.min(this._startLevel,i)),this.hls.trigger(l.LEVELS_UPDATED,{levels:n})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:n}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(l.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function Eo(e){const t={};e.forEach((e=>{const n=e.groupId||"";e.id=t[n]=t[n]||0,t[n]++}))}function Co(){return self.SourceBuffer||self.WebKitSourceBuffer}function To(){if(!M())return!1;const e=Co();return!e||e.prototype&&"function"==typeof e.prototype.appendBuffer&&"function"==typeof e.prototype.remove}class Ao extends ki{constructor(e,t,n){super(e,t,n,"stream-controller",p),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const e=this.media,t=e?e.currentTime:null;if(null===t||!i(t))return;if(this.log(`Media seeked to ${t.toFixed(3)}`),!this.getBufferedFrag(t))return;const n=this.getFwdBufferInfoAtPos(e,t,p,0);null!==n&&0!==n.len?this.tick():this.warn(`Main forward buffer length at ${t} on "seeked" event ${n?n.len:"empty"})`)},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(l.MANIFEST_PARSED,this.onManifestParsed,this),e.on(l.LEVEL_LOADING,this.onLevelLoading,this),e.on(l.LEVEL_LOADED,this.onLevelLoaded,this),e.on(l.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(l.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(l.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(l.BUFFER_CREATED,this.onBufferCreated,this),e.on(l.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(l.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(l.MANIFEST_PARSED,this.onManifestParsed,this),e.off(l.LEVEL_LOADED,this.onLevelLoaded,this),e.off(l.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(l.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(l.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(l.BUFFER_CREATED,this.onBufferCreated,this),e.off(l.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(l.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(l.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){const{lastCurrentTime:n,hls:i}=this;if(this.stopLoad(),this.setInterval(100),this.level=-1,!this.startFragRequested){let e=i.startLevel;-1===e&&(i.config.testBandwidth&&this.levels.length>1?(e=0,this.bitrateTest=!0):e=i.firstAutoLevel),i.nextLoadLevel=e,this.level=i.loadLevel,this._hasEnoughToStart=!!t}n>0&&-1===e&&!t&&(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n),this.state=hi,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=di}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case xi:{const{levels:e,level:t}=this,n=null==e?void 0:e[t],i=null==n?void 0:n.details;if(i&&(!i.live||this.levelLastLoaded===n&&!this.waitForLive(n))){if(this.waitForCdnTuneIn(i))break;this.state=hi;break}if(this.hls.nextLoadLevel!==this.level){this.state=hi;break}break}case mi:{var e;const t=self.performance.now(),n=this.retryDate;if(!n||t>=n||null!=(e=this.media)&&e.seeking){const{levels:e,level:t}=this,n=null==e?void 0:e[t];this.resetStartWhenNotLoaded(n||null),this.state=hi}}}this.state===hi&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var e;super.onTickEnd(),null!=(e=this.media)&&e.readyState&&!1===this.media.seeking&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:n,media:i}=this;if(null===t||!i&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;const r=this.buffering?e.nextLoadLevel:e.loadLevel;if(null==n||!n[r])return;const a=n[r],s=this.getMainFwdBufferInfo();if(null===s)return;const o=this.getLevelDetails();if(o&&this._streamEnded(s,o)){const e={};return 2===this.altAudio&&(e.type="video"),this.hls.trigger(l.BUFFER_EOS,e),void(this.state=yi)}if(!this.buffering)return;e.loadLevel!==r&&-1===e.manualLevel&&this.log(`Adapting to level ${r} from level ${this.level}`),this.level=e.nextLoadLevel=r;const c=a.details;if(!c||this.state===xi||this.waitForLive(a))return this.level=r,this.state=xi,void(this.startFragRequested=!1);const u=s.len,d=this.getMaxBufferLength(a.maxBitrate);if(u>=d)return;this.backtrackFragment&&this.backtrackFragment.start>s.end&&(this.backtrackFragment=null);const h=this.backtrackFragment?this.backtrackFragment.start:s.end;let f=this.getNextFragment(h,c);if(this.couldBacktrack&&!this.fragPrevious&&f&&G(f)&&this.fragmentTracker.getState(f)!==Mt){var m;const e=(null!=(m=this.backtrackFragment)?m:f).sn-c.startSN,t=c.fragments[e-1];t&&f.cc===t.cc&&(f=t,this.fragmentTracker.removeFragment(t))}else this.backtrackFragment&&s.len&&(this.backtrackFragment=null);if(f&&this.isLoopLoading(f,h)){if(!f.gap){const e=this.audioOnly&&!this.altAudio?j:q,t=(e===q?this.videoBuffer:this.mediaBuffer)||this.media;t&&this.afterBufferFlushed(t,e,p)}f=this.getNextFragmentLoopLoading(f,c,s,p,d)}f&&(!f.initSegment||f.initSegment.data||this.bitrateTest||(f=f.initSegment),this.loadFragment(f,a,h))}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);i===Ct||i===At?G(e)?this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):super.loadFragment(e,t,n):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,p)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(null!=t&&t.readyState){let n;const i=this.getAppendedFrag(t.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const r=this.getLevelDetails();if(null!=r&&r.live){const e=this.getMainFwdBufferInfo();if(!e||e.len<2*r.targetduration)return}if(!t.paused&&e){const t=e[this.hls.nextLoadLevel],i=this.fragLastKbps;n=i&&this.fragCurrent?this.fragCurrent.duration*t.maxBitrate/(1e3*i)+1:0}else n=0;const a=this.getBufferedFrag(t.currentTime+n);if(a){const e=this.followingBufferedFrag(a);if(e){this.abortCurrentFrag();const t=e.maxStartPTS?e.maxStartPTS:e.start,n=e.duration,i=Math.max(a.end,t+Math.min(Math.max(n-this.config.maxFragLookUpTolerance,n*(this.couldBacktrack?.5:.125)),n*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(i,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case pi:case fi:case mi:case vi:case bi:this.state=hi}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,2===this.altAudio?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const n=t.media;Ka(n,"playing",this.onMediaPlaying),Ka(n,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:n}=this;n&&(Ua(n,"playing",this.onMediaPlaying),Ua(n,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(e,t);!!t.transferMedia||(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(l.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(e,t){let n=!1,i=!1;t.levels.forEach((e=>{const t=e.audioCodec;t&&(n=n||-1!==t.indexOf("mp4a.40.2"),i=i||-1!==t.indexOf("mp4a.40.5"))})),this.audioCodecSwitch=n&&i&&!function(){var e;const t=Co();return"function"==typeof(null==t||null==(e=t.prototype)?void 0:e.changeType)}(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:n}=this;if(!n||this.state!==hi)return;const i=t.levelInfo;(!i.details||i.details.live&&(this.levelLastLoaded!==i||i.details.expired)||this.waitForCdnTuneIn(i.details))&&(this.state=xi)}onLevelLoaded(e,t){var n;const{levels:i,startFragRequested:r}=this,a=t.level,s=t.details,o=s.totalduration;if(!i)return void this.warn(`Levels were reset while loading level ${a}`);this.log(`Level ${a} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""}, cc [${s.startCC}, ${s.endCC}] duration:${o}`);const c=t.levelInfo,u=this.fragCurrent;!u||this.state!==fi&&this.state!==mi||u.level!==t.level&&u.loader&&this.abortCurrentFrag();let d=0;if(s.live||null!=(n=c.details)&&n.live){var h;if(this.checkLiveUpdate(s),s.deltaUpdateFailed)return;d=this.alignPlaylists(s,c.details,null==(h=this.levelLastLoaded)?void 0:h.details)}if(c.details=s,this.levelLastLoaded=c,r||this.setStartPosition(s,d),this.hls.trigger(l.LEVEL_UPDATED,{details:s,level:a}),this.state===xi){if(this.waitForCdnTuneIn(s))return;this.state=hi}r&&s.live&&this.synchronizeToLiveEdge(s),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:n}=this;if(!n)return;const i=this.hls.liveSyncPosition,r=this.getLoadPosition(),a=e.fragmentStart,s=e.edge,o=r>=a-t.maxFragLookUpTolerance&&r<=s;if(null!==i&&n.duration>i&&(r<i||!o)){const a=void 0!==t.liveMaxLatencyDuration?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;if((!o&&n.readyState<4||r<s-a)&&(this._hasEnoughToStart||(this.nextLoadPosition=i),n.readyState))if(this.warn(`Playback: ${r.toFixed(3)} is located too far from the end of live sliding playlist: ${s}, reset currentTime to : ${i.toFixed(3)}`),"buffered"===this.config.liveSyncMode){var l;const e=Zt.bufferInfo(n,i,0);if(null==e||null==(l=e.buffered)||!l.length)return void(n.currentTime=i);if(e.start<=r)return void(n.currentTime=i);const{nextStart:t}=Zt.bufferedInfo(e.buffered,r,0);t&&(n.currentTime=t)}else n.currentTime=i}}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:i,payload:r}=e,{levels:a}=this;if(!a)return void this.warn(`Levels were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);const s=a[n.level];if(!s)return void this.warn(`Level ${n.level} not found on progress`);const o=s.details;if(!o)return this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),void this.fragmentTracker.removeFragment(n);const l=s.videoCodec,c=o.PTSKnown||!o.live,u=null==(t=n.initSegment)?void 0:t.data,d=this._getAudioCodec(s),h=this.transmuxer=this.transmuxer||new Qr(this.hls,p,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=i?i.index:-1,m=-1!==f,g=new Vt(n.level,n.sn,n.stats.chunkCount,r.byteLength,f,m),v=this.initPTS[n.cc];h.push(r,u,d,l,n,i,o.totalduration,c,g,v)}onAudioTrackSwitching(e,t){const n=this.hls,i=2===this.altAudio;if(ot(t.url,n))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const e=this.fragCurrent;e&&(this.log("Switching to main audio track, cancel main fragment load"),e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(i)return this.fragmentTracker.removeAllFragments(),n.once(l.BUFFER_FLUSHED,(()=>{var e;null==(e=this.hls)||e.trigger(l.AUDIO_TRACK_SWITCHED,t)})),void n.trigger(l.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});n.trigger(l.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const n=ot(t.url,this.hls);if(n){const e=this.videoBuffer;e&&this.mediaBuffer!==e&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=e)}this.altAudio=n?2:0,this.tick()}onBufferCreated(e,t){const n=t.tracks;let i,r,a=!1;for(const e in n){const t=n[e];if("main"===t.id){if(r=e,i=t,"video"===e){const t=n[e];t&&(this.videoBuffer=t.buffer)}}else a=!0}a&&i?(this.log(`Alternate track found, use ${r}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:n,part:i}=t,r=n.type===p;if(r){if(this.fragContextChanged(n))return this.warn(`Fragment ${n.sn}${i?" p: "+i.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),void(this.state===bi&&(this.state=hi));const e=i?i.stats:n.stats;this.fragLastKbps=Math.round(8*e.total/(e.buffering.end-e.loading.first)),G(n)&&(this.fragPrevious=n),this.fragBufferedComplete(n,i)}const a=this.media;a&&(!this._hasEnoughToStart&&Zt.getBuffered(a).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),r&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var n;if(t.fatal)this.state=_i;else switch(t.details){case o.FRAG_GAP:case o.FRAG_PARSING_ERROR:case o.FRAG_DECRYPT_ERROR:case o.FRAG_LOAD_ERROR:case o.FRAG_LOAD_TIMEOUT:case o.KEY_LOAD_ERROR:case o.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(p,t);break;case o.LEVEL_LOAD_ERROR:case o.LEVEL_LOAD_TIMEOUT:case o.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==xi||(null==(n=t.context)?void 0:n.type)!==u||(this.state=hi);break;case o.BUFFER_ADD_CODEC_ERROR:case o.BUFFER_APPEND_ERROR:if("main"!==t.parent)return;this.resetLoadingState();break;case o.BUFFER_FULL_ERROR:if("main"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case o.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}}onFragLoadEmergencyAborted(){this.state=hi,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==j||!this.altAudio){const e=(t===q?this.videoBuffer:this.mediaBuffer)||this.media;e&&(this.afterBufferFlushed(e,t,p),this.tick())}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,-1===this.level&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let n=this.startPosition;if(n>=0&&t<n){if(e.seeking)return void this.log(`could not seek to ${n}, already seeking at ${t}`);const i=this.timelineOffset;i&&n&&(n+=i);const r=this.getLevelDetails(),a=Zt.getBuffered(e),s=a.length?a.start(0):0,o=s-n,l=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||o>0&&(o<l||this.loadingParts&&o<2*((null==r?void 0:r.partTarget)||0)))&&(this.log(`adjusting start position by ${o} to match buffer start`),n+=o,this.startPosition=n),t<n&&(this.log(`seek to target start position ${n} from current time ${t} buffer start ${s}`),e.currentTime=n)}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t=-1!==t.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then((e=>{const{hls:n}=this,i=null==e?void 0:e.frag;if(!i||this.fragContextChanged(i))return;t.fragmentError=0,this.state=hi,this.startFragRequested=!1,this.bitrateTest=!1;const r=i.stats;r.parsing.start=r.parsing.end=r.buffering.start=r.buffering.end=self.performance.now(),n.trigger(l.FRAG_LOADED,e),i.bitrateTest=!1}))}_handleTransmuxComplete(e){var t;const n=this.playlistType,{hls:r}=this,{remuxResult:a,chunkMeta:s}=e,o=this.getCurrentContext(s);if(!o)return void this.resetWhenMissingContext(s);const{frag:c,part:u,level:d}=o,{video:h,text:p,id3:f,initSegment:m}=a,{details:g}=d,v=this.altAudio?void 0:a.audio;if(this.fragContextChanged(c))this.fragmentTracker.removeFragment(c);else{if(this.state=vi,m){if(null!=m&&m.tracks){const e=c.initSegment||c;this._bufferInitSegment(d,m.tracks,e,s),r.trigger(l.FRAG_PARSING_INIT_SEGMENT,{frag:e,id:n,tracks:m.tracks})}const e=m.initPTS,t=m.timescale;i(e)&&(this.initPTS[c.cc]={baseTime:e,timescale:t},r.trigger(l.INIT_PTS_FOUND,{frag:c,id:n,initPTS:e,timescale:t}))}if(h&&g){v&&"audiovideo"===h.type&&this.logMuxedErr(c);const e=g.fragments[c.sn-1-g.startSN],t=c.sn===g.startSN,n=!e||c.cc>e.cc;if(!1!==a.independent){const{startPTS:e,endPTS:i,startDTS:r,endDTS:a}=h;if(u)u.elementaryStreams[h.type]={startPTS:e,endPTS:i,startDTS:r,endDTS:a};else if(h.firstKeyFrame&&h.independent&&1===s.id&&!n&&(this.couldBacktrack=!0),h.dropped&&h.independent){const r=this.getMainFwdBufferInfo(),s=(r?r.end:this.getLoadPosition())+this.config.maxBufferHole,o=h.firstKeyFramePTS?h.firstKeyFramePTS:e;if(!t&&s<o-this.config.maxBufferHole&&!n)return void this.backtrack(c);n&&(c.gap=!0),c.setElementaryStreamInfo(h.type,c.start,i,c.start,a,!0)}else t&&e-(g.appliedTimelineOffset||0)>2&&(c.gap=!0);c.setElementaryStreamInfo(h.type,e,i,r,a),this.backtrackFragment&&(this.backtrackFragment=c),this.bufferFragmentData(h,c,u,s,t||n)}else{if(!t&&!n)return void this.backtrack(c);c.gap=!0}}if(v){const{startPTS:e,endPTS:t,startDTS:n,endDTS:i}=v;u&&(u.elementaryStreams[j]={startPTS:e,endPTS:t,startDTS:n,endDTS:i}),c.setElementaryStreamInfo(j,e,t,n,i),this.bufferFragmentData(v,c,u,s)}if(g&&null!=f&&null!=(t=f.samples)&&t.length){const e={id:n,frag:c,details:g,samples:f.samples};r.trigger(l.FRAG_PARSING_METADATA,e)}if(g&&p){const e={id:n,frag:c,details:g,samples:p.samples};r.trigger(l.FRAG_PARSING_USERDATA,e)}}}logMuxedErr(e){this.warn(`${G(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,n,i){if(this.state!==vi)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(n));const{audio:r,video:a,audiovideo:s}=t;if(r){let n=Pe(r.codec,e.audioCodec);"mp4a"===n&&(n="mp4a.40.5");const i=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){n&&(n=-1!==n.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5");const e=r.metadata;e&&"channelCount"in e&&1!==(e.channelCount||1)&&-1===i.indexOf("firefox")&&(n="mp4a.40.5")}n&&-1!==n.indexOf("mp4a.40.5")&&-1!==i.indexOf("android")&&"audio/mpeg"!==r.container&&(n="mp4a.40.2",this.log(`Android: force audio codec to ${n}`)),e.audioCodec&&e.audioCodec!==n&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${n}"`),r.levelCodec=n,r.id=p,this.log(`Init audio buffer, container:${r.container}, codecs[selected/level/parsed]=[${n||""}/${e.audioCodec||""}/${r.codec}]`),delete t.audiovideo}if(a){a.levelCodec=e.videoCodec,a.id=p;const n=a.codec;if(4===(null==n?void 0:n.length))switch(n){case"hvc1":case"hev1":a.codec="hvc1.1.6.L120.90";break;case"av01":a.codec="av01.0.04M.08";break;case"avc1":a.codec="avc1.42e01e"}this.log(`Init video buffer, container:${a.container}, codecs[level/parsed]=[${e.videoCodec||""}/${n}]${a.codec!==n?" parsed-corrected="+a.codec:""}${a.supplemental?" supplemental="+a.supplemental:""}`),delete t.audiovideo}s&&(this.log(`Init audiovideo buffer, container:${s.container}, codecs[level/parsed]=[${e.codecs}/${s.codec}]`),delete t.video,delete t.audio);const o=Object.keys(t);if(o.length){if(this.hls.trigger(l.BUFFER_CODECS,t),!this.hls)return;o.forEach((e=>{const r=t[e].initSegment;null!=r&&r.byteLength&&this.hls.trigger(l.BUFFER_APPENDING,{type:e,data:r,frag:n,part:null,chunkMeta:i,parent:n.type})}))}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&2===this.altAudio?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,p)}get maxBufferLength(){const{levels:e,level:t}=this,n=null==e?void 0:e[t];return n?this.getMaxBufferLength(n.maxBitrate):this.config.maxBufferLength}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=hi}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&!1===e.seeking){const n=e.currentTime;if(Zt.isBuffered(e,n)?t=this.getAppendedFrag(n):Zt.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){this.backtrackFragment=null;const e=this.fragPlaying,n=t.level;e&&t.sn===e.sn&&e.level===n||(this.fragPlaying=t,this.hls.trigger(l.FRAG_CHANGED,{frag:t}),e&&e.level===n||this.hls.trigger(l.LEVEL_SWITCHED,{level:n}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){var e;if(this.fragPlaying)return this.fragPlaying;const t=(null==(e=this.media)?void 0:e.currentTime)||this.lastCurrentTime;return i(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=(null==(e=this.media)?void 0:e.currentTime)||this.lastCurrentTime;if(i(t)){const e=this.getLevelDetails(),n=this.currentFrag||(e?ct(null,e.fragments,t):null);if(n){const e=n.programDateTime;if(null!==e){const i=e+1e3*(t-n.start);return new Date(i)}}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class Mo{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const n in this.keyUriToKeyInfo){const i=this.keyUriToKeyInfo[n].loader;if(i){var t;if(e&&e!==(null==(t=i.context)?void 0:t.frag.type))return;i.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=o.KEY_LOAD_ERROR,n,i,r){return new qt({type:s.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:r,error:n,networkDetails:i})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length)if(t.length){const{sn:n,cc:i}=e;for(let e=0;e<t.length;e++){const r=t[e];if(i<=r.cc&&("initSegment"===n||"initSegment"===r.sn||n<r.sn))return this.emeController.selectKeySystemFormat(r).then((e=>{if(r.setKeyFormat(e),this.emeController&&this.config.requireKeySystemAccessOnStart){const t=bn(e);if(t)return this.emeController.getKeySystemAccess([t])}}))}}else if(this.config.requireKeySystemAccessOnStart){const e=En(this.config);if(e.length)return this.emeController.getKeySystemAccess(e)}return null}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then((t=>this.loadInternal(e,t))):this.loadInternal(e)}loadInternal(e,t){var n,i;t&&e.setKeyFormat(t);const r=e.decryptdata;if(!r){const n=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,o.KEY_LOAD_ERROR,n))}const a=r.uri;if(!a)return Promise.reject(this.createKeyLoadError(e,o.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${a}"`)));let s=this.keyUriToKeyInfo[a];if(null!=(n=s)&&n.decryptdata.key)return r.key=s.decryptdata.key,Promise.resolve({frag:e,keyInfo:s});var l;if(null!=(i=s)&&i.keyLoadPromise)switch(null==(l=s.mediaKeySessionContext)?void 0:l.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return s.keyLoadPromise.then((t=>(r.key=t.keyInfo.decryptdata.key,{frag:e,keyInfo:s})))}switch(s=this.keyUriToKeyInfo[a]={decryptdata:r,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},r.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return"identity"===r.keyFormat?this.loadKeyHTTP(s,e):this.loadKeyEME(s,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(s,e);default:return Promise.reject(this.createKeyLoadError(e,o.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${r.method}"`)))}}loadKeyEME(e,t){const n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const t=this.emeController.loadKey(n);if(t)return(e.keyLoadPromise=t.then((t=>(e.mediaKeySessionContext=t,n)))).catch((t=>{throw e.keyLoadPromise=null,t}))}return Promise.resolve(n)}loadKeyHTTP(e,t){const n=this.config,i=new(0,n.loader)(n);return t.keyLoader=e.loader=i,e.keyLoadPromise=new Promise(((r,a)=>{const s={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},l=n.keyLoadPolicy.default,c={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(e,t,n,i)=>{const{frag:s,keyInfo:l,url:c}=n;if(!s.decryptdata||l!==this.keyUriToKeyInfo[c])return a(this.createKeyLoadError(s,o.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),i));l.decryptdata.key=s.decryptdata.key=new Uint8Array(e.data),s.keyLoader=null,l.loader=null,r({frag:s,keyInfo:l})},onError:(e,n,i,r)=>{this.resetLoader(n),a(this.createKeyLoadError(t,o.KEY_LOAD_ERROR,new Error(`HTTP Error ${e.code} loading key ${e.text}`),i,w({url:s.url,data:void 0},e)))},onTimeout:(e,n,i)=>{this.resetLoader(n),a(this.createKeyLoadError(t,o.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),i))},onAbort:(e,n,i)=>{this.resetLoader(n),a(this.createKeyLoadError(t,o.INTERNAL_ABORTED,new Error("key loading aborted"),i))}};i.load(s,c,u)}))}resetLoader(e){const{frag:t,keyInfo:n,url:i}=e,r=n.loader;t.keyLoader===r&&(t.keyLoader=null,n.loader=null),delete this.keyUriToKeyInfo[i],r&&r.destroy()}}function Lo(e){const{type:t}=e;switch(t){case d:return f;case h:return m;default:return p}}function Do(e,t){let n=e.url;return void 0!==n&&0!==n.indexOf("data:")||(n=t.url),n}class Io{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(l.MANIFEST_LOADING,this.onManifestLoading,this),e.on(l.LEVEL_LOADING,this.onLevelLoading,this),e.on(l.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(l.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(l.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(l.MANIFEST_LOADING,this.onManifestLoading,this),e.off(l.LEVEL_LOADING,this.onLevelLoading,this),e.off(l.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(l.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(l.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,n=t.pLoader,i=t.loader,r=new(n||i)(t);return this.loaders[e.type]=r,r}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:n}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:c,url:n,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:n,level:i,pathwayId:r,url:a,deliveryDirectives:s,levelInfo:o}=t;this.load({id:n,level:i,pathwayId:r,responseType:"text",type:u,url:a,deliveryDirectives:s,levelOrTrack:o})}onAudioTrackLoading(e,t){const{id:n,groupId:i,url:r,deliveryDirectives:a,track:s}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:d,url:r,deliveryDirectives:a,levelOrTrack:s})}onSubtitleTrackLoading(e,t){const{id:n,groupId:i,url:r,deliveryDirectives:a,track:s}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:h,url:r,deliveryDirectives:a,levelOrTrack:s})}onLevelsUpdated(e,t){const n=this.loaders[u];if(n){const e=n.context;e&&!t.levels.some((t=>t===e.levelOrTrack))&&(n.abort(),delete this.loaders[u])}}load(e){var t;const n=this.hls.config;let r,a=this.getInternalLoader(e);if(a){const t=this.hls.logger,n=a.context;if(n&&n.levelOrTrack===e.levelOrTrack&&(n.url===e.url||n.deliveryDirectives&&!e.deliveryDirectives))return void(n.url===e.url?t.log(`[playlist-loader]: ignore ${e.url} ongoing request`):t.log(`[playlist-loader]: ignore ${e.url} in favor of ${n.url}`));t.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),a.abort()}if(r=e.type===c?n.manifestLoadPolicy.default:y({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),a=this.createInternalLoader(e),i(null==(t=e.deliveryDirectives)?void 0:t.part)){let t;if(e.type===u&&null!==e.level?t=this.hls.levels[e.level].details:e.type===d&&null!==e.id?t=this.hls.audioTracks[e.id].details:e.type===h&&null!==e.id&&(t=this.hls.subtitleTracks[e.id].details),t){const e=t.partTarget,n=t.targetduration;if(e&&n){const t=1e3*Math.max(3*e,.8*n);r=y({},r,{maxTimeToFirstByteMs:Math.min(t,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(t,r.maxTimeToFirstByteMs)})}}}const s=r.errorRetry||r.timeoutRetry||{},o={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},l={onSuccess:(e,t,n,i)=>{const r=this.getInternalLoader(n);this.resetInternalLoader(n.type);const a=e.data;0===a.indexOf("#EXTM3U")?(t.parsing.start=performance.now(),Nn.isMediaPlaylist(a)||n.type!==c?this.handleTrackOrLevelPlaylist(e,t,n,i||null,r):this.handleMasterPlaylist(e,t,n,i)):this.handleManifestParsingError(e,n,new Error("no EXTM3U delimiter"),i||null,t)},onError:(e,t,n,i)=>{this.handleNetworkError(t,n,!1,e,i)},onTimeout:(e,t,n)=>{this.handleNetworkError(t,n,!0,void 0,e)}};a.load(e,o,l)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:n}=this.hls;(e||n)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,n,i){const r=this.hls,a=e.data,s=Do(e,n),o=Nn.parseMasterPlaylist(a,s);if(o.playlistParsingError)return void this.handleManifestParsingError(e,n,o.playlistParsingError,i,t);const{contentSteering:c,levels:u,sessionData:d,sessionKeys:h,startTimeOffset:p,variableList:f}=o;this.variableList=f;const{AUDIO:m=[],SUBTITLES:g,"CLOSED-CAPTIONS":v}=Nn.parseMasterPlaylistMedia(a,s,o);if(m.length){m.some((e=>!e.url))||!u[0].audioCodec||u[0].attrs.AUDIO||(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),m.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new nn({}),bitrate:0,url:""}))}r.trigger(l.MANIFEST_LOADED,{levels:u,audioTracks:m,subtitles:g,captions:v,contentSteering:c,url:s,stats:t,networkDetails:i,sessionData:d,sessionKeys:h,startTimeOffset:p,variableList:f})}handleTrackOrLevelPlaylist(e,t,n,r,a){const s=this.hls,{id:o,level:u,type:d}=n,h=Do(e,n),p=i(u)?u:i(o)?o:0,f=Lo(n),m=Nn.parseLevelPlaylist(e.data,h,p,f,0,this.variableList);if(d===c){const e={attrs:new nn({}),bitrate:0,details:m,name:"",url:h};m.requestScheduled=t.loading.start+ei(m,0),s.trigger(l.MANIFEST_LOADED,{levels:[e],audioTracks:[],url:h,stats:t,networkDetails:r,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=m,this.handlePlaylistLoaded(m,e,t,n,r,a)}handleManifestParsingError(e,t,n,i,r){this.hls.trigger(l.ERROR,{type:s.NETWORK_ERROR,details:o.MANIFEST_PARSING_ERROR,fatal:t.type===c,url:e.url,err:n,error:n,reason:n.message,response:e,context:t,networkDetails:i,stats:r})}handleNetworkError(e,t,n=!1,i,r){let a=`A network ${n?"timeout":"error"+(i?" (status "+i.code+")":"")} occurred while loading ${e.type}`;e.type===u?a+=`: ${e.level} id: ${e.id}`:e.type!==d&&e.type!==h||(a+=` id: ${e.id} group-id: "${e.groupId}"`);const p=new Error(a);this.hls.logger.warn(`[playlist-loader]: ${a}`);let f=o.UNKNOWN,m=!1;const g=this.getInternalLoader(e);switch(e.type){case c:f=n?o.MANIFEST_LOAD_TIMEOUT:o.MANIFEST_LOAD_ERROR,m=!0;break;case u:f=n?o.LEVEL_LOAD_TIMEOUT:o.LEVEL_LOAD_ERROR,m=!1;break;case d:f=n?o.AUDIO_TRACK_LOAD_TIMEOUT:o.AUDIO_TRACK_LOAD_ERROR,m=!1;break;case h:f=n?o.SUBTITLE_TRACK_LOAD_TIMEOUT:o.SUBTITLE_LOAD_ERROR,m=!1}g&&this.resetInternalLoader(e.type);const v={type:s.NETWORK_ERROR,details:f,fatal:m,url:e.url,loader:g,context:e,error:p,networkDetails:t,stats:r};if(i){const n=(null==t?void 0:t.url)||e.url;v.response=w({url:n,data:void 0},i)}this.hls.trigger(l.ERROR,v)}handlePlaylistLoaded(e,t,n,i,r,a){const f=this.hls,{type:m,level:g,id:v,groupId:b,deliveryDirectives:y}=i,_=Do(t,i),w=Lo(i),x="number"==typeof i.level&&w===p?g:void 0;if(!e.fragments.length){const a=e.playlistParsingError=new Error("No Segments found in Playlist");return void f.trigger(l.ERROR,{type:s.NETWORK_ERROR,details:o.LEVEL_EMPTY_ERROR,fatal:!1,url:_,error:a,reason:a.message,response:t,context:i,level:x,parent:w,networkDetails:r,stats:n})}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const k=e.playlistParsingError;if(k){if(this.hls.logger.warn(k),!f.config.ignorePlaylistParsingErrors)return void f.trigger(l.ERROR,{type:s.NETWORK_ERROR,details:o.LEVEL_PARSING_ERROR,fatal:!1,url:_,error:k,reason:k.message,response:t,context:i,level:x,parent:w,networkDetails:r,stats:n});e.playlistParsingError=null}switch(e.live&&a&&(a.getCacheAge&&(e.ageHeader=a.getCacheAge()||0),a.getCacheAge&&!isNaN(e.ageHeader)||(e.ageHeader=0)),m){case c:case u:f.trigger(l.LEVEL_LOADED,{details:e,levelInfo:i.levelOrTrack||f.levels[0],level:x||0,id:v||0,stats:n,networkDetails:r,deliveryDirectives:y,withoutMultiVariant:m===c});break;case d:f.trigger(l.AUDIO_TRACK_LOADED,{details:e,track:i.levelOrTrack,id:v||0,groupId:b||"",stats:n,networkDetails:r,deliveryDirectives:y});break;case h:f.trigger(l.SUBTITLE_TRACK_LOADED,{details:e,track:i.levelOrTrack,id:v||0,groupId:b||"",stats:n,networkDetails:r,deliveryDirectives:y})}}}class Ro{static get version(){return Li}static isMSESupported(){return To()}static isSupported(){return function(){if(!To())return!1;const e=M();return"function"==typeof(null==e?void 0:e.isTypeSupported)&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some((t=>e.isTypeSupported(Ae(t,"video"))))||["mp4a.40.2","fLaC"].some((t=>e.isTypeSupported(Ae(t,"audio")))))}()}static getMediaSource(){return M()}static get Events(){return l}static get MetadataSchema(){return Qi}static get ErrorTypes(){return s}static get ErrorDetails(){return o}static get DefaultConfig(){return Ro.defaultConfig?Ro.defaultConfig:po}static set DefaultConfig(e){Ro.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new Mi,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;const t=this.logger=function(e,t,n){const i=E();if("object"==typeof console&&!0===e||"object"==typeof e){const r=["debug","log","info","warn","error"];r.forEach((t=>{i[t]=C(t,e,n)}));try{i.log(`Debug logs enabled for "${t}" in hls.js version 1.6.5`)}catch(e){return E()}r.forEach((t=>{T[t]=C(t,e)}))}else y(T,i);return i}(e.debug||!1,"Hls instance",e.assetPlayerId),n=this.config=function(e,t,n){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==t.liveMaxLatencyDurationCount&&(void 0===t.liveSyncDurationCount||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==t.liveMaxLatencyDuration&&(void 0===t.liveSyncDuration||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const i=fo(e),r=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return["manifest","level","frag"].forEach((e=>{const a=`${"level"===e?"playlist":e}LoadPolicy`,s=void 0===t[a],o=[];r.forEach((n=>{const r=`${e}Loading${n}`,l=t[r];if(void 0!==l&&s){o.push(r);const e=i[a].default;switch(t[a]={default:e},n){case"TimeOut":e.maxLoadTimeMs=l,e.maxTimeToFirstByteMs=l;break;case"MaxRetry":e.errorRetry.maxNumRetry=l,e.timeoutRetry.maxNumRetry=l;break;case"RetryDelay":e.errorRetry.retryDelayMs=l,e.timeoutRetry.retryDelayMs=l;break;case"MaxRetryTimeout":e.errorRetry.maxRetryDelayMs=l,e.timeoutRetry.maxRetryDelayMs=l}}})),o.length&&n.warn(`hls.js config: "${o.join('", "')}" setting(s) are deprecated, use "${a}": ${Qe(t[a])}`)})),w(w({},i),t)}(Ro.DefaultConfig,e,t);this.userConfig=e,n.progressive&&mo(n,t);const{abrController:i,bufferController:r,capLevelController:a,errorController:s,fpsController:o}=n,c=new s(this),u=this.abrController=new i(this),d=new Lt(this),h=n.interstitialsController,p=h?this.interstitialsController=new h(this,Ro):null,f=this.bufferController=new r(this,d),m=this.capLevelController=new a(this),g=new o(this),v=new Io(this),b=n.contentSteeringController,_=b?new b(this):null,x=this.levelController=new So(this,_),k=new xo(this),S=new Mo(this.config),A=this.streamController=new Ao(this,d,S),M=this.gapController=new go(this,d);m.setStreamController(A),g.setStreamController(A);const L=[v,x,A];p&&L.splice(1,0,p),_&&L.splice(1,0,_),this.networkControllers=L;const D=[u,f,M,m,g,k,d];this.audioTrackController=this.createController(n.audioTrackController,L);const I=n.audioStreamController;I&&L.push(this.audioStreamController=new I(this,d,S)),this.subtitleTrackController=this.createController(n.subtitleTrackController,L);const R=n.subtitleStreamController;R&&L.push(this.subtititleStreamController=new R(this,d,S)),this.createController(n.timelineController,D),S.emeController=this.emeController=this.createController(n.emeController,D),this.cmcdController=this.createController(n.cmcdController,D),this.latencyController=this.createController(ko,D),this.coreComponents=D,L.push(c);const P=c.onErrorOut;"function"==typeof P&&this.on(l.ERROR,P,c),this.on(l.MANIFEST_LOADED,v.onManifestLoaded,v)}createController(e,t){if(e){const n=new e(this);return t&&t.push(n),n}return null}on(e,t,n=this){this._emitter.on(e,t,n)}once(e,t,n=this){this._emitter.once(e,t,n)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,n=this,i){this._emitter.off(e,t,n,i)}listeners(e){return this._emitter.listeners(e)}emit(e,t,n){return this._emitter.emit(e,t,n)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(t){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+t.message+'". Here is a stacktrace:',t),!this.triggeringException){this.triggeringException=!0;const n=e===l.ERROR;this.trigger(l.ERROR,{type:s.OTHER_ERROR,details:o.INTERNAL_EXCEPTION,fatal:n,event:e,error:t}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(l.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach((e=>e.destroy())),this.networkControllers.length=0,this.coreComponents.forEach((e=>e.destroy())),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){if(!e||"media"in e&&!e.media){const t=new Error(`attachMedia failed: invalid argument (${e})`);return void this.trigger(l.ERROR,{type:s.OTHER_ERROR,details:o.ATTACH_MEDIA_ERROR,fatal:!0,error:t})}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in e,n=t?e.media:e,i=t?e:{media:n};this._media=n,this.trigger(l.MEDIA_ATTACHING,i)}detachMedia(){this.logger.log("detachMedia"),this.trigger(l.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(l.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,n=this._url,i=this._url=K.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${i}`),t&&n&&(n!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(l.MANIFEST_LOADING,{url:e})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(e=-1,t){this.logger.log(`startLoad(${e+(t?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let n=0;n<this.networkControllers.length&&(this.networkControllers[n].startLoad(e,t),this.started&&this.networkControllers);n++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].stopLoad(),!this.started&&this.networkControllers);e++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach((e=>{e.resumeBuffering&&e.resumeBuffering()})))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach((e=>{e.pauseBuffering&&e.pauseBuffering()})))}get inFlightFragments(){const e={[p]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[f]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[m]=this.subtititleStreamController.inFlightFrag),e}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const e=this._media,t=null==e?void 0:e.currentTime;this.detachMedia(),e&&(this.attachMedia(e),t&&this.startLoad(t))}removeLevel(e){this.levelController.removeLevel(e)}get sessionId(){let e=this._sessionId;return e||(e=this._sessionId=function(){try{return crypto.randomUUID()}catch(e){try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch(e){let t=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)}))}}}()),e}get levels(){const e=this.levelController.levels;return e||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){this.logger.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){this.logger.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){this.logger.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){this.logger.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return-1===e&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){this.logger.log(`set startLevel:${e}`),-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get abrEwmaDefaultEstimate(){const{bwEstimator:e}=this.abrController;return e?e.defaultEstimate:NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(this.logger.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){(function(e){return je.indexOf(e)>-1})(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return-1===this.levelController.manualLevel}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const n=e.length;for(let i=0;i<n;i++)if(e[i].maxBitrate>=t)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this;let i;if(i=-1===t&&null!=e&&e.length?e.length-1:t,n)for(let t=i;t--;){const i=e[t].attrs["HDCP-LEVEL"];if(i&&i<=n)return t}return i}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){var t;return(null==(t=this.audioTrackController)?void 0:t.setAudioOption(e))||null}setSubtitleOption(e){var t;return(null==(t=this.subtitleTrackController)?void 0:t.setSubtitleOption(e))||null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return!!e&&e.subtitleDisplay}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(e){this.latencyController.targetLatency=e}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(e){this.levelController.pathwayPriority=e}get bufferedToEnd(){var e;return!(null==(e=this.bufferController)||!e.bufferedToEnd)}get interstitialsManager(){var e;return(null==(e=this.interstitialsController)?void 0:e.interstitialsManager)||null}getMediaDecodingInfo(e,t=this.allAudioTracks){return Ue(e,tt(t),navigator.mediaCapabilities)}}Ro.defaultConfig=void 0},48136:function(e,t,n){"use strict";var i=Object.defineProperty,r=Object.defineProperties,a=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,c=(e,t,n)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,u=(e,t)=>{for(var n in t||(t={}))o.call(t,n)&&c(e,n,t[n]);if(s)for(var n of s(t))l.call(t,n)&&c(e,n,t[n]);return e},d=(e,t)=>r(e,a(t)),h=e=>"symbol"==typeof e?e:e+"",p=(e,t)=>{var n={};for(var i in e)o.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&s)for(var i of s(e))t.indexOf(i)<0&&l.call(e,i)&&(n[i]=e[i]);return n};function f(e){return Array.isArray(e)}function m(){return"window"in globalThis&&"document"in globalThis}function g(){return"function"==typeof navigator.vibrate}function v(){var e,t;if(!m())return"other";const n=null!=(t=null==(e=navigator.userAgentData)?void 0:e.platform)?t:navigator.platform;return/^mac/i.test(n)?5===navigator.maxTouchPoints?"ios":"macos":/^win/i.test(n)?"windows":/android/i.test(navigator.userAgent)?"android":/iphone|ipod|ipad/i.test(navigator.userAgent)?"ios":/\bcros\b/i.test(navigator.userAgent)?"chromeos":"other"}function b(){return HTMLElement.prototype.hasOwnProperty("popover")}var y={strings:{en:{"keyboard.tooltip.symbols":"符号","keyboard.tooltip.greek":"希腊字母","keyboard.tooltip.numeric":"数字","keyboard.tooltip.alphabetic":"罗马字母","tooltip.cut to clipboard":"剪切到剪贴板","tooltip.copy to clipboard":"复制到剪贴板","tooltip.paste from clipboard":"粘贴","tooltip.redo":"重做","tooltip.toggle virtual keyboard":"切换虚拟键盘","tooltip.undo":"撤消","menu.insert matrix":"插入矩阵","menu.borders":"矩阵分隔符","menu.array.add row above":"在后面添加行","menu.array.add row below":"在前面添加行","menu.array.add column after":"在后面添加列r","menu.array.add column before":"在前面添加列","menu.array.delete row":"删除行","menu.array.delete rows":"删除选定行","menu.array.delete column":"删除列","menu.array.delete columns":"删除选定的列","menu.mode":"模式","menu.mode-math":"数学","menu.mode-text":"文本","menu.mode-latex":"LaTeX","tooltip.blackboard":"黑板","tooltip.bold":"粗体","tooltip.italic":"斜体","tooltip.fraktur":"Fraktur","tooltip.script":"脚本","tooltip.caligraphic":"草书","tooltip.typewriter":"打字机","tooltip.roman-upright":"罗马直立","tooltip.row-by-col":"%@ × %@","menu.font-style":"字体样式","menu.accent":"重音","menu.decoration":"装饰","menu.color":"颜色","menu.background-color":"背景","menu.evaluate":"计算","menu.simplify":"简化","menu.solve":"求解","menu.solve-for":"求解 %@","menu.cut":"剪切","menu.copy":"复制","menu.copy-as-latex":"复制为 LaTeX","menu.copy-as-ascii-math":"复制为 ASCII Math","menu.copy-as-mathml":"复制为 MathML","menu.paste":"粘贴","menu.select-all":"全选","color.red":"红色","color.orange":"橙色","color.yellow":"黄色","color.lime":"绿黄色","color.green":"绿色","color.teal":"青色","color.cyan":"蓝绿色","color.blue":"蓝色","color.indigo":"靛蓝色","color.purple":"紫色","color.magenta":"洋红色","color.black":"黑色","color.dark-grey":"深灰色","color.grey":"灰色","color.light-grey":"浅灰色","color.white":"白色"}},_locale:"",_dirty:!1,_subscribers:[],_numberFormatter:void 0,get locale(){return y._locale||(y._locale=m()?navigator.language.slice(0,5):"en-US"),y._locale},set locale(e){y._locale=e,y._numberFormatter=void 0,y.dirty=!0},get numberFormatter(){return y._numberFormatter||(y._numberFormatter=new Intl.NumberFormat(y.locale)),y._numberFormatter},merge(e,t){if("string"==typeof e&&t)y.strings[e]=u(u({},y.strings[e]),t),y.dirty=!0;else for(const t of Object.keys(e))y.merge(t,e[t])},get dirty(){return y._dirty},set dirty(e){y._dirty||y._dirty===e||(y._dirty=!0,setTimeout((()=>{y._dirty=!1,this._subscribers.forEach((e=>null==e?void 0:e()))}),0))},subscribe(e){return y._subscribers.push(e),y._subscribers.length-1},unsubscribe(e){e<0||e>=y._subscribers.length||(y._subscribers[e]=void 0)},update(e){let t=e.querySelectorAll("[data-l10n-tooltip]");for(const e of t){const t=e.getAttribute("data-l10n-tooltip");if(t){const n=_(t);n&&e.setAttribute("data-tooltip",n)}}t=e.querySelectorAll("[data-l10n-arial-label]");for(const e of t){const t=e.getAttribute("data-l10n-arial-label");if(t){const n=_(t);n&&e.setAttribute("aria-label",n)}}}};function _(e,...t){if(void 0===e)return;let n="";const i=y.locale;y.strings[i]&&(n=y.strings[i][e]);const r=i.slice(0,2);if(!n&&y.strings[r]&&(n=y.strings[r][e]),n||(n=y.strings.en[e]),!n)return;const a=/(%@|%([0-9]+)\$@)/g;let s=a.exec(n),o=0;for(;s;){if(t[o++]){let e=t[s[2]?parseInt(s[2],10)-1:o-1];"number"==typeof e&&(e=y.numberFormatter.format(e)),n=n.replace(s[1],e)}s=a.exec(n)}return n=n.replace(/%%/g,"%"),n}var w={m0:"#3F3D99",m1:"#993D71",m2:"#998B3D",m3:"#3D9956",m4:"#3D5A99",m5:"#993D90",m6:"#996D3D",m7:"#43993D",m8:"#3D7999",m9:"#843D99"},x={blue:"#0072BD",orange:"#D95319",yellow:"#EDB120",purple:"#7E2F8E",green:"#77AC30",cyan:"#4DBEEE",red:"#A2142F"},k={red:"#fbbbb6",orange:"#ffe0c2",yellow:"#fff1c2",lime:"#d0e8b9",green:"#bceac4",teal:"#b9f1f1",cyan:"#b8e5c9",blue:"#b6d9fb",indigo:"#d1c2f0",purple:"#e3baf8",magenta:"#f9c8e0",black:"#353535","dark-grey":"#8C8C8C",grey:"#D0D0D0","light-grey":"#F0F0F0",white:"#ffffff"},S={red:"#d7170b",orange:"#fe8a2b",yellow:"#ffc02b",lime:"#63b215",green:"#21ba3a",teal:"#17cfcf",cyan:"#13a7ec",blue:"#0d80f2",indigo:"#63c",purple:"#a219e6",magenta:"#eb4799",black:"#000","dark-grey":"#666",grey:"#A6A6A6","light-grey":"#d4d5d2",white:"#ffffff"},E={Red:"red",Orange:"orange",Yellow:"yellow",LimeGreen:"lime",Green:"green",TealBlue:"teal",Blue:"blue",Violet:"indigo",Purple:"purple",Magenta:"magenta",Black:"black",Gray:"grey",White:"white"},C={Apricot:"#FBB982",Aquamarine:"#00B5BE",Bittersweet:"#C04F17",Black:"#221E1F",Blue:"#2D2F92",BlueGreen:"#00B3B8",BlueViolet:"#473992",BrickRed:"#B6321C",Brown:"#792500",BurntOrange:"#F7921D",CadetBlue:"#74729A",CarnationPink:"#F282B4",Cerulean:"#00A2E3",CornflowerBlue:"#41B0E4",Cyan:"#00AEEF",Dandelion:"#FDBC42",DarkOrchid:"#A4538A",Emerald:"#00A99D",ForestGreen:"#009B55",Fuchsia:"#8C368C",Goldenrod:"#FFDF42",Gray:"#949698",Green:"#00A64F",GreenYellow:"#DFE674",JungleGreen:"#00A99A",Lavender:"#F49EC4",Limegreen:"#8DC73E",Magenta:"#EC008C",Mahogany:"#A9341F",Maroon:"#AF3235",Melon:"#F89E7B",MidnightBlue:"#006795",Mulberry:"#A93C93",NavyBlue:"#006EB8",OliveGreen:"#3C8031",Orange:"#F58137",OrangeRed:"#ED135A",Orchid:"#AF72B0",Peach:"#F7965A",Periwinkle:"#7977B8",PineGreen:"#008B72",Plum:"#92268F",ProcessBlue:"#00B0F0",Purple:"#99479B",RawSienna:"#974006",Red:"#ED1B23",RedOrange:"#F26035",RedViolet:"#A1246B",Rhodamine:"#EF559F",RoyalBlue:"#0071BC",RoyalPurple:"#613F99",RubineRed:"#ED017D",Salmon:"#F69289",SeaGreen:"#3FBC9D",Sepia:"#671800",SkyBlue:"#46C5DD",SpringGreen:"#C6DC67",Tan:"#DA9D76",TealBlue:"#00AEB3",Thistle:"#D883B7",Turquoise:"#00B4CE",Violet:"#58429B",VioletRed:"#EF58A0",White:"#FFFFFF",WildStrawberry:"#EE2967",Yellow:"#FFF200",YellowGreen:"#98CC70",YellowOrange:"#FAA21A"};function T(e){var t,n,i,r,a,s;const o=e.split("!");let l,c,u,d=255,h=255,p=255,f=-1;const m=o.length>0&&o[0].startsWith("-");m&&(o[0]=o[0].slice(1));for(let e=0;e<o.length;e++){l=d,c=h,u=p;const m=null==(t=o[e].trim().match(/^([A-Za-z\d-]+)/))?void 0:t[1],g=null==m?void 0:m.toLowerCase(),v=m&&null!=(s=null!=(a=null!=(r=null!=(i=null!=(n=S[g])?n:S[E[m]])?i:x[m])?r:C[m])?a:w[m])?s:o[e].trim();let b=v.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if((null==b?void 0:b[1])&&b[2]&&b[3])d=Math.max(0,Math.min(255,Number.parseInt(b[1],16))),h=Math.max(0,Math.min(255,Number.parseInt(b[2],16))),p=Math.max(0,Math.min(255,Number.parseInt(b[3],16)));else if(b=v.match(/^#([\da-f]{3})$/i),null==b?void 0:b[1]){const e=Number.parseInt(b[1][0],16),t=Number.parseInt(b[1][1],16),n=Number.parseInt(b[1][2],16);d=Math.max(0,Math.min(255,16*e+e)),h=Math.max(0,Math.min(255,16*t+t)),p=Math.max(0,Math.min(255,16*n+n))}else{if(b=v.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i),!((null==b?void 0:b[1])&&b[2]&&b[3]))return;d=Math.max(0,Math.min(255,Number.parseInt(b[1]))),h=Math.max(0,Math.min(255,Number.parseInt(b[2]))),p=Math.max(0,Math.min(255,Number.parseInt(b[3])))}f>=0&&(d=(1-f)*d+f*l,h=(1-f)*h+f*c,p=(1-f)*p+f*u,f=-1),e+1<o.length&&(f=Math.max(0,Math.min(100,Number.parseInt(o[++e])))/100)}return f>=0&&(d=f*d+(1-f)*l,h=f*h+(1-f)*c,p=f*p+(1-f)*u),m&&(d=255-d,h=255-h,p=255-p),"#"+("00"+Math.round(d).toString(16)).slice(-2)+("00"+Math.round(h).toString(16)).slice(-2)+("00"+Math.round(p).toString(16)).slice(-2)}function A(e){var t,n;return e=e.trim(),null!=(n=null!=(t=k[e.toLowerCase()])?t:k[E[e]])?n:T(e)}function M(e,t,n){return n<0&&(n+=6),n>=6&&(n-=6),n<1?(t-e)*n+e:n<3?t:n<4?(t-e)*(4-n)+e:e}function L(e){return e<0?0:e>255?255:Math.round(e)}function D(e){let t=function(e){if(!e)return;if("#"!==e[0])return;let t;return(e=e.slice(1)).length<=4?(t={r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16)},4===e.length&&(t.a=parseInt(e[3]+e[3],16)/255)):(t={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16)},8===e.length&&(t.a=parseInt(e[6]+e[7],16)/255)),t&&void 0===t.a&&(t.a=1),t}(e);if(!t)return e;let{h:n,s:i,l:r}=function(e){let{r:t,g:n,b:i}=e;t/=255,n/=255,i/=255;const r=Math.min(t,n,i),a=Math.max(t,n,i),s=a-r;let o,l;a===r?o=0:t===a?o=(n-i)/s:n===a?o=2+(i-t)/s:i===a&&(o=4+(t-n)/s),o=Math.min(60*o,360),o<0&&(o+=360);const c=(r+a)/2;return l=a===r?0:c<=.5?s/(a+r):s/(2-a-r),{h:o,s:l,l:c}}(t);return i+=.1,r-=.1,function(e){const{r:t,g:n,b:i}=e;let r=((1<<24)+(L(t)<<16)+(L(n)<<8)+L(i)).toString(16).slice(1);return r[0]===r[1]&&r[2]===r[3]&&r[4]===r[5]&&r[6]===r[7]&&(r=r[0]+r[2]+r[4]),"#"+r}(function(e){let[t,n,i]=[e.h,e.s,e.l];t=(t+360)%360/60,i=Math.max(0,Math.min(i,1)),n=Math.max(0,Math.min(n,1));const r=i<=.5?i*(n+1):i+n-i*n,a=2*i-r;return{r:Math.round(255*M(a,r,t+2)),g:Math.round(255*M(a,r,t)),b:Math.round(255*M(a,r,t-2))}}({h:n,s:i,l:r}))}var I={60:"\\lt",62:"\\gt",111:"o",38:"\\&",123:"\\lbrace",125:"\\rbrace",91:"\\lbrack",93:"\\rbrack",58:"\\colon",160:"~",172:"\\neg",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8224:"\\dagger",8225:"\\ddagger",8230:"\\ldots",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",39:"\\prime",8592:"\\gets",8594:"\\to",9651:"\\triangle",9661:"\\triangledown",8715:"\\owns",8727:"\\ast",8739:"\\vert",8741:"\\Vert",8743:"\\land",8744:"\\lor",8901:"\\cdot",8904:"\\bowtie",8800:"\\ne",8804:"\\le",8805:"\\ge",8869:"\\bot",10231:"\\biconditional",10232:"\\impliedby",10233:"\\implies",10234:"\\iff",8450:"\\mathbb{C}",8469:"\\mathbb{N}",8473:"\\mathbb{P}",8474:"\\mathbb{Q}",8477:"\\mathbb{R}",8484:"\\mathbb{Z}",8461:"\\mathbb{H}",8476:"\\Re",8465:"\\Im",42:"\\ast",11036:"\\square",9633:"\\square",8720:"\\coprod",8716:"\\not\\ni",9671:"\\diamond",8846:"\\uplus",8851:"\\sqcap",8852:"\\sqcup",8768:"\\wr",8750:"\\oint",8226:"\\textbullet",8722:"-",978:"\\Upsilon"},R={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},P=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"main",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function O(e,t,n){if(!/[A-Za-z\d]/.test(e))return e;if("up"===n&&(n=void 0),!t&&!n)return e;const i=e.codePointAt(0);if(void 0===i)return e;for(const e of P)if((!t||e.variant===t)&&(!n||e.style===n)&&i>=e.offset&&i<e.offset+e.len){const t=e.start+i-e.offset;return String.fromCodePoint(R[t]||t)}return e}function N(e){var t;if((e<119808||e>120831)&&(e<8448||e>8527))return{char:String.fromCodePoint(e)};for(const n in R)if(R[n]===e){e=null!=(t=n.codePointAt(0))?t:0;break}for(const t of P)if(e>=t.start&&e<t.start+t.len)return{char:String.fromCodePoint(e-t.start+t.offset),variant:t.variant,style:t.style};return{char:String.fromCodePoint(e)}}function B(e){return e?Array.isArray(e)?e:"object"==typeof e&&"group"in e?e.group:[]:[]}var $,F,z,K={},U=u({},I),j={},q={},H={iff:{primitive:!0,captureSelection:!0,def:"\\;⟺\\;"},nicefrac:"^{#1}\\!\\!/\\!_{#2}",phase:{def:"\\enclose{phasorangle}{#1}",args:1,captureSelection:!1},rd:"\\mathrm{d}",rD:"\\mathrm{D}",doubleStruckCapitalN:"\\mathbb{N}",doubleStruckCapitalR:"\\mathbb{R}",doubleStruckCapitalQ:"\\mathbb{Q}",doubleStruckCapitalZ:"\\mathbb{Z}",doubleStruckCapitalP:"\\mathbb{P}",scriptCapitalE:"\\mathscr{E}",scriptCapitalH:"\\mathscr{H}",scriptCapitalL:"\\mathscr{L}",gothicCapitalC:"\\mathfrak{C}",gothicCapitalH:"\\mathfrak{H}",gothicCapitalI:"\\mathfrak{I}",gothicCapitalR:"\\mathfrak{R}",imaginaryI:"\\mathrm{i}",imaginaryJ:"\\mathrm{j}",exponentialE:"\\mathrm{e}",differentialD:"\\mathrm{d}",capitalDifferentialD:"\\mathrm{D}",mathstrut:{def:"\\vphantom{(}",primitive:!0},angl:"\\enclose{actuarial}{#1}",angln:"\\enclose{actuarial}{n}",anglr:"\\enclose{actuarial}{r}",anglk:"\\enclose{actuarial}{k}",mathtools:{primitive:!0,package:{ordinarycolon:":",vcentcolon:"\\mathrel{\\mathop\\ordinarycolon}",dblcolon:'{\\mathop{\\char"2237}}',coloneqq:'{\\mathop{\\char"2254}}',Coloneqq:'{\\mathop{\\char"2237\\char"3D}}',coloneq:'{\\mathop{\\char"3A\\char"2212}}',Coloneq:'{\\mathop{\\char"2237\\char"2212}}',eqqcolon:'{\\mathop{\\char"2255}}',Eqqcolon:'{\\mathop{\\char"3D\\char"2237}}',eqcolon:'{\\mathop{\\char"2239}}',Eqcolon:'{\\mathop{\\char"2212\\char"2237}}',colonapprox:'{\\mathop{\\char"003A\\char"2248}}',Colonapprox:'{\\mathop{\\char"2237\\char"2248}}',colonsim:'{\\mathop{\\char"3A\\char"223C}}',Colonsim:'{\\mathop{\\char"2237\\char"223C}}',colondash:"\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",Colondash:"\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}"}},ratio:"\\vcentcolon",coloncolon:"\\dblcolon",colonequals:"\\coloneq",coloncolonequals:"\\Coloneq",equalscolon:"\\eqcolon",equalscoloncolon:"\\Eqcolon",colonminus:"\\colondash",coloncolonminus:"\\Colondash",minuscolon:"\\dashcolon",minuscoloncolon:"\\Dashcolon",coloncolonapprox:"\\Colonapprox",coloncolonsim:"\\Colonsim",simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",simcoloncolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcoloncolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",notni:"\\mathrel{\\char`∌}",limsup:"\\operatorname*{lim\\,sup}",liminf:"\\operatorname*{lim\\,inf}",injlim:"\\operatorname*{inj\\,lim}",projlim:"\\operatorname*{proj\\,lim}",varlimsup:"\\operatorname*{\\overline{lim}}",varliminf:"\\operatorname*{\\underline{lim}}",varinjlim:"\\operatorname*{\\underrightarrow{lim}}",varprojlim:"\\operatorname*{\\underleftarrow{lim}}",argmin:"\\operatorname*{arg\\,min}",argmax:"\\operatorname*{arg\\,max}",plim:"\\mathop{\\operatorname{plim}}\\limits",tripledash:{def:"\\vphantom{-}\\raise{4mu}{\\mkern1.5mu\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2mu}}",expand:!0},"braket.sty":{package:{bra:{def:"\\mathinner{\\langle{#1}|}",args:1,captureSelection:!1},ket:{def:"\\mathinner{|{#1}\\rangle}",args:1,captureSelection:!1},braket:{def:"\\mathinner{\\langle{#1}\\rangle}",args:1,captureSelection:!1},set:{def:"\\mathinner{\\lbrace #1 \\rbrace}",args:1,captureSelection:!1},Bra:{def:"\\left\\langle #1\\right|",args:1,captureSelection:!1},Ket:{def:"\\left|#1\\right\\rangle",args:1,captureSelection:!1},Braket:{def:"\\left\\langle{#1}\\right\\rangle",args:1,captureSelection:!1},Set:{def:"\\left\\lbrace #1 \\right\\rbrace",args:1,captureSelection:!1}}},"amsmath.sty":{package:{varGamma:"\\mathit{\\Gamma}",varDelta:"\\mathit{\\Delta}",varTheta:"\\mathit{\\Theta}",varLambda:"\\mathit{\\Lambda}",varXi:"\\mathit{\\Xi}",varPi:"\\mathit{\\Pi}",varSigma:"\\mathit{\\Sigma}",varUpsilon:"\\mathit{\\Upsilon}",varPhi:"\\mathit{\\Phi}",varPsi:"\\mathit{\\Psi}",varOmega:"\\mathit{\\Omega}",pmod:{def:"\\quad(\\operatorname{mod}\\ #1)",args:1,expand:!1,captureSelection:!1},mod:{def:"\\quad\\operatorname{mod}\\,\\,#1",args:1,expand:!1},bmod:{def:"\\;\\mathbin{\\operatorname{mod }}",expand:!1}},primitive:!0},"texvc.sty":{package:{darr:"\\downarrow",dArr:"\\Downarrow",Darr:"\\Downarrow",lang:"\\langle",rang:"\\rangle",uarr:"\\uparrow",uArr:"\\Uparrow",Uarr:"\\Uparrow",N:"\\mathbb{N}",R:"\\mathbb{R}",Z:"\\mathbb{Z}",alef:"\\aleph",alefsym:"\\aleph",Alpha:"\\mathrm{A}",Beta:"\\mathrm{B}",bull:"\\bullet",Chi:"\\mathrm{X}",clubs:"\\clubsuit",cnums:"\\mathbb{C}",Complex:"\\mathbb{C}",Dagger:"\\ddagger",diamonds:"\\diamondsuit",empty:"\\emptyset",Epsilon:"\\mathrm{E}",Eta:"\\mathrm{H}",exist:"\\exists",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",Harr:"\\Leftrightarrow",hearts:"\\heartsuit",image:"\\Im",infin:"\\infty",Iota:"\\mathrm{I}",isin:"\\in",Kappa:"\\mathrm{K}",larr:"\\leftarrow",lArr:"\\Leftarrow",Larr:"\\Leftarrow",lrarr:"\\leftrightarrow",lrArr:"\\Leftrightarrow",Lrarr:"\\Leftrightarrow",Mu:"\\mathrm{M}",natnums:"\\mathbb{N}",Nu:"\\mathrm{N}",Omicron:"\\mathrm{O}",plusmn:"\\pm",rarr:"\\rightarrow",rArr:"\\Rightarrow",Rarr:"\\Rightarrow",real:"\\Re",reals:"\\mathbb{R}",Reals:"\\mathbb{R}",Rho:"\\mathrm{P}",sdot:"\\cdot",sect:"\\S",spades:"\\spadesuit",sub:"\\subset",sube:"\\subseteq",supe:"\\supseteq",Tau:"\\mathrm{T}",thetasym:"\\vartheta",weierp:"\\wp",Zeta:"\\mathrm{Z}"},primitive:!1}},V={" ":32,"\\!":33,"\\#":35,"\\$":36,"\\%":37,"\\&":38,"-":45,"\\textunderscore":95,"\\euro":8364,"\\maltese":10016,"\\{":123,"\\}":125,"\\textbraceleft":123,"\\textbraceright":125,"\\lbrace":123,"\\rbrace":125,"\\lbrack":91,"\\rbrack":93,"\\nobreakspace":160,"\\ldots":8230,"\\textellipsis":8230,"\\backslash":92,"`":8216,"'":8217,"``":8220,"''":8221,"\\degree":176,"\\textasciicircum":94,"\\textasciitilde":126,"\\textasteriskcentered":42,"\\textbackslash":92,"\\textbullet":8226,"\\textdollar":36,"\\textsterling":163,"\\textdagger":8224,"\\textdaggerdbl":8225,"–":8211,"—":8212,"‘":8216,"’":8217,"“":8220,"”":8221,'"':8221,"\\ss":223,"\\ae":230,"\\oe":339,"\\AE":198,"\\OE":338,"\\O":216,"\\i":305,"\\j":567,"\\aa":229,"\\AA":197},G=/[\w!@*()-=+{}\[\]\\';:?/.,~<>`|$%#&^" ]/;function Z(e,t,n="mord",i){void 0!==t&&(K[e]={definitionType:"symbol",type:n,variant:i,codepoint:t},U[t]||(U[t]=e))}function W(e,t,n){if("string"!=typeof e)for(const[i,r,a,s]of e)Z(i,r,null!=a?a:t,null!=s?s:n);else for(let t=0;t<e.length;t++){const n=e.charAt(t);Z(n,n.codePointAt(0))}}function Y(e,t){for(let n=e;n<=t;n++)Z(String.fromCodePoint(n),n)}function X(e){let t="auto";const n=e.match(/:([^=]+)/);return n&&(t=n[1].trim()),t}function J(e){if(!e)return[];const t=[];let n=e.split("]");if(n[0].startsWith("[")){t.push({isOptional:!0,type:X(n[0].slice(1))});for(let e=1;e<=n.length;e++)t.push(...J(n[e]))}else if(n=e.split("}"),n[0].startsWith("{")){t.push({isOptional:!1,type:X(n[0].slice(1))});for(let e=1;e<=n.length;e++)t.push(...J(n[e]))}return t}function Q(e){if(!e)return"";let t="",n=!0;for(const i of e)"string"==typeof i.value?t+=i.value:n=!1;return n?t:""}function ee(e,t){"string"==typeof e&&(e=[e]);const n={tabular:!1,params:[],createAtom:t};for(const t of e)q[t]=n}function te(e,t,n){"string"==typeof e&&(e=[e]);const i={tabular:!0,params:J(t),createAtom:n};for(const t of e)q[t]=i}function ne(e,t,n){var i,r;n||(n={});const a={definitionType:"function",params:J(t),ifMode:n.ifMode,isFunction:null!=(i=n.isFunction)&&i,applyMode:n.applyMode,infix:null!=(r=n.infix)&&r,parse:n.parse,createAtom:n.createAtom,applyStyle:n.applyStyle,serialize:n.serialize,render:n.render};if("string"==typeof e)j["\\"+e]=a;else for(const t of e)j["\\"+t]=a}function ie(e){return z||(z=ae(H)),e?ae(u(u({},z),e)):z}function re(e,t){var n,i,r,a;if("string"==typeof e){let r=0;const a=e;return/(^|[^\\])#1/.test(a)&&(r=1),/(^|[^\\])#2/.test(a)&&(r=2),/(^|[^\\])#3/.test(a)&&(r=3),/(^|[^\\])#4/.test(a)&&(r=4),/(^|[^\\])#5/.test(a)&&(r=5),/(^|[^\\])#6/.test(a)&&(r=6),/(^|[^\\])#7/.test(a)&&(r=7),/(^|[^\\])#8/.test(a)&&(r=8),/(^|[^\\])#9/.test(a)&&(r=9),{expand:null==(n=null==t?void 0:t.expand)||n,captureSelection:null==(i=null==t?void 0:t.captureSelection)||i,args:r,def:a}}return u({expand:null==(r=null==t?void 0:t.expand)||r,captureSelection:null==(a=null==t?void 0:t.captureSelection)||a,args:0},e)}function ae(e){if(!e)return{};const t={};for(const n of Object.keys(e)){const i=e[n];if(null==i)delete t[n];else if("object"==typeof i&&"package"in i)for(const e of Object.keys(i.package))t[e]=re(i.package[e],{expand:!i.primitive,captureSelection:i.captureSelection});else t[n]=re(i)}return t}function se(e,t="math"){if(!e||0===e.length)return null;let n=null;if(e.startsWith("\\")){if(n=j[e],n)return n.ifMode&&n.ifMode!==t?null:n;"math"===t?n=K[e]:V[e]&&(n={definitionType:"symbol",type:"mord",codepoint:V[e]})}else if("math"===t){if(n=K[e],!n&&1===e.length){const t=le("math",e.codePointAt(0));return t.startsWith("\\")?d(u({},se(t,"math")),{command:t}):null}}else V[e]?n={definitionType:"symbol",type:"mord",codepoint:V[e]}:"text"===t&&(n={definitionType:"symbol",type:"mord",codepoint:e.codePointAt(0)});return null!=n?n:null}function oe(e,t){if(!e.startsWith("\\"))return null;return t[e.slice(1)]}function le(e,t){if(void 0===t)return"";if("math"===e&&U[t])return U[t];if("text"===e){const e=Object.keys(V).find((e=>V[e]===t));return e||String.fromCodePoint(t)}return String.fromCodePoint(t)}!function(){if(!m())return!0;if(/firefox/i.test(navigator.userAgent)){const e=navigator.userAgent.match(/firefox\/(\d+)/i);if(!e)return!1;return parseInt(e[1])>=78}if(/trident/i.test(navigator.userAgent))return!1;if(/edge/i.test(navigator.userAgent)){const e=navigator.userAgent.match(/edg\/(\d+)/i);if(!e)return!1;return parseInt(e[1])>=79}return!0}()?($=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/,F=/[\da-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/):($=new RegExp("\\p{Letter}","u"),F=new RegExp("[0-9\\p{Letter}]","u"));var ce=[0,.68889,0,0,.72222],ue=[0,.68889,0,0,.66667],de=[0,.68889,0,0,.77778],he=[0,.68889,0,0,.61111],pe=[.16667,.68889,0,0,.77778],fe=[0,.68889,0,0,.55556],me=[0,0,0,0,.25],ge=[0,.825,0,0,2.33334],ve=[0,.9,0,0,2.33334],be=[0,.68889,0,0,.54028],ye=[-.03598,.46402,0,0,.5],_e=[-.13313,.36687,0,0,1],we=[.01354,.52239,0,0,1],xe=[.01354,.52239,0,0,1.11111],ke=[0,.54986,0,0,1],Se=[0,.69224,0,0,.5],Ee=[0,.43056,0,0,1],Ce=[.08198,.58198,0,0,.77778],Te=[.19444,.69224,0,0,.41667],Ae=[.1808,.675,0,0,1],Me=[.19444,.69224,0,0,.83334],Le=[.13667,.63667,0,0,1],De=[-.064,.437,0,0,1.334],Ie=[.08167,.58167,0,0,.77778],Re=[0,.69224,0,0,.72222],Pe=[0,.69224,0,0,.66667],Oe=[-.13313,.36687,0,0,.77778],Ne=[.06062,.54986,0,0,.77778],Be=[0,.69224,0,0,.77778],$e=[.25583,.75583,0,0,.77778],Fe=[.25142,.75726,0,0,.77778],ze=[.20576,.70576,0,0,.77778],Ke=[.30274,.79383,0,0,.77778],Ue=[.22958,.72958,0,0,.77778],je=[.1808,.675,0,0,.77778],qe=[.13667,.63667,0,0,.77778],He=[.13597,.63597,0,0,.77778],Ve=[.03517,.54986,0,0,.77778],Ge=[0,.675,0,0,.77778],Ze=[.19444,.69224,0,0,.61111],We=[0,.54986,0,0,.76042],Ye=[0,.54986,0,0,.66667],Xe=[.0391,.5391,0,0,.77778],Je=[.03517,.54986,0,0,1.33334],Qe=[.38569,.88569,0,0,.77778],et=[.23222,.74111,0,0,.77778],tt=[.19444,.69224,0,0,.77778],nt=[0,.37788,0,0,.5],it=[0,.54986,0,0,.72222],rt=[0,.69224,0,0,.83334],at=[.11111,.69224,0,0,.66667],st=[.26167,.75726,0,0,.77778],ot=[.48256,.98256,0,0,.77778],lt=[.28481,.79383,0,0,.77778],ct=[.08167,.58167,0,0,.22222],ut=[.08167,.58167,0,0,.38889],dt=[0,.43056,.04028,0,.66667],ht=[.41951,.91951,0,0,.77778],pt=[.24982,.74947,0,0,.38865],ft=[.08319,.58283,0,0,.75623],mt=[0,.10803,0,0,.27764],gt=[0,.47534,0,0,.50181],vt=[.18906,.47534,0,0,.50181],bt=[0,.69141,0,0,.50181],yt=[.24982,.74947,0,0,.27764],_t=[0,.69141,0,0,.21471],wt=[.25,.75,0,0,.44722],xt=[0,.64444,0,0,.575],kt=[.08556,.58556,0,0,.89444],St=[0,.69444,0,0,.89444],Et=[0,.68611,0,0,.9],Ct=[0,.68611,0,0,.86944],Tt=[.25,.75,0,0,.575],At=[.25,.75,0,0,.31944],Mt=[0,.69444,0,0,.63889],Lt=[0,.69444,0,0,.31944],Dt=[0,.44444,0,0,.63889],It=[0,.44444,0,0,.51111],Rt=[0,.69444,0,0,.575],Pt=[.13333,.63333,0,0,.89444],Ot=[0,.44444,0,0,.31944],Nt=[0,.69444,0,0,.86944],Bt=[0,.68611,0,0,.69166],$t=[0,.68611,0,0,.83055],Ft=[0,.68611,0,0,.89444],zt=[0,.69444,0,0,.60278],Kt=[.19444,.69444,0,0,.51111],Ut=[0,.69444,0,0,.83055],jt=[-.10889,.39111,0,0,1.14999],qt=[.19444,.69444,0,0,.575],Ht=[.19444,.69444,0,0,1.14999],Vt=[.19444,.69444,0,0,.70277],Gt=[.05556,.75,0,0,.575],Zt=[0,.68611,0,0,.95833],Wt=[.08556,.58556,0,0,.76666],Yt=[-.02639,.47361,0,0,.575],Xt=[0,.44444,0,0,.89444],Jt=[0,.55556,0,0,.76666],Qt=[-.10889,.39111,0,0,.89444],en=[.00222,.50222,0,0,.89444],tn=[.19667,.69667,0,0,.89444],nn=[.08556,.58556,0,0,1.14999],rn=[0,.69444,0,0,.70277],an=[-.02778,.47222,0,0,.575],sn=[.25,.75,0,0,.51111],on=[-.13889,.36111,0,0,1.14999],ln=[.19444,.69444,0,0,1.02222],cn=[.12963,.69444,0,0,.89444],un=[.19444,.69444,0,0,.44722],dn=[0,.64444,.13167,0,.59111],hn=[.19444,.64444,.13167,0,.59111],pn=[0,.68611,.17208,0,.8961],fn=[.19444,.44444,.105,0,.53222],mn=[0,.44444,.085,0,.82666],gn=[0,.69444,.06709,0,.59111],vn=[0,.69444,.12945,0,.35555],bn=[0,.69444,0,0,.94888],yn=[0,.69444,.11472,0,.59111],_n=[0,.68611,.10778,0,.88555],wn=[0,.69444,.07939,0,.62055],xn=[0,.69444,.12417,0,.30667],kn=[0,.64444,.13556,0,.51111],Sn=[.19444,.64444,.13556,0,.51111],En=[0,.68333,.16389,0,.74333],Cn=[.19444,.43056,.08847,0,.46],Tn=[0,.43056,.07514,0,.71555],An=[0,.69444,.06646,0,.51111],Mn=[0,.69444,0,0,.83129],Ln=[0,.69444,.1225,0,.51111],Dn=[0,.68333,.09403,0,.76666],In=[0,.68333,.11111,0,.76666],Rn=[0,.69444,.06961,0,.51444],Pn=[0,.69444,0,0,.27778],On=[.25,.75,0,0,.38889],Nn=[0,.64444,0,0,.5],Bn=[0,.69444,0,0,.77778],$n=[0,.68333,0,0,.75],Fn=[0,.68333,0,0,.77778],zn=[0,.68333,0,0,.68056],Kn=[0,.68333,0,0,.72222],Un=[.25,.75,0,0,.5],jn=[.25,.75,0,0,.27778],qn=[0,.69444,0,0,.5],Hn=[0,.69444,0,0,.55556],Vn=[0,.43056,0,0,.44445],Gn=[0,.43056,0,0,.5],Zn=[.19444,.43056,0,0,.55556],Wn=[0,.43056,0,0,.55556],Yn=[.08333,.58333,0,0,.77778],Xn=[0,.43056,0,0,.27778],Jn=[0,.66786,0,0,.27778],Qn=[0,.69444,0,0,.75],ei=[0,.66786,0,0,.5],ti=[0,.68333,0,0,.625],ni=[.19444,.69444,0,0,.44445],ii=[0,.69444,0,0,.72222],ri=[.19444,.69444,0,0,.5],ai=[.19444,.69444,0,0,1],si=[.011,.511,0,0,1.126],oi=[.19444,.69444,0,0,.61111],li=[.05556,.75,0,0,.5],ci=[0,.68333,0,0,.83334],ui=[.0391,.5391,0,0,.66667],di=[-.05555,.44445,0,0,.5],hi=[0,.43056,0,0,.77778],pi=[0,.55556,0,0,.66667],fi=[-.03625,.46375,0,0,.77778],mi=[-.01688,.48312,0,0,.77778],gi=[.0391,.5391,0,0,1],vi=[0,.69444,0,0,.61111],bi=[-.03472,.46528,0,0,.5],yi=[.25,.75,0,0,.44445],_i=[-.14236,.35764,0,0,1],wi=[.244,.744,0,0,.412],xi=[.19444,.69444,0,0,.88889],ki=[.12963,.69444,0,0,.77778],Si=[.19444,.69444,0,0,.38889],Ei=[.011,.511,0,0,1.638],Ci=[.19444,.69444,0,0,0],Ti=[0,.44444,0,0,.575],Ai=[.19444,.44444,0,0,.575],Mi=[0,.68611,0,0,.75555],Li=[0,.69444,0,0,.66759],Di=[0,.68611,0,0,.80555],Ii=[0,.68611,.08229,0,.98229],Ri=[0,.68611,0,0,.76666],Pi=[0,.44444,0,0,.58472],Oi=[.19444,.44444,0,0,.6118],Ni=[.19444,.43056,0,0,.5],Bi=[0,.68333,.02778,.08334,.76278],$i=[0,.68333,.08125,.05556,.83125],Fi=[0,.43056,0,.05556,.48472],zi=[.19444,.43056,0,.08334,.51702],Ki=[.25,.75,0,0,.42778],Ui=[0,.69444,0,0,.55],ji=[0,.69444,0,0,.73334],qi=[0,.69444,0,0,.79445],Hi=[0,.69444,0,0,.51945],Vi=[0,.69444,0,0,.70278],Gi=[0,.69444,0,0,.76389],Zi=[.25,.75,0,0,.34306],Wi=[0,.69444,0,0,.56111],Yi=[0,.69444,0,0,.25556],Xi=[.19444,.45833,0,0,.56111],Ji=[0,.45833,0,0,.56111],Qi=[0,.69444,0,0,.30556],er=[0,.69444,0,0,.58056],tr=[0,.69444,0,0,.67223],nr=[0,.69444,0,0,.85556],ir=[0,.69444,0,0,.55834],rr=[0,.65556,.11156,0,.5],ar=[0,.69444,.08094,0,.70834],sr=[.17014,0,0,0,.44445],or=[0,.69444,.0799,0,.5],lr=[0,.69444,0,0,.73752],cr=[0,.69444,.09205,0,.5],ur=[0,.69444,.09031,0,.77778],dr=[0,.69444,.07816,0,.27778],hr=[0,.69444,.00316,0,.5],pr=[.19444,.69444,0,0,.83334],fr=[.05556,.75,0,0,.83334],mr=[0,.75,0,0,.5],gr=[.125,.08333,0,0,.27778],vr=[0,.08333,0,0,.27778],br=[0,.65556,0,0,.5],yr=[0,.69444,0,0,.47222],_r=[0,.69444,0,0,.66667],wr=[0,.69444,0,0,.59722],xr=[0,.69444,0,0,.54167],kr=[0,.69444,0,0,.70834],Sr=[.25,.75,0,0,.28889],Er=[0,.69444,0,0,.51667],Cr=[0,.44444,0,0,.44445],Tr=[.19444,.44444,0,0,.51667],Ar=[0,.44444,0,0,.38333],Mr=[0,.44444,0,0,.51667],Lr=[0,.69444,0,0,.83334],Dr=[.35001,.85,0,0,.45834],Ir=[.35001,.85,0,0,.57778],Rr=[.35001,.85,0,0,.41667],Pr=[.35001,.85,0,0,.58334],Or=[0,.72222,0,0,.55556],Nr=[1e-5,.6,0,0,.66667],Br=[1e-5,.6,0,0,.77778],$r=[.25001,.75,0,0,.94445],Fr=[.306,.805,.19445,0,.47222],zr=[.30612,.805,.19445,0,.47222],Kr=[.25001,.75,0,0,.83334],Ur=[.35001,.85,0,0,.47222],jr=[.25001,.75,0,0,1.11111],qr=[.65002,1.15,0,0,.59722],Hr=[.65002,1.15,0,0,.81111],Vr=[.65002,1.15,0,0,.47222],Gr=[.65002,1.15,0,0,.66667],Zr=[0,.75,0,0,1],Wr=[.55001,1.05,0,0,1.27778],Yr=[.862,1.36,.44445,0,.55556],Xr=[.86225,1.36,.44445,0,.55556],Jr=[.55001,1.05,0,0,1.11111],Qr=[.65002,1.15,0,0,.52778],ea=[.65002,1.15,0,0,.61111],ta=[.55001,1.05,0,0,1.51112],na=[.95003,1.45,0,0,.73611],ia=[.95003,1.45,0,0,1.04445],ra=[.95003,1.45,0,0,.52778],aa=[.95003,1.45,0,0,.75],sa=[0,.75,0,0,1.44445],oa=[.95003,1.45,0,0,.58334],la=[1.25003,1.75,0,0,.79167],ca=[1.25003,1.75,0,0,1.27778],ua=[1.25003,1.75,0,0,.58334],da=[1.25003,1.75,0,0,.80556],ha=[0,.825,0,0,1.8889],pa=[1.25003,1.75,0,0,.63889],fa=[.64502,1.155,0,0,.875],ma=[1e-5,.6,0,0,.875],ga=[-99e-5,.601,0,0,.66667],va=[.64502,1.155,0,0,.66667],ba=[1e-5,.9,0,0,.88889],ya=[.65002,1.15,0,0,.88889],_a=[.90001,0,0,0,.88889],wa=[-.00499,.605,0,0,1.05556],xa=[0,.12,0,0,.45],ka=[0,.61111,0,0,.525],Sa=[.08333,.69444,0,0,.525],Ea=[-.08056,.53055,0,0,.525],Ca=[-.05556,.55556,0,0,.525],Ta=[0,.43056,0,0,.525],Aa=[.22222,.43056,0,0,.525],Ma=[0,0,0,0,.525],La={"AMS-Regular":{32:me,65:ce,66:ue,67:ce,68:ce,69:ue,70:he,71:de,72:de,73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:de,76:ue,77:[0,.68889,0,0,.94445],78:ce,79:pe,80:he,81:pe,82:ce,83:fe,84:ue,85:ce,86:ce,87:[0,.68889,0,0,1],88:ce,89:ce,90:ue,107:fe,160:me,165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:fe,295:be,710:ge,732:ve,770:ge,771:ve,989:Ie,1008:dt,8245:[0,.54986,0,0,.275],8463:be,8487:ce,8498:fe,8502:ue,8503:[0,.68889,0,0,.44445],8504:ue,8513:[0,.68889,0,0,.63889],8592:ye,8594:ye,8602:_e,8603:_e,8606:we,8608:we,8610:xe,8611:xe,8619:ke,8620:ke,8621:[-.13313,.37788,0,0,1.38889],8622:_e,8624:Se,8625:Se,8630:Ee,8631:Ee,8634:Ce,8635:Ce,8638:Te,8639:Te,8642:Te,8643:Te,8644:Ae,8646:Ae,8647:Ae,8648:Me,8649:Ae,8650:Me,8651:we,8652:we,8653:_e,8654:_e,8655:_e,8666:Le,8667:Le,8669:[-.13313,.37788,0,0,1],8672:De,8674:De,8705:[0,.825,0,0,.5],8708:fe,8709:Ie,8717:[0,.43056,0,0,.42917],8722:ye,8724:[.08198,.69224,0,0,.77778],8726:Ie,8733:Be,8736:Re,8737:Re,8738:[.03517,.52239,0,0,.72222],8739:ct,8740:[.25142,.74111,0,0,.27778],8741:ut,8742:[.25142,.74111,0,0,.5],8756:Pe,8757:Pe,8764:Oe,8765:[-.13313,.37788,0,0,.77778],8769:Oe,8770:fi,8774:Ke,8776:mi,8778:Ie,8782:Ne,8783:Ne,8785:Ce,8786:Ce,8787:Ce,8790:Be,8791:Ue,8796:[.08198,.91667,0,0,.77778],8806:$e,8807:$e,8808:Fe,8809:Fe,8812:[.25583,.75583,0,0,.5],8814:ze,8815:ze,8816:Ke,8817:Ke,8818:Ue,8819:Ue,8822:je,8823:je,8828:qe,8829:qe,8830:Ue,8831:Ue,8832:ze,8833:ze,8840:Ke,8841:Ke,8842:He,8843:He,8847:Ve,8848:Ve,8858:Ce,8859:Ce,8861:Ce,8862:Ge,8863:Ge,8864:Ge,8865:Ge,8872:[0,.69224,0,0,.61111],8873:Re,8874:[0,.69224,0,0,.88889],8876:he,8877:he,8878:ce,8879:ce,8882:Ve,8883:Ve,8884:qe,8885:qe,8888:[0,.54986,0,0,1.11111],8890:Zn,8891:Ze,8892:Ze,8901:[0,.54986,0,0,.27778],8903:Ie,8905:Ie,8906:Ie,8907:Be,8908:Be,8909:[-.03598,.46402,0,0,.77778],8910:We,8911:We,8912:Ve,8913:Ve,8914:Ye,8915:Ye,8916:Pe,8918:Xe,8919:Xe,8920:Je,8921:Je,8922:Qe,8923:Qe,8926:qe,8927:qe,8928:Ke,8929:Ke,8934:et,8935:et,8936:et,8937:et,8938:ze,8939:ze,8940:Ke,8941:Ke,8994:tt,8995:tt,9416:[.15559,.69224,0,0,.90222],9484:Se,9488:Se,9492:nt,9496:nt,9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:Ge,9633:Ge,9650:it,9651:it,9654:Ve,9660:it,9661:it,9664:Ve,9674:at,9733:[.19444,.69224,0,0,.94445],10003:rt,10016:rt,10731:at,10846:[.19444,.75583,0,0,.61111],10877:qe,10878:qe,10885:$e,10886:$e,10887:He,10888:He,10889:st,10890:st,10891:ot,10892:ot,10901:qe,10902:qe,10933:Fe,10934:Fe,10935:st,10936:st,10937:st,10938:st,10949:$e,10950:$e,10955:lt,10956:lt,57350:ct,57351:ut,57352:Ie,57353:dt,57356:Fe,57357:Fe,57358:ht,57359:Ke,57360:Ke,57361:ht,57366:Fe,57367:Fe,57368:Fe,57369:Fe,57370:He,57371:He},"Caligraphic-Regular":{32:me,65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:me},"Fraktur-Regular":{32:me,33:[0,.69141,0,0,.29574],34:_t,38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:pt,41:pt,42:[0,.62119,0,0,.27764],43:ft,44:mt,45:ft,46:mt,47:[.24982,.74947,0,0,.50181],48:gt,49:gt,50:gt,51:vt,52:vt,53:vt,54:bt,55:vt,56:bt,57:vt,58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:yt,93:yt,94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:me,8216:_t,8217:_t,58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:me,33:[0,.69444,0,0,.35],34:zt,35:[.19444,.69444,0,0,.95833],36:Gt,37:[.05556,.75,0,0,.95833],38:St,39:Lt,40:wt,41:wt,42:[0,.75,0,0,.575],43:Pt,44:[.19444,.15556,0,0,.31944],45:Ar,46:[0,.15556,0,0,.31944],47:Tt,48:xt,49:xt,50:xt,51:xt,52:xt,53:xt,54:xt,55:xt,56:xt,57:xt,58:Ot,59:[.19444,.44444,0,0,.31944],60:kt,61:Qt,62:kt,63:[0,.69444,0,0,.54305],64:St,65:Ct,66:[0,.68611,0,0,.81805],67:$t,68:[0,.68611,0,0,.88194],69:Mi,70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:Et,73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:Bt,77:[0,.68611,0,0,1.09166],78:Et,79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:Ct,89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:At,92:Tt,93:At,94:Rt,95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:Mt,99:It,100:Mt,101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:Mt,105:Lt,106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:Lt,109:[0,.44444,0,0,.95833],110:Dt,111:Ti,112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:Dt,118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:It,123:Tt,124:At,125:Tt,126:[.35,.34444,0,0,.575],160:me,163:[0,.69444,0,0,.86853],168:Rt,172:[0,.44444,0,0,.76666],176:Nt,177:Pt,184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:Pt,216:[.04861,.73472,0,0,.89444],223:wr,230:[0,.44444,0,0,.83055],247:Pt,248:[.09722,.54167,0,0,.575],305:Ot,338:[0,.68611,0,0,1.16944],339:Xt,567:[.19444,.44444,0,0,.35139],710:Rt,711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:Rt,715:Rt,728:Rt,729:Lt,730:Nt,732:Rt,733:Rt,915:Bt,916:Zt,920:Ft,923:Di,926:Ri,928:Et,931:$t,933:Ft,934:$t,936:Ft,937:$t,8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:Lt,8217:Lt,8220:zt,8221:zt,8224:Kt,8225:Kt,8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:Li,8465:Ut,8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:Ut,8501:rn,8592:jt,8593:qt,8594:jt,8595:qt,8596:jt,8597:Tt,8598:Ht,8599:Ht,8600:Ht,8601:Ht,8636:jt,8637:jt,8640:jt,8641:jt,8656:jt,8657:Vt,8658:jt,8659:Vt,8660:jt,8661:[.25,.75,0,0,.70277],8704:Mt,8706:[0,.69444,.06389,0,.62847],8707:Mt,8709:Gt,8711:Zt,8712:Wt,8715:Wt,8722:Pt,8723:Pt,8725:Tt,8726:Tt,8727:an,8728:Yt,8729:Yt,8730:[.18,.82,0,0,.95833],8733:Xt,8734:[0,.44444,0,0,1.14999],8736:Re,8739:At,8741:Tt,8743:Jt,8744:Jt,8745:Jt,8746:Jt,8747:[.19444,.69444,.12778,0,.56875],8764:Qt,8768:[.19444,.69444,0,0,.31944],8771:en,8776:[.02444,.52444,0,0,.89444],8781:en,8801:en,8804:tn,8805:tn,8810:nn,8811:nn,8826:kt,8827:kt,8834:kt,8835:kt,8838:tn,8839:tn,8846:Jt,8849:tn,8850:tn,8851:Jt,8852:Jt,8853:Pt,8854:Pt,8855:Pt,8856:Pt,8857:Pt,8866:rn,8867:rn,8868:St,8869:St,8900:Yt,8901:[-.02639,.47361,0,0,.31944],8902:an,8968:sn,8969:sn,8970:sn,8971:sn,8994:on,8995:on,9651:ln,9657:an,9661:ln,9667:an,9711:Ht,9824:cn,9825:cn,9826:cn,9827:cn,9837:[0,.75,0,0,.44722],9838:un,9839:un,10216:wt,10217:wt,10815:Et,10927:tn,10928:tn,57376:Ci},"Main-BoldItalic":{32:me,33:[0,.69444,.11417,0,.38611],34:wn,35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:vn,40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:dn,49:dn,50:dn,51:dn,52:hn,53:dn,54:dn,55:hn,56:dn,57:dn,58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:yn,64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:pn,73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:pn,79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:gn,95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:fn,104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:fn,114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:me,168:[0,.69444,.11473,0,.59111],176:bn,184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:mn,248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:mn,567:[.19444,.44444,.04611,0,.385],710:gn,711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:vn,730:bn,732:yn,733:yn,915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:pn,931:[0,.68611,.11431,0,.82666],933:_n,934:[0,.68611,.05632,0,.82666],936:_n,937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:vn,8217:vn,8220:[0,.69444,.16772,0,.62055],8221:wn},"Main-Italic":{32:me,33:xn,34:Rn,35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:xn,40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:kn,49:kn,50:kn,51:kn,52:Sn,53:kn,54:kn,55:Sn,56:kn,57:kn,58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:Ln,64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:En,73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:En,79:Dn,80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:En,86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:An,95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:Cn,104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:Cn,114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:me,168:[0,.66786,.10474,0,.51111],176:Mn,184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:Tn,248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:Tn,710:An,711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:Mn,732:[0,.66786,.11585,0,.51111],733:Ln,915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:Dn,923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:En,931:[0,.68333,.12028,0,.71555],933:In,934:[0,.68333,.05986,0,.71555],936:In,937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:xn,8217:xn,8220:[0,.69444,.1685,0,.51444],8221:Rn,8463:be},"Main-Regular":{32:me,33:Pn,34:qn,35:pr,36:li,37:fr,38:Bn,39:Pn,40:On,41:On,42:mr,43:Yn,44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:Un,48:Nn,49:Nn,50:Nn,51:Nn,52:Nn,53:Nn,54:Nn,55:Nn,56:Nn,57:Nn,58:Xn,59:[.19444,.43056,0,0,.27778],60:Xe,61:Oe,62:Xe,63:yr,64:Bn,65:$n,66:[0,.68333,0,0,.70834],67:Kn,68:[0,.68333,0,0,.76389],69:zn,70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:$n,73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:Fn,76:ti,77:[0,.68333,0,0,.91667],78:$n,79:Fn,80:zn,81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:Kn,85:$n,86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:$n,89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:jn,92:Un,93:jn,94:qn,95:[.31,.12056,.02778,0,.5],97:Gn,98:Hn,99:Vn,100:Hn,101:Vn,102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:Hn,105:Jn,106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:Pn,109:[0,.43056,0,0,.83334],110:Wn,111:Gn,112:Zn,113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:Wn,118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:Vn,123:Un,124:jn,125:Un,126:[.35,.31786,0,0,.5],160:me,163:[0,.69444,0,0,.76909],167:ni,168:ei,172:[0,.43056,0,0,.66667],176:Qn,177:Yn,182:oi,184:sr,198:[0,.68333,0,0,.90278],215:Yn,216:[.04861,.73194,0,0,.77778],223:qn,230:[0,.43056,0,0,.72222],247:Yn,248:[.09722,.52778,0,0,.5],305:Xn,338:[0,.68333,0,0,1.01389],339:hi,567:[.19444,.43056,0,0,.30556],710:qn,711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:qn,715:qn,728:qn,729:Jn,730:Qn,732:ei,733:qn,915:ti,916:ci,920:Fn,923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:$n,931:Kn,933:Fn,934:Kn,936:Fn,937:Kn,8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:Pn,8217:Pn,8220:qn,8221:qn,8224:ni,8225:ni,8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:be,8465:ii,8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:ii,8501:vi,8592:_e,8593:ri,8594:_e,8595:ri,8596:_e,8597:Un,8598:ai,8599:ai,8600:ai,8601:ai,8614:[.011,.511,0,0,1],8617:si,8618:si,8636:_e,8637:_e,8640:_e,8641:_e,8652:[.011,.671,0,0,1],8656:_e,8657:oi,8658:_e,8659:oi,8660:_e,8661:[.25,.75,0,0,.61111],8704:Hn,8706:[0,.69444,.05556,.08334,.5309],8707:Hn,8709:li,8711:ci,8712:ui,8715:ui,8722:Yn,8723:Yn,8725:Un,8726:Un,8727:bi,8728:di,8729:di,8730:[.2,.8,0,0,.83334],8733:hi,8734:Ee,8736:Re,8739:jn,8741:Un,8743:pi,8744:pi,8745:pi,8746:pi,8747:[.19444,.69444,.11111,0,.41667],8764:Oe,8768:[.19444,.69444,0,0,.27778],8771:fi,8773:[-.022,.589,0,0,1],8776:mi,8781:fi,8784:[-.133,.67,0,0,.778],8801:fi,8804:He,8805:He,8810:gi,8811:gi,8826:Xe,8827:Xe,8834:Xe,8835:Xe,8838:He,8839:He,8846:pi,8849:He,8850:He,8851:pi,8852:pi,8853:Yn,8854:Yn,8855:Yn,8856:Yn,8857:Yn,8866:vi,8867:vi,8868:Bn,8869:Bn,8872:[.249,.75,0,0,.867],8900:di,8901:[-.05555,.44445,0,0,.27778],8902:bi,8904:[.005,.505,0,0,.9],8942:[.03,.9,0,0,.278],8943:[-.19,.31,0,0,1.172],8945:[-.1,.82,0,0,1.282],8968:yi,8969:yi,8970:yi,8971:yi,8994:_i,8995:_i,9136:wi,9137:wi,9651:xi,9657:bi,9661:xi,9667:bi,9711:ai,9824:ki,9825:ki,9826:ki,9827:ki,9837:[0,.75,0,0,.38889],9838:Si,9839:Si,10216:On,10217:On,10222:wi,10223:wi,10229:[.011,.511,0,0,1.609],10230:Ei,10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:Ei,10815:$n,10927:He,10928:He,57376:Ci},"Math-BoldItalic":{32:me,48:Ti,49:Ti,50:Ti,51:Ai,52:Ai,53:Ai,54:xt,55:Ai,56:xt,57:Ai,65:Ct,66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:Ii,73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:Mi,77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:Li,105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:Pi,112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:me,915:[0,.68611,.15972,0,.65694],916:Zt,920:[0,.68611,.03194,0,.86722],923:Di,926:[0,.68611,.07458,0,.84125],928:Ii,931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:Ri,936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:Pi,960:[0,.44444,.03704,0,.68241],961:Oi,962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:Oi,1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:me,48:Gn,49:Gn,50:Gn,51:Ni,52:Ni,53:Ni,54:Nn,55:Ni,56:Nn,57:Ni,65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:$i,73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:Bi,80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:Fi,112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:me,915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:Bi,923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:$i,931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:Fi,960:[0,.43056,.03588,0,.57003],961:zi,962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:zi,1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:me,33:[0,.69444,0,0,.36667],34:ir,35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:Qi,40:Ki,41:Ki,42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:Ui,49:Ui,50:Ui,51:Ui,52:Ui,53:Ui,54:Ui,55:Ui,56:Ui,57:Ui,58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:Hi,64:ji,65:ji,66:ji,67:Vi,68:qi,69:[0,.69444,0,0,.64167],70:vi,71:ji,72:qi,73:[0,.69444,0,0,.33056],74:Hi,75:Gi,76:er,77:[0,.69444,0,0,.97778],78:qi,79:qi,80:Vi,81:[.10556,.69444,0,0,.79445],82:Vi,83:vi,84:ji,85:Gi,86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:ji,89:[0,.69444,.0275,0,.73334],90:tr,91:Zi,93:Zi,94:Ui,95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:Wi,99:[0,.45833,0,0,.48889],100:Wi,101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:Wi,105:Yi,106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:Yi,109:[0,.45833,0,0,.86667],110:Ji,111:[0,.45833,0,0,.55],112:Xi,113:Xi,114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:Ji,118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:me,168:Ui,176:ji,180:Ui,184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:Ui,711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:Ui,729:Qi,730:ji,732:Ui,733:Ui,915:er,916:[0,.69444,0,0,.91667],920:nr,923:tr,926:ji,928:qi,931:qi,933:nr,934:qi,936:nr,937:qi,8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:Qi,8217:Qi,8220:ir,8221:ir},"SansSerif-Italic":{32:me,33:[0,.69444,.05733,0,.31945],34:hr,35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:dr,40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:gr,45:[0,.44444,.01946,0,.33333],46:vr,47:[.25,.75,.13164,0,.5],48:rr,49:rr,50:rr,51:rr,52:rr,53:rr,54:rr,55:rr,56:rr,57:rr,58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:_r,66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:ar,73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:xr,77:[0,.69444,.08094,0,.875],78:ar,79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:or,95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:me,168:[0,.67937,.06385,0,.5],176:lr,184:sr,305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:or,711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:cr,715:qn,728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:lr,732:[0,.67659,.08826,0,.5],733:cr,915:[0,.69444,.13372,0,.54167],916:Lr,920:[0,.69444,.07555,0,.77778],923:vi,926:[0,.69444,.12816,0,.66667],928:ar,931:[0,.69444,.11983,0,.72222],933:ur,934:[0,.69444,.04603,0,.72222],936:ur,937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:dr,8217:dr,8220:[0,.69444,.14205,0,.5],8221:hr},"SansSerif-Regular":{32:me,33:[0,.69444,0,0,.31945],34:qn,35:pr,36:li,37:fr,38:[0,.69444,0,0,.75834],39:Pn,40:On,41:On,42:mr,43:Yn,44:gr,45:[0,.44444,0,0,.33333],46:vr,47:Un,48:br,49:br,50:br,51:br,52:br,53:br,54:br,55:br,56:br,57:br,58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:yr,64:_r,65:_r,66:_r,67:Mt,68:[0,.69444,0,0,.72223],69:wr,70:[0,.69444,0,0,.56945],71:_r,72:kr,73:Pn,74:yr,75:[0,.69444,0,0,.69445],76:xr,77:[0,.69444,0,0,.875],78:kr,79:[0,.69444,0,0,.73611],80:Mt,81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:Hn,84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:_r,89:[0,.69444,.025,0,.66667],90:vi,91:Sr,93:Sr,94:qn,95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:Er,99:Cr,100:Er,101:Cr,102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:Er,105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:Mr,111:[0,.44444,0,0,.5],112:Tr,113:Tr,114:[0,.44444,.01389,0,.34167],115:Ar,116:[0,.57143,0,0,.36111],117:Mr,118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:me,168:[0,.67937,0,0,.5],176:_r,184:sr,305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:qn,711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:qn,715:qn,728:qn,729:[0,.67937,0,0,.27778],730:_r,732:[0,.67659,0,0,.5],733:qn,915:xr,916:Lr,920:Bn,923:vi,926:_r,928:kr,931:ii,933:Bn,934:ii,936:Bn,937:ii,8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:Pn,8217:Pn,8220:qn,8221:qn},"Script-Regular":{32:me,65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:me},"Size1-Regular":{32:me,40:Dr,41:Dr,47:Ir,91:Rr,92:Ir,93:Rr,123:Pr,125:Pr,160:me,710:Or,732:Or,770:Or,771:Or,8214:[-99e-5,.601,0,0,.77778],8593:Nr,8595:Nr,8657:Br,8659:Br,8719:$r,8720:$r,8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:zr,8748:Fr,8749:Fr,8750:zr,8896:Kr,8897:Kr,8898:Kr,8899:Kr,8968:Ur,8969:Ur,8970:Ur,8971:Ur,9168:ga,10216:Ur,10217:Ur,10752:jr,10753:jr,10754:jr,10756:Kr,10758:Kr},"Size2-Regular":{32:me,40:qr,41:qr,47:Hr,91:Vr,92:Hr,93:Vr,123:Gr,125:Gr,160:me,710:Zr,732:Zr,770:Zr,771:Zr,8719:Wr,8720:Wr,8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:Xr,8748:Yr,8749:Yr,8750:Xr,8896:Jr,8897:Jr,8898:Jr,8899:Jr,8968:Qr,8969:Qr,8970:Qr,8971:Qr,10216:ea,10217:ea,10752:ta,10753:ta,10754:ta,10756:Jr,10758:Jr},"Size3-Regular":{32:me,40:na,41:na,47:ia,91:ra,92:ia,93:ra,123:aa,125:aa,160:me,710:sa,732:sa,770:sa,771:sa,8730:[.95003,1.45,0,0,1],8968:oa,8969:oa,8970:oa,8971:oa,10216:aa,10217:aa},"Size4-Regular":{32:me,40:la,41:la,47:ca,91:ua,92:ca,93:ua,123:da,125:da,160:me,710:ha,732:ha,770:ha,771:ha,8730:[1.25003,1.75,0,0,1],8968:pa,8969:pa,8970:pa,8971:pa,9115:fa,9116:ma,9117:fa,9118:fa,9119:ma,9120:fa,9121:va,9122:ga,9123:va,9124:va,9125:ga,9126:va,9127:ba,9128:ya,9129:_a,9130:[0,.3,0,0,.88889],9131:ba,9132:ya,9133:_a,9143:[.88502,.915,0,0,1.05556],10216:da,10217:da,57344:wa,57345:wa,57680:xa,57681:xa,57682:xa,57683:xa},"Typewriter-Regular":{32:Ma,33:ka,34:ka,35:ka,36:Sa,37:Sa,38:ka,39:ka,40:Sa,41:Sa,42:[0,.52083,0,0,.525],43:Ea,44:[.13889,.125,0,0,.525],45:Ea,46:[0,.125,0,0,.525],47:Sa,48:ka,49:ka,50:ka,51:ka,52:ka,53:ka,54:ka,55:ka,56:ka,57:ka,58:Ta,59:[.13889,.43056,0,0,.525],60:Ca,61:[-.19549,.41562,0,0,.525],62:Ca,63:ka,64:ka,65:ka,66:ka,67:ka,68:ka,69:ka,70:ka,71:ka,72:ka,73:ka,74:ka,75:ka,76:ka,77:ka,78:ka,79:ka,80:ka,81:[.13889,.61111,0,0,.525],82:ka,83:ka,84:ka,85:ka,86:ka,87:ka,88:ka,89:ka,90:ka,91:Sa,92:Sa,93:Sa,94:ka,95:[.09514,0,0,0,.525],96:ka,97:Ta,98:ka,99:Ta,100:ka,101:Ta,102:ka,103:Aa,104:ka,105:ka,106:[.22222,.61111,0,0,.525],107:ka,108:ka,109:Ta,110:Ta,111:Ta,112:Aa,113:Aa,114:Ta,115:Ta,116:[0,.55358,0,0,.525],117:Ta,118:Ta,119:Ta,120:Ta,121:Aa,122:Ta,123:Sa,124:Sa,125:Sa,126:ka,127:ka,160:Ma,176:ka,184:[.19445,0,0,0,.525],305:Ta,567:Aa,711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:ka,715:ka,728:ka,730:ka,770:ka,771:ka,776:ka,915:ka,916:ka,920:ka,923:ka,926:ka,928:ka,931:ka,933:ka,934:ka,936:ka,937:ka,8216:ka,8217:ka,8242:ka,9251:[.11111,.21944,0,0,.525]}},Da=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,Ia=10,Ra=.25,Pa=.431,Oa={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[Pa,Pa,Pa],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.5,.732,.925],num2:[.394,.384,.5],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[Ra,Ra,Ra],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04]},Na=[0,.5,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Ba={" ":" ","":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function $a(e,t){void 0===e&&(e=77);const n=La[t][e];if(n)return{defaultMetrics:!1,depth:n[0],height:n[1],italic:n[2],skew:n[3],width:n[4]};if(11034===e)return{defaultMetrics:!0,depth:.2,height:.8,italic:0,skew:0,width:.8};const i=String.fromCodePoint(e);if(i in Ba)e=Ba[i].codePointAt(0);else if(Da.test(i))return e=77,{defaultMetrics:!0,depth:.2,height:.9,italic:0,skew:0,width:1};return{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0,width:.8}}var Fa={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],longrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],longleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],longleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],longrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],longleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],longleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],longRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716],longLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},za={widehat1:[1062,239,.24],widehat2:[2364,300,.3],widehat3:[2364,360,.36],widehat4:[2364,420,.42],widecheck1:[1062,239,.24],widecheck2:[2364,300,.3],widecheck3:[2364,360,.36],widecheck4:[2364,420,.42],widetilde1:[600,260,.26],widetilde2:[1033,286,.286],widetilde3:[2339,306,.306],widetilde4:[2340,312,.34],overarc:[1061,159,.3],underarc:[1061,159,.3]},Ka={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",overarc:"M529 0c179 0 524 115 524 115 5 1 9 5 9 10 0 1-1 2-1 3l-4 22c-1 5-5 9-11 9h-2s-338-93-512-92c-174 0-513 92-513 92h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13 0 0 342-115 520-115z",underarc:"m 529 160\n c -179 0 -524 -115 -524 -115\n c -5 -1 -9 -5 -9 -10\n c 0 -1 1 -2 1 -3\n l 4 -22\n c 1 -5 5 -9 11 -9\n h 2\n s 338 93 512 92\n c 174 0 513 -92 513 -92\n h 2\n c 5 0 9 4 11 9\n l 5 22\n c 1 6 -2 12 -8 13\n c 0 0 -342 115 -520 115\n z\n ",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",widetilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",widetilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",widetilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",widetilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};var Ua,ja=8205,qa=[[ja,1],[65038,2],[127995,5],[129456,4],[917536,96]],Ha=[127462,127487];function Va(e){var t;if(void 0===Ua){Ua={};for(const e of qa)for(let t=e[0];t<=e[0]+e[1]-1;t++)Ua[t]=!0}return null!=(t=Ua[e])&&t}function Ga(e){return e>=Ha[0]&&e<=Ha[1]}function Za(e){if(/^[\u0020-\u00FF]*$/.test(e))return e;const t=[],n=function(e){const t=[];for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);if(13===i&&10===e.charCodeAt(n+1)&&(i=10,n++),13!==i&&12!==i||(i=10),0===i&&(i=65533),i>=55296&&i<=56319){const t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(i=65536+1024*(i-55296)+(t-56320),n++)}t.push(i)}return t}(e);let i=0;for(;i<n.length;){const e=n[i++],r=n[i];if(r===ja){const e=i-1;for(i+=2;n[i]===ja;)i+=2;t.push(String.fromCodePoint(...n.slice(e,i-e+1)))}else if(Va(r)){const e=i-1;for(;Va(n[i]);)i+=n[i]===ja?2:1;t.push(String.fromCodePoint(...n.slice(e,2*i-e-1)))}else Ga(e)?(i+=1,t.push(String.fromCodePoint(...n.slice(i-2,2)))):t.push(String.fromCodePoint(e))}return t}function Wa(e,t){var n,i,r,a;const s=[];let o=e.next();if(o)if("\\relax"===o);else if("\\noexpand"===o)o=e.next(),o&&s.push(o);else if("\\obeyspaces"===o)e.obeyspaces=!0;else if("\\bgroup"===o)s.push("<{>");else if("\\egroup"===o)s.push("<}>");else if("\\string"===o){if(o=e.next(),o)if(o.startsWith("\\"))for(const e of o)s.push("\\"===e?"\\backslash":e);else"<{>"===o?s.push("\\{"):"<space>"===o?s.push("~"):"<}>"===o&&s.push("\\}")}else if("\\csname"===o){for(;"<space>"===e.peek();)e.next();let r="",a=!1,l=[];do{if(0===l.length)if(/^#[\d?@]$/.test(e.peek())){const r=e.get().slice(1);l=Ya(null!=(i=null!=(n=null==t?void 0:t(r))?n:null==t?void 0:t("?"))?i:"\\placeholder{}",t),o=l[0]}else o=e.next(),l=o?[o]:[];a=0===l.length,a||"\\endcsname"!==o||(a=!0,l.shift()),a||(a="<$>"===o||"<$$>"===o||"<{>"===o||"<}>"===o||"string"==typeof o&&o.length>1&&o.startsWith("\\")),a||(r+=l.shift())}while(!a);r&&s.push("\\"+r),s.push(...l)}else if("\\endcsname"===o);else if(o.length>1&&o.startsWith("#")){const e=o.slice(1);s.push(...Ya(null!=(a=null!=(r=null==t?void 0:t(e))?r:null==t?void 0:t("?"))?a:"\\placeholder{}",t))}else s.push(o);return s}function Ya(e,t=null){const n=[];let i="";for(const t of e.toString().split(/\r?\n/)){i&&n.push(i),i=" ";const e=t.match(/((?:\\%)|[^%])*/);null!==e&&n.push(e[0])}const r=new class{constructor(e){this.obeyspaces=!1,this.pos=0,this.s=Za(e)}end(){return this.pos>=this.s.length}get(){return this.pos<this.s.length?this.s[this.pos++]:""}peek(){return this.s[this.pos]}match(e){const t="string"==typeof this.s?e.exec(this.s.slice(this.pos)):e.exec(this.s.slice(this.pos).join(""));return(null==t?void 0:t[0])?(this.pos+=t[0].length,t[0]):""}next(){if(this.end())return null;if(!this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]+/))return"<space>";if(this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]/))return"<space>";const e=this.get();if("\\"===e){if(!this.end()){let e=this.match(/^[a-zA-Z\*]+/);return e?this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]*/):e=this.get(),"\\"+e}}else{if("{"===e)return"<{>";if("}"===e)return"<}>";if("^"===e){if("^"===this.peek()){this.get();const e=this.match(/^(\^(\^(\^(\^[\da-f])?[\da-f])?[\da-f])?[\da-f])?[\da-f]{2}/);if(e)return String.fromCodePoint(Number.parseInt(e.slice(e.lastIndexOf("^")+1),16))}return e}if("#"===e){if(!this.end()){let e=!1;if(/[\d?@]/.test(this.peek())&&(e=!0,this.pos+1<this.s.length)){const t=this.s[this.pos+1];e=/[^\dA-Za-z]/.test(t)}return e?"#"+this.get():"#"}}else if("$"===e)return"$"===this.peek()?(this.get(),"<$$>"):"<$>"}return e}}(function(e){var t;let n="";for(const i of e){if("{}<>[]$&#^_%:'˜".includes(i)){n+=i;continue}const e=null!=(t=i.codePointAt(0))?t:0;let r=I[e];if(r)r.startsWith("\\")?n+=r+" ":n+=r;else{const{char:t,variant:i,style:a}=N(e);switch(r=t,i){case"double-struck":r=`\\mathbb{${r}}`;break;case"fraktur":r=`\\mathfrak{${r}}`;break;case"script":r=`\\mathscr{${r}}`;break;case"sans-serif":r=`\\mathsf{${r}}`;break;case"monospace":r=`\\mathtt{${r}}`;break;case"calligraphic":r=`\\mathcal{${r}}`}switch(a){case"bold":r=`\\mathbf{${r}}`;break;case"italic":r=`\\mathit{${r}}`;break;case"bolditalic":r=`\\mathbfit{${r}}`}n+=r}}return n}(n.join(""))),a=[];do{a.push(...Wa(r,t))}while(!r.end());return a}function Xa(e){let t="";const n=[];for(const i of e)i&&(t&&/^[a-zA-Z\*]/.test(i)&&n.push(t),n.push(i),/^\\[a-zA-Z]+\*?[\"\'][^\ ]+$/.test(i)&&n.push(" "),t=/\\[a-zA-Z]+\*?$/.test(i)?" ":"");return n.join("")}function Ja(e,...t){return console.assert(e.startsWith("\\")),0===t.length?e:Xa([e,...t.map((e=>`{${e}}`))])}function Qa(e){return Xa(e.map((e=>{var t;return null!=(t={"<space>":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[e])?t:e})))}var es=class e{constructor(t){e._registry[t]=this}static createAtom(t,n,i){return e._registry[t].createAtom(n,se(n,t),i)}static serialize(t,n){var i;if(!t||0===t.length)return"";if(null!=(i=n.skipStyles)&&i){const i=[];for(const r of ns(t)){const t=e._registry[r[0].mode];i.push(...t.serialize(r,n))}return Xa(i)}return Xa(function(e,t){if(0===e.length)return[];const{parent:n}=e[0],i=null==n?void 0:n.computedStyle.fontSize,r=[];for(const a of is(e,"fontSize")){const e=a[0].computedStyle.fontSize,s=as(a,t);s&&(!e||"auto"===e||n&&i===e?r.push(...s):r.push(["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][e],...s))}return r}(t,n))}static getFont(t,n,i){return e._registry[t].getFont(n,i)}};es._registry={};var ts=es;function ns(e){const t=[];let n=[],i="NONE";for(const r of e)"first"!==r.type&&(r.mode!==i?(n.length>0&&t.push(n),n=[r],i=r.mode):n.push(r));return n.length>0&&t.push(n),t}function is(e,t){const n=[];let i,r=[];for(const a of e)if("first"!==a.type&&a.style){let e;"variant"===t?(e=a.style.variant,a.style.variantStyle&&"up"!==a.style.variantStyle&&(e+="-"+a.style.variantStyle)):e=a.style[t],e===i?r.push(a):(r.length>0&&n.push(r),r=[a],i=e)}return r.length>0&&n.push(r),n}function rs(e,t){var n;const{parent:i}=e[0],r=null==i?void 0:i.computedStyle.color,a=[];for(const s of ns(e)){const e=t.defaultMode;for(const o of is(s,"color")){const s=o[0].computedStyle,l=ts._registry[o[0].mode].serialize(o,d(u({},t),{defaultMode:"text"===e?"text":"math"}));t.skipStyles||!s.color||"none"===s.color||i&&r===s.color?a.push(Xa(l)):a.push(Ja("\\textcolor",null!=(n=s.verbatimColor)?n:s.color,Xa(l)))}}return a}function as(e,t){const{parent:n}=e[0],i=null==n?void 0:n.computedStyle.backgroundColor;return is(e,"backgroundColor").map((e=>{var r;if(e.length>0||"box"!==e[0].type){const a=e[0].computedStyle;if(a.backgroundColor&&"none"!==a.backgroundColor&&(!n||i!==a.backgroundColor))return Ja("\\colorbox",null!=(r=a.verbatimBackgroundColor)?r:a.backgroundColor,Xa(rs(e,d(u({},t),{defaultMode:"text"}))))}return Xa(rs(e,t))}))}function ss(e){if(!e)return;return{mord:"ord",mbin:"bin",mop:"op",mrel:"rel",mopen:"open",mclose:"close",mpunct:"punct",minner:"inner",spacing:"ignore",latex:"latex",composition:"inner",error:"inner",placeholder:"ord",supsub:"ignore"}[e]}function os(e){if(0===e.length)return"ord";const t=ss(e[0].type),n=ss(e[e.length-1].type);return t&&t===n?t:"ord"}function ls(e,t){if("string"==typeof e)return e;if("number"==typeof e){console.assert(Number.isFinite(e));const n=Math.ceil(100*e)/100;return 0===n?"0":n.toString()+(null!=t?t:"")}return""}var cs=class e{constructor(t,n){var i,r,a,s,o;if("number"==typeof t?this.value=String.fromCodePoint(t):"string"==typeof t?this.value=t:f(t)?this.children=t.filter((e=>null!==e)):t&&t instanceof e&&(this.children=[t]),this.children)for(const e of this.children)e.parent=this;this.type=null!=(i=null==n?void 0:n.type)?i:"ignore",this.isSelected=!0===(null==n?void 0:n.isSelected),(null==n?void 0:n.caret)&&(this.caret=n.caret),this.classes=null!=(r=null==n?void 0:n.classes)?r:"",this.isTight=null!=(a=null==n?void 0:n.isTight)&&a,(null==n?void 0:n.attributes)&&(this.attributes=n.attributes);let l=null==n?void 0:n.fontFamily;(null==n?void 0:n.style)&&this.value&&(l=null!=(o=ts.getFont(null!=(s=n.mode)?s:"math",this,d(u({variant:"normal"},n.style),{letterShapeStyle:n.letterShapeStyle})))?o:void 0),l||(l="Main-Regular"),this._height=0,this._depth=0,this._width=0,this.hasExplicitWidth=!1,this.skew=0,this.italic=0,this.maxFontSize=0,this.scale=1,void 0!==(null==n?void 0:n.maxFontSize)&&(this.maxFontSize=n.maxFontSize),function(e,t){var n;if("latex"===e.type)return e.height=.9,e.depth=.2,void(e._width=1);if(e.value){e.height=-1/0,e.depth=-1/0,e._width=0,e.skew=-1/0,e.italic=-1/0;for(let n=0;n<e.value.length;n++){const i=$a(e.value.codePointAt(n),t);e.height=Math.max(e.height,i.height),e.depth=Math.max(e.depth,i.depth),e._width+=i.width,e.skew=i.skew,e.italic=i.italic}return}if(e.children&&e.children.length>0){let t=-1/0,i=-1/0,r=0;for(const a of e.children)a.height>t&&(t=a.height),a.depth>i&&(i=a.depth),r=Math.max(r,null!=(n=a.maxFontSize)?n:0);e.height=t,e.depth=i,e._width=e.children.reduce(((e,t)=>e+t.width),0),e.maxFontSize=r}}(this,l)}set atomID(e){void 0!==e&&0!==e.length&&(this.id=e)}selected(e){if(this.isSelected!==e&&(this.isSelected=e,this.children))for(const t of this.children)t.selected(e)}setStyle(e,t,n){if(void 0===t)return;const i=ls(t,n);i.length>0&&(this.cssProperties||(this.cssProperties={}),this.cssProperties[e]=i)}setTop(e){Number.isFinite(e)&&Math.abs(e)>.01&&(this.cssProperties||(this.cssProperties={}),this.cssProperties.top=ls(e,"em"),this.height-=e,this.depth+=e)}get left(){var e;return(null==(e=this.cssProperties)?void 0:e["margin-left"])?Number.parseFloat(this.cssProperties["margin-left"]):0}set left(e){Number.isFinite(e)&&(0===e?this.cssProperties&&delete this.cssProperties["margin-left"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-left"]=ls(e,"em")))}set right(e){Number.isFinite(e)&&(0===e?this.cssProperties&&delete this.cssProperties["margin-right"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-right"]=ls(e,"em")))}set bottom(e){Number.isFinite(e)&&(0===e?this.cssProperties&&delete this.cssProperties["margin-bottom"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-bottom"]=ls(e,"em")))}get width(){return this._width*this.scale}set width(e){this._width=e,this.hasExplicitWidth=!0}set softWidth(e){}get height(){return this._height*this.scale}set height(e){this._height=e}get depth(){return this._depth*this.scale}set depth(e){this._depth=e}wrap(e){const t=e.parent;if(!t)return this;e.isPhantom&&this.setStyle("opacity",0);const n=e.color;n&&n!==t.color&&this.setStyle("color",n);let i=e.backgroundColor;this.isSelected&&(i=D(i)),i&&i!==t.backgroundColor&&(this.setStyle("background-color",i),this.setStyle("display","inline-block"));const r=e.scalingFactor;return this.scale=r,this.skew*=r,this.italic*=r,this}toMarkup(){var e,t,n,i;let r=null!=(e=this.value)?e:"";if(this.children)for(const e of this.children)r+=e.toMarkup();let a="";if(this.svgBody)a=function(e){if(za[e]){const[t,n,i]=za[e],r=`<span class="stretchy" style="height:${i}em"><svg width="100%" height="${i}em" viewBox="0 0 ${t} ${n}" preserveAspectRatio="none" ><path fill="currentcolor" d="${Ka[e]}"></path></svg></span>`;return`<span style="display:inline-block;height:${Math.floor(100*i/2)/100}em;min-width:0">${r}</span>`}const[t,n,i,r]=Fa[e];let a,s;const o=i/1e3;3===t.length?(a=["slice-1-of-3","slice-2-of-3","slice-3-of-3"],s=["xMinYMin","xMidYMin","xMaxYMin"]):2===t.length?(a=["slice-1-of-2","slice-2-of-2"],s=["xMinYMin","xMaxYMin"]):(a=["slice-1-of-1"],s=[r]);const l=t.map(((e,t)=>`<span class="${a[t]}" style=height:${o}em><svg width=400em height=${o}em viewBox="0 0 400000 ${i}" preserveAspectRatio="${s[t]} slice"><path fill="currentcolor" d="${Ka[e]}"></path></svg></span>`)).join("");return`<span style="display:inline-block;height:${o}em;min-width:${n}em;">${l}</span>`}(this.svgBody);else if(this.svgOverlay){a='<span style="',a+="display: inline-block;",a+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`,a+=`vertical-align:${Math.floor(100*this.depth)/100}em;`,a+='">',a+=r,a+="</span>",a+='<svg style="position:absolute;overflow:visible;',a+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`;const e=null==(t=this.cssProperties)?void 0:t.padding;e?(a+=`top:${e};`,a+=`left:${e};`,a+=`width:calc(100% - 2 * ${e} );`):a+="top:0;left:0;width:100%;",a+="z-index:2;",a+='"',this.svgStyle&&(a+=this.svgStyle),a+=` viewBox="0 0 ${Math.floor(100*this.width)/100} ${Math.floor(100*(this.height+this.depth))/100}"`,a+=`>${this.svgOverlay}</svg>`}let s="";const o=this.classes.split(" ");o.push(null!=(n={latex:"ML__raw-latex",placeholder:"ML__placeholder",error:"ML__error"}[this.type])?n:""),"latex"===this.caret&&o.push("ML__latex-caret"),this.isSelected&&o.push("ML__selected");const l=1===o.length?o[0]:o.filter(((e,t,n)=>e.length>0&&n.indexOf(e)===t)).join(" ");if(l.length>0&&(s+=` class="${l}"`),this.id&&(s+=` data-atom-id=${this.id}`),this.cssId&&(s+=` id="${this.cssId.replace(/ /g,"-")}" `),this.attributes&&(s+=" "+Object.keys(this.attributes).map((e=>`${e}="${this.attributes[e]}"`)).join(" ")),this.htmlData){const e=this.htmlData.split(",");for(const t of e){const e=t.match(/([^=]+)=(.+$)/);if(e){const t=e[1].trim().replace(/ /g,"-");t&&(s+=` data-${t}="${e[2]}" `)}else{const e=t.trim().replace(/ /g,"-");e&&(s+=` data-${e} `)}}}const c=null!=(i=this.cssProperties)?i:{};this.hasExplicitWidth&&void 0===c.width&&(c.width=Math.ceil(100*this._width)/100+"em");const u=Object.keys(c).map((e=>`${e}:${c[e]}`));if(void 0!==this.scale&&1!==this.scale&&(r.length>0||a.length>0)&&u.push(`font-size: ${Math.ceil(1e4*this.scale)/100}%`),this.htmlStyle){const e=this.htmlStyle.split(";");let t="";for(const n of e){const e=n.match(/([^=]+):(.+$)/);if(e){const n=e[1].trim().replace(/ /g,"-");n&&(t+=`${n}:${e[2]};`)}}t&&(s+=` style="${t}"`)}u.length>0&&(s+=` style="${u.join(";")}"`);let d="";return d=s.length>0||a.length>0?`<span${s}>${r}${a}</span>`:r,"text"===this.caret?d+='<span class="ML__text-caret"></span>':"math"===this.caret&&(d+='<span class="ML__caret"></span>'),d}tryCoalesceWith(e){if(this.svgBody||!this.value)return!1;if(e.svgBody||!e.value)return!1;const t=this.children&&this.children.length>0,n=e.children&&e.children.length>0;if(t||n)return!1;if(e.cssProperties||this.cssProperties)for(const t of["border","border-left","border-right","border-right-width","left","margin","margin-left","margin-right","padding","position","width"]){if(e.cssProperties&&t in e.cssProperties)return!1;if(this.cssProperties&&t in this.cssProperties)return!1}const i=this.cssProperties?Object.keys(this.cssProperties).length:0;if(i!==(e.cssProperties?Object.keys(e.cssProperties).length:0))return!1;if(i>0)for(const t of Object.keys(this.cssProperties))if(this.cssProperties[t]!==e.cssProperties[t])return!1;const r=this.classes.trim().replace(/\s+/g," ").split(" "),a=e.classes.trim().replace(/\s+/g," ").split(" ");if(r.length!==a.length)return!1;r.sort(),a.sort();for(const[e,t]of r.entries()){if("vertical-separator"===t)return!1;if(t!==a[e])return!1}return this.value+=e.value,this.height=Math.max(this.height,e.height),this.depth=Math.max(this.depth,e.depth),this._width=this._width+e._width,this.maxFontSize=Math.max(this.maxFontSize,e.maxFontSize),this.italic=e.italic,!0}};function us(e){if(!e||0===e.length)return[];e[0].children=us(e[0].children);const t=[e[0]];for(let n=1;n<e.length;n++)t[t.length-1].tryCoalesceWith(e[n])||(e[n].children=us(e[n].children),t.push(e[n]));return t}function ds(e){return e.children&&(e.children=us(e.children)),e}function hs(e,t){if(!e)return new cs(null,t);const n=new cs(null,{classes:"ML__strut",type:"ignore"});n.setStyle("height",Math.max(0,e.height),"em");const i=[n];if(0!==e.depth){const t=new cs(null,{classes:"ML__strut--bottom",type:"ignore"});t.setStyle("height",e.height+e.depth,"em"),t.setStyle("vertical-align",-e.depth,"em"),i.push(t)}return i.push(e),new cs(i,d(u({},t),{type:"lift"}))}function ps(e){const t=function(e){return Fa[e]?Fa[e][2]/1e3:za[e][2]}(e)/2,n=new cs(null,{maxFontSize:0});return n.height=t+.166,n.depth=t-.166,n.svgBody=e,n}function fs(e){var t;const[n,i]=function(e){if("individualShift"in e){const t=e.individualShift;let n=t[0];const i=[n],r=-n.shift-n.box.depth;let a=r;for(let e=1;e<t.length;e++){const r=t[e],s=-r.shift-a-r.box.depth,o=s-(n.box.height+n.box.depth);a+=s,i.push(o),i.push(r),n=r}return[i,r]}if("top"in e){let t=e.top;for(const n of e.children)t-="number"==typeof n?n:n.box.height+n.box.depth;return[e.children,t]}if("bottom"in e)return[e.children,-e.bottom];if("firstBaseline"in e){const t=e.firstBaseline[0];if("number"==typeof t)throw new Error("First child must be an element.");return[e.firstBaseline,-t.box.depth]}if("shift"in e){const t=e.children[0];if("number"==typeof t)throw new Error("First child must be an element.");return[e.children,-t.box.depth-e.shift]}return[null,0]}(e);if(!n)return[[],0,0];const r=new cs(null,{classes:"pstrut"});let a=0;for(const e of n)if("number"!=typeof e){const t=e.box;a=Math.max(a,t.maxFontSize,t.height)}a+=2,r.height=a,r.setStyle("height",a,"em");const s=[];let o=i,l=i,c=i,u=0;for(const e of n){if("number"==typeof e)c+=e;else{const n=e.box,i=null!=(t=e.classes)?t:[],o=new cs([r,n],{classes:i.join(" "),style:e.style});n.setStyle("height",n.height+n.depth,"em"),n.setStyle("display","inline-block"),o.setStyle("top",-a-c-n.depth,"em"),e.marginLeft&&o.setStyle("margin-left",e.marginLeft,"em"),e.marginRight&&o.setStyle("margin-right",e.marginRight,"em"),s.push(o),c+=n.height+n.depth,u=Math.max(u,o.width)}o=Math.min(o,c),l=Math.max(l,c)}s.forEach((e=>{e.softWidth=u}));const d=new cs(s,{classes:"vlist"});if(d.softWidth=u,d.height=l,d.setStyle("height",l,"em"),o>=0)return[[new cs(d,{classes:"vlist-r"})],l,-o];const h=new cs(new cs(null),{classes:"vlist"});h.height=-o,h.setStyle("height",-o,"em");const p=new cs(8203,{classes:"vlist-s",maxFontSize:0});return p.softWidth=0,p.height=0,p.depth=0,[[new cs([d,p],{classes:"vlist-r"}),new cs(h,{classes:"vlist-r"})],l,-o]}var ms=class extends cs{constructor(e,t){var n;const[i,r,a]=fs(e);super(1===i.length?i[0]:i,{type:null==t?void 0:t.type,classes:(null!=(n=null==t?void 0:t.classes)?n:"")+" vlist-t"+(2===i.length?" vlist-t2":"")}),this.height=r,this.depth=a,this.softWidth=i.reduce(((e,t)=>Math.max(e,t.width)),0)}};var gs=class{constructor(e,t,n){this.id=e,this.sizeDelta=t,this.cramped=n;const i={"-4":2,"-3":1,0:0}[t];this.metrics=Object.keys(Oa).reduce(((e,t)=>d(u({},e),{[t]:Oa[t][i]})),{})}getFontSize(e){return Math.max(1,e+this.sizeDelta)}get sup(){return bs[[0,1,0,1,2,3,2,3][this.id]]}get sub(){return bs[[0,0,0,0,2,2,2,2][this.id]]}get fracNum(){return bs[[0,1,0,1,2,3,4,5][this.id]]}get fracDen(){return bs[[0,0,0,0,2,2,4,4][this.id]]}get cramp(){return bs[[0,0,2,2,4,4,6,6][this.id]]}get isTight(){return this.sizeDelta<0}},vs={7:new gs(7,0,!1),6:new gs(6,0,!0),5:new gs(5,0,!1),4:new gs(4,0,!0),3:new gs(3,-3,!1),2:new gs(2,-3,!0),1:new gs(1,-4,!1),0:new gs(0,-4,!0)},bs=d(u({},vs),{displaystyle:vs[7],textstyle:vs[5],scriptstyle:vs[3],scriptscriptstyle:vs[1]});function ys(e,t){var n;if(!e)return 0;const i={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:3/4,em:Ia,bp:1.00375,dd:1238/1157,pc:12,in:72.27,mu:10/18}[null!=(n=e.unit)?n:"pt"];if(Number.isFinite(t)){const n=10**t;return Math.round(e.dimension/Ia*i*n)/n}return e.dimension*i}function _s(e,t){if(null===e)return 0;const n=ys(e)/Ia;if(Number.isFinite(t)){const e=10**t;return Math.round(n*e)/e}return n}function ws(e){var t;return`${e.dimension}${null!=(t=e.unit)?t:"pt"}`}function xs(e){var t,n;if(null==e)return null;let i="";if("dimension"in e&&(i=`${e.dimension}${null!=(t=e.unit)?t:"pt"}`),"glue"in e&&(i=function(e){let t=ws(e.glue);return e.grow&&0!==e.grow.dimension&&(t+=` plus ${ws(e.grow)}`),e.shrink&&0!==e.shrink.dimension&&(t+=` minus ${ws(e.shrink)}`),t}(e)),"number"in e)if("base"in e&&"decimal"!==e.base)if("alpha"===e.base)i=`\`${String.fromCodePoint(e.number)}`;else{const t=Math.round(e.number)>>>0;"hexadecimal"===e.base?(i=Number(t).toString(16).toUpperCase(),i=t<=255?i.padStart(2,"0"):t<=65535?i.padStart(4,"0"):t<=16777215?i.padStart(6,"0"):i.padStart(8,"0"),i=`"${i}`):"octal"===e.base&&(i=Number(t).toString(8),i=t<=63?i.padStart(2,"0"):t<=30583?i.padStart(4,"0"):i.padStart(8,"0"),i=`'${i}`)}else i=Number(e.number).toString();return"register"in e&&("factor"in e&&(-1===e.factor?i="-":1!==e.factor&&(i=Number(e.factor).toString())),"global"in e&&e.global&&(i+="\\global"),i+=`\\${e.register}`),"string"in e&&(i=e.string),null!=(n=e.relax)&&n&&(i+="\\relax"),i}function ks(e,t){return null==e?null:"number"in e?d(u({},e),{number:e.number*t}):"register"in e?"factor"in e&&e.factor?d(u({},e),{factor:e.factor*t}):d(u({},e),{factor:t}):"dimension"in e?d(u({},e),{dimension:e.dimension*t}):"glue"in e?e.shrink&&e.grow?{glue:ks(e.glue,t),shrink:ks(e.shrink,t),grow:ks(e.grow,t)}:e.shrink?{glue:ks(e.glue,t),shrink:ks(e.shrink,t)}:e.grow?{glue:ks(e.glue,t),grow:ks(e.grow,t)}:{glue:ks(e.glue,t)}:null}var Ss={"p@":{dimension:1},"z@":{dimension:0},maxdimen:{dimension:16383.99999},hfuzz:{dimension:.1},vfuzz:{dimension:.1},overfullrule:{dimension:5},hsize:{dimension:6.5,unit:"in"},vsize:{dimension:8.9,unit:"in"},parindent:{dimension:20},maxdepth:{dimension:4},splitmaxdepth:{register:"maxdimen"},boxmaxdepth:{register:"maxdimen"},delimitershortfall:{dimension:5},nulldelimiterspace:{dimension:1.2,unit:"pt"},scriptspace:{dimension:.5},topskip:{dimension:10},splittopskip:{dimension:10},normalbaselineskip:{dimension:12},normallineskip:{dimension:1},normallineskiplimit:{dimension:0},jot:{dimension:3},doublerulesep:{dimension:2},arrayrulewidth:{dimension:.4},arraycolsep:{dimension:5},fboxsep:{dimension:3},fboxrule:{dimension:.4},"z@skip":{glue:{dimension:0},shrink:{dimension:0},grow:{dimension:0}},hideskip:{glue:{dimension:-1e3},grow:{dimension:1,unit:"fill"}},"@flushglue":{glue:{dimension:0},grow:{dimension:1,unit:"fill"}},parskip:{glue:{dimension:0},grow:{dimension:1}},abovedisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},abovedisplayshortskip:{glue:{dimension:0},grow:{dimension:3}},belowdisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},belowdisplayshortskip:{glue:{dimension:7},grow:{dimension:3},shrink:{dimension:4}},parfillskip:{glue:{dimension:0},grow:{dimension:1,unit:"fil"}},thinmuskip:{glue:{dimension:3,unit:"mu"}},medmuskip:{glue:{dimension:4,unit:"mu"},grow:{dimension:2,unit:"mu"},shrink:{dimension:4,unit:"mu"}},thickmuskip:{glue:{dimension:5,unit:"mu"},grow:{dimension:5,unit:"mu"}},smallskipamount:{glue:{dimension:3},grow:{dimension:1},shrink:{dimension:1}},medskipamount:{glue:{dimension:6},grow:{dimension:2},shrink:{dimension:3}},bigskipamount:{glue:{dimension:12},grow:{dimension:2},shrink:{dimension:4}},pretolerance:100,tolerance:200,hbadness:1e3,vbadness:1e3,linepenalty:10,hyphenpenalty:50,exhyphenpenalty:50,binoppenalty:700,relpenalty:500,clubpenalty:150,widowpenalty:150,displaywidowpenalty:50,brokenpenalty:100,predisplaypenalty:1e4,doublehyphendemerits:1e4,finalhyphendemerits:5e3,adjdemerits:1e4,tracinglostchars:1,uchyph:1,delimiterfactor:901,defaulthyphenchar:"\\-",defaultskewchar:-1,newlinechar:-1,showboxbreadth:5,showboxdepth:3,errorcontextlines:5,interdisplaylinepenalty:100,interfootnotelinepenalty:100,baselineSkip:1.2,arraystretch:1,month:(new Date).getMonth()+1,day:(new Date).getDate(),year:(new Date).getFullYear()};function Es(){return u({},Ss)}function Cs(){return{registers:Es(),smartFence:!1,renderPlaceholder:void 0,placeholderSymbol:"▢",letterShapeStyle:y.locale.startsWith("fr")?"french":"tex",minFontScale:0,colorMap:T,backgroundColorMap:A,getMacro:e=>oe(e,ie())}}var Ts=class e{constructor(t,n){var i,r,a,s,o,l,c,d,h,p,f,m,g,v,b;let y;(null==t?void 0:t.parent)?(this.parent=t.parent,y=t.parent,this.registers={}):(y=u(u({},Cs()),null!=(i=null==t?void 0:t.from)?i:{}),this.registers=y.registers),y.atomIdsSettings&&(this.atomIdsSettings=u({},y.atomIdsSettings)),this.renderPlaceholder=y.renderPlaceholder,this.isPhantom=null!=(s=null!=(a=null==t?void 0:t.isPhantom)?a:null==(r=this.parent)?void 0:r.isPhantom)&&s,this.letterShapeStyle=y.letterShapeStyle,this.minFontScale=y.minFontScale,(null==n?void 0:n.color)&&"none"!==n.color?this.color=n.color:this.color=null!=(l=null==(o=this.parent)?void 0:o.color)?l:"",(null==n?void 0:n.backgroundColor)&&"none"!==n.backgroundColor?this.backgroundColor=n.backgroundColor:this.backgroundColor=null!=(d=null==(c=this.parent)?void 0:c.backgroundColor)?d:"",(null==n?void 0:n.fontSize)&&"auto"!==n.fontSize&&n.fontSize!==(null==(h=this.parent)?void 0:h.size)?this.size=n.fontSize:this.size=null!=(f=null==(p=this.parent)?void 0:p.size)?f:5;let _=null!=(g=null==(m=this.parent)?void 0:m.mathstyle)?g:bs.displaystyle;if("string"==typeof(null==t?void 0:t.mathstyle)){if(y instanceof e)switch(t.mathstyle){case"cramp":_=_.cramp;break;case"superscript":_=_.sup;break;case"subscript":_=_.sub;break;case"numerator":_=_.fracNum;break;case"denominator":_=_.fracDen}switch(t.mathstyle){case"textstyle":_=bs.textstyle;break;case"displaystyle":_=bs.displaystyle;break;case"scriptstyle":_=bs.scriptstyle;break;case"scriptscriptstyle":_=bs.scriptscriptstyle}}this.mathstyle=_,this.smartFence=y.smartFence,this.placeholderSymbol=y.placeholderSymbol,this.colorMap=null!=(v=y.colorMap)?v:e=>e,this.backgroundColorMap=null!=(b=y.backgroundColorMap)?b:e=>e,this.getMacro=y.getMacro,console.assert(void 0!==this.parent||void 0!==this.registers)}makeID(){if(!this.atomIdsSettings)return;if(this.atomIdsSettings.overrideID)return this.atomIdsSettings.overrideID;if("number"!=typeof this.atomIdsSettings.seed)return`${Date.now().toString(36).slice(-2)}${Math.floor(1e5*Math.random()).toString(36)}`;const e=this.atomIdsSettings.seed.toString(36);return this.atomIdsSettings.seed+=1,e}scale(e){return e*this.effectiveFontSize}get scalingFactor(){return this.parent?this.effectiveFontSize/this.parent.effectiveFontSize:1}get isDisplayStyle(){return 7===this.mathstyle.id||6===this.mathstyle.id}get isCramped(){return this.mathstyle.cramped}get isTight(){return this.mathstyle.isTight}get metrics(){return this.mathstyle.metrics}get effectiveFontSize(){return Math.max(Na[Math.max(1,this.size+this.mathstyle.sizeDelta)],this.minFontScale)}getRegister(e){var t;return(null==(t=this.registers)?void 0:t[e])?this.registers[e]:this.parent?this.parent.getRegister(e):void 0}getRegisterAsNumber(e){const t=this.getRegister(e);return"number"==typeof t?t:"string"==typeof t?Number(t):void 0}getRegisterAsGlue(e){var t;if(null==(t=this.registers)?void 0:t[e]){const t=this.registers[e];return"object"==typeof t&&"glue"in t?t:"object"==typeof t&&"dimension"in t?{glue:{dimension:t.dimension}}:"number"==typeof t?{glue:{dimension:t}}:void 0}if(this.parent)return this.parent.getRegisterAsGlue(e)}getRegisterAsEm(e,t){return _s(this.getRegisterAsDimension(e),t)}getRegisterAsDimension(e){var t;if(null==(t=this.registers)?void 0:t[e]){const t=this.registers[e];return"object"==typeof t&&"glue"in t?t.glue:"object"==typeof t&&"dimension"in t?t:"number"==typeof t?{dimension:t}:void 0}if(this.parent)return this.parent.getRegisterAsDimension(e)}setRegister(e,t){void 0!==t?this.registers[e]=t:delete this.registers[e]}evaluate(e){if(!e||!("register"in e))return e;let t=this;if("global"in e&&e.global)for(;t.parent;)t=t.parent;let n=1;"factor"in e&&1!==e.factor&&void 0!==e.factor&&(n=e.factor);const i=t.getRegister(e.register);if(void 0===i)return;if("string"==typeof i)return{string:Number(i).toString()+i};if("number"==typeof i)return{number:n*i};const r=t.evaluate(i);return void 0!==r?"string"in r?{string:Number(i).toString()+r.string}:"number"in r?{number:n*r.number}:"dimension"in r?d(u({},r),{dimension:n*r.dimension}):"glue"in r?d(u({},r),{glue:d(u({},r.glue),{dimension:n*r.glue.dimension}),shrink:r.shrink?d(u({},r.shrink),{dimension:n*r.shrink.dimension}):void 0,grow:r.grow?d(u({},r.grow),{dimension:n*r.grow.dimension}):void 0}):e:void 0}toDimension(e){const t=this.evaluate(e);return void 0===t?null:"dimension"in t?t:"glue"in t?t.glue:"number"in t?{dimension:t.number}:null}toEm(e,t){if(null===e)return 0;const n=this.toDimension(e);return null===n?0:ys(n,t)/Ia}toNumber(e){if(null===e)return null;const t=this.evaluate(e);return void 0===t?null:"number"in t?t.number:"dimension"in t?t.dimension:"glue"in t?t.glue.dimension:"string"in t?Number(t.string):null}toColor(e){var t,n;if(null===e)return null;const i=this.evaluate(e);return void 0===i?null:"string"in i?null!=(n=null==(t=this.colorMap)?void 0:t.call(this,i.string))?n:i.string:null}toBackgroundColor(e){var t,n;if(null===e)return null;const i=this.evaluate(e);return void 0===i?null:"string"in i?null!=(n=null==(t=this.backgroundColorMap)?void 0:t.call(this,i.string))?n:i.string:null}},As=["body","above","below","superscript","subscript"];function Ms(e){return"string"==typeof e&&As.includes(e)}function Ls(e){return void 0!==e&&Array.isArray(e)&&2===e.length}var Ds=class e{constructor(e){var t,n,i,r,a,s;this.type=e.type,"string"==typeof e.value&&(this.value=e.value),this.command=null!=(n=null!=(t=e.command)?t:this.value)?n:"",this.mode=null!=(i=e.mode)?i:"math",e.isFunction&&(this.isFunction=!0),e.limits&&(this.subsupPlacement=e.limits),this.style=u({},e.style),this.displayContainsHighlight=null!=(r=e.displayContainsHighlight)&&r,this.captureSelection=null!=(a=e.captureSelection)&&a,this.skipBoundary=null!=(s=e.skipBoundary)&&s,void 0!==e.verbatimLatex&&null!==e.verbatimLatex&&(this.verbatimLatex=e.verbatimLatex),e.args&&(this.args=e.args),e.body&&(this.body=e.body),this._changeCounter=0}static createBox(e,t,n){var i;if(!t)return null;const r=function(e){let t;const n=[];let i=[];for(const r of e)if(t||r.style){const e=r.computedStyle;t&&e.color===t.color&&e.backgroundColor===t.backgroundColor&&e.fontSize===t.fontSize?i.push(r):(i.length>0&&n.push(i),i=[r],t=e)}else i.push(r);i.length>0&&n.push(i);return n}(t),a=[];for(const t of r){const n=t[0].style,i=Is(e,t,{style:{color:n.color,backgroundColor:n.backgroundColor,fontSize:n.fontSize}});i&&a.push(i)}if(0===a.length)return null;const s=(null!=(i=null==n?void 0:n.classes)?i:"").trim();return 1!==a.length||s||(null==n?void 0:n.type)?new cs(a,{classes:s,type:null==n?void 0:n.type}).wrap(e):a[0].wrap(e)}static serialize(e,t){return ts.serialize(e,t)}static commonAncestor(e,t){if(e===t)return e.parent;if(e.parent===t.parent)return e.parent;const n=new WeakSet;let{parent:i}=e;for(;i;)n.add(i),i=i.parent;for(i=t.parent;i;){if(n.has(i))return i;i=i.parent}console.assert(Boolean(i))}static fromJson(t){return new e("string"==typeof t?{type:"mord",value:t,mode:"math"}:t)}get latexMode(){return"math"===this.mode?"math":"text"}toJson(){const e={};if(this.type&&(e.type=this.type),"math"!==this.mode&&(e.mode=this.mode),this.command&&this.command!==this.value&&(e.command=this.command),void 0!==this.value&&(e.value=this.value),this.style&&Object.keys(this.style).length>0&&(e.style=u({},this.style)),void 0!==this.verbatimLatex&&(e.verbatimLatex=this.verbatimLatex),this.subsupPlacement&&(e.subsupPlacement=this.subsupPlacement),this.explicitSubsupPlacement&&(e.explicitSubsupPlacement=!0),this.isFunction&&(e.isFunction=!0),this.displayContainsHighlight&&(e.displayContainsHighlight=!0),this.isExtensibleSymbol&&(e.isExtensibleSymbol=!0),this.skipBoundary&&(e.skipBoundary=!0),this.captureSelection&&(e.captureSelection=!0),this.args&&(e.args=this.args.map((e=>null===e?"<null>":Array.isArray(e)&&e[0]instanceof Ds?{atoms:e.map((e=>e.toJson()))}:"object"==typeof e&&"group"in e?{group:e.group.map((e=>e.toJson()))}:e))),this._branches)for(const t of Object.keys(this._branches))this._branches[t]&&(e[t]=this._branches[t].filter((e=>"first"!==e.type)).map((e=>e.toJson())));return"mord"===e.type&&2===Object.keys(e).length&&"value"in e?e.value:e}get changeCounter(){return this.parent?this.parent.changeCounter:this._changeCounter}set isDirty(e){if(e){this.parent||this._changeCounter++,"verbatimLatex"in this&&(this.verbatimLatex=void 0),this._children=void 0;let{parent:e}=this;for(;e;)e.parent||e._changeCounter++,"verbatimLatex"in e&&(e.verbatimLatex=void 0),e._children=void 0,e=e.parent}}_serialize(e){if(!(e.expandMacro||e.skipStyles||e.skipPlaceholders)&&"string"==typeof this.verbatimLatex)return this.verbatimLatex;const t=se(this.command,this.mode);return(null==t?void 0:t.serialize)?t.serialize(this,e):this.body&&this.command?Xa([Ja(this.command,this.bodyToLatex(e)),this.supsubToLatex(e)]):this.body?Xa([this.bodyToLatex(e),this.supsubToLatex(e)]):this.value&&""!==this.value?this.command:""}bodyToLatex(e){var t;return ts.serialize(this.body,d(u({},e),{defaultMode:null!=(t=e.defaultMode)?t:this.latexMode}))}aboveToLatex(e){return ts.serialize(this.above,e)}belowToLatex(e){return ts.serialize(this.below,e)}supsubToLatex(e){let t="";if(e=d(u({},e),{defaultMode:"math"}),void 0!==this.branch("subscript")){const n=ts.serialize(this.subscript,e);0===n.length?t+="_{}":1===n.length&&/^[0-9]$/.test(n)?t+=`_${n}`:t+=`_{${n}}`}if(void 0!==this.branch("superscript")){const n=ts.serialize(this.superscript,e);0===n.length?t+="^{}":1===n.length?"′"===n?t+="^\\prime ":"″"===n?t+="^\\doubleprime ":/^[0-9]$/.test(n)?t+=`^${n}`:t+=`^{${n}}`:t+=`^{${n}}`}return t}get treeDepth(){let e=1,t=this.parent;for(;t;)t=t.parent,e+=1;return e}get inCaptureSelection(){let e=this;for(;e;){if(e.captureSelection)return!0;e=e.parent}return!1}get parentPrompt(){let e=this.parent;for(;e;){if("prompt"===e.type&&!e.captureSelection)return e;e=e.parent}return null}branch(e){if(Ms(e)&&this._branches)return this._branches[e]}get branches(){if(!this._branches)return[];const e=[];for(const t of As)this._branches[t]&&e.push(t);return e}createBranch(e){return console.assert(Ms(e)),Ms(e)?(this._branches?this._branches[e]||(this._branches[e]=[this.makeFirstAtom(e)]):this._branches={[e]:[this.makeFirstAtom(e)]},this.isDirty=!0,this._branches[e]):[]}get row(){return Ls(this.parentBranch)?this.parentBranch[0]:-1}get col(){return Ls(this.parentBranch)?this.parentBranch[1]:-1}get body(){var e;return null==(e=this._branches)?void 0:e.body}set body(e){this.setChildren(e,"body")}get superscript(){var e;return null==(e=this._branches)?void 0:e.superscript}set superscript(e){this.setChildren(e,"superscript")}get subscript(){var e;return null==(e=this._branches)?void 0:e.subscript}set subscript(e){this.setChildren(e,"subscript")}get above(){var e;return null==(e=this._branches)?void 0:e.above}set above(e){this.setChildren(e,"above")}get below(){var e;return null==(e=this._branches)?void 0:e.below}set below(e){this.setChildren(e,"below")}get computedStyle(){var e,t;const n="string"==typeof this.style.verbatimColor,i="string"==typeof this.style.verbatimBackgroundColor,r=u(u({},null!=(t=null==(e=this.parent)?void 0:e.computedStyle)?t:{}),this.style);return delete r.variant,delete r.variantStyle,i||delete r.verbatimBackgroundColor,n||delete r.verbatimColor,r}applyStyle(e){this.isDirty=!0,this.style=u(u({},this.style),e),"none"===this.style.fontFamily&&delete this.style.fontFamily,"auto"===this.style.fontShape&&delete this.style.fontShape,"auto"===this.style.fontSeries&&delete this.style.fontSeries,"none"===this.style.color&&(delete this.style.color,delete this.style.verbatimColor),"none"===this.style.backgroundColor&&(delete this.style.backgroundColor,delete this.style.verbatimBackgroundColor),"auto"===this.style.fontSize&&delete this.style.fontSize;for(const t of this.children)t.applyStyle(e)}getInitialBaseElement(){var e,t,n;return this.hasEmptyBranch("body")?this:(console.assert("first"===(null==(e=this.body)?void 0:e[0].type)),null!=(n=null==(t=this.body[1])?void 0:t.getInitialBaseElement())?n:this)}getFinalBaseElement(){return this.hasEmptyBranch("body")?this:this.body[this.body.length-1].getFinalBaseElement()}isCharacterBox(){return"leftright"!==this.type&&"genfrac"!==this.type&&"subsup"!==this.type&&"delim"!==this.type&&"array"!==this.type&&"surd"!==this.type&&"mord"===this.getFinalBaseElement().type}hasEmptyBranch(e){const t=this.branch(e);return!t||(console.assert(t.length>0),console.assert("first"===t[0].type),1===t.length)}setChildren(e,t){var n;if(!e)return;if(console.assert(Ms(t)),!Ms(t))return;console.assert("first"!==(null==(n=e[0])?void 0:n.type));const i=[this.makeFirstAtom(t),...e];this._branches?this._branches[t]=i:this._branches={[t]:i};for(const n of e)n.parent=this,n.parentBranch=t;this.isDirty=!0}makeFirstAtom(t){const n=new e({type:"first",mode:this.mode});return n.parent=this,n.parentBranch=t,n}addChild(e,t){console.assert("first"!==e.type),this.createBranch(t).push(e),this.isDirty=!0,e.parent=this,e.parentBranch=t}addChildBefore(e,t){console.assert(void 0!==t.parentBranch);const n=this.createBranch(t.parentBranch);n.splice(n.indexOf(t),0,e),this.isDirty=!0,e.parent=this,e.parentBranch=t.parentBranch}addChildAfter(e,t){console.assert(void 0!==t.parentBranch);const n=this.createBranch(t.parentBranch);n.splice(n.indexOf(t)+1,0,e),this.isDirty=!0,e.parent=this,e.parentBranch=t.parentBranch}addChildren(e,t){const n=this.createBranch(t);for(const i of e)i.parent=this,i.parentBranch=t,n.push(i);this.isDirty=!0}addChildrenAfter(e,t){console.assert(0===e.length||"first"!==e[0].type),console.assert(void 0!==t.parentBranch);const n=this.createBranch(t.parentBranch);n.splice(n.indexOf(t)+1,0,...e),this.isDirty=!0;for(const n of e)n.parent=this,n.parentBranch=t.parentBranch;return e[e.length-1]}removeBranch(e){const t=this.branch(e);if(Ms(e)&&(this._branches[e]=void 0),!t)return[];for(const e of t)e.parent=void 0,e.parentBranch=void 0;return console.assert("first"===t[0].type),t.shift(),this.isDirty=!0,t}removeChild(e){if(console.assert(e.parent===this),"first"===e.type)return;const t=this.branch(e.parentBranch),n=t.indexOf(e);console.assert(n>=0),t.splice(n,1),this.isDirty=!0,e.parent=void 0,e.parentBranch=void 0}get siblings(){return this.parent?this.parent.branch(this.parentBranch):[]}get firstSibling(){return this.siblings[0]}get lastSibling(){const{siblings:e}=this;return e[e.length-1]}get isFirstSibling(){return this===this.firstSibling}get isLastSibling(){return this===this.lastSibling}get hasNoSiblings(){return 1===this.siblings.length}get leftSibling(){console.assert(void 0!==this.parent);const e=this.parent.branch(this.parentBranch);return e[e.indexOf(this)-1]}get rightSibling(){console.assert(void 0!==this.parent);const e=this.parent.branch(this.parentBranch);return e[e.indexOf(this)+1]}get hasChildren(){return Boolean(this._branches&&this.children.length>0)}get firstChild(){return console.assert(this.hasChildren),this.children[0]}get lastChild(){console.assert(this.hasChildren);const{children:e}=this;return e[e.length-1]}get children(){if(this._children)return this._children;if(!this._branches)return[];const e=[];for(const t of As)if(this._branches[t])for(const n of this._branches[t])e.push(...n.children),e.push(n);return this._children=e,e}render(e){if("first"===this.type&&!e.atomIdsSettings)return null;const t=se(this.command,this.mode);if(null==t?void 0:t.render)return t.render(this,e);const n=new Ts({parent:e},this.style);let i=this.createBox(n,{classes:this.parent?"":"ML__base"});return i?(this.subsupPlacement||!this.superscript&&!this.subscript||(i=this.attachSupsub(n,{base:i})),i.wrap(n)):null}attachSupsub(t,n){var i;const r=n.base,a=this.superscript,s=this.subscript;if(!a&&!s)return r;let o=null,l=null;const c=null!=(i=n.isCharacterBox)?i:this.isCharacterBox();let u=0;if(a){const n=new Ts({parent:t,mathstyle:"superscript"});o=e.createBox(n,a),c||(u=r.height-t.metrics.supDrop*n.scalingFactor)}let d,h=0;if(s){const n=new Ts({parent:t,mathstyle:"subscript"});l=e.createBox(n,s),c||(h=r.depth+t.metrics.subDrop*n.scalingFactor)}d=t.isDisplayStyle?t.metrics.sup1:t.isCramped?t.metrics.sup3:t.metrics.sup2;const p=.05/t.scalingFactor;let f=null;if(l&&o){u=Math.max(u,d,o.depth+.25*t.metrics.xHeight),h=Math.max(h,t.metrics.sub2);const e=t.metrics.defaultRuleThickness;if(u-o.depth-(l.height-h)<4*e){h=4*e-(u-o.depth)+l.height;const n=.8*t.metrics.xHeight-(u-o.depth);n>0&&(u+=n,h-=n)}const n=this.isExtensibleSymbol&&r.italic?-r.italic:0;f=new ms({individualShift:[{box:l,shift:h,marginLeft:n},{box:o,shift:-u}]}).wrap(t)}else l&&!o?(h=Math.max(h,t.metrics.sub1,l.height-.3448),f=new ms({shift:h,children:[{box:l,marginRight:p,marginLeft:this.isCharacterBox()?-r.italic:0}]})):!l&&o&&(u=Math.max(u,d,o.depth+.10775),f=new ms({shift:-u,children:[{box:o,marginRight:p}]}));return new cs([r,new cs(f,{caret:this.caret,isSelected:this.isSelected,classes:"msubsup"})],{type:n.type})}attachLimits(t,n){const i=this.superscript?e.createBox(new Ts({parent:t,mathstyle:"superscript"},this.style),this.superscript):null,r=this.subscript?e.createBox(new Ts({parent:t,mathstyle:"subscript"},this.style),this.subscript):null;return i||r?function(e,t){var n,i,r,a,s;const o=e.metrics,l=new cs(t.base),c=null!=(n=t.baseShift)?n:0,u=null!=(i=t.slant)?i:0;let d=0,h=0;t.above&&(d=null!=(r=t.aboveShift)?r:Math.max(o.bigOpSpacing1,o.bigOpSpacing3-t.above.depth)),t.below&&(h=null!=(a=t.belowShift)?a:Math.max(o.bigOpSpacing2,o.bigOpSpacing4-t.below.height));let p=null;if(t.below&&t.above){const n=o.bigOpSpacing5+t.below.height+t.below.depth+h+l.depth+c;p=new ms({bottom:n,children:[o.bigOpSpacing5,{box:t.below,marginLeft:-u,classes:["ML__center"]},h,{box:l,classes:["ML__center"]},d,{box:t.above,marginLeft:u,classes:["ML__center"]},o.bigOpSpacing5]}).wrap(e)}else if(t.below&&!t.above)p=new ms({top:l.height-c,children:[o.bigOpSpacing5,{box:t.below,marginLeft:-u,classes:["ML__center"]},h,{box:l,classes:["ML__center"]}]}).wrap(e);else if(!t.below&&t.above){const n=l.depth+c;p=new ms({bottom:n,children:[{box:l,classes:["ML__center"]},d,{box:t.above,marginLeft:u,classes:["ML__center"]},o.bigOpSpacing5]}).wrap(e)}else{const t=l.depth+c;p=new ms({bottom:t,children:[{box:l},o.bigOpSpacing5]}).wrap(e)}return new cs(p,{type:null!=(s=t.type)?s:"op"})}(t,d(u({},n),{above:i,below:r})):n.base.wrap(t)}bind(e,t){if(!t||e.isPhantom||""===this.value)return t;let n=this.parent;for(;n&&!n.captureSelection;)n=n.parent;return(null==n?void 0:n.captureSelection)||(this.id||(this.id=e.makeID()),t.atomID=this.id),t}createBox(t,n){var i,r,a,s;const o=null!=(i=this.value)?i:this.body,l=null!=(r=null==n?void 0:n.boxType)?r:ss(this.type);let c=null!=(a=null==n?void 0:n.classes)?a:"";"text"===this.mode&&(c+=" ML__text");const h="string"==typeof o||void 0===o?new cs(null!=o?o:null,{type:l,isSelected:this.isSelected,mode:this.mode,maxFontSize:t.scalingFactor,style:d(u({variant:"normal"},this.style),{fontSize:Math.max(1,t.size+t.mathstyle.sizeDelta)}),letterShapeStyle:t.letterShapeStyle,classes:c}):null!=(s=e.createBox(t,o,{type:l,classes:c}))?s:new cs(null);return t.isTight&&(h.isTight=!0),"math"===this.mode&&"main"!==this.style.variant||(h.italic=0),h.right=h.italic,this.bind(t,h),this.caret&&(this.superscript||this.subscript||(h.caret=this.caret)),h}isDigit(){var e;return"mord"===this.type&&this.value?/^[\d,\.]$/.test(this.value):"group"===this.type&&2===(null==(e=this.body)?void 0:e.length)&&("first"===this.body[0].type&&","===this.body[1].value)}asDigit(){var e;return"mord"===this.type&&this.value&&/^[\d,\.]$/.test(this.value)?this.value:"group"===this.type&&2===(null==(e=this.body)?void 0:e.length)&&"first"===this.body[0].type&&","===this.body[1].value?".":""}};function Is(e,t,n){var i,r,a,s,o;if(!t||0===t.length)return null;const l=new Ts({parent:e},n.style),c=!(null==(i=l.atomIdsSettings)?void 0:i.groupNumbers);let h=[];if(1===t.length){const e=t[0],n=e.render(l);n&&(c&&e.isSelected&&n.selected(!0),h=[n])}else{let e="",n=!0;for(const i of t){(null==(r=l.atomIdsSettings)?void 0:r.groupNumbers)&&e&&(n&&i.isDigit()||!n&&Rs(i))&&(l.atomIdsSettings.overrideID=e);const t=i.render(l);l.atomIdsSettings&&(l.atomIdsSettings.overrideID=void 0),t&&((null==(a=l.atomIdsSettings)?void 0:a.groupNumbers)&&((i.isDigit()||Rs(i))&&(e&&n===i.isDigit()||(n=i.isDigit(),e=null!=(s=i.id)?s:"")),!e||(i.isDigit()||Rs(i))&&i.hasEmptyBranch("superscript")&&i.hasEmptyBranch("subscript")||(e="")),c&&i.isSelected&&t.selected(!0),h.push(t))}}if(0===h.length)return null;const p=new cs(h,d(u({isTight:l.isTight},n),{type:null!=(o=n.type)?o:"lift"}));return p.isSelected=h.every((e=>e.isSelected)),p.wrap(l)}function Rs(e){return"text"===e.mode}var Ps=class e extends Ds{constructor(e,t,n){super({type:"text",command:e,mode:"text",displayContainsHighlight:!0}),this.value=t,this.verbatimLatex=t,this.applyStyle(n)}static fromJson(t){return new e(t.command,t.value,t.style)}render(e){const t=this.createBox(e);return this.caret&&(t.caret=this.caret),t}_serialize(e){var t;return null!=(t=this.verbatimLatex)?t:le("text",this.value.codePointAt(0))}};function Os(e,t){return e[0]===t[0]&&e[1]===t[1]?"equal":"different"}function Ns(e){let t=1/0,n=-1/0;for(const i of e.ranges)t=Math.min(t,i[0],i[1]),n=Math.max(n,i[0],i[1]);return[t,n]}function Bs(e){return"number"==typeof e&&!Number.isNaN(e)}function $s(e){return Array.isArray(e)&&2===e.length}function Fs(e){return null!=e&&"object"==typeof e&&"ranges"in e&&Array.isArray(e.ranges)}function zs(e,t,n){return n?function(e,t){if(!t)return"";if("string"==typeof t)return t;if(!e||void 0===t.after)return t.value;let n=!1,i=!1,r=!1,a=!1,s=!1,o=!1,l=!1,c=!1,u=!1,d=!1,h=!1,p=!1,f=!1,m=!1,g=!1,v=e[0],b=0;for(;(null==v?void 0:v.type)&&/^(subsup|placeholder)$/.test(v.type);)b+=1,v=e[b];return n=!v||"first"===v.type,v&&(m="text"===v.mode,i=!m&&"mord"===v.type&&$.test(v.value),r=!m&&"mord"===v.type&&/\d+$/.test(v.value),a=!m&&v.isFunction,s="genfrac"===v.type,o="surd"===v.type,l="mbin"===v.type,c="mrel"===v.type,u="mop"===v.type||"operator"===v.type||"extensible-symbol"===v.type,d="mpunct"===v.type||"minner"===v.type,h="array"===v.type,p="mopen"===v.type,f="mclose"===v.type||"leftright"===v.type,g="space"===v.type),t.after.includes("nothing")&&n||t.after.includes("letter")&&i||t.after.includes("digit")&&r||t.after.includes("function")&&a||t.after.includes("frac")&&s||t.after.includes("surd")&&o||t.after.includes("binop")&&l||t.after.includes("relop")&&c||t.after.includes("operator")&&u||t.after.includes("punct")&&d||t.after.includes("array")&&h||t.after.includes("openfence")&&p||t.after.includes("closefence")&&f||t.after.includes("text")&&m||t.after.includes("space")&&g?t.value:""}(e,n[t]):""}var Ks={"&":"\\&","%":"\\%",$:"\\$","''":"^{\\doubleprime}","'''":"^{\\prime\\prime\\prime}","''''":"^{\\prime\\prime\\prime\\prime}",alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:"\\pi",Pi:"\\Pi",theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:"\\nabla",grad:"\\nabla",del:"\\partial",deg:{after:"digit+space",value:"\\degree"},infty:"\\infty","∞":"\\infty",oo:{after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":"\\sum",sum:"\\sum_{#?}^{#?}",int:"\\int_{#?}^{#?}",prod:"\\prod_{#?}^{#?}",sqrt:"\\sqrt{#?}","∆":"\\differentialD","∂":"\\differentialD",arcsin:"\\arcsin",arccos:"\\arccos",arctan:"\\arctan",arcsec:"\\arcsec",arccsc:"\\arccsc",arsinh:"\\arsinh",arcosh:"\\arcosh",artanh:"\\artanh",arcsech:"\\arcsech",arccsch:"\\arccsch",arg:"\\arg",ch:"\\ch",cosec:"\\cosec",cosh:"\\cosh",cot:"\\cot",cotg:"\\cotg",coth:"\\coth",csc:"\\csc",ctg:"\\ctg",cth:"\\cth",sec:"\\sec",sinh:"\\sinh",sh:"\\sh",tanh:"\\tanh",tg:"\\tg",th:"\\th",sin:"\\sin",cos:"\\cos",tan:"\\tan",lg:"\\lg",lb:"\\lb",log:"\\log",ln:"\\ln",exp:"\\exp",lim:"\\lim_{#?}",dx:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD x"},dy:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD y"},dt:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD t"},AA:"\\forall",EE:"\\exists","!EE":"\\nexists","&&":"\\land",xin:{after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},sint:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\sin t"},in:{after:"nothing+letter+closefence",value:"\\in"},"!in":"\\notin",NN:"\\mathbb{N}",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",xx:"\\times","+-":"\\pm","≠":"\\ne","!=":"\\ne","≥":"\\ge",">=":"\\ge","≤":"\\le","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},nu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:"\\exists","!exists":"\\nexists",":.":"\\therefore",liminf:"\\liminf_{#?}",limsup:"\\limsup_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:"\\bmod{#?}","(mod":"\\pmod{#?}",max:"\\max",min:"\\min",erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:"\\operatorname{bessel}",mean:"\\operatorname{mean}",median:"\\operatorname{median}",fft:"\\operatorname{fft}",lcm:"\\operatorname{lcm}",gcd:"\\operatorname{gcd}",randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:"\\operatorname{Re}",Im:"\\operatorname{Im}",mm:{after:"nothing+digit+operator",value:"\\operatorname{mm}"},cm:{after:"nothing+digit+operator",value:"\\operatorname{cm}"},km:{after:"nothing+digit+operator",value:"\\operatorname{km}"},kg:{after:"nothing+digit+operator",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","--\x3e...":"\\longrightarrow\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","*":"\\cdot","**":"\\star","***":"\\ast","//":"\\slash","\\\\":"\\backslash",setminus:"\\backslash","|><":"\\ltimes","><|":"\\rtimes","|><|":"\\bowtie","-:":"\\div",divide:"\\div","@":"\\circ","^^":"\\wedge","^^^":"\\bigwedge",vv:"\\vee",vvv:"\\bigvee",nn:"\\cap",nnn:"\\bigcap",uu:"\\cup",uuu:"\\bigcup","-=":"\\equiv","~=":"\\cong",lt:"<","lt=":"\\leq",gt:">","gt=":"\\geq","-<":"\\prec","-lt":"\\prec","-<=":"\\preceq",">-=":"\\succeq",prop:"\\propto",diamond:"\\diamond",square:"\\square",iff:"\\iff",sub:"\\subset",sup:"\\supset",sube:"\\subseteq",supe:"\\supseteq",uarr:"\\uparrow",darr:"\\downarrow",rarr:"\\rightarrow",rArr:"\\Rightarrow",larr:"\\leftarrow",lArr:"\\Leftarrow",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",aleph:"\\aleph",and:"\\land",or:"\\lor",not:"\\neg","_|_":"\\bot",TT:"\\top","|--":"\\vdash","|==":"\\models","|__":"\\lfloor","__|":"\\rfloor","|~":"\\lceil","~|":"\\rceil",">->":"\\rightarrowtail","->>":"\\twoheadrightarrow",">->>":"\\twoheadrightarrowtail",frac:"\\frac{#?}{#?}",cbrt:"\\sqrt[3]{#?}",nthroot:"\\sqrt[#?]{#?}"};function Us(e,t){var n;let i=null!=(n=null==t?void 0:t.format)?n:"auto";return"auto"===i&&([i,e]=function(e){if(e=e.trim(),e.length<=1)return["latex",e];let t;if([t,e]=Gs(e),t)return["latex",e];if(e.startsWith("`")&&e.endsWith("`"))return["ascii-math",e=e.substring(1,e.length-1)];if(e.includes("\\"))return["latex",e];if(/\$.+\$/.test(e))return["latex",`\\text{${e}}`];return[void 0,e]}(e)),"ascii-math"===i?["ascii-math",js(e=(e=(e=(e=(e=(e=e.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),{inlineShortcuts:null==t?void 0:t.inlineShortcuts})]:["latex",e]}function js(e,t){var n,i,r;if(!e)return"";let a,s=!1;const o=null!=(n=t.inlineShortcuts)?n:Ks;if(s||!e.startsWith("^")&&!e.startsWith("_")||(a=qs(e.slice(1),{inlineShortcuts:o,noWrap:!0}),e=e[0]+"{"+a.match+"}",e+=js(a.rest,t),s=!0),!s&&(a=e.match(/^(sqrt|\u221A)(.*)/),a)){a=qs(a[2],{inlineShortcuts:o,noWrap:!0});e="\\sqrt{"+(null!=(i=a.match)?i:"\\placeholder{}")+"}",e+=js(a.rest,t),s=!0}if(!s&&(a=e.match(/^(\\cbrt|\u221B)(.*)/),a)){a=qs(a[2],{inlineShortcuts:o,noWrap:!0});e="\\sqrt[3]{"+(null!=(r=a.match)?r:"\\placeholder{}")+"}",e+=js(a.rest,t),s=!0}if(s||(a=e.match(/^abs(.*)/),a&&(a=qs(a[1],{inlineShortcuts:o,noWrap:!0}),e="\\left|"+a.match+"\\right|",e+=js(a.rest,t),s=!0)),s||(a=e.match(/^["”“](.*?)["”“](.*)/),a&&(e="\\text{"+a[1]+"}",e+=js(a[2],t),s=!0)),s||(a=e.match(/^([^a-zA-Z\(\{\[\_\^\\\s"]+)(.*)/),a&&(e=Hs(a[1],o),e+=js(a[2],t),s=!0)),!s&&/^([fgh])[^a-zA-Z]/.test(e)&&(a=qs(e.slice(1),{inlineShortcuts:o,noWrap:!0}),e="("===e[1]?e[0]+"\\left("+a.match+"\\right)":e[0]+a.match,e+=js(a.rest,t),s=!0),s||(a=e.match(/^([a-zA-Z]+)(.*)/),a&&(e=Hs(a[1],o),e+=js(a[2],t),s=!0)),!s)if(a=qs(e,{inlineShortcuts:o,noWrap:!0}),a.match&&"/"===a.rest[0]){const n=qs(a.rest.slice(1),{inlineShortcuts:o,noWrap:!0});n.match&&(e="\\frac{"+a.match+"}{"+n.match+"}"+js(n.rest,t)),s=!0}else a.match&&(e=e.startsWith("(")?"\\left("+a.match+"\\right)"+js(a.rest,t):a.match+js(a.rest,t),s=!0);return s||(a=e.match(/^(\s+)(.*)$/),a&&(e=" "+js(a[2],t),s=!0)),e}function qs(e,t){let n="",i=e=e.trim(),r=e.charAt(0),a={"(":")","{":"}","[":"]"}[r];if(a){let s=1,o=1;for(;o<e.length&&s>0;)e[o]===r&&s++,e[o]===a&&s--,o++;0===s?(t.noWrap&&"("===r?n=js(e.substring(1,o-1),t):("{"===r&&"}"===a&&(r="\\{",a="\\}"),n="\\left"+r+js(e.substring(1,o-1),t)+"\\right"+a),i=e.slice(Math.max(0,o))):(n=e.substring(1,o),i="")}else{let r=e.match(/^([a-zA-Z]+)/);if(r){let n=zs(null,e,t.inlineShortcuts);if(n)return n=n.replace("_{#?}",""),n=n.replace("^{#?}",""),{match:n,rest:e.slice(n.length)}}if(r=e.match(/^([a-zA-Z])/),r)return{match:r[1],rest:e.slice(1)};if(r=e.match(/^(-)?\d+(\.\d*)?/),r)return{match:r[0],rest:e.slice(r[0].length)};/^\\(left|right)/.test(e)||(r=e.match(/^(\\[a-zA-Z]+)/),r&&(i=e.slice(r[1].length),n=r[1]))}return{match:n,rest:i}}function Hs(e,t){let n=zs(null,e,t);return n?(n=n.replace("_{#?}",""),n=n.replace("^{#?}",""),n+=" "):n=e,n}var Vs=[["\\[","\\]"],["\\(","\\)"],["$$","$$"],["$","$"],["\\begin{math}","\\end{math}"],["\\begin{displaymath}","\\end{displaymath}"],["\\begin{equation}","\\end{equation}"],["\\begin{equation*}","\\end{equation*}"]];function Gs(e){const t=e.trim();for(const e of Vs)if(t.startsWith(e[0])&&t.endsWith(e[1]))return[!0,t.substring(e[0].length,t.length-e[1].length)];return[!1,e]}var Zs=(e,t,n)=>(Vs.some((e=>t.startsWith(e[0])&&t.endsWith(e[1])))||(t=`$$ ${t} $$`),t),Ws=class e{constructor(t){e._modes[t]=this}static onPaste(t,n,i){var r;if(!n.contentEditable&&"none"===n.userSelect)return n.model.announce("plonk"),!1;if("string"==typeof i){const e=new DataTransfer;e.setData("text/plain",i),i=e}const a=new ClipboardEvent("paste",{clipboardData:i,cancelable:!0});return!!(null==(r=n.host)?void 0:r.dispatchEvent(a))&&e._modes[t].onPaste(n,i)}static copyToClipboard(e,t){if(!e.contentEditable&&"none"===e.userSelect)return void e.model.announce("plonk");const n=e.model,i=n.selectionIsCollapsed?[0,n.lastOffset]:Ns(n.selection),r=n.getValue(i,t);navigator.clipboard.writeText(r).then((()=>{}),(()=>e.model.announce("plonk")))}static onCopy(e,t){var n;if(!t.clipboardData)return;if(!e.contentEditable&&"none"===e.userSelect)return void e.model.announce("plonk");const i=e.model,r=i.selectionIsCollapsed?[0,i.lastOffset]:Ns(i.selection);let a=i.getAtoms(r);if(a.every((e=>"text"===e.mode||!e.mode)))t.clipboardData.setData("text/plain",a.filter((e=>e instanceof Ps)).map((e=>e.value)).join(""));else if(a.every((e=>"latex"===e.mode)))t.clipboardData.setData("text/plain",i.getAtoms(r,{includeChildren:!0}).map((e=>{var t;return null!=(t=e.value)?t:""})).join(""));else{let s;s=1===a.length&&void 0!==a[0].verbatimLatex?a[0].verbatimLatex:i.getValue(r,"latex-expanded"),t.clipboardData.setData("application/x-latex",s);try{t.clipboardData.setData("text/plain",e.options.onExport(e,s,r))}catch(e){}if(1===a.length){const e=a[0];"root"!==e.type&&"group"!==e.type||(a=e.body.filter((e=>"first"!==e.type)))}try{t.clipboardData.setData("application/json+mathlive",JSON.stringify(a.map((e=>e.toJson()))))}catch(e){}if(null==(n=window[Symbol.for("io.cortexjs.compute-engine")])?void 0:n.ComputeEngine){const e=window.MathfieldElement.computeEngine;if(e)try{const n=e.jsonSerializationOptions;e.jsonSerializationOptions={metadata:["latex"]};const a=e.parse(i.getValue(r,"latex-unstyled"));e.jsonSerializationOptions=n;const s=JSON.stringify(a.json);s&&t.clipboardData.setData("application/json",s)}catch(e){}}}t.preventDefault()}static insert(t,n,i={}){var r;const a="auto"===i.mode?t.mode:null!=(r=i.mode)?r:t.mode;return e._modes[a].insert(t,n,i)}onPaste(e,t){return!1}insert(e,t,n){return!1}};Ws._modes={};var Ys=Ws,Xs=[{key:"left",command:"moveToPreviousChar"},{key:"right",command:"moveToNextChar"},{key:"up",command:"moveUp"},{key:"down",command:"moveDown"},{key:"shift+[ArrowLeft]",command:"extendSelectionBackward"},{key:"shift+[ArrowRight]",command:"extendSelectionForward"},{key:"shift+[ArrowUp]",command:"extendSelectionUpward"},{key:"shift+[ArrowDown]",command:"extendSelectionDownward"},{key:"[Backspace]",command:"deleteBackward"},{key:"alt+[Delete]",command:"deleteBackward"},{key:"[Delete]",command:"deleteForward"},{key:"alt+[Backspace]",command:"deleteForward"},{key:"alt+[ArrowLeft]",command:"moveToPreviousWord"},{key:"alt+[ArrowRight]",command:"moveToNextWord"},{key:"shift+alt+[ArrowLeft]",command:"extendToPreviousWord"},{key:"shift+alt+[ArrowRight]",command:"extendToNextWord"},{key:"ctrl+[ArrowLeft]",command:"moveToGroupStart"},{key:"ctrl+[ArrowRight]",command:"moveToGroupEnd"},{key:"shift+ctrl+[ArrowLeft]",command:"extendToGroupStart"},{key:"shift+ctrl+[ArrowRight]",command:"extendToGroupEnd"},{key:"[Home]",command:"moveToMathfieldStart"},{key:"cmd+[ArrowLeft]",command:"moveToMathfieldStart"},{key:"shift+[Home]",command:"extendToMathFieldStart"},{key:"shift+cmd+[ArrowLeft]",command:"extendToMathFieldStart"},{key:"[End]",command:"moveToMathfieldEnd"},{key:"cmd+[ArrowRight]",command:"moveToMathfieldEnd"},{key:"shift+[End]",command:"extendToMathFieldEnd"},{key:"shift+cmd+[ArrowRight]",command:"extendToMathFieldEnd"},{key:"[Pageup]",command:"moveToGroupStart"},{key:"[Pagedown]",command:"moveToGroupEnd"},{key:"[Tab]",command:"moveToNextGroup"},{key:"shift+[Tab]",command:"moveToPreviousGroup"},{key:"[Escape]",ifMode:"math",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"text",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"latex",command:["complete","complete",{selectItem:"true"}]},{key:"\\",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[IntlBackslash]",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[Tab]",ifMode:"latex",command:["complete","accept-suggestion"]},{key:"[Return]",ifMode:"latex",command:"complete"},{key:"[Enter]",ifMode:"latex",command:"complete"},{key:"shift+[Escape]",ifMode:"latex",command:["complete","reject"]},{key:"[ArrowDown]",ifMode:"latex",command:"nextSuggestion"},{key:"[ArrowUp]",ifMode:"latex",command:"previousSuggestion"},{key:"ctrl+a",ifPlatform:"!macos",command:"selectAll"},{key:"cmd+a",command:"selectAll"},{key:"[Cut]",command:"cutToClipboard"},{key:"[Copy]",command:"copyToClipboard"},{key:"[Paste]",command:"pasteFromClipboard"},{key:"[Clear]",command:"deleteBackward"},{key:"[Undo]",command:"undo"},{key:"[Redo]",command:"redo"},{key:"[EraseEof]",command:"deleteToGroupEnd"},{key:"ctrl+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"cmd+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"ctrl+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"cmd+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"ctrl+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"cmd+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"ctrl+z",ifPlatform:"!macos",command:"undo"},{key:"cmd+z",command:"undo"},{key:"ctrl+y",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+y",command:"redo"},{key:"shift+ctrl+z",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+z",command:"redo"},{key:"ctrl+b",ifPlatform:"macos",command:"moveToPreviousChar"},{key:"ctrl+f",ifPlatform:"macos",command:"moveToNextChar"},{key:"ctrl+p",ifPlatform:"macos",command:"moveUp"},{key:"ctrl+n",ifPlatform:"macos",command:"moveDown"},{key:"ctrl+a",ifPlatform:"macos",command:"moveToMathfieldStart"},{key:"ctrl+e",ifPlatform:"macos",command:"moveToMathfieldEnd"},{key:"shift+ctrl+b",ifPlatform:"macos",command:"extendSelectionBackward"},{key:"shift+ctrl+f",ifPlatform:"macos",command:"extendSelectionForward"},{key:"shift+ctrl+p",ifPlatform:"macos",command:"extendSelectionUpward"},{key:"shift+ctrl+n",ifPlatform:"macos",command:"extendSelectionDownward"},{key:"shift+ctrl+a",ifPlatform:"macos",command:"extendToMathFieldStart"},{key:"shift+ctrl+e",ifPlatform:"macos",command:"extendToMathFieldEnd"},{key:"alt+ctrl+b",ifPlatform:"macos",command:"moveToPreviousWord"},{key:"alt+ctrl+f",ifPlatform:"macos",command:"moveToNextWord"},{key:"shift+alt+ctrl+b",ifPlatform:"macos",command:"extendToPreviousWord"},{key:"shift+alt+ctrl+f",ifPlatform:"macos",command:"extendToNextWord"},{key:"ctrl+h",ifPlatform:"macos",command:"deleteBackward"},{key:"ctrl+d",ifPlatform:"macos",command:"deleteForward"},{key:"ctrl+l",ifPlatform:"macos",command:"scrollIntoView"},{key:"ctrl+[Digit2]",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"ctrl+[Digit5]",ifMode:"math",command:"moveToOpposite"},{key:"ctrl+[Digit6]",ifMode:"math",command:"moveToSuperscript"},{key:"ctrl+[Return]",ifMode:"math",command:"addRowAfter"},{key:"ctrl+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Return]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"alt+p",ifMode:"math",command:["insert","\\pi"]},{key:"alt+v",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"alt+o",ifMode:"math",command:["insert","\\emptyset"]},{key:"alt+d",ifMode:"math",command:["insert","\\differentialD"]},{key:"shift+alt+o",ifMode:"math",command:["insert","\\varnothing"]},{key:"shift+alt+d",ifMode:"math",command:["insert","\\partial"]},{key:"alt+[Backslash]",ifMode:"math",command:["insert","\\backslash"]},{key:"[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#?}{#@}"]},{key:"shift+alt+k",command:"toggleKeystrokeCaption"},{key:"alt+[Space]",command:"toggleContextMenu"},{key:"alt+shift+[Space]",command:"toggleVirtualKeyboard"},{key:"alt+ctrl+[ArrowUp]",command:["speak","all",{withHighlighting:!1}]},{key:"alt+ctrl+[ArrowDown]",command:["speak","selection",{withHighlighting:!1}]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["switchMode","text","",""]},{key:"shift+alt+[KeyT]",ifMode:"math",command:["switchMode","text","",""]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"text",command:["switchMode","math","",""]},{key:"shift+alt+[KeyT]",ifMode:"text",command:["switchMode","math","",""]},{key:"/",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+/",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","/"]},{key:"alt+shift+/",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","/"]},{key:"alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrack #0 \\right\\rbrack"]},{key:"ctrl+[Minus]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"moveToSubscript"},{key:"shift+alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrace #0 \\right\\rbrace"]},{key:"ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"shift+ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"shift+cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"ctrl+[Backspace]",ifMode:"math",command:"removeRow"},{key:"cmd+[Backspace]",ifMode:"math",command:"removeRow"},{key:"alt+[Tab]",ifMode:"math",command:"addColumnAfter"},{key:"shift+alt+[Tab]",ifMode:"math",command:"addColumnBefore"},{key:"alt+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Enter]",ifMode:"math",command:"addRowBefore"},{key:"alt+[Return]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Return]",ifMode:"math",command:"addRowBefore"},{key:"shift+[Backspace]",ifMode:"math",command:"removeColumn"},{key:"alt+[Digit5]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","$\\infty"]},{key:"alt+[Digit9]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","("]},{key:"alt+[Digit0]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert",")"]},{key:"alt+|",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","|"]},{key:"shift+[Backquote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\~"]},{key:"[Backquote]",ifLayout:["windows.french","linux.french"],ifMode:"math",command:["insert","^2"]},{key:"[Backquote]",ifLayout:["windows.german","linux.german"],ifMode:"math",command:["insert","^"]},{key:"[IntlBackslash]",ifLayout:["apple.german"],ifMode:"math",command:["insert","^"]}],Js={"\\sqrt":["alt+v","ctrl+[Digit2]"],"\\pi":"alt+p","\\infty":"alt+[Digit5]","\\differentialD":"alt+d","\\partial":"shift+alt+d","\\frac":"Slash","\\emptyset":"alt+o","\\varnothing":"shift+alt+o","\\~":"~"};function Qs(e){var t;return(null==(t=e.element)?void 0:t.mathfield)===e}function eo(e){const t=function(e){var t,n;return null!=(n=null!=(t=e.querySelector(".ML__caret"))?t:e.querySelector(".ML__text-caret"))?n:e.querySelector(".ML__latex-caret")}(e);if(!t)return null;const n=t.getBoundingClientRect();return{x:n.right,y:n.bottom,height:n.height}}function to(e){var t;if(!e.parent)return"root";let n=null!=(t=e.parent.id)?t:"";return n+="string"==typeof e.parentBranch?"-"+e.parentBranch:`-${e.parentBranch[0]}/${e.parentBranch[0]}`,n}function no(e,t,n){if(!t)return null;const i=e.field.getBoundingClientRect(),r=t.right-t.left,a=t.bottom-t.top,s=Math.ceil(t.left-i.left+e.field.scrollLeft*n),o=Math.ceil(t.top-i.top);return{left:s,right:s+r,top:o,bottom:o+a}}function io(e){const t=e.getBoundingClientRect(),n=parseInt(getComputedStyle(e).marginRight),i={top:t.top-1,bottom:t.bottom,left:t.left,right:t.right-1+n};if(0===e.children.length||"SVG"===e.tagName.toUpperCase())return i;for(const t of e.children)if(1===t.nodeType&&"atomId"in t.dataset&&!t.classList.contains("pstrut")){const e=io(t);i.left=Math.min(i.left,e.left),i.right=Math.max(i.right,e.right),i.top=Math.min(i.top,e.top),i.bottom=Math.max(i.bottom,e.bottom)}return i}function ro(e,t){var n,i;if(!t.id)return null;let r=null!=(i=null==(n=e.atomBoundsCache)?void 0:n.get(t.id))?i:null;if(null!==r)return r;const a=e.field.querySelector(`[data-atom-id="${t.id}"]`);return r=a?io(a):null,e.atomBoundsCache&&(r?e.atomBoundsCache.set(t.id,r):e.atomBoundsCache.delete(t.id)),null!=r?r:null}function ao(e,t){return e.model.selection.ranges.reduce(((n,i)=>n.concat(...function(e,t,n){const i=new Map;for(const r of e.model.getAtoms(t,{includeChildren:!0})){if((null==n?void 0:n.excludeAtomsWithBackground)&&r.style.backgroundColor)continue;const t=e.field,a=t.offsetWidth;let s=Math.floor(t.getBoundingClientRect().width)/a;s=isNaN(s)?1:s;const o=no(e,ro(e,r),s);if(o){const e=to(r);if(i.has(e)){const t=i.get(e);i.set(e,{left:Math.min(t.left,o.left),right:Math.max(t.right,o.right),top:Math.min(t.top,o.top),bottom:Math.max(t.bottom,o.bottom)})}else i.set(e,o)}}return[...i.values()]}(e,i,t))),[])}function so(e,t){return"*"===e||"none"===t||("same-origin"===t?!window.origin||e===window.origin:"function"==typeof t&&t(e))}function oo(e){let t=0,n=0;const i=e.offsetWidth,r=e.offsetHeight;for(;e instanceof HTMLElement;)t+=e.offsetTop,n+=e.offsetLeft,e=e.offsetParent;return new DOMRect(n,t,i,r)}var lo,co;function uo(e){let t="";switch(e){case"mathfield-element":t="\n :host { display: inline-block; background-color: field; color: fieldtext; border-width: 1px; border-style: solid; border-color: #acacac; border-radius: 2px; padding:4px;}\n :host([hidden]) { display: none; }\n :host([disabled]), :host([disabled]:focus), :host([disabled]:focus-within) { outline: none; opacity: .5; }\n :host(:focus), :host(:focus-within) {\n outline: Highlight auto 1px; /* For Firefox */\n outline: -webkit-focus-ring-color auto 1px;\n }\n :host([readonly]:focus), :host([readonly]:focus-within),\n :host([read-only]:focus), :host([read-only]:focus-within) {\n outline: none;\n }\n @media (hover: none) and (pointer: coarse) {\n :host(:not(:focus)) :first-child { pointer-events: none !important; }\n }";break;case"core":t=".ML__container {\n min-height: auto !important;\n --_hue: var(--hue, 212);\n --_placeholder-color: var(--placeholder-color, hsl(var(--_hue), 40%, 49%));\n --_placeholder-opacity: var(--placeholder-opacity, 0.4);\n --_text-font-family: var(--text-font-family, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif);\n}\n.ML__sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n.ML__is-inline {\n display: inline-block;\n}\n.ML__base {\n visibility: inherit;\n display: inline-block;\n position: relative;\n cursor: text;\n padding: 0;\n margin: 0;\n box-sizing: content-box;\n border: 0;\n outline: 0;\n vertical-align: baseline;\n font-weight: inherit;\n font-family: inherit;\n font-style: inherit;\n text-decoration: none;\n width: min-content;\n}\n.ML__strut,\n.ML__strut--bottom {\n display: inline-block;\n min-height: 0.5em;\n}\n.ML__small-delim {\n font-family: KaTeX_Main;\n}\n/* Text mode */\n.ML__text {\n font-family: var(--_text-font-family);\n white-space: pre;\n}\n/* Use cmr for 'math upright' */\n.ML__cmr {\n font-family: KaTeX_Main;\n font-style: normal;\n}\n.ML__mathit {\n font-family: KaTeX_Math;\n /* The KaTeX_Math font is italic by default, so the font-style below is only \n useful when a fallback font is used\n */\n font-style: italic;\n}\n.ML__mathbf {\n font-family: KaTeX_Main;\n font-weight: bold;\n}\n/* Lowercase greek symbols should stick to math font when \\mathbf is applied \n to match TeX idiosyncratic behavior */\n.lcGreek.ML__mathbf {\n font-family: KaTeX_Math;\n font-weight: normal;\n}\n.ML__mathbfit {\n font-family: KaTeX_Math;\n font-weight: bold;\n font-style: italic;\n}\n.ML__ams {\n font-family: KaTeX_AMS;\n}\n/* Blackboard */\n.ML__bb {\n font-family: KaTeX_AMS;\n}\n.ML__cal {\n font-family: KaTeX_Caligraphic;\n}\n.ML__frak {\n font-family: KaTeX_Fraktur;\n}\n.ML__tt {\n font-family: KaTeX_Typewriter;\n}\n.ML__script {\n font-family: KaTeX_Script;\n}\n.ML__sans {\n font-family: KaTeX_SansSerif;\n}\n.ML__series_ul {\n font-weight: 100;\n}\n.ML__series_el {\n font-weight: 100;\n}\n.ML__series_l {\n font-weight: 200;\n}\n.ML__series_sl {\n font-weight: 300;\n}\n.ML__series_sb {\n font-weight: 500;\n}\n.ML__bold,\n.ML__boldsymbol {\n font-weight: 700;\n}\n.ML__series_eb {\n font-weight: 800;\n}\n.ML__series_ub {\n font-weight: 900;\n}\n.ML__series_uc {\n font-stretch: ultra-condensed;\n}\n.ML__series_ec {\n font-stretch: extra-condensed;\n}\n.ML__series_c {\n font-stretch: condensed;\n}\n.ML__series_sc {\n font-stretch: semi-condensed;\n}\n.ML__series_sx {\n font-stretch: semi-expanded;\n}\n.ML__series_x {\n font-stretch: expanded;\n}\n.ML__series_ex {\n font-stretch: extra-expanded;\n}\n.ML__series_ux {\n font-stretch: ultra-expanded;\n}\n.ML__it {\n font-style: italic;\n}\n.ML__shape_ol {\n -webkit-text-stroke: 1px black;\n text-stroke: 1px black;\n color: transparent;\n}\n.ML__shape_sc {\n font-variant: small-caps;\n}\n.ML__shape_sl {\n font-style: oblique;\n}\n/* First level emphasis */\n.ML__emph {\n color: #bc2612;\n}\n/* Second level emphasis */\n.ML__emph .ML__emph {\n color: #0c7f99;\n}\n.ML__highlight {\n color: #007cb2;\n background: #edd1b0;\n}\n.ML__center {\n text-align: center;\n}\n.ML__label_padding {\n padding: 0 0.5em;\n}\n.ML__frac-line {\n width: 100%;\n min-height: 1px;\n}\n.ML__frac-line:after {\n content: '';\n display: block;\n margin-top: max(-1px, -0.04em);\n min-height: max(1px, 0.04em);\n /* Ensure the line is visible when printing even if \"turn off background images\" is on*/\n -webkit-print-color-adjust: exact;\n print-color-adjust: exact;\n /* There's a bug since Chrome 62 where \n sub-pixel border lines don't draw at some zoom \n levels (110%, 90%). \n Setting the min-height used to work around it, but that workaround\n broke in Chrome 84 or so.\n Setting the background (and the min-height) seems to work for now.\n */\n background: currentColor;\n box-sizing: content-box;\n /* Vuetify sets the box-sizing to inherit \n causes the fraction line to not draw at all sizes (see #26) */\n /* On some versions of Firefox on Windows, the line fails to \n draw at some zoom levels, but setting the transform triggers\n the hardware accelerated path, which works */\n transform: translate(0, 0);\n}\n.ML__sqrt {\n display: inline-block;\n}\n.ML__sqrt-sign {\n display: inline-block;\n position: relative;\n}\n.ML__sqrt-line {\n display: inline-block;\n height: max(1px, 0.04em);\n width: 100%;\n}\n.ML__sqrt-line:before {\n content: '';\n display: block;\n margin-top: min(-1px, -0.04em);\n min-height: max(1px, 0.04em);\n /* Ensure the line is visible when printing even if \"turn off background images\" is on*/\n -webkit-print-color-adjust: exact;\n print-color-adjust: exact;\n background: currentColor;\n /* On some versions of Firefox on Windows, the line fails to \n draw at some zoom levels, but setting the transform triggers\n the hardware accelerated path, which works */\n transform: translate(0, 0);\n}\n.ML__sqrt-line:after {\n border-bottom-width: 1px;\n content: ' ';\n display: block;\n margin-top: -0.1em;\n}\n.ML__sqrt-index {\n margin-left: 0.27777778em;\n margin-right: -0.55555556em;\n}\n.ML__delim-size1 {\n font-family: KaTeX_Size1;\n}\n.ML__delim-size2 {\n font-family: KaTeX_Size2;\n}\n.ML__delim-size3 {\n font-family: KaTeX_Size3;\n}\n.ML__delim-size4 {\n font-family: KaTeX_Size4;\n}\n.ML__delim-mult .delim-size1 > span {\n font-family: KaTeX_Size1;\n}\n.ML__delim-mult .delim-size4 > span {\n font-family: KaTeX_Size4;\n}\n.ML__accent-body > span {\n font-family: KaTeX_Main;\n width: 0;\n}\n.ML__accent-vec {\n position: relative;\n left: 0.24em;\n}\n/** The markup for a LaTeX formula, either in an editable mathfield or \n in a static display.\n*/\n.ML__latex {\n display: inline-block;\n direction: ltr;\n text-align: left;\n text-indent: 0;\n text-rendering: auto;\n font-family: KaTeX_Main, 'Times New Roman', serif;\n font-style: normal;\n font-size-adjust: none;\n font-stretch: normal;\n font-variant-caps: normal;\n letter-spacing: normal;\n line-height: 1.2;\n word-wrap: normal;\n word-spacing: normal;\n white-space: nowrap;\n text-shadow: none;\n -webkit-user-select: none;\n user-select: none;\n width: min-content;\n}\n.ML__latex .style-wrap {\n position: relative;\n}\n.ML__latex .mfrac {\n display: inline-block;\n}\n.ML__latex .left-right {\n display: inline-block;\n}\n.ML__latex .vlist-t {\n display: inline-table;\n table-layout: fixed;\n border-collapse: collapse;\n}\n.ML__latex .vlist-r {\n display: table-row;\n}\n.ML__latex .vlist {\n display: table-cell;\n vertical-align: bottom;\n position: relative;\n}\n.ML__latex .vlist > span {\n display: block;\n height: 0;\n position: relative;\n}\n.ML__latex .vlist > span > span {\n display: inline-block;\n}\n.ML__latex .vlist > span > .pstrut {\n overflow: hidden;\n width: 0;\n}\n.ML__latex .vlist-t2 {\n margin-right: -2px;\n}\n.ML__latex .vlist-s {\n display: table-cell;\n vertical-align: bottom;\n font-size: 1px;\n width: 2px;\n min-width: 2px;\n}\n.ML__latex .msubsup {\n text-align: left;\n}\n.ML__latex .negativethinspace {\n display: inline-block;\n margin-left: -0.16667em;\n height: 0.71em;\n}\n.ML__latex .thinspace {\n display: inline-block;\n width: 0.16667em;\n height: 0.71em;\n}\n.ML__latex .mediumspace {\n display: inline-block;\n width: 0.22222em;\n height: 0.71em;\n}\n.ML__latex .thickspace {\n display: inline-block;\n width: 0.27778em;\n height: 0.71em;\n}\n.ML__latex .enspace {\n display: inline-block;\n width: 0.5em;\n height: 0.71em;\n}\n.ML__latex .quad {\n display: inline-block;\n width: 1em;\n height: 0.71em;\n}\n.ML__latex .qquad {\n display: inline-block;\n width: 2em;\n height: 0.71em;\n}\n.ML__latex .llap,\n.ML__latex .rlap {\n width: 0;\n position: relative;\n display: inline-block;\n}\n.ML__latex .llap > .inner,\n.ML__latex .rlap > .inner {\n position: absolute;\n}\n.ML__latex .llap > .fix,\n.ML__latex .rlap > .fix {\n display: inline-block;\n}\n.ML__latex .llap > .inner {\n right: 0;\n}\n.ML__latex .rlap > .inner {\n left: 0;\n}\n.ML__latex .rule {\n display: inline-block;\n border: solid 0;\n position: relative;\n box-sizing: border-box;\n}\n.ML__latex .overline .overline-line,\n.ML__latex .underline .underline-line {\n width: 100%;\n}\n.ML__latex .overline .overline-line:before,\n.ML__latex .underline .underline-line:before {\n content: '';\n border-bottom-style: solid;\n border-bottom-width: max(1px, 0.04em);\n -webkit-print-color-adjust: exact;\n print-color-adjust: exact;\n display: block;\n}\n.ML__latex .overline .overline-line:after,\n.ML__latex .underline .underline-line:after {\n border-bottom-style: solid;\n border-bottom-width: max(1px, 0.04em);\n -webkit-print-color-adjust: exact;\n print-color-adjust: exact;\n content: '';\n display: block;\n margin-top: -1px;\n}\n.ML__latex .stretchy {\n display: block;\n position: absolute;\n width: 100%;\n left: 0;\n overflow: hidden;\n}\n.ML__latex .stretchy:before,\n.ML__latex .stretchy:after {\n content: '';\n}\n.ML__latex .stretchy svg {\n display: block;\n position: absolute;\n width: 100%;\n height: inherit;\n fill: currentColor;\n stroke: currentColor;\n fill-rule: nonzero;\n fill-opacity: 1;\n stroke-width: 1;\n stroke-linecap: butt;\n stroke-linejoin: miter;\n stroke-miterlimit: 4;\n stroke-dasharray: none;\n stroke-dashoffset: 0;\n stroke-opacity: 1;\n}\n.ML__latex .slice-1-of-2 {\n display: inline-flex;\n position: absolute;\n left: 0;\n width: 50.2%;\n overflow: hidden;\n}\n.ML__latex .slice-2-of-2 {\n display: inline-flex;\n position: absolute;\n right: 0;\n width: 50.2%;\n overflow: hidden;\n}\n.ML__latex .slice-1-of-3 {\n display: inline-flex;\n position: absolute;\n left: 0;\n width: 25.1%;\n overflow: hidden;\n}\n.ML__latex .slice-2-of-3 {\n display: inline-flex;\n position: absolute;\n left: 25%;\n width: 50%;\n overflow: hidden;\n}\n.ML__latex .slice-3-of-3 {\n display: inline-flex;\n position: absolute;\n right: 0;\n width: 25.1%;\n overflow: hidden;\n}\n.ML__latex .slice-1-of-1 {\n display: inline-flex;\n position: absolute;\n width: 100%;\n left: 0;\n overflow: hidden;\n}\n.ML__latex .nulldelimiter {\n display: inline-block;\n}\n.ML__latex .op-group {\n display: inline-block;\n}\n.ML__latex .op-symbol {\n position: relative;\n}\n.ML__latex .op-symbol.small-op {\n font-family: KaTeX_Size1;\n}\n.ML__latex .op-symbol.large-op {\n font-family: KaTeX_Size2;\n}\n.ML__latex .mtable .vertical-separator {\n display: inline-block;\n min-width: 1px;\n box-sizing: border-box;\n}\n.ML__latex .mtable .arraycolsep {\n display: inline-block;\n}\n.ML__latex .mtable .col-align-m > .vlist-t {\n text-align: center;\n}\n.ML__latex .mtable .col-align-c > .vlist-t {\n text-align: center;\n}\n.ML__latex .mtable .col-align-l > .vlist-t {\n text-align: left;\n}\n.ML__latex .mtable .col-align-r > .vlist-t {\n text-align: right;\n}\n.ML__error {\n display: inline-block;\n background-image: radial-gradient(ellipse at center, hsl(341, 100%, 40%), rgba(0, 0, 0, 0) 70%);\n background-color: hsla(341, 100%, 40%, 0.1);\n background-repeat: repeat-x;\n background-size: 3px 3px;\n padding-bottom: 3px;\n background-position: 0 100%;\n}\n.ML__error > .ML__error {\n background: transparent;\n padding: 0;\n}\n.ML__placeholder {\n color: var(--_placeholder-color);\n opacity: var(--_placeholder-opacity);\n padding-left: 0.4ex;\n padding-right: 0.4ex;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n}\n.ML__notation {\n position: absolute;\n box-sizing: border-box;\n line-height: 0;\n}\n/* This class is used to implement the `\\mathtip` and `\\texttip` commands\n For UI elements, see `[data-ML__tooltip]`\n*/\n.ML__tooltip-container {\n position: relative;\n transform: scale(0);\n}\n.ML__tooltip-container .ML__tooltip-content {\n position: fixed;\n display: inline-table;\n visibility: hidden;\n z-index: 2;\n width: max-content;\n max-width: 400px;\n padding: 12px 12px;\n border-radius: 8px;\n background: #616161;\n --_selection-color: #fff;\n color: #fff;\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n opacity: 0;\n transition: opacity 0.15s cubic-bezier(0.4, 0, 1, 1);\n}\n.ML__tooltip-container .ML__tooltip-content .ML__text {\n white-space: normal;\n}\n.ML__tooltip-container .ML__tooltip-content .ML__base {\n display: contents;\n}\n.ML__tooltip-container:hover .ML__tooltip-content {\n visibility: visible;\n opacity: 1;\n font-size: 0.75em;\n transform: scale(1) translate(0, 3em);\n}\n";break;case"mathfield":t="@keyframes ML__caret-blink {\n 0%,\n 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0;\n }\n}\n.ML__container {\n display: inline-flex;\n flex-flow: row;\n justify-content: space-between;\n align-items: flex-end;\n min-height: 39px;\n /* Need some room for the virtual keyboard toggle */\n width: 100%;\n /* Encourage browsers to consider allocating a hardware accelerated\n layer for this element. */\n isolation: isolate;\n /* Prevent the browser from trying to interpret touch gestures in the field */\n /* \"Disabling double-tap to zoom removes the need for browsers to\n delay the generation of click events when the user taps the screen.\" */\n touch-action: none;\n --_caret-color: var(--caret-color, hsl(var(--_hue), 40%, 49%));\n --_selection-color: var(--selection-color, #000);\n --_selection-background-color: var(--selection-background-color, hsl(var(--_hue), 70%, 85%));\n --_text-highlight-background-color: var(--highlight-text, hsla(var(--_hue), 40%, 50%, 0.1));\n --_contains-highlight-background-color: var(--contains-highlight-background-color, hsl(var(--_hue), 40%, 95%));\n --_smart-fence-color: var(--smart-fence-color, currentColor);\n --_smart-fence-opacity: var(--smart-fence-opacity, 0.5);\n --_latex-color: var(--latex-color, hsl(var(--_hue), 80%, 40%));\n --_correct-color: var(--correct-color, #10a000);\n --_incorrect-color: var(--incorrect-color, #a01b00);\n --_composition-background-color: var(--composition-background-color, #fff1c2);\n --_composition-text-color: var(--composition-text-color, black);\n --_composition-underline-color: var(--composition-underline-color, transparent);\n}\n/* This is the actual field content (formula) */\n.ML__content {\n display: flex;\n align-items: center;\n align-self: center;\n position: relative;\n overflow: hidden;\n padding: 2px 3px 2px 1px;\n width: 100%;\n}\n.ML__virtual-keyboard-toggle,\n.ML__menu-toggle {\n box-sizing: border-box;\n display: flex;\n align-self: center;\n align-items: center;\n flex-shrink: 0;\n flex-direction: column;\n justify-content: center;\n width: 34px;\n height: 34px;\n padding: 0;\n margin-right: 4px;\n cursor: pointer;\n /* Avoid some weird blinking with :hover */\n border-radius: 8px;\n border: 1px solid transparent;\n transition: background 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);\n color: hsl(var(--_hue), 40%, 50%);\n fill: currentColor;\n background: transparent;\n}\n.ML__virtual-keyboard-toggle:hover,\n.ML__menu-toggle:hover {\n background: hsla(0, 0%, 70%, 0.3);\n color: #333;\n fill: currentColor;\n}\n.ML__virtual-keyboard-toggle > span,\n.ML__menu-toggle > span {\n display: flex;\n align-self: center;\n align-items: center;\n}\n/* The invisible element used to capture keyboard events. We're just trying\n really hard to make sure it doesn't show. */\n.ML__keyboard-sink {\n display: inline-block;\n resize: none;\n outline: none;\n border: none;\n /* Need these for Microsoft Edge */\n position: fixed;\n clip: rect(0 0 0 0);\n /* Need this to prevent iOS Safari from auto-zooming */\n font-size: 1em;\n font-family: KaTeX_Main;\n line-height: 0.5;\n /* On Chromium, if this is 0, no keyboard events are received */\n}\n[part=\"placeholder\"] {\n color: var(--neutral-400);\n}\n.ML__composition {\n background: var(--_composition-background-color);\n color: var(--_composition-text-color);\n text-decoration: underline var(--_composition-underline-color);\n}\n.ML__caret::after {\n content: '';\n visibility: hidden;\n width: 0;\n display: inline-block;\n height: 0.76em;\n --_caret-width: clamp(2px, 0.08em, 10px);\n border: none;\n border-radius: calc(var(--_caret-width) / 2);\n border-right: var(--_caret-width) solid var(--_caret-color);\n margin-right: calc(-1 * var(--_caret-width));\n position: relative;\n left: -0.045em;\n bottom: -0.05em;\n animation: ML__caret-blink 1.05s step-end forwards infinite;\n}\n.ML__text-caret::after {\n content: '';\n visibility: hidden;\n width: 0;\n display: inline-block;\n height: 0.76em;\n --_caret-width: clamp(2px, 0.08em, 10px);\n border: none;\n border-radius: calc(var(--_caret-width) / 2);\n border-right: var(--_caret-width) solid var(--_caret-color);\n margin-right: calc(-1 * var(--_caret-width));\n position: relative;\n left: -0.045em;\n bottom: -0.05em;\n animation: ML__caret-blink 1.05s step-end forwards infinite;\n}\n.ML__latex-caret::after {\n content: '';\n visibility: hidden;\n --_caret-width: clamp(2px, 0.08em, 10px);\n border: none;\n border-radius: calc(var(--_caret-width) / 2);\n border-right: var(--_caret-width) solid var(--_latex-color);\n margin-right: calc(-1 * var(--_caret-width));\n position: relative;\n left: -0.019em;\n animation: ML__caret-blink 1.05s step-end forwards infinite;\n}\n.ML__focused .ML__latex-caret::after,\n.ML__focused .ML__text-caret::after,\n.ML__focused .ML__caret::after {\n visibility: visible;\n}\n.ML__focused .ML__text {\n background: var(--_text-highlight-background-color);\n}\n/* When using smartFence, the anticipated closing fence is displayed\nwith this style */\n.ML__smart-fence__close {\n opacity: var(--_smart-fence-opacity);\n color: var(--_smart-fence-color);\n}\n.ML__selected,\n.ML__focused .ML__selected .ML__contains-caret,\n.ML__focused .ML__selected .ML__smart-fence__close,\n.ML__focused .ML__selected .ML__placeholder {\n color: var(--_selection-color);\n opacity: 1;\n}\n.ML__selection {\n box-sizing: border-box;\n background: var(--_selection-background-color) !important;\n}\n.ML__contains-caret.ML__close,\n.ML__contains-caret.ML__open,\n.ML__contains-caret > .ML__close,\n.ML__contains-caret > .ML__open,\n.ML__contains-caret .ML__sqrt-sign,\n.ML__contains-caret .ML__sqrt-line {\n color: var(--_caret-color);\n}\n.ML__contains-highlight {\n box-sizing: border-box;\n background: transparent;\n}\n.ML__focused .ML__contains-highlight {\n background: var(--_contains-highlight-background-color);\n}\n.ML__raw-latex {\n font-family: 'Berkeley Mono', 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;\n font-weight: 400;\n font-size: 0.8em;\n letter-spacing: -0.05em;\n color: var(--_latex-color);\n}\n.ML__suggestion {\n color: var(--neutral-500);\n}\n.ML__virtual-keyboard-toggle.is-visible.is-pressed:hover {\n background: hsl(var(--_hue), 25%, 35%);\n color: #fafafa;\n fill: currentColor;\n}\n.ML__virtual-keyboard-toggle:focus {\n outline: none;\n border-radius: 8px;\n border: 2px solid hsl(var(--_hue), 40%, 50%);\n}\n.ML__virtual-keyboard-toggle.is-pressed,\n.ML__virtual-keyboard-toggle.is-active:hover,\n.ML__virtual-keyboard-toggle.is-active {\n background: hsl(var(--_hue), 25%, 35%);\n color: #fafafa;\n fill: currentColor;\n}\n/* Add an attribute 'data-tooltip' to automatically show a\n tooltip over a element on hover.\n*/\n[data-tooltip] {\n position: relative;\n}\n[data-tooltip]::after {\n content: attr(data-tooltip);\n position: absolute;\n display: block;\n z-index: 2;\n pointer-events: none;\n right: auto;\n top: calc(-100% - 4px);\n width: max-content;\n max-width: 200px;\n padding: 8px 8px;\n border-radius: 4px;\n background: #616161;\n color: #fff;\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n text-align: center;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n font-style: normal;\n font-weight: 400;\n font-size: 13px;\n /* Phone */\n opacity: 0;\n transform: scale(0.5);\n}\n@media only screen and (max-width: 767px) {\n [data-tooltip]::after {\n padding: 8px 16px;\n font-size: 16px;\n }\n}\nmenu [data-tooltip]::after {\n left: 100%;\n top: 0%;\n}\nmenu .ML__base {\n cursor: default;\n}\n/** Don't display if we're tracking, i.e. have the pointer down */\n.tracking [data-tooltip]:hover::after {\n /* Use visibility, not display. Display will remove the after from the DOM, and the override below will not work */\n visibility: hidden;\n}\n/** But do display if tracking and inside a menu */\n.tracking menu li[data-tooltip]:hover::after,\n[data-tooltip]:hover::after {\n visibility: visible;\n opacity: 1;\n transform: scale(1);\n transition-property: opacity, scale;\n transition-duration: 0.15s;\n transition-delay: 1s;\n transition-timing-function: cubic-bezier(0.4, 0, 1, 1);\n}\n.ML__prompt {\n border-radius: 2px;\n}\n.ML__editablePromptBox {\n outline: 1px solid #acacac;\n border-radius: 2px;\n z-index: -1;\n}\n.ML__focusedPromptBox {\n outline: highlight auto 1px;\n}\n.ML__lockedPromptBox {\n background-color: rgba(142, 142, 141, 0.4);\n z-index: -1;\n}\n.ML__correctPromptBox {\n outline: 1px solid var(--_correct-color);\n box-shadow: 0 0 5px var(--_correct-color);\n}\n.ML__incorrectPromptBox {\n outline: 1px solid var(--_incorrect-color);\n box-shadow: 0 0 5px var(--_incorrect-color);\n}\n.variant-submenu {\n display: flex;\n flex-direction: column;\n padding: 8px;\n}\n.variant-submenu [part=menu-item] {\n font-size: 2rem;\n text-align: center;\n margin: 0;\n}\n.insert-matrix-submenu {\n display: grid;\n padding: 8px;\n align-content: center;\n justify-content: center;\n grid-template-columns: repeat(5, minmax(0, 1fr));\n}\n.insert-matrix-submenu [part=menu-item] {\n font-size: 21px;\n border: none;\n border-radius: 0;\n line-height: 21px;\n text-align: center;\n padding: 0;\n margin: 0;\n}\n.border-submenu [part=menu-item] {\n font-size: 2rem;\n line-height: 1.2;\n text-align: center;\n}\n.swatches-submenu {\n --_swatch-size: 2rem;\n --_columns: 4;\n display: flex;\n flex-flow: wrap;\n padding: 8px;\n max-width: calc(var(--_columns) * (var(--_swatch-size) + 18px) + 16px);\n box-sizing: border-box;\n}\n.menu-swatch {\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: fit-content;\n height: fit-content;\n margin: 2px;\n padding: 0;\n background: var(--neutral-200);\n}\n.menu-swatch > .label {\n padding: 0;\n margin: 0;\n line-height: 0;\n}\n.menu-swatch > .label > span {\n display: inline-block;\n margin: 6px;\n min-width: var(--_swatch-size);\n min-height: var(--_swatch-size);\n border-radius: 50%;\n}\n.menu-swatch.active {\n background: var(--neutral-100);\n scale: 1.4;\n}\n.menu-swatch.active > .label > span {\n border-radius: 2px;\n}\n.menu-swatch .ui-checkmark,\n.menu-swatch .ui-mixedmark {\n position: absolute;\n margin: 0;\n padding: 0;\n color: white;\n}\n.menu-swatch.dark-contrast .ui-checkmark,\n.menu-swatch.dark-contrast .ui-mixedmark {\n color: #000;\n}\n";break;case"environment-popover":t="#mathlive-environment-popover.is-visible {\n visibility: visible;\n}\n#mathlive-environment-popover {\n --_environment-panel-height: var(--environment-panel-height, 70px);\n --_accent-color: var(--accent-color, #aaa);\n --_background: var(--environment-panel-background, #fff);\n --_button-background: var(--environment-panel-button-background, white);\n --_button-background-hover: var(--environment-panel-button-background-hover, #f5f5f7);\n --_button-background-active: var(--environment-panel-button-background-active, #f5f5f7);\n --_button-text: var(--environment-panel-button-text, #e3e4e8);\n position: absolute;\n width: calc(var(--_environment-panel-height) * 2);\n height: var(--_environment-panel-height);\n border-radius: 4px;\n border: 1.5px solid var(--_accent-color);\n background-color: var(--_background);\n box-shadow: 0 0 30px 0 var(--environment-shadow, rgba(0, 0, 0, 0.4));\n pointer-events: all;\n visibility: hidden;\n}\n#mathlive-environment-popover .MLEP__array-buttons {\n height: calc(var(--_environment-panel-height) * 5/4);\n width: calc(var(--_environment-panel-height) * 5/4);\n margin-left: calc(0px - var(--_environment-panel-height) * 0.16);\n margin-top: calc(0px - var(--_environment-panel-height) * 0.19);\n}\n#mathlive-environment-popover .MLEP__array-buttons .font {\n fill: white;\n}\n#mathlive-environment-popover .MLEP__array-buttons circle {\n fill: #7f7f7f;\n transition: fill 300ms;\n}\n#mathlive-environment-popover .MLEP__array-buttons .MLEP__array-insert-background {\n fill-opacity: 1;\n fill: var(--_background);\n stroke: var(--_accent-color);\n stroke-width: 3px;\n}\n#mathlive-environment-popover .MLEP__array-buttons line {\n stroke: var(--_accent-color);\n stroke-opacity: 0;\n stroke-width: 40;\n pointer-events: none;\n transition: stroke-opacity 300ms;\n stroke-linecap: round;\n}\n#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover circle {\n fill: var(--_accent-color);\n}\n#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover line {\n stroke-opacity: 1;\n}\n#mathlive-environment-popover .MLEP__environment-delimiter-controls {\n height: 100%;\n width: 50%;\n}\n#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options {\n width: var(--_environment-panel-height);\n height: var(--_environment-panel-height);\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n justify-content: space-around;\n}\n#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg {\n pointer-events: all;\n margin-top: 2px;\n width: calc(var(--_environment-panel-height) / 3 * 28 / 24);\n height: calc(var(--_environment-panel-height) / 3 - 2px);\n border-radius: calc(var(--_environment-panel-height) / 25);\n background-color: var(--_button-background);\n}\n#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg:hover {\n background-color: var(--_button-background-hover);\n}\n#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path,\n#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg line {\n stroke: var(--_button-text);\n stroke-width: 2;\n stroke-linecap: round;\n}\n#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg rect,\n#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path {\n fill-opacity: 0;\n}\n#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active {\n pointer-events: none;\n background-color: var(--_button-background-active);\n}\n#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active path,\n#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active line {\n stroke: var(--_accent-color);\n}\n#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active circle {\n fill: var(--_accent-color);\n}\n";break;case"suggestion-popover":t="/* The element that display info while in latex mode */\n#mathlive-suggestion-popover {\n background-color: rgba(97, 97, 97);\n color: #fff;\n text-align: center;\n border-radius: 8px;\n position: fixed;\n z-index: 1;\n display: none;\n flex-direction: column;\n justify-content: center;\n box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);\n}\n#mathlive-suggestion-popover.top-tip::after {\n content: '';\n position: absolute;\n top: -15px;\n left: calc(50% - 15px);\n width: 0;\n height: 0;\n border-left: 15px solid transparent;\n border-right: 15px solid transparent;\n border-bottom: 15px solid rgba(97, 97, 97);\n font-size: 1rem;\n}\n#mathlive-suggestion-popover.bottom-tip::after {\n content: '';\n position: absolute;\n bottom: -15px;\n left: calc(50% - 15px);\n width: 0;\n height: 0;\n border-left: 15px solid transparent;\n border-right: 15px solid transparent;\n border-top: 15px solid rgba(97, 97, 97);\n font-size: 1rem;\n}\n#mathlive-suggestion-popover.is-animated {\n transition: all 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);\n animation: ML__fade-in cubic-bezier(0, 0, 0.2, 1) 0.15s;\n}\n#mathlive-suggestion-popover.is-visible {\n display: flex;\n}\n@keyframes ML__fade-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n/* The wrapper class for the entire content of the popover panel */\n#mathlive-suggestion-popover ul {\n display: flex;\n flex-flow: column;\n list-style: none;\n margin: 0;\n padding: 0;\n align-items: flex-start;\n max-height: 400px;\n overflow-y: auto;\n}\n#mathlive-suggestion-popover li {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n margin: 8px;\n padding: 8px;\n width: calc(100% - 16px - 16px);\n column-gap: 1em;\n border-radius: 8px;\n cursor: pointer;\n /* Since the content can be clicked on, provide feedback on hover */\n}\n#mathlive-suggestion-popover li a {\n color: #5ea6fd;\n padding-top: 0.3em;\n margin-top: 0.4em;\n display: block;\n}\n#mathlive-suggestion-popover li a:hover {\n color: #5ea6fd;\n text-decoration: underline;\n}\n#mathlive-suggestion-popover li:hover,\n#mathlive-suggestion-popover li.is-pressed,\n#mathlive-suggestion-popover li.is-active {\n background: rgba(255, 255, 255, 0.1);\n}\n/* The command inside a popover (inside a #mathlive-suggestion-popover) */\n.ML__popover__command {\n font-size: 1.6rem;\n font-family: KaTeX_Main;\n}\n.ML__popover__current {\n background: #5ea6fd;\n color: #fff;\n}\n.ML__popover__latex {\n font-family: 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;\n align-self: center;\n}\n/* The keyboard shortcuts for a symbol as displayed in the popover */\n.ML__popover__keybinding {\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n font-size: 0.8em;\n opacity: 0.7;\n}\n/* Style for the character that joins the modifiers of a keyboard shortcut \n(usually a \"+\" sign)*/\n.ML__shortcut-join {\n opacity: 0.5;\n}\n";break;case"keystroke-caption":t="/* The element that displays the keys as the user type them */\n#mathlive-keystroke-caption-panel {\n visibility: hidden;\n /*min-width: 160px;*/\n /*background-color: rgba(97, 97, 200, .95);*/\n background: var(--secondary, hsl(var(--_hue), 19%, 26%));\n border-color: var(--secondary-border, hsl(0, 0%, 91%));\n box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);\n text-align: center;\n border-radius: 6px;\n padding: 16px;\n position: absolute;\n z-index: 1;\n display: flex;\n flex-direction: row-reverse;\n justify-content: center;\n --keystroke: white;\n --on-keystroke: #555;\n --keystroke-border: #f7f7f7;\n}\n@media (prefers-color-scheme: dark) {\n body:not([theme='light']) #mathlive-keystroke-caption-panel {\n --keystroke: hsl(var(--_hue), 50%, 30%);\n --on-keystroke: hsl(0, 0%, 98%);\n --keystroke-border: hsl(var(--_hue), 50%, 25%);\n }\n}\nbody[theme='dark'] #mathlive-keystroke-caption-panel {\n --keystroke: hsl(var(--_hue), 50%, 30%);\n --on-keystroke: hsl(0, 0%, 98%);\n --keystroke-border: hsl(var(--_hue), 50%, 25%);\n}\n#mathlive-keystroke-caption-panel > span {\n min-width: 14px;\n /*height: 8px;*/\n margin: 0 8px 0 0;\n padding: 4px;\n background-color: var(--keystroke);\n color: var(--on-keystroke);\n fill: currentColor;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n font-size: 1em;\n border-radius: 6px;\n border: 2px solid var(--keystroke-border);\n /*box-shadow: 0 7px 14px rgba(0,0,0,0.25), 0 5px 5px rgba(0,0,0,0.22);*/\n}\n";break;case"virtual-keyboard":t=".ML__keyboard {\n --_keyboard-height: 0;\n --_keyboard-zindex: var(--keyboard-zindex, 105);\n --_accent-color: var(--keyboard-accent-color, #0c75d8);\n --_background: var(--keyboard-background, #cacfd7);\n --_border: var(--keyboard-border, #ddd);\n --_padding-horizontal: var(--keyboard-padding-horizontal, 0px);\n --_padding-top: var(--keyboard-padding-top, 5px);\n --_padding-bottom: var(--keyboard-padding-bottom, 0px);\n --_row-padding-left: var(--keyboard-row-padding-left, 0px);\n --_row-padding-right: var(--keyboard-row-padding-right, 0px);\n --_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f);\n --_toolbar-text-active: var(--keyboard-toolbar-text-active, var(--_accent-color));\n --_toolbar-background: var(--keyboard-toolbar-background, transparent);\n --_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee);\n --_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent);\n --_toolbar-font-size: var(--keyboard-toolbar-font-size, '135%');\n --_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff);\n --_keycap-background: var(--keycap-background, white);\n --_keycap-background-hover: var(--keycap-background-hover, #f5f5f7);\n --_keycap-background-active: var(--keycap-background-active, var(--_accent-color));\n --_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color));\n --_keycap-border: var(--keycap-border, #e5e6e9);\n --_keycap-border-bottom: var(--keycap-border-bottom, #8d8f92);\n --_keycap-text: var(--keycap-text, #000);\n --_keycap-text-active: var(--keycap-text-active, #fff);\n --_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text));\n --_keycap-text-pressed: var(--keycap-text-pressed, #fff);\n --_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color));\n --_keycap-primary-background: var(--keycap-primary-background, var(--_accent-color));\n --_keycap-primary-text: var(--keycap-primary-text, #ddd);\n --_keycap-primary-background-hover: var(--keycap-primary-background-hover, #0d80f2);\n --_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8);\n --_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795);\n --_keycap-secondary-text: var(--keycap-secondary-text, #060707);\n --_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0);\n --_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6);\n --_keycap-height: var(--keycap-height, 60px);\n /* Keycap width (incl. margin) */\n --_keycap-max-width: var(--keycap-max-width, 100px);\n --_keycap-gap: var(--keycap-gap, 8px);\n --_keycap-font-size: var(--keycap-font-size, clamp(16px, 4cqw, 24px));\n --_keycap-small-font-size: var(--keycap-small-font-size, calc(var(--keycap-font-size) * 0.8));\n --_keycap-extra-small-font-size: var(--keycap-extra-small-font-size, calc(var(--keycap-font-size) / 1.42));\n --_variant-panel-background: var(--variant-panel-background, #fff);\n --_variant-keycap-text: var(--variant-keycap-text, var(--_keycap-text));\n --_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active));\n --_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color));\n --_variant-keycap-length: var(--variant-keycap-length, 70px);\n --_variant-keycap-font-size: var(--variant-keycap-font-size, 30px);\n --_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 12px);\n --_keycap-shift-font-size: var(--keycap-shift-font-size, 16px);\n --_keycap-shift-color: var(--keycap-shift-color, var(--_accent-color));\n --_box-placeholder-color: var(--box-placeholder-color, var(--_accent-color));\n --_box-placeholder-pressed-color: var(--box-placeholder-pressed-color, var(--keycap-text-pressed));\n}\n.is-math-mode .MLK__rows .if-text-mode,\n.is-text-mode .MLK__rows .if-math-mode {\n display: none;\n}\n.if-can-undo,\n.if-can-redo,\n.if-can-copy,\n.if-can-cut,\n.if-can-paste {\n opacity: 0.4;\n pointer-events: none;\n}\n.can-undo .if-can-undo,\n.can-redo .if-can-redo,\n.can-copy .if-can-copy,\n.can-cut .if-can-cut,\n.can-paste .if-can-paste {\n opacity: 1;\n pointer-events: all;\n}\nbody > .ML__keyboard {\n position: fixed;\n --_padding-bottom: calc(var(--keyboard-padding-bottom, 0px) + env(safe-area-inset-bottom, 0));\n}\nbody > .ML__keyboard.is-visible > .MLK__backdrop {\n box-shadow: 0 -5px 6px rgba(0, 0, 0, 0.08);\n border-top: 1px solid var(--_border);\n}\nbody > .ML__keyboard.backdrop-is-transparent.is-visible > .MLK__backdrop {\n box-shadow: none;\n border: none;\n}\nbody > .ML__keyboard.is-visible.animate > .MLK__backdrop {\n transition: 0.28s cubic-bezier(0, 0, 0.2, 1);\n transition-property: transform, opacity;\n transition-timing-function: cubic-bezier(0.4, 0, 1, 1);\n}\n.ML__keyboard {\n position: relative;\n overflow: hidden;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n z-index: var(--_keyboard-zindex);\n box-sizing: border-box;\n outline: none;\n border: none;\n margin: 0;\n padding: 0;\n line-height: 1;\n overflow-wrap: unset;\n text-align: left;\n vertical-align: baseline;\n cursor: auto;\n white-space: pre;\n box-shadow: none;\n opacity: 1;\n transform: none;\n pointer-events: none;\n}\n.ML__keyboard :where(div) {\n box-sizing: border-box;\n outline: none;\n border: none;\n margin: 0;\n padding: 0;\n line-height: 1;\n overflow-wrap: unset;\n text-align: left;\n vertical-align: baseline;\n cursor: auto;\n white-space: pre;\n box-shadow: none;\n transform: none;\n}\n.MLK__backdrop {\n position: absolute;\n bottom: calc(-1 * var(--_keyboard-height));\n width: 100%;\n height: var(--_keyboard-height);\n box-sizing: border-box;\n padding-top: var(--_padding-top);\n padding-bottom: var(--_padding-bottom);\n padding-left: var(--_padding-horizontal);\n padding-right: var(--_padding-horizontal);\n opacity: 0;\n visibility: hidden;\n transform: translate(0, 0);\n background: var(--_background);\n}\n.backdrop-is-transparent .MLK__backdrop {\n background: transparent;\n}\n/* If a custom layout has a custom container/backdrop\n (backdrop-is-transparent), make sure to let pointer event go through. */\n.backdrop-is-transparent .MLK__plate {\n background: transparent;\n pointer-events: none;\n}\n/* If a custom layout has a custom container/backdrop, make sure to \n allow pointer events on it. */\n.backdrop-is-transparent .MLK__layer > div > div {\n pointer-events: all;\n}\n.ML__keyboard.is-visible > .MLK__backdrop {\n transform: translate(0, calc(-1 * var(--_keyboard-height)));\n opacity: 1;\n visibility: visible;\n}\n.caps-lock-indicator {\n display: none;\n width: 8px;\n height: 8px;\n background: #0cbc0c;\n box-shadow: inset 0 0 4px 0 #13ca13, 0 0 4px 0 #a9ef48;\n border-radius: 8px;\n right: 8px;\n top: 8px;\n position: absolute;\n}\n.ML__keyboard.is-caps-lock .caps-lock-indicator {\n display: block;\n}\n.ML__keyboard.is-caps-lock .shift {\n background: var(--_keycap-background-active);\n color: var(--_keycap-text-active);\n}\n.MLK__plate {\n position: absolute;\n top: var(--_padding-top);\n left: var(--_padding-horizontal);\n width: calc(100% - 2 * var(--_padding-horizontal));\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n container-type: inline-size;\n touch-action: none;\n -webkit-user-select: none;\n user-select: none;\n pointer-events: all;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n font-size: 16px;\n /* Size of toolbar labels */\n font-weight: 400;\n text-shadow: none;\n}\n.ML__box-placeholder {\n color: var(--_box-placeholder-color);\n}\n.MLK__tex {\n font-family: KaTeX_Main, KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;\n}\n.MLK__tex-math {\n font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;\n font-style: italic;\n}\n.MLK__layer {\n display: none;\n outline: none;\n}\n.MLK__layer.is-visible {\n display: flex;\n flex-flow: column;\n}\n/* Keyboard layouts are made or rows of keys... */\n.MLK__rows {\n --_keycap-width: min(var(--_keycap-max-width), 10cqw);\n display: flex;\n flex-flow: column;\n align-items: center;\n border-collapse: separate;\n clear: both;\n border: 0;\n margin: 0;\n margin-bottom: var(--_keycap-gap);\n gap: var(--_keycap-gap);\n /* If the styling include, e.g., some shadows, they will be\n cut off by the overflow. In that case, set the padding to \n compensate. */\n padding-left: var(--_row-padding-left);\n padding-right: var(--_row-padding-right);\n overflow: visible;\n touch-action: none;\n}\n.MLK__rows > .MLK__row {\n display: flex;\n flex-flow: row;\n justify-content: center;\n width: 100%;\n gap: var(--_keycap-gap);\n margin: 0;\n padding: 0;\n /* For the alignment of the text on some modifiers (e.g. shift) */\n /* Extra spacing between two adjacent keys */\n}\n.MLK__rows > .MLK__row .tex {\n font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;\n}\n.MLK__rows > .MLK__row .tex-math {\n font-family: KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;\n}\n.MLK__rows > .MLK__row .big-op {\n font-size: calc(1.25 * var(--_keycap-font-size));\n}\n.MLK__rows > .MLK__row .small {\n font-size: var(--_keycap-small-font-size);\n}\n.MLK__rows > .MLK__row .bottom {\n justify-content: flex-end;\n}\n.MLK__rows > .MLK__row .left {\n align-items: flex-start;\n padding-left: 12px;\n}\n.MLK__rows > .MLK__row .right {\n align-items: flex-end;\n padding-right: 12px;\n}\n.MLK__rows > .MLK__row .w0 {\n width: 0;\n}\n.MLK__rows > .MLK__row .w5 {\n width: calc(0.5 * var(--_keycap-width) - var(--_keycap-gap));\n}\n.MLK__rows > .MLK__row .w15 {\n width: calc(1.5 * var(--_keycap-width) - var(--_keycap-gap));\n}\n.MLK__rows > .MLK__row .w20 {\n width: calc(2 * var(--_keycap-width) - var(--_keycap-gap));\n}\n.MLK__rows > .MLK__row .w40 {\n width: calc(4 * var(--_keycap-width) - var(--_keycap-gap));\n}\n.MLK__rows > .MLK__row .w50 {\n width: calc(5 * var(--_keycap-width) - var(--_keycap-gap));\n}\n.MLK__rows > .MLK__row .MLK__keycap.w50 {\n font-size: 80%;\n padding-top: 10px;\n font-weight: 100;\n}\n.MLK__rows > .MLK__row .separator {\n background: transparent;\n border: none;\n pointer-events: none;\n}\n.MLK__rows > .MLK__row .horizontal-rule {\n height: 6px;\n margin-top: 3px;\n margin-bottom: 0;\n width: 100%;\n border-radius: 0;\n border-top: var(--_horizontal-rule);\n}\n.MLK__rows > .MLK__row .ghost {\n background: var(--_toolbar-background);\n border: none;\n color: var(--_toolbar-text);\n}\n.MLK__rows > .MLK__row .ghost:hover {\n background: var(--_toolbar-background-hover);\n}\n.MLK__rows > .MLK__row .bigfnbutton {\n font-size: var(--_keycap-extra-small-font-size);\n}\n.MLK__rows > .MLK__row .shift,\n.MLK__rows > .MLK__row .action {\n color: var(--_keycap-secondary-text);\n background: var(--_keycap-secondary-background);\n border-color: var(--_keycap-secondary-border);\n border-bottom-color: var(--_keycap-secondary-border-bottom);\n line-height: 0.8;\n font-size: min(1rem, var(--_keycap-small-font-size));\n font-weight: 600;\n padding: 8px 12px 8px 12px;\n}\n.MLK__rows > .MLK__row .shift:hover,\n.MLK__rows > .MLK__row .action:hover {\n background: var(--_keycap-secondary-background-hover);\n}\n.MLK__rows > .MLK__row .action.primary {\n background: var(--_keycap-primary-background);\n color: var(--_keycap-primary-text);\n}\n.MLK__rows > .MLK__row .action.primary:hover {\n background: var(--_keycap-primary-background-hover);\n color: var(--_keycap-primary-text);\n}\n.MLK__rows > .MLK__row .shift.selected,\n.MLK__rows > .MLK__row .action.selected {\n color: var(--_toolbar-text-active);\n}\n.MLK__rows > .MLK__row .shift.selected.is-pressed,\n.MLK__rows > .MLK__row .action.selected.is-pressed,\n.MLK__rows > .MLK__row .shift.selected.is-active,\n.MLK__rows > .MLK__row .action.selected.is-active {\n color: white;\n}\n.MLK__rows > .MLK__row .warning {\n background: #cd0030;\n color: white;\n}\n.MLK__rows > .MLK__row .warning svg.svg-glyph {\n width: 24px;\n height: 24px;\n min-height: 24px;\n}\n/** A regular keycap\n * Use the :where() pseudo-class to give it a very low specifity, \n * so that it can be overriden by custom style.\n */\n:where(.MLK__rows > .MLK__row div) {\n display: flex;\n flex-flow: column;\n align-items: center;\n justify-content: space-evenly;\n width: calc(var(--_keycap-width) - var(--_keycap-gap));\n height: var(--_keycap-height);\n box-sizing: border-box;\n padding: 0;\n vertical-align: top;\n text-align: center;\n float: left;\n color: var(--_keycap-text);\n fill: currentColor;\n font-size: var(--_keycap-font-size);\n background: var(--_keycap-background);\n border: 1px solid var(--_keycap-border);\n border-bottom-color: var(--_keycap-border-bottom);\n border-radius: 6px;\n cursor: pointer;\n touch-action: none;\n /* Keys with a variants panel */\n position: relative;\n overflow: hidden;\n -webkit-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n:where(.MLK__rows > .MLK__row div):hover {\n overflow: visible;\n background: var(--_keycap-background-hover);\n}\n:where(.MLK__rows > .MLK__row div) .ML__latex {\n pointer-events: none;\n touch-action: none;\n}\n:where(.MLK__rows > .MLK__row div) svg.svg-glyph {\n margin: 8px 0;\n width: 20px;\n height: 20px;\n min-height: 20px;\n}\n:where(.MLK__rows > .MLK__row div) svg.svg-glyph-lg {\n margin: 8px 0;\n width: 24px;\n height: 24px;\n min-height: 24px;\n}\n:where(.MLK__rows > .MLK__row div).MLK__tex-math {\n font-size: 25px;\n}\n:where(.MLK__rows > .MLK__row div).is-pressed {\n background: var(--_keycap-background-pressed);\n color: var(--_keycap-text-pressed);\n --_box-placeholder-color: var(--_box-placeholder-pressed-color);\n}\n:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active,\n:where(.MLK__rows > .MLK__row div).action.is-active,\n:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed,\n:where(.MLK__rows > .MLK__row div).action.is-pressed {\n z-index: calc(var(--_keyboard-zindex) - 5);\n}\n:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active aside,\n:where(.MLK__rows > .MLK__row div).action.is-active aside,\n:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed aside,\n:where(.MLK__rows > .MLK__row div).action.is-pressed aside {\n display: none;\n}\n:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active .MLK__shift,\n:where(.MLK__rows > .MLK__row div).action.is-active .MLK__shift,\n:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed .MLK__shift,\n:where(.MLK__rows > .MLK__row div).action.is-pressed .MLK__shift {\n display: none;\n}\n:where(.MLK__rows > .MLK__row div).shift.is-pressed,\n:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed,\n:where(.MLK__rows > .MLK__row div).action.is-pressed {\n background: var(--_keycap-background-pressed);\n color: var(--_keycap-text-pressed);\n}\n:where(.MLK__rows > .MLK__row div).shift.is-active,\n:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active,\n:where(.MLK__rows > .MLK__row div).action.is-active {\n background: var(--_keycap-background-active);\n color: var(--_keycap-text-active);\n --_box-placeholder-color: var(--_box-placeholder-pressed-color);\n}\n:where(.MLK__rows > .MLK__row div) small {\n color: var(--_keycap-secondary-text);\n}\n:where(.MLK__rows > .MLK__row div) aside {\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n font-size: 10px;\n line-height: 10px;\n color: var(--_keycap-secondary-text);\n}\n/* Add an attribute 'data-tooltip' to display a tooltip on hover.\nNote there are a different set of tooltip rules for the keyboard toggle\n(it's in a different CSS tree) */\n.ML__keyboard [data-tooltip] {\n position: relative;\n}\n.ML__keyboard [data-tooltip]::after {\n position: absolute;\n display: inline-table;\n content: attr(data-tooltip);\n top: inherit;\n bottom: 100%;\n width: max-content;\n max-width: 200px;\n padding: 8px 8px;\n background: #616161;\n color: #fff;\n text-align: center;\n z-index: 2;\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n font-weight: 400;\n font-size: 12px;\n transition: all 0.15s cubic-bezier(0.4, 0, 1, 1) 1s;\n opacity: 0;\n transform: scale(0.5);\n}\n.ML__keyboard [data-tooltip]:hover {\n position: relative;\n}\n.ML__keyboard [data-tooltip]:hover::after {\n opacity: 1;\n transform: scale(1);\n}\n.MLK__toolbar {\n align-self: center;\n display: flex;\n flex-flow: row;\n justify-content: space-between;\n width: 100%;\n max-width: 996px;\n min-height: 32px;\n /* Icons for undo/redo, etc. */\n}\n.MLK__toolbar svg {\n height: 20px;\n width: 20px;\n}\n.MLK__toolbar > .left {\n position: relative;\n display: flex;\n justify-content: flex-start;\n flex-flow: row;\n}\n.MLK__toolbar > .right {\n display: flex;\n justify-content: flex-end;\n flex-flow: row;\n}\n.MLK__toolbar > div > div {\n /* \"button\" in the toolbar */\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--_toolbar-text);\n fill: currentColor;\n background: var(--_toolbar-background);\n font-size: var(--_toolbar-font-size);\n padding: 4px 15px;\n cursor: pointer;\n width: max-content;\n min-width: 42px;\n min-height: 34px;\n border: none;\n padding-left: 10px;\n padding-right: 10px;\n padding-bottom: 8px;\n padding-top: 8px;\n margin-top: 0;\n margin-bottom: 4px;\n margin-left: 4px;\n margin-right: 4px;\n border-radius: 8px;\n box-shadow: none;\n border-bottom: 2px solid transparent;\n}\n.MLK__toolbar > div > div:not(.disabled):not(.selected):hover {\n background: var(--_toolbar-background-hover);\n}\n.MLK__toolbar > div > div.disabled svg,\n.MLK__toolbar > div > div.disabled:hover svg,\n.MLK__toolbar > div > div.disabled.is-pressed svg {\n color: var(--_toolbar-text);\n opacity: 0.2;\n}\n.MLK__toolbar > div > div:hover,\n.MLK__toolbar > div > div:active,\n.MLK__toolbar > div > div.is-pressed,\n.MLK__toolbar > div > div.is-active {\n color: var(--_toolbar-text-active);\n}\n.MLK__toolbar > div > div.selected {\n color: var(--_toolbar-text-active);\n background: var(--_toolbar-background-selected);\n border-radius: 0;\n border-bottom-color: var(--_toolbar-text-active);\n padding-bottom: 4px;\n margin-bottom: 8px;\n}\n/* This is the element that displays variants on press+hold */\n.MLK__variant-panel {\n visibility: hidden;\n position: fixed;\n display: flex;\n flex-flow: row wrap-reverse;\n justify-content: center;\n align-content: center;\n margin: 0;\n padding: 0;\n bottom: auto;\n top: 0;\n box-sizing: content-box;\n transform: none;\n z-index: calc(var(--_keyboard-zindex) + 1);\n touch-action: none;\n max-width: 350px;\n background: var(--_variant-panel-background);\n text-align: center;\n border-radius: 6px;\n padding: 6px;\n box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);\n transition: none;\n}\n.MLK__variant-panel.is-visible {\n visibility: visible;\n}\n.MLK__variant-panel.compact {\n --_variant-keycap-length: var(--variant-keycap-length, 50px);\n --_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);\n --_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 10px);\n}\n.MLK__variant-panel .item {\n display: flex;\n flex-flow: column;\n align-items: center;\n justify-content: center;\n font-size: var(--_variant-keycap-font-size);\n height: var(--_variant-keycap-length);\n width: var(--_variant-keycap-length);\n margin: 0;\n box-sizing: border-box;\n border-radius: 5px;\n border: 1px solid transparent;\n background: transparent;\n pointer-events: all;\n cursor: pointer;\n color: var(--_variant-keycap-text);\n fill: currentColor;\n}\n@media (max-height: 412px) {\n .MLK__variant-panel .item {\n --_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);\n --_variant-keycap-length: var(--variant-keycap-length, 50px);\n }\n}\n.MLK__variant-panel .item .ML__latex {\n pointer-events: none;\n}\n.MLK__variant-panel .item.is-active {\n background: var(--_variant-keycap-background-active);\n color: var(--_variant-keycap-text-active);\n}\n.MLK__variant-panel .item.is-pressed {\n background: var(--_variant-keycap-background-pressed);\n color: var(--_variant-keycap-text-pressed);\n}\n.MLK__variant-panel .item.small {\n font-size: var(--_keycap-small-font-size);\n}\n.MLK__variant-panel .item.swatch-button {\n box-sizing: border-box;\n background: #fbfbfb;\n}\n.MLK__variant-panel .item.swatch-button > span {\n display: inline-block;\n margin: 6px;\n width: calc(100% - 12px);\n height: calc(100% - 12px);\n border-radius: 50%;\n}\n.MLK__variant-panel .item.swatch-button:hover {\n background: #f0f0f0;\n}\n.MLK__variant-panel .item.swatch-button:hover > span {\n border-radius: 2px;\n}\n.MLK__variant-panel .item.box > div,\n.MLK__variant-panel .item.box > span {\n border: 1px dashed rgba(0, 0, 0, 0.24);\n}\n.MLK__variant-panel .item .warning {\n min-height: 60px;\n min-width: 60px;\n background: #cd0030;\n color: white;\n padding: 5px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 5px;\n}\n.MLK__variant-panel .item .warning.is-pressed,\n.MLK__variant-panel .item .warning.is-active {\n background: red;\n}\n.MLK__variant-panel .item .warning svg.svg-glyph {\n width: 50px;\n height: 50px;\n}\n.MLK__variant-panel .item aside {\n font-size: var(--_variant-keycap-aside-font-size);\n line-height: 12px;\n opacity: 0.78;\n padding-top: 2px;\n}\n.MLK__keycap {\n position: relative;\n}\n.MLK__shift {\n display: block;\n position: absolute;\n right: 4px;\n top: 4px;\n font-size: var(--_keycap-shift-font-size);\n color: var(--_keycap-shift-color);\n}\n.hide-shift .MLK__shift {\n display: none;\n}\n@media (max-width: 414px) {\n .MLK__variant-panel {\n max-width: 350px;\n --_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);\n --_variant-keycap-length: var(--variant-keycap-length, 50px);\n }\n}\n/* @xs breakpoint: iPhone 5 */\n@container (max-width: 414px) {\n .MLK__rows {\n --_keycap-gap: max(var(--_keycap-gap, 2px), 2px);\n --_keycap-height: max(var(--_keycap-height), 42px);\n --_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px);\n }\n .MLK__toolbar > div > div {\n font-size: 100%;\n margin-left: 2px;\n margin-right: 2px;\n }\n .MLK__rows .shift,\n .MLK__rows .action {\n font-size: 65%;\n }\n .MLK__rows .warning svg.svg-glyph {\n width: 14px;\n height: 14px;\n min-height: 14px;\n }\n}\n@container (max-width: 744px) {\n .MLK__rows {\n --_keycap-gap: max(var(--keycap-gap, 2px), 2px);\n --_keycap-height: max(var(--keycap-height, 52px), 52px);\n --_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px);\n }\n .MLK__toolbar > div > div {\n padding-left: 0;\n padding-right: 0;\n }\n .MLK__tooltip::after {\n padding: 8px 16px;\n font-size: 16px;\n }\n .MLK__rows > .MLK__row > div.fnbutton {\n font-size: 16px;\n }\n .MLK__rows > .MLK__row > div.bigfnbutton {\n font-size: calc(var(--_keycap-extra-small-font-size) / 1.55);\n }\n .MLK__rows > .MLK__row > div.small {\n font-size: 13px;\n }\n .MLK__rows > .MLK__row > div > aside {\n display: none;\n }\n .MLK__shift {\n display: none;\n }\n}\n/* Medium breakpoint: larger phones */\n@container (max-width: 768px) {\n .MLK__rows {\n --_keycap-height: max(var(--keycap-height, 42px), 42px);\n }\n .MLK__rows > .MLK__row > div > small {\n font-size: 14px;\n }\n}\n@media (max-height: 768px) {\n .MLK__rows {\n --_keycap-height: max(var(--keycap-height, 42px), 42px);\n }\n .MLK__rows > .MLK__row > div > small {\n font-size: 14px;\n }\n}\n@container (max-width: 1444px) {\n .MLK__rows .if-wide {\n display: none;\n }\n}\n@media (prefers-color-scheme: dark) {\n .ML__keyboard {\n --_accent-color: var(--keyboard-accent-color, #0b5c9c);\n --_background: var(--keyboard-background, #151515);\n --_border: var(--keyboard-border, transparent);\n --_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8);\n --_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030);\n --keyboard-toolbar-background-hover: #303030;\n --_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030);\n --_keycap-background: var(--keycap-background, #1f2022);\n --_keycap-background-hover: var(--keycap-background-hover, #2f3032);\n --_keycap-border: var(--_keycap-border, transparent);\n --_keycap-border-bottom: var(--_keycap-border-bottom, transparent);\n --_keycap-text: var(--keycap-text, #e3e4e8);\n --_keycap-secondary-background: var(--keycap-secondary-background, #3d4144);\n --_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154);\n --_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee);\n --keycap-secondary-border: transparent;\n --keycap-secondary-border-bottom: transparent;\n --_keycap-secondary-border: var(--keycap-secondary-border, transparent);\n --_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent);\n --_variant-panel-background: var(--variant-panel-background, #303030);\n --_variant-keycap-text-active: var(--variant-keycap-text-active, #fff);\n }\n}\n/* Same as the media query, but with a class */\n[theme='dark'] .ML__keyboard {\n --_accent-color: var(--keyboard-accent-color, #0b5c9c);\n --_background: var(--keyboard-background, #151515);\n --_border: var(--keyboard-border, transparent);\n --_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8);\n --_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030);\n --keyboard-toolbar-background-hover: #303030;\n --_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030);\n --_keycap-background: var(--keycap-background, #1f2022);\n --_keycap-background-hover: var(--keycap-background-hover, #2f3032);\n --_keycap-border: var(--_keycap-border, transparent);\n --_keycap-border-bottom: var(--_keycap-border-bottom, transparent);\n --_keycap-text: var(--keycap-text, #e3e4e8);\n --_keycap-secondary-background: var(--keycap-secondary-background, #3d4144);\n --_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154);\n --_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee);\n --keycap-secondary-border: transparent;\n --keycap-secondary-border-bottom: transparent;\n --_keycap-secondary-border: var(--keycap-secondary-border, transparent);\n --_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent);\n --_variant-panel-background: var(--variant-panel-background, #303030);\n --_variant-keycap-text-active: var(--variant-keycap-text-active, #fff);\n}\n[theme='light'] .ML__keyboard {\n --_accent-color: var(--keyboard-accent-color, #0c75d8);\n --_background: var(--keyboard-background, #cacfd7);\n --_border: var(--keyboard-border, #ddd);\n --_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f);\n --_toolbar-background: var(--keyboard-toolbar-background, transparent);\n --_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee);\n --_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent);\n --_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff);\n --_keycap-background: var(--keycap-background, white);\n --_keycap-background-hover: var(--keycap-background-hover, #f5f5f7);\n --_keycap-background-active: var(--keycap-background-active, var(--_accent-color));\n --_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color));\n --_keycap-border: var(--_keycap-border, #e5e6e9);\n --_keycap-border-bottom: var(--_keycap-border-bottom, #8d8f92);\n --_keycap-text: var(--keycap-text, #000);\n --_keycap-text-active: var(--keycap-text-active, #fff);\n --_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text));\n --_keycap-text-pressed: var(--keycap-text-pressed, #fff);\n --_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color));\n --_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8);\n --_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795);\n --_keycap-secondary-text: var(--keycap-secondary-text, #060707);\n --_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0);\n --_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6);\n --_variant-panel-background: var(--variant-panel-background, #fff);\n --_variant-keycap-text: var(--variant-keycap-textvar, var(--_keycap-text));\n --_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active));\n --_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color));\n}\n";break;case"ui":t=":host {\n --primary-color: #5898ff;\n --primary-color-dimmed: #c0c0f0;\n --primary-color-dark: var(--blue-500);\n --primary-color-light: var(--blue-100);\n --primary-color-reverse: #ffffff;\n --secondary-color: #ff8a65;\n --secondary-color-dimmed: #f0d5c5;\n --secondary-color-dark: var(--orange-500);\n --secondary-color-light: var(--orange-100);\n --secondary-color-reverse: #ffffff;\n --link-color: #5898ff;\n --link-color-dimmed: #c5c5c5;\n --link-color-dark: #121212;\n --link-color-light: #e2e2e2;\n --link-color-reverse: #ffffff;\n --semantic-blue: var(--blue-700);\n --semantic-red: var(--red-400);\n --semantic-orange: var(--orange-400);\n --semantic-green: var(--green-700);\n --neutral-100: #f5f5f5;\n --neutral-200: #eeeeee;\n --neutral-300: #e0e0e0;\n --neutral-400: #bdbdbd;\n --neutral-500: #9e9e9e;\n --neutral-600: #757575;\n --neutral-700: #616161;\n --neutral-800: #424242;\n --neutral-900: #212121;\n --red-25: #fff8f7;\n --red-50: #fff1ef;\n --red-100: #ffeae6;\n --red-200: #ffcac1;\n --red-300: #ffa495;\n --red-400: #ff7865;\n --red-500: #f21c0d;\n --red-600: #e50018;\n --red-700: #d30024;\n --red-800: #bd002c;\n --red-900: #a1002f;\n --orange-25: #fffbf8;\n --orange-50: #fff7f1;\n --orange-100: #fff3ea;\n --orange-200: #ffe1c9;\n --orange-300: #ffcca2;\n --orange-400: #ffb677;\n --orange-500: #fe9310;\n --orange-600: #f58700;\n --orange-700: #ea7c00;\n --orange-800: #dc6d00;\n --orange-900: #ca5b00;\n --brown-25: #fff8ef;\n --brown-50: #fff1df;\n --brown-100: #ffe9ce;\n --brown-200: #ebcca6;\n --brown-300: #cdaf8a;\n --brown-400: #af936f;\n --brown-500: #856a47;\n --brown-600: #7f5e34;\n --brown-700: #78511f;\n --brown-800: #6e4200;\n --brown-900: #593200;\n --yellow-25: #fffdf9;\n --yellow-50: #fffcf2;\n --yellow-100: #fffaec;\n --yellow-200: #fff2ce;\n --yellow-300: #ffe8ab;\n --yellow-400: #ffdf85;\n --yellow-500: #ffcf33;\n --yellow-600: #f1c000;\n --yellow-700: #dfb200;\n --yellow-800: #c9a000;\n --yellow-900: #ad8a00;\n --lime-25: #f4ffee;\n --lime-50: #e9ffdd;\n --lime-100: #ddffca;\n --lime-200: #a8fb6f;\n --lime-300: #94e659;\n --lime-400: #80d142;\n --lime-500: #63b215;\n --lime-600: #45a000;\n --lime-700: #268e00;\n --lime-800: #007417;\n --lime-900: #005321;\n --green-25: #f5fff5;\n --green-50: #ebffea;\n --green-100: #e0ffdf;\n --green-200: #a7ffa7;\n --green-300: #5afa65;\n --green-400: #45e953;\n --green-500: #17cf36;\n --green-600: #00b944;\n --green-700: #00a34a;\n --green-800: #008749;\n --green-900: #00653e;\n --teal-25: #f3ffff;\n --teal-50: #e6fffe;\n --teal-100: #d9fffe;\n --teal-200: #8dfffe;\n --teal-300: #57f4f4;\n --teal-400: #43e5e5;\n --teal-500: #17cfcf;\n --teal-600: #00c2c0;\n --teal-700: #00b5b1;\n --teal-800: #00a49e;\n --teal-900: #009087;\n --cyan-25: #f7fcff;\n --cyan-50: #eff8ff;\n --cyan-100: #e7f5ff;\n --cyan-200: #c2e6ff;\n --cyan-300: #95d5ff;\n --cyan-400: #61c4ff;\n --cyan-500: #13a7ec;\n --cyan-600: #069eda;\n --cyan-700: #0095c9;\n --cyan-800: #0088b2;\n --cyan-900: #0a7897;\n --blue-25: #f7faff;\n --blue-50: #eef5ff;\n --blue-100: #e5f1ff;\n --blue-200: #bfdbff;\n --blue-300: #92c2ff;\n --blue-400: #63a8ff;\n --blue-500: #0d80f2;\n --blue-600: #0077db;\n --blue-700: #006dc4;\n --blue-800: #0060a7;\n --blue-900: #005086;\n --indigo-25: #f8f7ff;\n --indigo-50: #f1efff;\n --indigo-100: #eae7ff;\n --indigo-200: #ccc3ff;\n --indigo-300: #ac99ff;\n --indigo-400: #916aff;\n --indigo-500: #63c;\n --indigo-600: #5a21b2;\n --indigo-700: #4e0b99;\n --indigo-800: #3b0071;\n --indigo-900: #220040;\n --purple-25: #fbf7ff;\n --purple-50: #f8f0ff;\n --purple-100: #f4e8ff;\n --purple-200: #e4c4ff;\n --purple-300: #d49aff;\n --purple-400: #c36aff;\n --purple-500: #a219e6;\n --purple-600: #9000c4;\n --purple-700: #7c009f;\n --purple-800: #600073;\n --purple-900: #3d0043;\n --magenta-25: #fff8fb;\n --magenta-50: #fff2f6;\n --magenta-100: #ffebf2;\n --magenta-200: #ffcddf;\n --magenta-300: #ffa8cb;\n --magenta-400: #ff7fb7;\n --magenta-500: #eb4799;\n --magenta-600: #da3689;\n --magenta-700: #c82179;\n --magenta-800: #b00065;\n --magenta-900: #8a004c;\n}\n@media (prefers-color-scheme: dark) {\n :host {\n --semantic-blue: var(--blue-700);\n --semantic-red: var(--red-400);\n --semantic-orange: var(--orange-400);\n --semantic-green: var(--green-700);\n --semantic-bg-blue: var(--blue-25);\n --semantic-bg-red: var(--red-25);\n --semantic-bg-orange: var(--orange-25);\n --semantic-bg-green: var(--green-25);\n --neutral-100: #121212;\n --neutral-200: #424242;\n --neutral-300: #616161;\n --neutral-400: #757575;\n --neutral-500: #9e9e9e;\n --neutral-600: #bdbdbd;\n --neutral-700: #e0e0e0;\n --neutral-800: #eeeeee;\n --neutral-900: #f5f5f5;\n }\n}\n:host([theme='dark']) {\n --semantic-blue: var(--blue-700);\n --semantic-red: var(--red-400);\n --semantic-orange: var(--orange-400);\n --semantic-green: var(--green-700);\n --semantic-bg-blue: var(--blue-25);\n --semantic-bg-red: var(--red-25);\n --semantic-bg-orange: var(--orange-25);\n --semantic-bg-green: var(--green-25);\n --neutral-100: #121212;\n --neutral-200: #424242;\n --neutral-300: #616161;\n --neutral-400: #757575;\n --neutral-500: #9e9e9e;\n --neutral-600: #bdbdbd;\n --neutral-700: #e0e0e0;\n --neutral-800: #eeeeee;\n --neutral-900: #f5f5f5;\n}\n/* @media (prefers-color-scheme: dark) {\n :host {\n --label-color: #fff;\n --active-label-color: #000;\n --menu-bg: #525252;\n --active-bg: #5898ff;\n --active-bg-dimmed: #5c5c5c;\n }\n} */\n:host {\n --ui-font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont,\n 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji',\n 'Segoe UI Emoji', 'Segoe UI Symbol';\n --ui-font-size: 14px;\n --ui-line-height: 1.5;\n --ui-letter-spacing: 0.007em;\n --mono-font-family: 'Berkeley Mono', 'JetBrains Mono', 'IBM Plex Mono',\n 'Source Code Pro', Menlo, Monaco, 'Courier New', monospace;\n --ui-layer-1: var(--neutral-100);\n --ui-layer-2: var(--neutral-200);\n --ui-layer-3: var(--neutral-300);\n --ui-layer-4: var(--neutral-400);\n --ui-layer-5: var(--neutral-500);\n --ui-layer-6: var(--neutral-600);\n --ui-border-color: var(--primary-color);\n --ui-border-radius: 4px;\n --ui-text: var(--neutral-900);\n --ui-text-secondary: var(--neutral-700);\n --ui-text-placeholder: var(--neutral-500);\n --ui-text-muted: var(--neutral-300);\n /** A field is a UI element in which a user can type data, for\n * example an input or textarea element.\n */\n --ui-field-bg: var(--neutral-100);\n --ui-field-bg-hover: var(--neutral-100);\n --ui-field-bg-disabled: var(--neutral-300);\n --ui-field-bg-invalid: var(--red-100);\n --ui-field-bg-focus: var(--neutral-100);\n --ui-field-border: 0.5px solid var(--border-color);\n --ui-field-border-hover: 0.5px solid var(--border-color);\n --ui-field-border-disabled: 0.5px solid var(--border-color);\n --ui-field-border-invalid: 0.5px solid var(--border-color);\n --ui-field-border-focus: 0.5px solid var(--border-color);\n --ui-menu-bg: var(--neutral-100);\n --ui-menu-text: var(--neutral-900);\n --ui-menu-bg-hover: var(--neutral-200);\n --ui-menu-text-hover: var(--neutral-900);\n /** The `active` state is used for the state of menu items\n * when they are selected.\n */\n --ui-menu-bg-active: var(--primary-color);\n --ui-menu-text-active: var(--primary-color-reverse);\n /** The `active-muted` set is used for the state of\n * submenus when they are open.\n */\n --ui-menu-bg-active-muted: var(--neutral-300);\n --ui-menu-text-active-muted: var(--neutral-900);\n /* --ui-menu-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.302),\n0 2px 6px 2px rgba(60, 64, 67, 0.149); */\n --ui-menu-shadow: 0 0 2px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, 0.2);\n --ui-menu-divider: 0.5px solid #c7c7c7;\n /* var(--neutral-300); */\n --ui-menu-z-index: 10000;\n --page-bg: var(--neutral-100);\n --content-bg: var(--neutral-200);\n}\n@media (prefers-color-scheme: dark) {\n :host {\n --ui-menu-bg: var(--neutral-200);\n }\n}\n:host([theme='dark']) {\n --ui-menu-bg: var(--neutral-200);\n}\n/* PingFang SC is a macOS font. Microsoft Yahei is a Windows font. \n Noto is a Linux/Android font.\n*/\n:lang(zh-cn),\n:lang(zh-sg),\n:lang(zh-my),\n:lang(zh) {\n --ui-font-family: -apple-system, system-ui, 'PingFang SC', 'Hiragino Sans GB',\n 'Noto Sans CJK SC', 'Noto Sans SC', 'Noto Sans', 'Microsoft Yahei UI',\n 'Microsoft YaHei New', 'Microsoft Yahei', '微软雅黑', SimSun, '宋体',\n STXihei, '华文细黑', sans-serif;\n}\n:lang(zh-tw),\n:lang(zh-hk),\n:lang(zh-mo) {\n --ui-font-family: -apple-system, system-ui, 'Noto Sans',\n 'Microsoft JhengHei UI', 'Microsoft JhengHei', '微軟正黑體', '新細明體',\n 'PMingLiU', '細明體', 'MingLiU', sans-serif;\n}\n:lang(ja),\n:lang(ja-jp),\n:lang(ja-jp-mac) {\n --ui-font-family: -apple-system, system-ui, 'Hiragino Sans',\n 'Hiragino Kaku Gothic ProN', 'Noto Sans CJK JP', 'Noto Sans JP', 'Noto Sans',\n '游ゴシック', '游ゴシック体', YuGothic, 'Yu Gothic', 'メイリオ', Meiryo,\n 'MS Pゴシック', 'MS PGothic', sans-serif;\n}\n:lang(ko),\n:lang(ko-kr),\n:lang(ko-kr-std) {\n --ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',\n 'Noto Sans', 'Malgun Gothic', '맑은 고딕', 'Apple SD Gothic Neo',\n '애플 SD 산돌고딕 Neo', 'Apple SD 산돌고딕 Neo', '돋움', Dotum, sans-serif;\n}\n:lang(ko-kr-apple) {\n --ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',\n 'Noto Sans', 'Apple SD Gothic Neo', '애플 SD 산돌고딕 Neo',\n 'Apple SD 산돌고딕 Neo', '돋움', Dotum, sans-serif;\n}\n:lang(zh-cn),\n:lang(zh-sg),\n:lang(zh-my),\n:lang(zh),\n:lang(zh-tw),\n:lang(zh-hk),\n:lang(zh-mo),\n:lang(ja),\n:lang(ja-jp),\n:lang(ja-jp-mac),\n:lang(ko),\n:lang(ko-kr),\n:lang(ko-kr-std),\n:lang(ko-kr-apple) {\n --ui-font-size: 1rem;\n --ui-line-height: 1.7;\n --ui-letter-spacing: 0;\n}\n:dir(rtl) {\n --ui-line-height: auto;\n --ui-letter-spacing: 0;\n}\n";break;case"menu":t=".ui-menu *,\n.ui-menu ::before,\n.ui-menu ::after {\n box-sizing: border-box;\n}\n.ui-menu {\n display: none;\n color-scheme: light dark;\n -webkit-user-select: none;\n /* Important: Safari iOS doesn't respect user-select */\n user-select: none;\n cursor: default;\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: rgba(0 0 0 0);\n --active-label-color: #fff;\n /* ui-menu-text-active */\n --label-color: #121212;\n /* ui-menu-text */\n --menu-bg: #e2e2e2;\n /* ui-menu-background */\n --active-bg: #5898ff;\n /* ui-menu-background-active */\n --active-bg-dimmed: #c5c5c5;\n /* ui-menu-background-active-muted */\n}\n/** Use the :where pseudo selector to make the specificity of the\n * selector 0, so that it can be overridden by the user.\n */\n:where(.ui-menu-container) {\n position: absolute;\n overflow: visible;\n width: auto;\n height: auto;\n z-index: 10000;\n border-radius: 8px;\n background: var(--ui-menu-bg);\n box-shadow: var(--ui-menu-shadow);\n list-style: none;\n padding: 6px 0 6px 0;\n margin: 0;\n user-select: none;\n cursor: default;\n color: var(--ui-menu-text);\n font-weight: normal;\n font-style: normal;\n text-shadow: none;\n text-transform: none;\n letter-spacing: 0;\n outline: none;\n opacity: 1;\n /* The [popover] elements have a 1px solid black border. Ugh. */\n border: none;\n width: fit-content;\n height: fit-content;\n}\n:where(.ui-menu-container > li) {\n display: flex;\n flex-flow: row;\n align-items: center;\n padding: 1px 7px 1px 7px;\n margin-top: 0;\n margin-left: 6px;\n margin-right: 6px;\n border-radius: 4px;\n white-space: nowrap;\n position: relative;\n outline: none;\n fill: currentColor;\n user-select: none;\n cursor: default;\n text-align: left;\n color: inherit;\n font-family: var(--ui-font-family);\n font-size: var(--ui-font-size);\n line-height: var(--ui-line-height);\n letter-spacing: var(--ui-letter-spacing);\n}\n:where(.ui-menu-container > li > .label) {\n appearance: none;\n background: none;\n outline: none;\n width: 100%;\n margin: 0;\n padding: 1px 2px 1px 1px;\n overflow: visible;\n border: 1px solid transparent;\n white-space: nowrap;\n text-align: start;\n}\n:where(.ui-menu-container > li:has(.heading)) {\n margin-top: 0.5em;\n}\n:where(.ui-menu-container > li > .label.heading) {\n font-weight: bold;\n opacity: 0.4;\n}\n:where(.ui-menu-container > li.indent > .label) {\n margin-inline-start: 12px;\n}\n:where(.ui-menu-container > li > .label.indent) {\n margin-inline-start: 12px;\n}\n:where(.ui-menu-container > li[role='divider']) {\n border-bottom: 1px solid var(--ui-menu-divider);\n border-radius: 0;\n padding: 0;\n margin-left: 15px;\n margin-right: 15px;\n padding-top: 5px;\n margin-bottom: 5px;\n width: calc(100% - 30px);\n /** 100% - (margin-left + margin-right) */\n}\n:where(.ui-menu-container > li[aria-disabled='true']) {\n opacity: 0.5;\n}\n:where(.ui-menu-container > li.active) {\n background: var(--ui-menu-bg-active);\n background: -apple-system-control-accent;\n color: var(--ui-menu-text-active);\n}\n:where(.ui-menu-container > li.active.is-submenu-open) {\n background: var(--ui-menu-bg-active-muted);\n color: inherit;\n}\n:where(.ui-menu-container > li[aria-haspopup='true'] > .label) {\n padding-inline-end: 0;\n}\n:where(.ui-menu-container > li[aria-haspopup='true'].active::after) {\n color: var(--ui-menu-text-active);\n}\n/** Keyboard shortcut */\n:where(.ui-menu-container > li > kbd) {\n font-family: var(--ui-font-family);\n margin-inline-start: 12px;\n opacity: 0.4;\n}\n:where(.ui-menu-container > li.active > kbd) {\n opacity: 0.85;\n}\n.ui-trailing-chevron {\n display: flex;\n margin-inline-start: 24px;\n width: 10px;\n height: 10px;\n margin-bottom: 4px;\n}\n.ui-trailing-chevron:dir(rtl) {\n transform: scaleX(-1);\n}\n.ui-checkmark {\n display: flex;\n margin-inline-end: -11px;\n margin-inline-start: -4px;\n margin-top: 2px;\n width: 16px;\n height: 16px;\n}\n.ui-mixedmark {\n display: flex;\n margin-inline-end: -11px;\n margin-inline-start: -4px;\n margin-top: 2px;\n width: 16px;\n height: 16px;\n}\n"}return t}function ho(e){return lo||(lo={}),lo[e]||(lo[e]=new CSSStyleSheet,lo[e].replaceSync(uo(e))),lo[e]}function po(e){var t;if(!("adoptedStyleSheets"in document)){if(window.document.getElementById(`mathlive-style-${e}`))return;const t=window.document.createElement("style");return t.id=`mathlive-style-${e}`,t.append(window.document.createTextNode(uo(e))),void window.document.head.appendChild(t)}if(co||(co={}),0!==(null!=(t=co[e])?t:0))co[e]+=1;else{const t=ho(e);document.adoptedStyleSheets=[...document.adoptedStyleSheets,t],co[e]=1}}function fo(e){if("adoptedStyleSheets"in document&&(null==co?void 0:co[e])&&(co[e]-=1,co[e]<=0)){const t=lo[e];document.adoptedStyleSheets=document.adoptedStyleSheets.filter((e=>e!==t))}}var mo=class e extends Ds{constructor(e){var t;super(d(u({},e),{type:"accent",body:null!=(t=e.body)?t:void 0})),e.accentChar?this.accent=e.accentChar:this.svgAccent=null==e?void 0:e.svgAccent,this.skipBoundary=!0,this.captureSelection=!0}static fromJson(t){return new e(t)}toJson(){return d(u({},super.toJson()),{accentChar:this.accent,svgAccent:this.svgAccent})}render(e){var t;const n=new Ts({parent:e,mathstyle:"cramp"},this.style),i=null!=(t=Ds.createBox(n,this.body))?t:new cs("▢",{style:this.style});let r=0;!this.hasEmptyBranch("body")&&2===this.body.length&&this.body[1].isCharacterBox()&&(r=i.skew);let a,s=Math.min(i.height,Pa);if(this.svgAccent)a=ps(this.svgAccent),s=n.metrics.bigOpSpacing1-s;else if(this.accent){const e=new cs(this.accent,{fontFamily:"Main-Regular"});e.italic=0;const t=8407===this.accent?" ML__accent-vec":"";a=new cs(new cs(e),{classes:"ML__accent-body"+t})}a=new ms({shift:0,children:[{box:new cs(i)},-s,{box:a,marginLeft:i.left+2*r,classes:["ML__center"]}]});const o=new cs(a,{type:"lift"});return this.caret&&(o.caret=this.caret),this.bind(n,o.wrap(n)),this.attachSupsub(n,{base:o})}},go={"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\lparen":"\\rparen","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},vo=Object.fromEntries(Object.entries(go).map((([e,t])=>[t,e])));function bo(e){var t;return null!=(t={"[":91,"]":93,"(":40,")":41,"\\mid":8739,"|":8739,"∣":8739,"∥":8741,"\\|":8739,"\\{":123,"\\}":125,"\\lbrace":123,"\\rbrace":125,"\\lparen":40,"\\rparen":41,"\\lbrack":91,"\\rbrack":93,"\\vert":8739,"\\lvert":8739,"\\mvert":8739,"\\rvert":8739,"\\Vert":8741,"\\lVert":8741,"\\mVert":8741,"\\rVert":8741,"\\parallel":8741,"\\shortparallel":8741,"\\langle":10216,"\\rangle":10217,"\\lfloor":8970,"\\rfloor":8971,"\\lceil":8968,"\\rceil":8969,"\\ulcorner":9484,"\\urcorner":9488,"\\llcorner":9492,"\\lrcorner":9496,"\\lgroup":10222,"\\rgroup":10223,"\\lmoustache":9136,"\\rmoustache":9137,"\\surd":8730}[e])?t:e.codePointAt(0)}function yo(e,t,n,i,r){var a,s;const o=new Ts({parent:i,mathstyle:"textstyle"},null==r?void 0:r.style),l=new cs(bo(e),{fontFamily:`Size${t}-Regular`,isSelected:r.isSelected,classes:(null!=(a=r.classes)?a:"")+` ML__delim-size${t}`,type:null!=(s=r.type)?s:"ignore"}).wrap(o);return n&&l.setTop((1-o.scalingFactor)*Ra),l}function _o(e,t,n,i,r){var a;let s,o,l,c;s=l=c=bo(e),o=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=s=c=8739:"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=s=c=8741:"\\uparrow"===e?l=c=9168:"\\Uparrow"===e?l=c=8214:"\\downarrow"===e?s=l=9168:"\\Downarrow"===e?s=l=8214:"\\updownarrow"===e?(s=8593,l=9168,c=8595):"\\Updownarrow"===e?(s=8657,l=8214,c=8659):"["===e||"\\lbrack"===e?(s=9121,l=9122,c=9123,h="Size4-Regular"):"]"===e||"\\rbrack"===e?(s=9124,l=9125,c=9126,h="Size4-Regular"):"\\lfloor"===e||"⌊"===e?(l=s=9122,c=9123,h="Size4-Regular"):"\\lceil"===e||"⌈"===e?(s=9121,l=c=9122,h="Size4-Regular"):"\\rfloor"===e||"⌋"===e?(l=s=9125,c=9126,h="Size4-Regular"):"\\rceil"===e||"⌉"===e?(s=9124,l=c=9125,h="Size4-Regular"):"("===e||"\\lparen"===e?(s=9115,l=9116,c=9117,h="Size4-Regular"):")"===e||"\\rparen"===e?(s=9118,l=9119,c=9120,h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(s=9127,o=9128,c=9129,l=9130,h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(s=9131,o=9132,c=9133,l=9130,h="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(s=9127,c=9129,l=9130,h="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(s=9131,c=9133,l=9130,h="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(s=9127,c=9133,l=9130,h="Size4-Regular"):"\\rmoustache"===e||"⎱"===e?(s=9131,c=9129,l=9130,h="Size4-Regular"):"\\surd"===e?(s=57345,c=9143,l=57344,h="Size4-Regular"):"\\ulcorner"===e?(s=9484,l=c=32):"\\urcorner"===e?(s=9488,l=c=32):"\\llcorner"===e?(c=9492,l=s=32):"\\lrcorner"===e&&(s=9496,l=s=32);const p=$a(s,h),f=p.height+p.depth,m=$a(l,h),g=m.height+m.depth,v=$a(c,h),b=v.height+v.depth;let y=0,_=1;if(null!==o){const e=$a(o,h);y=e.height+e.depth,_=2}const w=f+b+y,x=Math.max(0,Math.ceil((t-w)/(_*g))),k=w+x*_*g;let S=Ra;n&&(S*=i.scalingFactor);const E=k/2-S,C=[];C.push({box:new cs(c,{fontFamily:h})}),C.push(-.008);const T=new cs(l,{fontFamily:h});if(null===o)for(let e=0;e<x;e++)C.push({box:T});else{for(let e=0;e<x;e++)C.push({box:T});C.push(-.008),C.push({box:new cs(o,{fontFamily:h})}),C.push(-.008);for(let e=0;e<x;e++)C.push({box:T})}C.push(-.008),C.push({box:new cs(s,{fontFamily:h})});let A="";"Size1-Regular"===h?A=" delim-size1":"Size4-Regular"===h&&(A=" delim-size4");const M=new ms({bottom:E,children:C},{classes:A});return new cs(M,d(u({},null!=r?r:{}),{classes:(null!=(a=null==r?void 0:r.classes)?a:"")+" ML__delim-mult"}))}var wo=new Set(["(",")","\\lparen","\\rparen","[","]","\\lbrack","\\rbrack","\\{","\\}","\\lbrace","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd","⌊","⌋","⌈","⌉"]),xo=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","⟮","⟯","⎰","⎱"]),ko=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),So=[0,1.2,1.8,2.4,3];var Eo=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Co=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"stack"}],To=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Ao(e,t,n,i,r,a){if(!t||0===t.length||"."===t)return Lo(r);let s;"<"===t||"\\lt"===t?t="\\langle":">"!==t&&"\\gt"!==t||(t="\\rangle"),s=ko.has(t)?Eo:wo.has(t)?To:Co;const o=function(e,t,n,i){for(let a={"-4":0,"-3":1,0:2}[i.mathstyle.sizeDelta];a<n.length&&"stack"!==n[a].type;a++){const s=$a(e,"small"===(r=n[a]).type?"Main-Regular":"large"===r.type?"Size"+r.size+"-Regular":(console.assert("stack"===r.type),"Size4-Regular"));if(s.defaultMetrics)return{type:"small",mathstyle:"scriptstyle"};let o=s.height+s.depth;if("small"===n[a].type&&("scriptscriptstyle"===n[a].mathstyle?o*=Math.max(Na[Math.max(1,i.size-2)],i.minFontScale):"scriptstyle"===n[a].mathstyle&&(o*=Math.max(Na[Math.max(1,i.size-1)],i.minFontScale))),o>t)return n[a]}var r;return n[n.length-1]}(bo(t),n,s,r),l=new Ts({parent:r,mathstyle:o.mathstyle},null==a?void 0:a.style);return"small"===o.type?function(e,t,n,i){var r;const a=new cs(bo(e),{fontFamily:"Main-Regular",isSelected:i.isSelected,classes:"ML__small-delim "+(null!=(r=i.classes)?r:"")}).wrap(t);return n&&a.setTop((1-t.scalingFactor)*Ra),a}(t,l,i,d(u({},a),{type:e})):"large"===o.type?yo(t,o.size,i,l,d(u({},a),{type:e})):(console.assert("stack"===o.type),_o(t,n,i,l,d(u({},a),{type:e})))}function Mo(e,t,n,i,r,a){if("."===t)return Lo(r,null==a?void 0:a.classes);const s=Ra*r.scalingFactor,o=Math.max(n-s,i+s);return Ao(e,t,Math.max(o/500*901,2*o-.5),!0,r,a)}function Lo(e,t){const n=new cs(null,{classes:" nulldelimiter "+(null!=t?t:""),type:"ignore"});return n.width=e.getRegisterAsEm("nulldelimiterspace"),n.wrap(new Ts({parent:e,mathstyle:"textstyle"}))}var Do=class e extends Ds{constructor(e){var t;super({type:"placeholder",command:"\\placeholder",mode:null!=(t=null==e?void 0:e.mode)?t:"math",style:null==e?void 0:e.style}),this.captureSelection=!0}static fromJson(t){return new e(t)}toJson(){return super.toJson()}render(e){let t;return this.value=e.placeholderSymbol,t="function"==typeof e.renderPlaceholder?e.renderPlaceholder(e):this.createBox(e),this.caret&&(t.classes+=" ML__placeholder-selected"),t}_serialize(e){return e.skipPlaceholders?"":"\\placeholder{}"}},Io=["matrix","matrix*","pmatrix","pmatrix*","bmatrix","bmatrix*","Bmatrix","Bmatrix*","vmatrix","vmatrix*","Vmatrix","Vmatrix*"],Ro=["cases","dcases","rcases"],Po=["align","align*","aligned","gather","gathered","split"],Oo=["array","subequations","eqnarray"];function No(e){return Io.includes(e)}var Bo=class e extends Ds{constructor(e,t,n,i={}){var r;super({type:"array"}),this.environmentName=e,this.rowGaps=n,i.mathstyleName&&(this.mathstyleName=i.mathstyleName),i.columns&&(0===i.columns.length?this.colFormat=[{align:"l"}]:this.colFormat=i.columns),this.colFormat||(this.colFormat=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]),this.array=function(e,t,n){let i=0;for(const e of n)"align"in e&&(i+=1);let r=0;const a=[];for(const n of t){let t=0;for(r=Math.max(r,Math.min(n.length,i));t<n.length;){const r=[],s=Math.min(n.length,t+i);for(;t<s;){const i=n[t];0===i.length?r.push([new Ds({type:"first",mode:e.mode})]):"first"!==i[0].type?r.push([new Ds({type:"first",mode:e.mode}),...i]):(console.assert(!i.slice(1).some((e=>"first"===e.type))),r.push(i)),t+=1}a.push(r)}}a.length>0&&1===a[a.length-1].length&&1===a[a.length-1][0].length&&"first"===a[a.length-1][0][0].type&&a.pop();const s=[];for(const t of a){if(t.length!==r)for(let n=t.length;n<r;n++)t.push([new Ds({type:"first",mode:e.mode}),new Do]);s.push(t)}let o=0,l=0;for(const t of s){l=0;for(const n of t){for(const t of n)t.parent=e,t.parentBranch=[o,l];l+=1}o+=1}return e.isDirty=!0,s}(this,t,this.colFormat),i.leftDelim&&(this.leftDelim=i.leftDelim),i.rightDelim&&(this.rightDelim=i.rightDelim),void 0!==i.arraycolsep&&(this.arraycolsep=i.arraycolsep),this.colSeparationType=i.colSeparationType,void 0!==i.arraystretch&&(this.arraystretch=i.arraystretch),this.minColumns=null!=(r=i.minColumns)?r:1}static fromJson(t){return new e(t.environmentName,t.array,t.rowGaps,t)}toJson(){const e=d(u({},super.toJson()),{environmentName:this.environmentName,array:this.array.map((e=>e.map((e=>e.map((e=>e.toJson())))))),rowGaps:this.rowGaps,columns:this.colFormat,colSeparationType:this.colSeparationType});return void 0!==this.arraystretch&&(e.arraystretch=this.arraystretch),void 0!==this.arraycolsep&&(e.arraycolsep=this.arraycolsep),this.leftDelim&&(e.leftDelim=this.leftDelim),this.rightDelim&&(e.rightDelim=this.rightDelim),e}branch(e){var t;if(Ls(e))return null!=(t=this.array[e[0]][e[1]])?t:void 0}createBranch(e){var t;return Ls(e)?(this.isDirty=!0,null!=(t=this.branch(e))?t:[]):[]}get rowCount(){return this.array.length}get colCount(){return this.array[0].length}get maxColumns(){return this.colFormat.filter((e=>Boolean(e.align))).length}removeBranch(e){if(Ms(e))return super.removeBranch(e);const t=this.branch(e);return this.array[e[0]][e[1]]=void 0,t.forEach((e=>{e.parent=void 0,e.parentBranch=void 0})),console.assert("first"===t[0].type),t.shift(),this.isDirty=!0,t}get hasChildren(){return this.children.length>0}get children(){const e=[];for(const t of this.array)for(const n of t)if(n)for(const t of n)e.push(...t.children),e.push(t);return[...e,...super.children]}render(e){var t,n,i,r,a,s;const o=new Ts({parent:e,mathstyle:this.mathstyleName},this.style),l=o.getRegisterAsEm("arrayrulewidth"),c=o.getRegisterAsEm("arraycolsep"),u=o.getRegisterAsEm("doublerulesep"),d=null!=(n=null!=(t=this.arraystretch)?t:o.getRegisterAsNumber("arraystretch"))?n:1;let h="number"==typeof this.arraycolsep?this.arraycolsep:c;if("small"===this.colSeparationType){h=new Ts({parent:e,mathstyle:"scriptstyle"}).scalingFactor/e.scalingFactor*.2778}const p=1.2*d,f=.7*p,m=.3*p;let g=0;const v=[];let b=0;const y=this.array.length;for(let e=0;e<y;++e){const t=this.array[e];b=Math.max(b,t.length);const n=new Ts({parent:o,mathstyle:this.mathstyleName},this.style);let a=f/n.scalingFactor,s=m/n.scalingFactor;const l={cells:[],height:0,depth:0,pos:0};for(const e of t){const t=null!=(i=Ds.createBox(n,e,{type:"ignore"}))?i:new cs(null,{type:"ignore"});s=Math.max(s,t.depth),a=Math.max(a,t.height),l.cells.push(t)}let c=null!=(r=_s(this.rowGaps[e]))?r:0;c>0&&(c+=m,s=Math.max(s,c),c=0),e<y-1&&!No(this.environmentName)&&"cases"!==this.environmentName&&"array"!==this.environmentName&&(s+=o.getRegisterAsEm("jot")),l.height=a,l.depth=s,g+=a,l.pos=g,g+=s+c,v.push(l)}const _=g/2+Ra,w=[];for(let e=0;e<b;e++){const t=[];for(const n of v){const i=n.cells[e];i.depth=n.depth,i.height=n.height,t.push({box:i,shift:n.pos-_})}t.length>0&&w.push(new ms({individualShift:t}))}const x=[];let k=!1,S=!1,E=0,C=!this.leftDelim;const{colFormat:T}=this;for(const t of T){if("align"in t&&E>=w.length)break;if("align"in t)k?x.push(Fo(2*h)):(S||C)&&x.push(Fo(h)),x.push(new cs(w[E],{classes:"col-align-"+t.align})),E++,k=!0,S=!1,C=!1;else if("gap"in t){if("number"==typeof t.gap)x.push(Fo(t.gap));else{const n=zo(e,v,_,t.gap);n&&x.push(n)}k=!1,S=!1,C=!1}else if("separator"in t){const e=new cs(null,{classes:"vertical-separator"});e.height=g,e.setStyle("height",g,"em"),e.setStyle("border-right",`${l}em ${t.separator} currentColor`),e.setStyle("vertical-align",-(g-_),"em");let n=0;S?n=u-l:k&&(n=h-l),e.left=n,x.push(e),k=!1,S=!0,C=!1}}k&&!this.rightDelim&&x.push(Fo(h));const A=new cs(x,{classes:"mtable"});if(!(this.leftDelim&&"."!==this.leftDelim||this.rightDelim&&"."!==this.rightDelim))return this.caret&&(A.caret=this.caret),this.bind(e,A);const M=A.height,L=A.depth,D=this.bind(e,new cs([this.bind(e,Mo("open",null!=(a=this.leftDelim)?a:".",M,L,o,{isSelected:this.isSelected})),A,this.bind(e,Mo("close",null!=(s=this.rightDelim)?s:".",M,L,o,{isSelected:this.isSelected}))],{type:"ord"}));return D?(D.setStyle("display","inline-block"),this.caret&&(D.caret=this.caret),this.bind(e,this.attachSupsub(e,{base:D}))):null}_serialize(e){var t;const n=[];if("lines"===this.environmentName?n.push("{\\displaylines"):n.push(`\\begin{${this.environmentName}}`),"array"===this.environmentName){if(n.push("{"),void 0!==this.colFormat)for(const e of this.colFormat)"align"in e&&"string"==typeof e.align?n.push(e.align):"separator"in e&&"solid"===e.separator?n.push("|"):"separator"in e&&"dashed"===e.separator&&n.push(":");n.push("}")}for(let i=0;i<this.array.length;i++){for(let t=0;t<this.array[i].length;t++)t>0&&n.push(" & "),n.push(Ds.serialize(this.array[i][t],e));if(i<this.array.length-1){const e=this.rowGaps[i];(null==e?void 0:e.dimension)?n.push(`\\\\[${e.dimension} ${null!=(t=e.unit)?t:"pt"}] `):n.push("\\\\ ")}}return"lines"===this.environmentName?n.push("}"):n.push(`\\end{${this.environmentName}}`),Xa(n)}getCell(e,t){return this.array[e][t]}setCell(e,t,n){console.assert("array"===this.type&&Array.isArray(this.array)&&void 0!==this.array[e][t]);for(const n of this.array[e][t])n.parent=void 0,n.parentBranch=void 0;let i=n;0!==n.length&&"first"===n[0].type||(i=[new Ds({type:"first",mode:this.mode}),...n]),this.array[e][t]=i;for(const n of i)n.parent=this,n.parentBranch=[e,t];this.isDirty=!0}addRowBefore(e){console.assert("array"===this.type&&Array.isArray(this.array));const t=[];for(let e=0;e<this.colCount;e++)t.push($o(this));this.array.splice(e,0,t);for(let t=e;t<this.rowCount;t++)for(let e=0;e<this.colCount;e++){const n=this.array[t][e];if(n)for(const i of n)i.parentBranch=[t,e]}this.isDirty=!0}addRowAfter(e){console.assert("array"===this.type&&Array.isArray(this.array));const t=[];for(let e=0;e<this.colCount;e++)t.push($o(this));this.array.splice(e+1,0,t);for(let t=e+1;t<this.rowCount;t++)for(let e=0;e<this.colCount;e++){const n=this.array[t][e];if(n)for(const i of n)i.parentBranch=[t,e]}this.isDirty=!0}removeRow(e){console.assert("array"===this.type&&Array.isArray(this.array)&&this.rowCount>e);const t=this.array.splice(e,1);for(const e of t)for(const t of e)if(t)for(const e of t)e.parent=void 0,e.parentBranch=void 0;for(let t=e;t<this.rowCount;t++)for(let e=0;e<this.colCount;e++){const n=this.array[t][e];if(n)for(const i of n)i.parentBranch=[t,e]}this.isDirty=!0}addColumnBefore(e){console.assert("array"===this.type&&Array.isArray(this.array));for(const t of this.array)t.splice(e,0,$o(this));for(let t=0;t<this.rowCount;t++)for(let n=e;n<this.colCount;n++){const e=this.array[t][n];if(e)for(const i of e)i.parentBranch=[t,n]}this.isDirty=!0}addColumnAfter(e){console.assert("array"===this.type&&Array.isArray(this.array));for(const t of this.array)t.splice(e+1,0,$o(this));for(let t=0;t<this.rowCount;t++)for(let n=e+1;n<this.colCount;n++){const e=this.array[t][n];if(e)for(const i of e)i.parentBranch=[t,n]}this.isDirty=!0}addColumn(){this.addColumnAfter(this.colCount-1)}removeColumn(e){console.assert("array"===this.type&&Array.isArray(this.array)&&this.colCount>e);for(const t of this.array){const n=t.splice(e,1);for(const e of n)if(e)for(const t of e)t.parent=void 0,t.parentBranch=void 0}for(let t=0;t<this.rowCount;t++)for(let n=e;n<this.colCount;n++){const e=this.array[t][n];if(e)for(const i of e)i.parentBranch=[t,n]}this.isDirty=!0}get cells(){const e=[];for(const t of this.array)for(const n of t)n&&e.push(n.filter((e=>"first"!==e.type)));return e}};function $o(e){const t=new Ds({type:"first",mode:e.mode});t.parent=e;const n=new Do;return n.parent=e,[t,n]}function Fo(e){const t=new cs(null,{classes:"arraycolsep"});return t.width=e,t}function zo(e,t,n,i){if(!i)return null;const r=[];for(const a of t){const t=Ds.createBox(e,i,{type:"ignore"});t&&(t.depth=a.depth,t.height=a.height,r.push({box:t,shift:a.pos-n}))}return new ms({individualShift:r}).wrap(e)}var Ko=class e extends Ds{constructor(e){super({mode:e.mode,command:e.command,style:e.style,body:e.body,type:"box"}),this.framecolor=e.framecolor,this.backgroundcolor=e.backgroundcolor,this.padding=e.padding,this.offset=e.offset,this.border=e.border}static fromJson(t){return new e(t)}toJson(){return d(u({},super.toJson()),{framecolor:this.framecolor,backgroundcolor:this.backgroundcolor,padding:this.padding,offset:this.offset,border:this.border})}render(e){var t,n,i,r;const a=Ds.createBox(e,this.body,{type:"lift"});if(!a)return null;const s=e.toEm(null!=(t=this.offset)?t:{dimension:0});a.depth+=s,a.setStyle("display","inline-block"),a.setStyle("position","relative"),a.setStyle("height",Math.floor(100*a.height+a.depth)/100,"em"),a.setStyle("vertical-align",-Math.floor(100*a.height)/100,"em");const o=new Ts({parent:e},this.style),l=o.toEm(null!=(n=this.padding)?n:{register:"fboxsep"}),c=new cs(null,{classes:"ML__box"});c.height=a.height+l,c.depth=a.depth+l,c.setStyle("box-sizing","border-box"),c.setStyle("position","absolute"),c.setStyle("top",.3-l,"em"),c.setStyle("left",0),c.setStyle("height",c.height+c.depth,"em"),c.setStyle("width","100%"),this.backgroundcolor&&c.setStyle("background-color",null!=(i=o.toColor(this.backgroundcolor))?i:"transparent"),this.framecolor&&c.setStyle("border",`${o.getRegisterAsEm("fboxrule",2)}em solid ${null!=(r=o.toColor(this.framecolor))?r:"black"}`),this.border&&c.setStyle("border",this.border);const u=new cs([c,a],{type:"lift"});return u.setStyle("display","inline-block"),u.setStyle("position","relative"),u.setStyle("line-height",0),u.height=a.height+l+(s>0?s:0),u.depth=a.depth+l+(s<0?-s:0),u.setStyle("padding-left",l,"em"),u.setStyle("padding-right",l,"em"),u.setStyle("height",Math.floor(100*(a.height+a.depth+2*l+Math.abs(s)))/100,"em"),u.setStyle("margin-top",-l,"em"),u.setStyle("top",Math.floor(100*(a.depth-a.height+2*l-s))/100,"em"),u.setStyle("vertical-align",Math.floor(100*(a.depth+2*l))/100,"em"),this.caret&&(u.caret=this.caret),this.attachSupsub(e,{base:u})}_serialize(e){return e.skipStyles?Xa([this.bodyToLatex(e),this.supsubToLatex(e)]):super._serialize(e)}},Uo=class e extends Ds{constructor(e,t){var n;super({type:"composition",mode:null!=(n=null==t?void 0:t.mode)?n:"math",value:e})}static fromJson(t){return new e(t.value,t)}toJson(){return super.toJson()}get computedStyle(){return{}}render(e){const t=new cs(this.value,{classes:"ML__composition",type:"composition"});return this.bind(e,t),this.caret&&(t.caret=this.caret),t}_serialize(e){return""}},jo=class e extends Ds{constructor(e){super({type:"error",value:e,command:e,mode:"math"}),this.verbatimLatex=e}static fromJson(t){return new e(t.command)}toJson(){return super.toJson()}render(e){const t=this.createBox(e,{classes:"ML__error"});return this.caret&&(t.caret=this.caret),t}},qo=class e extends Ds{constructor(e,t,n){super({type:"group",mode:t,style:n}),this.body=e,this.boxType=e.length>1?"ord":"ignore",this.skipBoundary=!0,this.displayContainsHighlight=!1,e&&1===e.length&&","===e[0].command&&(this.captureSelection=!0)}static fromJson(t){return new e(t.body,t.mode,t.style)}render(e){const t=Ds.createBox(e,this.body,{type:this.boxType});return t?(this.caret&&(t.caret=this.caret),this.bind(e,t)):null}_serialize(e){if(!(e.expandMacro||e.skipStyles||e.skipPlaceholders)&&"string"==typeof this.verbatimLatex)return this.verbatimLatex;const t=se(this.command,this.mode);return(null==t?void 0:t.serialize)?t.serialize(this,e):`{${this.bodyToLatex(e)}}`}},Ho=class e extends Ds{constructor(e,t,n){super({type:"leftright",style:n.style,displayContainsHighlight:!0}),this.variant=e,this.body=t,this.leftDelim=n.leftDelim,this.rightDelim=n.rightDelim}static fromJson(t){var n;return new e(null!=(n=t.variant)?n:"",t.body,t)}toJson(){const e=super.toJson();return this.variant&&(e.variant=this.variant),this.leftDelim&&(e.leftDelim=this.leftDelim),this.rightDelim&&(e.rightDelim=this.rightDelim),e}_serialize(e){var t,n;const i=this.matchingRightDelim();return"left...right"===this.variant?Xa(["\\left",null!=(t=this.leftDelim)?t:".",this.bodyToLatex(e),"\\right",i]):"mleft...mright"===this.variant?Xa(["\\mleft",null!=(n=this.leftDelim)?n:".",this.bodyToLatex(e),"\\mright",i]):Xa([this.leftDelim&&"."!==this.leftDelim?this.leftDelim:"",this.bodyToLatex(e),i])}matchingRightDelim(){var e,t;if(this.rightDelim&&"?"!==this.rightDelim)return this.rightDelim;const n=null!=(e=this.leftDelim)?e:".";return null!=(t=go[n])?t:n}render(e){var t,n;const i=new Ts({parent:e},this.style);console.assert(void 0!==this.body);const r=new Ts({parent:e,mathstyle:"textstyle"},this.style),a=null!=(t=Ds.createBox(i,this.body,{type:"inner"}))?t:new cs(null,{type:"inner"}),s=a.height/r.scalingFactor,o=a.depth/r.scalingFactor,l=[];if(this.leftDelim&&l.push(this.bind(r,Mo("open",this.leftDelim,s,o,r,{isSelected:this.isSelected,classes:"ML__open"+(this.containsCaret?" ML__contains-caret":""),mode:this.mode,style:this.style}))),a&&(Vo(a.children,this,i,s,o),l.push(a)),this.rightDelim){let e=this.containsCaret?" ML__contains-caret":"",t=this.rightDelim;"?"===t&&(i.smartFence?(t=this.matchingRightDelim(),e+=" ML__smart-fence__close"):t="."),l.push(this.bind(r,Mo("close",t,s,o,r,{isSelected:this.isSelected,classes:e+" ML__close",mode:this.mode,style:this.style})))}let c="mleft...mright"===this.variant;const u=this.leftSibling;u&&(!c&&u.isFunction&&(c=!0),!c&&"subsup"===u.type&&(null==(n=u.leftSibling)?void 0:n.isFunction)&&(c=!0));const d=new cs(l,{type:c?"close":"inner",classes:"left-right"});return d.setStyle("margin-top",-a.depth+"em"),d.setStyle("height",`${a.height+a.depth}em`),this.caret&&(d.caret=this.caret),this.bind(i,d.wrap(i))}};function Vo(e,t,n,i,r){if(e)for(let a=0;a<e.length;a++){const s=e[a];"middle"===s.type?(e[a]=t.bind(n,Mo("inner",s.value,i,r,n,{isSelected:t.isSelected})),e[a].caret=s.caret,e[a].isSelected=s.isSelected,e[a].cssId=s.cssId,e[a].htmlData=s.htmlData,e[a].htmlStyle=s.htmlStyle,e[a].attributes=s.attributes,e[a].cssProperties=s.cssProperties):s.children&&Vo(s.children,t,n,i,r)}}var Go=class e extends Ds{constructor(e,t){var n;super({type:"macro",command:e,style:t.style}),this.body=t.body,void 0===t.captureSelection?t.args?this.captureSelection=!1:this.captureSelection=!0:this.captureSelection=t.captureSelection,this.macroArgs=t.args,this.expand=null!=(n=t.expand)&&n}static fromJson(t){return new e(t.command,t)}toJson(){const e=super.toJson();return this.expand&&(e.expand=!0),void 0!==this.captureSelection&&(e.captureSelection=this.captureSelection),this.macroArgs&&(e.args=this.macroArgs),e}_serialize(e){var t;return e.expandMacro&&this.expand?this.bodyToLatex(e):this.command+(null!=(t=this.macroArgs)?t:"")}render(e){const t=Ds.createBox(e,this.body);return t?(this.caret&&(t.caret=this.caret),this.bind(e,t)):null}},Zo=class e extends Ds{constructor(){super({type:"macro-argument"})}static fromJson(t){return new e}toJson(){return super.toJson()}_serialize(e){return""}render(e){return null}},Wo=class e extends Ds{constructor(e,t,n=!1,i,r){var a;super({type:"prompt",mode:null!=(a=null==r?void 0:r.mode)?a:"math",style:null==r?void 0:r.style,command:"\\placeholder"}),this.body=i,this.correctness=t,this.placeholderId=e,this.locked=n,this.captureSelection=this.locked}static fromJson(t){return new e(t.placeholderId,t.correctness,t.locked,t.body,t)}toJson(){const e=super.toJson();return this.placeholderId&&(e.placeholderId=this.placeholderId),this.body||delete e.body,this.body&&(e.body=this.body.filter((e=>"first"!==e.type)).map((e=>e.toJson()))),this.correctness&&(e.correctness=this.correctness),e.locked=this.locked,e}render(e){const t=new Ts({parent:e}),n=t.getRegisterAsEm("fboxsep"),i=n,r=n,a=Ds.createBox(e,this.body);if(!a)return null;a.height||(a.height=t.metrics.xHeight),a.setStyle("vertical-align",-a.height,"em"),"correct"===this.correctness?a.setStyle("color","var(--correct-color, var(--ML__correct-color))"):"incorrect"===this.correctness&&a.setStyle("color","var(--incorrect-color, var(--ML__incorrect-color))");const s=new cs(a,{type:"ord"});s.setStyle("display","inline-block"),s.setStyle("height",a.height+a.depth,"em"),s.setStyle("vertical-align",-r,"em");let o="ML__prompt ";this.locked?o+=" ML__lockedPromptBox ":o+=" ML__editablePromptBox ","correct"===this.correctness?o+=" ML__correctPromptBox ":"incorrect"===this.correctness&&(o+=" ML__incorrectPromptBox "),this.containsCaret&&(o+=" ML__focusedPromptBox ");const l=new cs(null,{classes:o,attributes:{part:"prompt"}});l.height=s.height+r,l.depth=s.depth+r,l.width=s.width+2*i,l.setStyle("box-sizing","border-box"),l.setStyle("position","absolute"),l.setStyle("height",s.height+s.depth+2*r,"em"),0===i&&l.setStyle("width","100%"),0!==i&&(l.setStyle("width",`calc(100% + ${2*i}em)`),l.setStyle("top",n,"em"),l.setStyle("left",-i,"em")),this.body&&1!==this.body.length||(l.width=3*i,l.setStyle("width",`calc(100% + ${3*i}em)`),l.setStyle("left",-1.5*i,"em"));let c="";"incorrect"===this.correctness&&(c+='<line x1="3%" y1="97%" x2="97%" y2="3%" stroke-width="0.5" stroke="var(--incorrect-color, var(--ML__incorrect-color))" stroke-linecap="round" />'),c&&(l.svgOverlay=c);const u=new cs([l,s],{classes:"ML__prompt-atom"});return u.setStyle("position","relative"),u.setStyle("display","inline-block"),u.setStyle("line-height",0),u.height=s.height+r+.2,u.depth=s.depth+r,u.left=i,u.right=i,u.setStyle("height",s.height+r,"em"),u.setStyle("top",s.depth-s.height,"em"),u.setStyle("vertical-align",s.depth+r,"em"),u.setStyle("margin-left",.5,"em"),u.setStyle("margin-right",.5,"em"),this.caret&&(u.caret=this.caret),this.bind(t,this.attachSupsub(e,{base:u}))}_serialize(e){var t;const n=null!=(t=this.bodyToLatex(e))?t:"";if(e.skipPlaceholders)return n;let i="\\placeholder";return this.placeholderId&&(i+=`[${this.placeholderId}]`),"correct"===this.correctness?i+="[correct]":"incorrect"===this.correctness&&(i+="[incorrect]"),this.locked&&(i+="[locked]"),Ja(i,n)}},Yo=class e extends Ds{constructor(e){super({type:"subsup",style:null==e?void 0:e.style}),this.subsupPlacement="auto"}static fromJson(t){const n=new e(t);for(const e of As)t[e]&&n.setChildren(t[e],e);return n}render(e){var t;const n=new Ts({parent:e,isPhantom:!0}),i=this.leftSibling,r=null!=(t=i.render(n))?t:new cs(null),a=new cs(null);return a.height=r.height,a.depth=r.depth,this.attachSupsub(e,{base:a,isCharacterBox:i.isCharacterBox(),type:"ignore"})}_serialize(e){return this.supsubToLatex(e)}};function Xo(e){return!!e&&!/^(<$$>|<$>|<space>|<{>|<}>|#[0-9\?]|\\.+)$/.test(e)}var Jo=class{constructor(e,t,n){var i,r,a,s;this.errors=[],this.index=0,this.endCount=0,null!=n||(n={}),this.tokens=e,this.context=t instanceof Ts&&!(null==n?void 0:n.parseMode)&&!n.mathstyle?t:new Ts({from:t,mathstyle:n.mathstyle},n.style),this.args=null!=(i=n.args)?i:void 0,this.smartFence=this.context.smartFence,this.parsingContext={parent:void 0,mathlist:[],style:null!=(r=n.style)?r:{},parseMode:null!=(a=n.parseMode)?a:"math",mathstyle:null!=(s=n.mathstyle)?s:"displaystyle",tabular:!1}}beginContext(e){var t,n,i;const r=this.parsingContext,a={parent:r,mathlist:[],style:u({},r.style),parseMode:null!=(t=null==e?void 0:e.mode)?t:r.parseMode,mathstyle:null!=(n=null==e?void 0:e.mathstyle)?n:r.mathstyle,tabular:null!=(i=null==e?void 0:e.tabular)&&i};this.parsingContext=a}endContext(){this.parsingContext=this.parsingContext.parent}onError(e){this.errors.push(u({before:Qa(this.tokens.slice(this.index,this.index+10)),after:Qa(this.tokens.slice(Math.max(0,this.index-10),this.index))},e))}get mathlist(){return this.parsingContext.mathlist}set mathlist(e){this.parsingContext.mathlist=e}get parseMode(){return this.parsingContext.parseMode}set parseMode(e){this.parsingContext.parseMode=e}get tabularMode(){return this.parsingContext.tabular}get style(){let e=this.parsingContext;for(;e;){if(e.style)return u({},e.style);e=e.parent}return{}}set style(e){this.parsingContext.style=e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}next(){this.index+=1}get(){return this.endCount=0,this.index<this.tokens.length?this.tokens[this.index++]:""}peek(){return this.tokens[this.index]}match(e){return this.tokens[this.index]===e&&(this.index++,!0)}lastSubsupAtom(){let e;if(this.mathlist.length>0){if(e=this.mathlist[this.mathlist.length-1],"subsup"===e.type)return e;if(void 0!==e.subsupPlacement)return e}return e=new Yo({style:this.style}),this.mathlist.push(e),e}hasPattern(e){return e.test(this.tokens[this.index])}hasInfixCommand(){var e;const{index:t}=this;if(t<this.tokens.length&&this.tokens[t].startsWith("\\")){const n=se(this.tokens[t],this.parseMode);return!(!n||"symbol"===n.definitionType)&&(!(n.ifMode&&!n.ifMode.includes(this.parseMode))&&(null!=(e=n.infix)&&e))}return!1}matchColumnSeparator(){if(!this.tabularMode)return!1;return"&"===this.peek()&&(this.index++,!0)}matchRowSeparator(){if(!this.tabularMode)return!1;const e=this.peek();return("\\\\"===e||"\\cr"===e||"\\tabularnewline"===e)&&(this.index++,!0)}placeholder(){var e;const t=null==(e=this.args)?void 0:e.call(this,"?");return t?Qo(t,{parseMode:this.parseMode,mathstyle:"textstyle"}):[new Do({mode:this.parseMode,style:this.style})]}skipWhitespace(){for(;this.match("<space>"););}skipUntilToken(e){let t=this.tokens[this.index];for(;t&&t!==e;)t=this.tokens[++this.index];t===e&&this.index++}skipFiller(){for(;this.match("\\relax")||this.match("<space>"););}matchKeyword(e){const t=this.index;let n=this.end(),i="";for(;!n;){const t=this.get();Xo(t)?(i+=t,n=this.end()||i.length>=e.length):n=!0}const r=e.toUpperCase()===i.toUpperCase();return r||(this.index=t),r}scanString(){let e="";for(;!this.end();){const t=this.peek();if("]"===t)return e;if("<space>"===t)e+=" ";else if(t.startsWith("\\"))this.onError({code:"unexpected-command-in-string"}),e+=t.substring(1);else{if(!Xo(t))return e;e+=t}this.next()}return e}scanBalancedString(){let e="",t=this.end(),n=1;for(;!t;){const i=this.get();"<space>"===i?e+=" ":"<{>"===i?(e+="{",n+=1):"<}>"===i?(n-=1,n>0?e+="}":this.index-=1):e+="<$>"===i?"$":"<$$>"===i?"$$":i,t=0===n||this.end()}return e}scanLiteralGroup(){var e;if(!this.match("<{>"))return"";let t="",n=1;for(;n>0&&!this.end();){const i=this.get();"<}>"===i?(n-=1,n>0&&(t+="}")):"<{>"===i?(n+=1,t+="{"):(/\\[a-zA-Z]+$/.test(t)&&/^[a-zA-Z]/.test(i)&&(t+=" "),t+=null!=(e={"<space>":" ","<$$>":"$$","<$>":"$"}[i])?e:i)}return t}scanNumber(e=!0){var t,n;let i=!1,r=this.peek();for(;"<space>"===r||"+"===r||"-"===r;)this.get(),"-"===r&&(i=!i),r=this.peek();e=Boolean(e);let a=10,s=/\d/;if(this.match("'"))a=8,s=/[0-7]/,e=!0;else if(this.match('"'))a=16,s=/[\dA-F]/,e=!0;else if(this.match("x"))a=16,s=/[\dA-Fa-f]/,e=!0;else if(this.match("`"))return r=this.get(),r?2===r.length&&r.startsWith("\\")?{number:(i?-1:1)*(null!=(t=r.codePointAt(1))?t:0),base:"alpha"}:{number:(i?-1:1)*(null!=(n=r.codePointAt(0))?n:0),base:"alpha"}:null;let o="";for(;this.hasPattern(s);)o+=this.get();if(!e&&(this.match(".")||this.match(",")))for(o+=".";this.hasPattern(s);)o+=this.get();const l=e?Number.parseInt(o,a):Number.parseFloat(o);return Number.isNaN(l)?null:{number:i?-l:l,base:16===a?"hexadecimal":8===a?"octal":"decimal"}}scanRegister(){var e;const t=this.index,n=this.scanNumber(!1);if(this.skipWhitespace(),this.match("\\relax"))return n;let i=!1;if(null===n)for(;;){const e=this.peek();if("-"===e)i=!i;else if("+"!==e)break;this.next(),this.skipWhitespace()}if(this.match("\\global")){this.skipWhitespace();const e=this.get();return e.startsWith("\\")?n?{register:e,global:!0,factor:(i?-1:1)*n.number}:i?{register:e,global:!0,factor:-1}:{register:e,global:!0}:(this.index=t,null)}let r=this.get();return(null==r?void 0:r.startsWith("\\"))?(r=r.substring(1),this.context.registers[r]?i&&null===n?{register:r}:{register:r,factor:(i?-1:1)*(null!=(e=null==n?void 0:n.number)?e:1)}:(this.index=t,null)):(this.index=t,null)}scanValue(){const e=this.scanRegister();if(e)return e;const t=this.index,n=this.scanGlueOrDimen();if(n&&("unit"in n||"glue"in n&&"unit"in n.glue))return n;this.index=t;const i=this.scanNumber();if(i)return i;if(this.end()||!Xo(this.peek()))return null;const r=this.scanString();return r.length>0?{string:r}:null}scanDimen(){const e=this.scanNumber(!1);if(null===e)return null;const t=e.number;let n;return this.skipWhitespace(),this.matchKeyword("true"),this.skipWhitespace(),this.matchKeyword("pt")?n="pt":this.matchKeyword("mm")?n="mm":this.matchKeyword("cm")?n="cm":this.matchKeyword("ex")?n="ex":this.matchKeyword("px")?n="px":this.matchKeyword("em")?n="em":this.matchKeyword("bp")?n="bp":this.matchKeyword("dd")?n="dd":this.matchKeyword("pc")?n="pc":this.matchKeyword("in")?n="in":this.matchKeyword("mu")&&(n="mu"),n?{dimension:t,unit:n}:{dimension:t}}scanGlueOrDimen(){const e=this.scanDimen();if(null===e)return null;if(this.skipWhitespace(),this.match("\\relax"))return e;const t={glue:e};if(this.matchKeyword("plus")){const e=this.scanDimen();if(!e)return t;t.grow=e}if(this.skipWhitespace(),this.match("\\relax"))return t;if(this.skipWhitespace(),this.matchKeyword("minus")){const e=this.scanDimen();if(!e)return t;t.shrink=e}return t.grow||t.shrink?t:e}scanColspec(){this.skipWhitespace();const e=[];for(;!this.end()&&"<}>"!==this.peek()&&"]"!==this.peek();){const t=this.get();"c"===t||"r"===t||"l"===t?e.push({align:t}):"|"===t?e.push({separator:"solid"}):":"===t?e.push({separator:"dashed"}):"@"===t&&(this.match("<{>")&&(this.beginContext({mode:"math"}),e.push({gap:this.scan((e=>"<}>"===e))}),this.endContext()),this.match("<}>")||this.onError({code:"unbalanced-braces"}))}return e}scanModeSet(){let e;if(this.match("\\(")&&(e="textstyle"),!e&&this.match("\\[")&&(e="displaystyle"),!e)return null;this.beginContext({mode:"math",mathstyle:e});const t=this.scan((t=>t===("displaystyle"===e?"\\]":"\\)")));return this.match("displaystyle"===e?"\\]":"\\)")||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),t}scanModeShift(){let e="";if(this.match("<$>")&&(e="<$>"),!e&&this.match("<$$>")&&(e="<$$>"),!e)return null;this.beginContext({mode:"math",mathstyle:"textstyle"});const t=this.scan((t=>t===e));return this.match(e)||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),t}scanEnvironment(){if(!this.match("\\begin"))return null;const e=this.scanArgument("string");if(!e)return null;const t=null!=(n=q[e])?n:null;var n;if(!t)return this.onError({code:"unknown-environment",arg:e}),null;const i=[];if(t.params)for(const n of t.params)if(n.isOptional)i.push(this.scanOptionalArgument(n.type));else{const t=this.scanArgument(n.type);t||this.onError({code:"missing-argument",arg:e}),i.push(t)}this.beginContext({tabular:t.tabular});const r=[],a=[];let s=[],o=!1;do{if(this.end()&&(this.onError({code:"unbalanced-environment",arg:e}),o=!0),!o&&this.match("\\end")&&(this.scanArgument("string")!==e&&this.onError({code:"unbalanced-environment",arg:e}),o=!0),!o)if(this.matchColumnSeparator())s.push(this.mathlist),this.mathlist=[];else if(this.matchRowSeparator()){s.push(this.mathlist),this.mathlist=[];let e=null;this.skipWhitespace(),this.match("[")&&(e=this.scanDimen(),this.skipWhitespace(),this.match("]")),a.push(null!=e?e:{dimension:0}),r.push(s),s=[]}else this.mathlist.push(...this.scan((e=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline"].includes(e))))}while(!o);return s.push(this.mathlist),s.length>0&&r.push(s),this.endContext(),t.createAtom(e,r,a,i)}scanExpression(){const e=this.mathlist;if(this.mathlist=[],this.parseExpression()){const t=this.mathlist;return this.mathlist=e,t}return this.mathlist=e,null}scan(e){this.beginContext(),e||(e=e=>"<}>"===e);let t,n="",i=null,r=[],a=null;for(;!this.end()&&!e(this.peek());)this.hasInfixCommand()&&!n?(n=this.get(),i=se(n,"math"),i&&(r=this.scanArguments(i)[1]),a=this.mathlist,this.mathlist=[]):this.parseExpression();return n?(console.assert(Boolean(i)),r.unshift(this.mathlist),a&&r.unshift(a),t=[i.createAtom({command:n,args:r,style:this.style,mode:this.parseMode})]):t=this.mathlist,this.endContext(),t}scanGroup(){const e=this.index;if(!this.match("<{>"))return null;const t=this.scan((e=>"<}>"===e));this.match("<}>")||this.onError({code:"unbalanced-braces"});const n=new qo(t,this.parseMode,this.style);return n.verbatimLatex=Qa(this.tokens.slice(e,this.index)),n}scanSmartFence(){if(this.skipWhitespace(),!this.match("("))return null;this.beginContext();let e=1;for(;!this.end()&&0!==e;)this.match("(")&&(e+=1),this.match(")")&&(e-=1),0!==e&&this.parseExpression();const t=new Ho("",this.mathlist,{leftDelim:"(",rightDelim:0===e?")":"?"});return this.endContext(),t}scanDelim(){this.skipWhitespace();const e=this.peek();if(!e)return this.onError({code:"unexpected-end-of-string"}),null;if(!Xo(e)&&!e.startsWith("\\"))return null;this.next();const t=se(e,"math");return t?"function"===t.definitionType&&t.ifMode&&!t.ifMode.includes(this.parseMode)?(this.onError({code:"unexpected-delimiter",arg:e}),null):"symbol"!==t.definitionType||"mopen"!==t.type&&"mclose"!==t.type?/^(\.|\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:(this.onError({code:"unexpected-delimiter",arg:e}),null):e:(this.onError({code:"unknown-command",arg:e}),null)}scanLeftRight(){var e;if(this.match("\\right"))return this.onError({code:"unbalanced-braces"}),new jo("\\right");if(this.match("\\mright"))return this.onError({code:"unbalanced-braces"}),new jo("\\mright");let t="\\right";if(!this.match("\\left")){if(!this.match("\\mleft"))return null;t="\\mright"}const n=this.scanDelim();if(!n)return this.onError({code:"unexpected-delimiter"}),new jo("\\right"===t?"\\left":"\\mleft");for(this.beginContext();!this.end()&&!this.match(t);)this.parseExpression();const i=this.mathlist;this.endContext();const r=null!=(e=this.scanDelim())?e:".";return new Ho("\\right"===t?"left...right":"mleft...mright",i,{leftDelim:n,rightDelim:r,style:this.style})}parseSupSub(){if("math"!==this.parseMode)return!1;let e=this.peek();if("^"!==e&&"_"!==e&&"'"!==e)return!1;const t=this.lastSubsupAtom();for(;"^"===e||"_"===e||"'"===e;)this.match("'")?this.match("'")?t.addChild(new Ds({type:"mord",command:"\\doubleprime",mode:"math",value:"′′"}),"superscript"):t.addChild(new Ds({type:"mord",command:"\\prime",mode:"math",value:"′"}),"superscript"):(this.match("^")||this.match("_"))&&t.addChildren(B(this.scanArgument("expression")),"_"===e?"subscript":"superscript"),e=this.peek();return!0}parseLimits(){if("math"!==this.parseMode)return!1;const e=this.match("\\limits"),t=!e&&this.match("\\nolimits"),n=!t&&!e&&this.match("\\displaylimits");if(!e&&!t&&!n)return!1;const i=this.mathlist.length>0?this.mathlist[this.mathlist.length-1]:null;return null!==i&&(i.explicitSubsupPlacement=!0,e&&(i.subsupPlacement="over-under"),t&&(i.subsupPlacement="adjacent"),n&&(i.subsupPlacement="auto"),!0)}scanArguments(e){if(!(null==e?void 0:e.params))return[void 0,[]];let t;const n=[];let i=e.infix?2:0;for(;i<e.params.length;){const r=e.params[i];"rest"===r.type?n.push(this.scan((e=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline","\\right"].includes(e)))):r.isOptional?n.push(this.scanOptionalArgument(r.type)):r.type.endsWith("*")?t=r.type.slice(0,-1):n.push(this.scanArgument(r.type)),i+=1}return[t,n]}scanSymbolOrLiteral(){const e=this.peek();if(!e)return null;let t;if(this.next(),Xo(e)){const t=ts.createAtom(this.parseMode,e,u({},this.style));return t?[t]:null}if(t=this.scanMacro(e),t)return[t];if(e.startsWith("\\")){const n=se(e,this.parseMode);if(!n)return this.onError({code:"unknown-command",arg:e}),[new jo(e)];if("symbol"===n.definitionType){const i=u({},this.style);n.variant&&(i.variant=n.variant),t=new Ds({type:n.type,command:e,style:i,value:String.fromCodePoint(n.codepoint),mode:this.parseMode,verbatimLatex:e})}else{if(n.applyMode||n.applyStyle||n.infix)return this.onError({code:"invalid-command",arg:e}),[new jo(e)];n.createAtom&&(t=n.createAtom({command:e,args:[],style:this.style,mode:this.parseMode}))}}return t?[t]:null}scanArgument(e){var t;this.skipFiller();const n=this.parseMode;if("auto"===e&&(e=n),!this.match("<{>")){if("string"===e)return this.scanString();if("value"===e)return this.scanValue();if("delim"===e)return null!=(t=this.scanDelim())?t:".";if("expression"===e)return this.scanExpression();if("math"===e){e!==n&&this.beginContext({mode:"math"});const t=this.scanSymbolOrLiteral();return e!==n&&this.endContext(),t}if("text"===e){e!==n&&this.beginContext({mode:"text"});const t=this.scanSymbolOrLiteral();return e!==n&&this.endContext(),t}return"balanced-string"===e||console.assert(!1),null}if("text"===e){this.beginContext({mode:"text"});do{this.mathlist.push(...this.scan())}while(!this.match("<}>")&&!this.end());const e=this.mathlist;return this.endContext(),{group:e}}if("math"===e){this.beginContext({mode:"math"});do{this.mathlist.push(...this.scan())}while(!this.match("<}>")&&!this.end());const e=this.mathlist;return this.endContext(),{group:e}}let i=null;if("expression"===e){this.beginContext({mode:"math"});do{this.mathlist.push(...this.scan())}while(!this.match("<}>")&&!this.end());const e=this.mathlist;return this.endContext(),{group:e}}return"string"===e?i=this.scanString():"balanced-string"===e?i=this.scanBalancedString():"colspec"===e?i=this.scanColspec():"value"===e&&(i=this.scanValue()),this.skipUntilToken("<}>"),i}scanOptionalArgument(e){if(e="auto"===e?this.parseMode:e,this.skipFiller(),!this.match("["))return null;let t=null;for(;!this.end()&&!this.match("]");)if("string"===e)t=this.scanString();else if("value"===e)t=this.scanValue();else if("colspec"===e)t=this.scanColspec();else if("bbox"===e){const e={},n=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const t of n){const n=t.match(/^\s*([\d.]+)\s*([a-z]{2})/);if(n)e.padding={dimension:parseInt(n[1]),unit:n[2]};else{const n=t.match(/^\s*border\s*:\s*(.*)/);n?e.border=n[1]:e.backgroundcolor={string:t}}}t=e}else"math"===e&&(this.beginContext({mode:"math"}),t=this.mathlist.concat(this.scan((e=>"]"===e))),this.endContext());return t}scanSymbolOrCommand(e){var t,n,i;if("\\placeholder"===e){const e=this.scanOptionalArgument("string"),t=this.scanOptionalArgument("math"),n=Ds.serialize(t,{defaultMode:"math"});let i,r=[];i||"correct"!==n?i||"incorrect"!==n?""!==n&&(r=t):i="incorrect":i="correct";const a="locked"===this.scanOptionalArgument("string"),s=this.scanArgument("auto");let o;return o=s&&Array.isArray(s)&&s.length>0?s:s&&"object"==typeof s&&"group"in s?s.group:r,e?[new Wo(e,i,a,null!=o?o:r,{mode:this.parseMode,style:this.style})]:[new Do({mode:this.parseMode,style:this.style})]}if("\\renewcommand"===e||"\\newcommand"===e||"\\providecommand"===e||"\\def"===e){const t=this.index,n=this.scanLiteralGroup()||this.next();if(!n)return null;if(this.context.registers[n.substring(1)]){const i=this.scanArgument("string");null!==i&&(this.context.registers[n.substring(1)]=i);const r=Xa([e,Qa(this.tokens.slice(t,this.index))]);return[new Ds({type:"text",value:"",verbatimLatex:r})]}}let r=this.scanMacro(e);if(r)return[r];const a=se(e,this.parseMode);if(!a)return"text"===this.parseMode?(/[a-zA-Z]/.test(null!=(t=this.peek())?t:"")&&(e+=" "),[...e].map((e=>new Ds({type:"text",value:e,mode:"text",style:this.style})))):(this.onError({code:"unknown-command",arg:e}),[new jo(e)]);const s=this.index;if("symbol"===a.definitionType){const t=u({},this.style);a.variant&&(t.variant=a.variant),r=new Ds({type:a.type,command:e,style:t,value:String.fromCodePoint(a.codepoint),mode:this.parseMode})}else{if(a.ifMode&&!a.ifMode.includes(this.parseMode))return[];const t=this.parseMode;let s;a.applyMode&&(this.parseMode=a.applyMode);let o=[];if(a.parse?o=a.parse(this):[s,o]=this.scanArguments(a),this.parseMode=t,a.applyMode&&!a.applyStyle&&!a.createAtom)return B(o[0]);if(a.infix)return this.onError({code:"too-many-infix-commands",arg:e}),null;if("function"==typeof a.createAtom)r=a.createAtom({command:e,args:o,style:this.style,mode:this.parseMode}),s&&(r.body=B(this.scanArgument(s)));else if("function"==typeof a.applyStyle){const t=u(u({},this.style),a.applyStyle(e,o,this.context)),n=this.parseMode;if(a.applyMode&&(this.parseMode=a.applyMode),s){const e=this.style;this.style=t;const i=this.scanArgument(s);return this.style=e,this.parseMode=n,B(i)}this.style=t}else r=new Ds({type:"mord",command:null!=(n=a.command)?n:e,style:u({},this.style),value:e,mode:null!=(i=a.applyMode)?i:this.parseMode})}if(!r)return null;if(r instanceof Ds&&void 0===r.verbatimLatex&&!/^\\(llap|rlap|class|cssId|htmlData)$/.test(e)){const t=Xa([e,Qa(this.tokens.slice(s,this.index))]);t&&(r.verbatimLatex=t)}if(null===r.verbatimLatex&&(r.verbatimLatex=void 0),r.isFunction&&this.smartFence){const e=this.scanSmartFence();if(e)return[r,e]}return[r]}scanSymbolCommandOrLiteral(){const e=this.get();if(!e)return null;if(Xo(e)){const t=ts.createAtom(this.parseMode,e,u({},this.style));if(!t)return null;if(t.isFunction&&this.smartFence){const e=this.scanSmartFence();if(e)return[t,e]}return[t]}return e.startsWith("\\")?this.scanSymbolOrCommand(e):"<space>"===e?"text"===this.parseMode?[new Ps(" "," ",this.style)]:null:("<}>"===e?this.onError({latex:"",code:"unbalanced-braces"}):this.onError({latex:"",code:"unexpected-token",arg:e}),null)}scanMacro(e){var t;const n=this.context.getMacro(e);if(!n)return null;const i=this.index,r=n.args,a={"?":null==(t=this.args)?void 0:t.call(this,"?")};for(let e=1;e<=r;e++){let t=this.scanLiteralGroup();if(!t){const e=this.index;this.scanExpression(),t=Qa(this.tokens.slice(e,this.index))}a[e]=t}return new Go(e,{expand:n.expand,captureSelection:n.captureSelection,args:i===this.index?null:Qa(this.tokens.slice(i,this.index)),style:this.parsingContext.style,body:Qo(n.def,{context:this.context,parseMode:this.parseMode,args:e=>a[e],mathstyle:this.parsingContext.mathstyle,style:this.parsingContext.style})})}parseExpression(){var e,t,n,i;let r=null!=(i=null!=(n=null!=(t=null!=(e=this.scanEnvironment())?e:this.scanModeShift())?t:this.scanModeSet())?n:this.scanGroup())?i:this.scanLeftRight();if(null===r){if(this.parseSupSub())return!0;if(this.parseLimits())return!0;r=this.scanSymbolCommandOrLiteral()}return!!r&&(Array.isArray(r)?this.mathlist.push(...r):this.mathlist.push(r),!0)}};function Qo(e,t){var n,i,r,a;const s=null!=(n=null==t?void 0:t.args)?n:void 0,o=new Jo(Ya(e,s),null==t?void 0:t.context,{args:s,mathstyle:null!=(i=null==t?void 0:t.mathstyle)?i:"displaystyle",parseMode:null!=(r=null==t?void 0:t.parseMode)?r:"math",style:null!=(a=null==t?void 0:t.style)?a:{}}),l=[];for(;!o.end();)l.push(...o.scan((()=>!1)));return l}function el(e,t){var n;const i=new Jo(Ya(e,null),null==t?void 0:t.context,{mathstyle:"displaystyle",parseMode:null!=(n=null==t?void 0:t.parseMode)?n:"math"});for(;!i.end();)i.scan();return i.errors}var tl=class e extends Ds{constructor(e,t){super({type:"chem"},{command:e,mode:"math"});const n=il.go(nl.go(t,"\\pu"===e?"pu":"ce"),!1);this.body=Qo(n),this._verbatimLatex=e+"{"+t+"}",this.arg=t,this.captureSelection=!0}static fromJson(t){return new e(t.command,t.arg)}set verbatimLatex(e){}get verbatimLatex(){return this._verbatimLatex}toJson(){return d(u({},super.toJson()),{arg:this.arg})}render(e){const t=Ds.createBox(e,this.body,{type:"inner"});return this.caret&&(t.caret=this.caret),this.bind(e,t)}_serialize(e){return console.assert(void 0!==this.verbatimLatex),this.verbatimLatex}};ne(["ce","pu"],"{chemformula:balanced-string}",{createAtom:e=>{var t;return new tl(e.command,null!=(t=e.args[0])?t:"")}});var nl={go:function(e,t){if(!e)return[];void 0===t&&(t="ce");var n,i="0",r={};r.parenthesisLevel=0,e=(e=(e=e.replace(/\n/g," ")).replace(/[\u2212\u2013\u2014\u2010]/g,"-")).replace(/[\u2026]/g,"...");for(var a=10,s=[];;){n!==e?(a=10,n=e):a--;var o=nl.stateMachines[t],l=o.transitions[i]||o.transitions["*"];e:for(var c=0;c<l.length;c++){var u=nl.patterns.match_(l[c].pattern,e);if(u){for(var d=l[c].task,h=0;h<d.action_.length;h++){var p;if(o.actions[d.action_[h].type_])p=o.actions[d.action_[h].type_](r,u.match_,d.action_[h].option);else{if(!nl.actions[d.action_[h].type_])throw["MhchemBugA","mhchem bug A. Please report. ("+d.action_[h].type_+")"];p=nl.actions[d.action_[h].type_](r,u.match_,d.action_[h].option)}nl.concatArray(s,p)}if(i=d.nextState||i,!(e.length>0))return s;if(d.revisit||(e=u.remainder),!d.toContinue)break e}}if(a<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(e,t){if(t)if("[object Array]"===Object.prototype.toString.call(t))for(var n=0;n<t.length;n++)e.push(t[n]);else e.push(t)},patterns:{patterns:{empty:/^$/,else:/^./,else2:/^./,space:/^\s/,"space A":/^\s(?=[A-Z\\$])/,space$:/^\s$/,"a-z":/^[a-z]/,x:/^x/,x$:/^x$/,i$:/^i$/,letters:/^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,"\\greek":/^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,"one lowercase latin letter $":/^(?:([a-z])(?:$|[^a-zA-Z]))$/,"$one lowercase latin letter$ $":/^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,"one lowercase greek letter $":/^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,digits:/^[0-9]+/,"-9.,9":/^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,"-9.,9 no missing 0":/^[+\-]?[0-9]+(?:[.,][0-9]+)?/,"(-)(9.,9)(e)(99)":function(e){var t=e.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:(?:([eE])|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);return t&&t[0]?{match_:t.slice(1),remainder:e.substr(t[0].length)}:null},"(-)(9)^(-9)":function(e){var t=e.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);return t&&t[0]?{match_:t.slice(1),remainder:e.substr(t[0].length)}:null},"state of aggregation $":function(e){var t=nl.patterns.findObserveGroups(e,"",/^\([a-z]{1,3}(?=[\),])/,")","");if(t&&t.remainder.match(/^($|[\s,;\)\]\}])/))return t;var n=e.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);return n?{match_:n[0],remainder:e.substr(n[0].length)}:null},"_{(state of aggregation)}$":/^_\{(\([a-z]{1,3}\))\}/,"{[(":/^(?:\\\{|\[|\()/,")]}":/^(?:\)|\]|\\\})/,", ":/^[,;]\s*/,",":/^[,;]/,".":/^[.]/,". ":/^([.\u22C5\u00B7\u2022])\s*/,"...":/^\.\.\.(?=$|[^.])/,"* ":/^([*])\s*/,"^{(...)}":function(e){return nl.patterns.findObserveGroups(e,"^{","","","}")},"^($...$)":function(e){return nl.patterns.findObserveGroups(e,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(e){return nl.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(e){return nl.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(e){return nl.patterns.findObserveGroups(e,"_{","","","}")},"_($...$)":function(e){return nl.patterns.findObserveGroups(e,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(e){return nl.patterns.findObserveGroups(e,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(e){return nl.patterns.findObserveGroups(e,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(e){return nl.patterns.findObserveGroups(e,"","{","}","")},"{(...)}":function(e){return nl.patterns.findObserveGroups(e,"{","","","}")},"$...$":function(e){return nl.patterns.findObserveGroups(e,"","$","$","")},"${(...)}$":function(e){return nl.patterns.findObserveGroups(e,"${","","","}$")},"$(...)$":function(e){return nl.patterns.findObserveGroups(e,"$","","","$")},"=<>":/^[=<>]/,"#":/^[#\u2261]/,"+":/^\+/,"-$":/^-(?=[\s_},;\]/]|$|\([a-z]+\))/,"-9":/^-(?=[0-9])/,"- orbital overlap":/^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,"-":/^-/,"pm-operator":/^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,operator:/^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,arrowUpDown:/^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,"\\bond{(...)}":function(e){return nl.patterns.findObserveGroups(e,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(e){return nl.patterns.findObserveGroups(e,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(e){return nl.patterns.findObserveGroups(e,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(e){return nl.patterns.findObserveGroups(e,"",/^\\[a-zA-Z]+\{/,"}","")},"\\ca":/^\\ca(?:\s+|(?![a-zA-Z]))/,"\\x":/^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,orbital:/^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,others:/^[\/~|]/,"\\frac{(...)}":function(e){return nl.patterns.findObserveGroups(e,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(e){return nl.patterns.findObserveGroups(e,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(e){return nl.patterns.findObserveGroups(e,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(e){return nl.patterns.findObserveGroups(e,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(e){return nl.patterns.findObserveGroups(e,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(e){return nl.patterns.findObserveGroups(e,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(e){return nl.patterns.findObserveGroups(e,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(e){return nl.patterns.findObserveGroups(e,"\\ce{","","","}")},oxidation$:/^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"d-oxidation$":/^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"roman numeral":/^[IVX]+/,"1/2$":/^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,amount:function(e){var t;if(t=e.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/))return{match_:t[0],remainder:e.substr(t[0].length)};var n=nl.patterns.findObserveGroups(e,"","$","$","");return n&&(t=n.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/))?{match_:t[0],remainder:e.substr(t[0].length)}:null},amount2:function(e){return this.amount(e)},"(KV letters),":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,formula$:function(e){if(e.match(/^\([a-z]+\)$/))return null;var t=e.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return t?{match_:t[0],remainder:e.substr(t[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(e,t,n,i,r,a,s,o,l,c){var u=function(e,t){if("string"==typeof t)return 0!==e.indexOf(t)?null:t;var n=e.match(t);return n?n[0]:null},d=u(e,t);if(null===d)return null;if(e=e.substr(d.length),null===(d=u(e,n)))return null;var h=function(e,t,n){for(var i=0;t<e.length;){var r=e.charAt(t),a=u(e.substr(t),n);if(null!==a&&0===i)return{endMatchBegin:t,endMatchEnd:t+a.length};if("{"===r)i++;else if("}"===r){if(0===i)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];i--}t++}return null}(e,d.length,i||r);if(null===h)return null;var p=e.substring(0,i?h.endMatchEnd:h.endMatchBegin);if(a||s){var f=this.findObserveGroups(e.substr(h.endMatchEnd),a,s,o,l);if(null===f)return null;var m=[p,f.match_];return{match_:c?m.join(""):m,remainder:f.remainder}}return{match_:p,remainder:e.substr(h.endMatchEnd)}},match_:function(e,t){var n=nl.patterns.patterns[e];if(void 0===n)throw["MhchemBugP","mhchem bug P. Please report. ("+e+")"];if("function"==typeof n)return nl.patterns.patterns[e](t);var i=t.match(n);return i?{match_:i[2]?[i[1],i[2]]:i[1]?i[1]:i[0],remainder:t.substr(i[0].length)}:null}},actions:{"a=":function(e,t){e.a=(e.a||"")+t},"b=":function(e,t){e.b=(e.b||"")+t},"p=":function(e,t){e.p=(e.p||"")+t},"o=":function(e,t){e.o=(e.o||"")+t},"q=":function(e,t){e.q=(e.q||"")+t},"d=":function(e,t){e.d=(e.d||"")+t},"rm=":function(e,t){e.rm=(e.rm||"")+t},"text=":function(e,t){e.text_=(e.text_||"")+t},insert:function(e,t,n){return{type_:n}},"insert+p1":function(e,t,n){return{type_:n,p1:t}},"insert+p1+p2":function(e,t,n){return{type_:n,p1:t[0],p2:t[1]}},copy:function(e,t){return t},rm:function(e,t){return{type_:"rm",p1:t||""}},text:function(e,t){return nl.go(t,"text")},"{text}":function(e,t){var n=["{"];return nl.concatArray(n,nl.go(t,"text")),n.push("}"),n},"tex-math":function(e,t){return nl.go(t,"tex-math")},"tex-math tight":function(e,t){return nl.go(t,"tex-math tight")},bond:function(e,t,n){return{type_:"bond",kind_:n||t}},"color0-output":function(e,t){return{type_:"color0",color:t[0]}},ce:function(e,t){return nl.go(t)},"1/2":function(e,t){var n=[];t.match(/^[+\-]/)&&(n.push(t.substr(0,1)),t=t.substr(1));var i=t.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);return i[1]=i[1].replace(/\$/g,""),n.push({type_:"frac",p1:i[1],p2:i[2]}),i[3]&&(i[3]=i[3].replace(/\$/g,""),n.push({type_:"tex-math",p1:i[3]})),n},"9,9":function(e,t){return nl.go(t,"9,9")}},createTransitions:function(e){var t,n,i,r,a={};for(t in e)for(n in e[t])for(i=n.split("|"),e[t][n].stateArray=i,r=0;r<i.length;r++)a[i[r]]=[];for(t in e)for(n in e[t])for(i=e[t][n].stateArray||[],r=0;r<i.length;r++){var s=e[t][n];if(s.action_){s.action_=[].concat(s.action_);for(var o=0;o<s.action_.length;o++)"string"==typeof s.action_[o]&&(s.action_[o]={type_:s.action_[o]})}else s.action_=[];for(var l=t.split("|"),c=0;c<l.length;c++)if("*"===i[r])for(var u in a)a[u].push({pattern:l[c],task:s});else a[i[r]].push({pattern:l[c],task:s})}return a},stateMachines:{}};nl.stateMachines={ce:{transitions:nl.createTransitions({empty:{"*":{action_:"output"}},else:{"0|1|2":{action_:"beginsWithBond=false",revisit:!0,toContinue:!0}},oxidation$:{0:{action_:"oxidation-output"}},CMT:{r:{action_:"rdt=",nextState:"rt"},rd:{action_:"rqt=",nextState:"rdt"}},arrowUpDown:{"0|1|2|as":{action_:["sb=false","output","operator"],nextState:"1"}},uprightEntities:{"0|1|2":{action_:["o=","output"],nextState:"1"}},orbital:{"0|1|2|3":{action_:"o=",nextState:"o"}},"->":{"0|1|2|3":{action_:"r=",nextState:"r"},"a|as":{action_:["output","r="],nextState:"r"},"*":{action_:["output","r="],nextState:"r"}},"+":{o:{action_:"d= kv",nextState:"d"},"d|D":{action_:"d=",nextState:"d"},q:{action_:"d=",nextState:"qd"},"qd|qD":{action_:"d=",nextState:"qd"},dq:{action_:["output","d="],nextState:"d"},3:{action_:["sb=false","output","operator"],nextState:"0"}},amount:{"0|2":{action_:"a=",nextState:"a"}},"pm-operator":{"0|1|2|a|as":{action_:["sb=false","output",{type_:"operator",option:"\\pm"}],nextState:"0"}},operator:{"0|1|2|a|as":{action_:["sb=false","output","operator"],nextState:"0"}},"-$":{"o|q":{action_:["charge or bond","output"],nextState:"qd"},d:{action_:"d=",nextState:"d"},D:{action_:["output",{type_:"bond",option:"-"}],nextState:"3"},q:{action_:"d=",nextState:"qd"},qd:{action_:"d=",nextState:"qd"},"qD|dq":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},"-9":{"3|o":{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"3"}},"- orbital overlap":{o:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},d:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"}},"-":{"0|1|2":{action_:[{type_:"output",option:1},"beginsWithBond=true",{type_:"bond",option:"-"}],nextState:"3"},3:{action_:{type_:"bond",option:"-"}},a:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},as:{action_:[{type_:"output",option:2},{type_:"bond",option:"-"}],nextState:"3"},b:{action_:"b="},o:{action_:{type_:"- after o/d",option:!1},nextState:"2"},q:{action_:{type_:"- after o/d",option:!1},nextState:"2"},"d|qd|dq":{action_:{type_:"- after o/d",option:!0},nextState:"2"},"D|qD|p":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},amount2:{"1|3":{action_:"a=",nextState:"a"}},letters:{"0|1|2|3|a|as|b|p|bp|o":{action_:"o=",nextState:"o"},"q|dq":{action_:["output","o="],nextState:"o"},"d|D|qd|qD":{action_:"o after d",nextState:"o"}},digits:{o:{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},q:{action_:["output","o="],nextState:"o"},a:{action_:"o=",nextState:"o"}},"space A":{"b|p|bp":{}},space:{a:{nextState:"as"},0:{action_:"sb=false"},"1|2":{action_:"sb=true"},"r|rt|rd|rdt|rdq":{action_:"output",nextState:"0"},"*":{action_:["output","sb=true"],nextState:"1"}},"1st-level escape":{"1|2":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}]},"*":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}],nextState:"0"}},"[(...)]":{"r|rt":{action_:"rd=",nextState:"rd"},"rd|rdt":{action_:"rq=",nextState:"rdq"}},"...":{"o|d|D|dq|qd|qD":{action_:["output",{type_:"bond",option:"..."}],nextState:"3"},"*":{action_:[{type_:"output",option:1},{type_:"insert",option:"ellipsis"}],nextState:"1"}},". |* ":{"*":{action_:["output",{type_:"insert",option:"addition compound"}],nextState:"1"}},"state of aggregation $":{"*":{action_:["output","state of aggregation"],nextState:"1"}},"{[(":{"a|as|o":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"0|1|2|3":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"*":{action_:["output","o=","output","parenthesisLevel++"],nextState:"2"}},")]}":{"0|1|2|3|b|p|bp|o":{action_:["o=","parenthesisLevel--"],nextState:"o"},"a|as|d|D|q|qd|qD|dq":{action_:["output","o=","parenthesisLevel--"],nextState:"o"}},", ":{"*":{action_:["output","comma"],nextState:"0"}},"^_":{"*":{}},"^{(...)}|^($...$)":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"D"},q:{action_:"d=",nextState:"qD"},"d|D|qd|qD|dq":{action_:["output","d="],nextState:"D"}},"^a|^\\x{}{}|^\\x{}|^\\x|'":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"d"},q:{action_:"d=",nextState:"qd"},"d|qd|D|qD":{action_:"d="},dq:{action_:["output","d="],nextState:"d"}},"_{(state of aggregation)}$":{"d|D|q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x":{"0|1|2|as":{action_:"p=",nextState:"p"},b:{action_:"p=",nextState:"bp"},"3|o":{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},"q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"=<>":{"0|1|2|3|a|as|o|q|d|D|qd|qD|dq":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"#":{"0|1|2|3|a|as|o":{action_:[{type_:"output",option:2},{type_:"bond",option:"#"}],nextState:"3"}},"{}":{"*":{action_:{type_:"output",option:1},nextState:"1"}},"{...}":{"0|1|2|3|a|as|b|p|bp":{action_:"o=",nextState:"o"},"o|d|D|q|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"$...$":{a:{action_:"a="},"0|1|2|3|as|b|p|bp|o":{action_:"o=",nextState:"o"},"as|o":{action_:"o="},"q|d|D|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"\\bond{(...)}":{"*":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"\\frac{(...)}":{"*":{action_:[{type_:"output",option:1},"frac-output"],nextState:"3"}},"\\overset{(...)}":{"*":{action_:[{type_:"output",option:2},"overset-output"],nextState:"3"}},"\\underset{(...)}":{"*":{action_:[{type_:"output",option:2},"underset-output"],nextState:"3"}},"\\underbrace{(...)}":{"*":{action_:[{type_:"output",option:2},"underbrace-output"],nextState:"3"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:[{type_:"output",option:2},"color-output"],nextState:"3"}},"\\color{(...)}0":{"*":{action_:[{type_:"output",option:2},"color0-output"]}},"\\ce{(...)}":{"*":{action_:[{type_:"output",option:2},"ce"],nextState:"3"}},"\\,":{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"1"}},"\\x{}{}|\\x{}|\\x":{"0|1|2|3|a|as|b|p|bp|o|c0":{action_:["o=","output"],nextState:"3"},"*":{action_:["output","o=","output"],nextState:"3"}},others:{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"3"}},else2:{a:{action_:"a to o",nextState:"o",revisit:!0},as:{action_:["output","sb=true"],nextState:"1",revisit:!0},"r|rt|rd|rdt|rdq":{action_:["output"],nextState:"0",revisit:!0},"*":{action_:["output","copy"],nextState:"3"}}}),actions:{"o after d":function(e,t){var n;if((e.d||"").match(/^[0-9]+$/)){var i=e.d;e.d=void 0,n=this.output(e),e.b=i}else n=this.output(e);return nl.actions["o="](e,t),n},"d= kv":function(e,t){e.d=t,e.dType="kv"},"charge or bond":function(e,t){if(e.beginsWithBond){var n=[];return nl.concatArray(n,this.output(e)),nl.concatArray(n,nl.actions.bond(e,t,"-")),n}e.d=t},"- after o/d":function(e,t,n){var i=nl.patterns.match_("orbital",e.o||""),r=nl.patterns.match_("one lowercase greek letter $",e.o||""),a=nl.patterns.match_("one lowercase latin letter $",e.o||""),s=nl.patterns.match_("$one lowercase latin letter$ $",e.o||""),o="-"===t&&(i&&""===i.remainder||r||a||s);!o||e.a||e.b||e.p||e.d||e.q||i||!a||(e.o="$"+e.o+"$");var l=[];return o?(nl.concatArray(l,this.output(e)),l.push({type_:"hyphen"})):(i=nl.patterns.match_("digits",e.d||""),n&&i&&""===i.remainder?(nl.concatArray(l,nl.actions["d="](e,t)),nl.concatArray(l,this.output(e))):(nl.concatArray(l,this.output(e)),nl.concatArray(l,nl.actions.bond(e,t,"-")))),l},"a to o":function(e){e.o=e.a,e.a=void 0},"sb=true":function(e){e.sb=!0},"sb=false":function(e){e.sb=!1},"beginsWithBond=true":function(e){e.beginsWithBond=!0},"beginsWithBond=false":function(e){e.beginsWithBond=!1},"parenthesisLevel++":function(e){e.parenthesisLevel++},"parenthesisLevel--":function(e){e.parenthesisLevel--},"state of aggregation":function(e,t){return{type_:"state of aggregation",p1:nl.go(t,"o")}},comma:function(e,t){var n=t.replace(/\s*$/,"");return n!==t&&0===e.parenthesisLevel?{type_:"comma enumeration L",p1:n}:{type_:"comma enumeration M",p1:n}},output:function(e,t,n){var i,r,a;e.r?(r="M"===e.rdt?nl.go(e.rd,"tex-math"):"T"===e.rdt?[{type_:"text",p1:e.rd||""}]:nl.go(e.rd),a="M"===e.rqt?nl.go(e.rq,"tex-math"):"T"===e.rqt?[{type_:"text",p1:e.rq||""}]:nl.go(e.rq),i={type_:"arrow",r:e.r,rd:r,rq:a}):(i=[],(e.a||e.b||e.p||e.o||e.q||e.d||n)&&(e.sb&&i.push({type_:"entitySkip"}),e.o||e.q||e.d||e.b||e.p||2===n?e.o||e.q||e.d||!e.b&&!e.p?e.o&&"kv"===e.dType&&nl.patterns.match_("d-oxidation$",e.d||"")?e.dType="oxidation":e.o&&"kv"===e.dType&&!e.q&&(e.dType=void 0):(e.o=e.a,e.d=e.b,e.q=e.p,e.a=e.b=e.p=void 0):(e.o=e.a,e.a=void 0),i.push({type_:"chemfive",a:nl.go(e.a,"a"),b:nl.go(e.b,"bd"),p:nl.go(e.p,"pq"),o:nl.go(e.o,"o"),q:nl.go(e.q,"pq"),d:nl.go(e.d,"oxidation"===e.dType?"oxidation":"bd"),dType:e.dType})));for(var s in e)"parenthesisLevel"!==s&&"beginsWithBond"!==s&&delete e[s];return i},"oxidation-output":function(e,t){var n=["{"];return nl.concatArray(n,nl.go(t,"oxidation")),n.push("}"),n},"frac-output":function(e,t){return{type_:"frac-ce",p1:nl.go(t[0]),p2:nl.go(t[1])}},"overset-output":function(e,t){return{type_:"overset",p1:nl.go(t[0]),p2:nl.go(t[1])}},"underset-output":function(e,t){return{type_:"underset",p1:nl.go(t[0]),p2:nl.go(t[1])}},"underbrace-output":function(e,t){return{type_:"underbrace",p1:nl.go(t[0]),p2:nl.go(t[1])}},"color-output":function(e,t){return{type_:"color",color1:t[0],color2:nl.go(t[1])}},"r=":function(e,t){e.r=t},"rdt=":function(e,t){e.rdt=t},"rd=":function(e,t){e.rd=t},"rqt=":function(e,t){e.rqt=t},"rq=":function(e,t){e.rq=t},operator:function(e,t,n){return{type_:"operator",kind_:n||t}}}},a:{transitions:nl.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},"$(...)$":{"*":{action_:"tex-math tight",nextState:"1"}},",":{"*":{action_:{type_:"insert",option:"commaDecimal"}}},else2:{"*":{action_:"copy"}}}),actions:{}},o:{transitions:nl.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},letters:{"*":{action_:"rm"}},"\\ca":{"*":{action_:{type_:"insert",option:"circa"}}},"\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"{text}"}},else2:{"*":{action_:"copy"}}}),actions:{}},text:{transitions:nl.createTransitions({empty:{"*":{action_:"output"}},"{...}":{"*":{action_:"text="}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"\\greek":{"*":{action_:["output","rm"]}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:["output","copy"]}},else:{"*":{action_:"text="}}}),actions:{output:function(e){if(e.text_){var t={type_:"text",p1:e.text_};for(var n in e)delete e[n];return t}}}},pq:{transitions:nl.createTransitions({empty:{"*":{}},"state of aggregation $":{"*":{action_:"state of aggregation"}},i$:{0:{nextState:"!f",revisit:!0}},"(KV letters),":{0:{action_:"rm",nextState:"0"}},formula$:{0:{nextState:"f",revisit:!0}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"!f",revisit:!0}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"a-z":{f:{action_:"tex-math"}},letters:{"*":{action_:"rm"}},"-9.,9":{"*":{action_:"9,9"}},",":{"*":{action_:{type_:"insert+p1",option:"comma enumeration S"}}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"state of aggregation":function(e,t){return{type_:"state of aggregation subscript",p1:nl.go(t,"o")}},"color-output":function(e,t){return{type_:"color",color1:t[0],color2:nl.go(t[1],"pq")}}}},bd:{transitions:nl.createTransitions({empty:{"*":{}},x$:{0:{nextState:"!f",revisit:!0}},formula$:{0:{nextState:"f",revisit:!0}},else:{0:{nextState:"!f",revisit:!0}},"-9.,9 no missing 0":{"*":{action_:"9,9"}},".":{"*":{action_:{type_:"insert",option:"electron dot"}}},"a-z":{f:{action_:"tex-math"}},x:{"*":{action_:{type_:"insert",option:"KV x"}}},letters:{"*":{action_:"rm"}},"'":{"*":{action_:{type_:"insert",option:"prime"}}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"color-output":function(e,t){return{type_:"color",color1:t[0],color2:nl.go(t[1],"bd")}}}},oxidation:{transitions:nl.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:"roman-numeral"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},else:{"*":{action_:"copy"}}}),actions:{"roman-numeral":function(e,t){return{type_:"roman numeral",p1:t||""}}}},"tex-math":{transitions:nl.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},else:{"*":{action_:"o="}}}),actions:{output:function(e){if(e.o){var t={type_:"tex-math",p1:e.o};for(var n in e)delete e[n];return t}}}},"tex-math tight":{transitions:nl.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},"-|+":{"*":{action_:"tight operator"}},else:{"*":{action_:"o="}}}),actions:{"tight operator":function(e,t){e.o=(e.o||"")+"{"+t+"}"},output:function(e){if(e.o){var t={type_:"tex-math",p1:e.o};for(var n in e)delete e[n];return t}}}},"9,9":{transitions:nl.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:nl.createTransitions({empty:{"*":{action_:"output"}},space$:{"*":{action_:["output","space"]}},"{[(|)]}":{"0|a":{action_:"copy"}},"(-)(9)^(-9)":{0:{action_:"number^",nextState:"a"}},"(-)(9.,9)(e)(99)":{0:{action_:"enumber",nextState:"a"}},space:{"0|a":{}},"pm-operator":{"0|a":{action_:{type_:"operator",option:"\\pm"},nextState:"0"}},operator:{"0|a":{action_:"copy",nextState:"0"}},"//":{d:{action_:"o=",nextState:"/"}},"/":{d:{action_:"o=",nextState:"/"}},"{...}|else":{"0|d":{action_:"d=",nextState:"d"},a:{action_:["space","d="],nextState:"d"},"/|q":{action_:"q=",nextState:"q"}}}),actions:{enumber:function(e,t){var n=[];return"+-"===t[0]||"+/-"===t[0]?n.push("\\pm "):t[0]&&n.push(t[0]),t[1]&&(nl.concatArray(n,nl.go(t[1],"pu-9,9")),t[2]&&(t[2].match(/[,.]/)?nl.concatArray(n,nl.go(t[2],"pu-9,9")):n.push(t[2])),(t[3]||t[4])&&("e"===t[3]||"*"===t[4]?n.push({type_:"cdot"}):n.push({type_:"times"}))),t[5]&&n.push("10^{"+t[5]+"}"),n},"number^":function(e,t){var n=[];return"+-"===t[0]||"+/-"===t[0]?n.push("\\pm "):t[0]&&n.push(t[0]),nl.concatArray(n,nl.go(t[1],"pu-9,9")),n.push("^{"+t[2]+"}"),n},operator:function(e,t,n){return{type_:"operator",kind_:n||t}},space:function(){return{type_:"pu-space-1"}},output:function(e){var t,n=nl.patterns.match_("{(...)}",e.d||"");n&&""===n.remainder&&(e.d=n.match_);var i=nl.patterns.match_("{(...)}",e.q||"");if(i&&""===i.remainder&&(e.q=i.match_),e.d&&(e.d=e.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),e.d=e.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),e.q){e.q=e.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),e.q=e.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F");var r={d:nl.go(e.d,"pu"),q:nl.go(e.q,"pu")};"//"===e.o?t={type_:"pu-frac",p1:r.d,p2:r.q}:(t=r.d,r.d.length>1||r.q.length>1?t.push({type_:" / "}):t.push({type_:"/"}),nl.concatArray(t,r.q))}else t=nl.go(e.d,"pu-2");for(var a in e)delete e[a];return t}}},"pu-2":{transitions:nl.createTransitions({empty:{"*":{action_:"output"}},"*":{"*":{action_:["output","cdot"],nextState:"0"}},"\\x":{"*":{action_:"rm="}},space:{"*":{action_:["output","space"],nextState:"0"}},"^{(...)}|^(-1)":{1:{action_:"^(-1)"}},"-9.,9":{0:{action_:"rm=",nextState:"0"},1:{action_:"^(-1)",nextState:"0"}},"{...}|else":{"*":{action_:"rm=",nextState:"1"}}}),actions:{cdot:function(){return{type_:"tight cdot"}},"^(-1)":function(e,t){e.rm+="^{"+t+"}"},space:function(){return{type_:"pu-space-2"}},output:function(e){var t=[];if(e.rm){var n=nl.patterns.match_("{(...)}",e.rm||"");t=n&&""===n.remainder?nl.go(n.match_,"pu"):{type_:"rm",p1:e.rm}}for(var i in e)delete e[i];return t}}},"pu-9,9":{transitions:nl.createTransitions({empty:{0:{action_:"output-0"},o:{action_:"output-o"}},",":{0:{action_:["output-0","comma"],nextState:"o"}},".":{0:{action_:["output-0","copy"],nextState:"o"}},else:{"*":{action_:"text="}}}),actions:{comma:function(){return{type_:"commaDecimal"}},"output-0":function(e){var t=[];if(e.text_=e.text_||"",e.text_.length>4){var n=e.text_.length%3;0===n&&(n=3);for(var i=e.text_.length-3;i>0;i-=3)t.push(e.text_.substr(i,3)),t.push({type_:"1000 separator"});t.push(e.text_.substr(0,n)),t.reverse()}else t.push(e.text_);for(var r in e)delete e[r];return t},"output-o":function(e){var t=[];if(e.text_=e.text_||"",e.text_.length>4){for(var n=e.text_.length-3,i=0;i<n;i+=3)t.push(e.text_.substr(i,3)),t.push({type_:"1000 separator"});t.push(e.text_.substr(i))}else t.push(e.text_);for(var r in e)delete e[r];return t}}}};var il={go:function(e,t){if(!e)return"";for(var n="",i=!1,r=0;r<e.length;r++){var a=e[r];"string"==typeof a?n+=a:(n+=il._go2(a),"1st-level escape"===a.type_&&(i=!0))}return t||i||!n||(n="{"+n+"}"),n},_goInner:function(e){return e?il.go(e,!0):e},_go2:function(e){var t;switch(e.type_){case"chemfive":t="";var n={a:il._goInner(e.a),b:il._goInner(e.b),p:il._goInner(e.p),o:il._goInner(e.o),q:il._goInner(e.q),d:il._goInner(e.d)};n.a&&(n.a.match(/^[+\-]/)&&(n.a="{"+n.a+"}"),t+=n.a+"\\,"),(n.b||n.p)&&(t+="{\\vphantom{X}}",t+="^{\\hphantom{"+(n.b||"")+"}}_{\\hphantom{"+(n.p||"")+"}}",t+="{\\vphantom{X}}",t+="^{\\smash[t]{\\vphantom{2}}\\llap{"+(n.b||"")+"}}",t+="_{\\vphantom{2}\\llap{\\smash[t]{"+(n.p||"")+"}}}"),n.o&&(n.o.match(/^[+\-]/)&&(n.o="{"+n.o+"}"),t+=n.o),"kv"===e.dType?((n.d||n.q)&&(t+="{\\vphantom{X}}"),n.d&&(t+="^{"+n.d+"}"),n.q&&(t+="_{\\smash[t]{"+n.q+"}}")):"oxidation"===e.dType?(n.d&&(t+="{\\vphantom{X}}",t+="^{"+n.d+"}"),n.q&&(t+="{\\vphantom{X}}",t+="_{\\smash[t]{"+n.q+"}}")):(n.q&&(t+="{\\vphantom{X}}",t+="_{\\smash[t]{"+n.q+"}}"),n.d&&(t+="{\\vphantom{X}}",t+="^{"+n.d+"}"));break;case"rm":case"roman numeral":t="\\mathrm{"+e.p1+"}";break;case"text":e.p1.match(/[\^_]/)?(e.p1=e.p1.replace(" ","~").replace("-","\\text{-}"),t="\\mathrm{"+e.p1+"}"):t="\\text{"+e.p1+"}";break;case"state of aggregation":t="\\mskip2mu "+il._goInner(e.p1);break;case"state of aggregation subscript":t="\\mskip1mu "+il._goInner(e.p1);break;case"bond":if(!(t=il._getBond(e.kind_)))throw["MhchemErrorBond","mhchem Error. Unknown bond type ("+e.kind_+")"];break;case"frac":var i="\\frac{"+e.p1+"}{"+e.p2+"}";t="\\mathchoice{\\textstyle"+i+"}{"+i+"}{"+i+"}{"+i+"}";break;case"pu-frac":var r="\\frac{"+il._goInner(e.p1)+"}{"+il._goInner(e.p2)+"}";t="\\mathchoice{\\textstyle"+r+"}{"+r+"}{"+r+"}{"+r+"}";break;case"tex-math":case"1st-level escape":t=e.p1+" ";break;case"frac-ce":t="\\frac{"+il._goInner(e.p1)+"}{"+il._goInner(e.p2)+"}";break;case"overset":t="\\overset{"+il._goInner(e.p1)+"}{"+il._goInner(e.p2)+"}";break;case"underset":t="\\underset{"+il._goInner(e.p1)+"}{"+il._goInner(e.p2)+"}";break;case"underbrace":t="\\underbrace{"+il._goInner(e.p1)+"}_{"+il._goInner(e.p2)+"}";break;case"color":t="{\\color{"+e.color1+"}{"+il._goInner(e.color2)+"}}";break;case"color0":t="\\color{"+e.color+"}";break;case"arrow":var a={rd:il._goInner(e.rd),rq:il._goInner(e.rq)},s=il._getArrow(e.r);a.rd||a.rq?"<=>"===e.r||"<=>>"===e.r||"<<=>"===e.r||"<--\x3e"===e.r?(s="\\long"+s,a.rd&&(s="\\overset{"+a.rd+"}{"+s+"}"),a.rq&&(s="<--\x3e"===e.r?"\\underset{\\lower2mu{"+a.rq+"}}{"+s+"}":"\\underset{\\lower6mu{"+a.rq+"}}{"+s+"}"),s=" {}\\mathrel{"+s+"}{} "):(a.rq&&(s+="[{"+a.rq+"}]"),s=" {}\\mathrel{\\x"+(s+="{"+a.rd+"}")+"}{} "):s=" {}\\mathrel{\\long"+s+"}{} ",t=s;break;case"operator":t=il._getOperator(e.kind_);break;case"space":t=" ";break;case"entitySkip":case"pu-space-1":t="~";break;case"pu-space-2":t="\\mkern3mu ";break;case"1000 separator":t="\\mkern2mu ";break;case"commaDecimal":t="{,}";break;case"comma enumeration L":t="{"+e.p1+"}\\mkern6mu ";break;case"comma enumeration M":t="{"+e.p1+"}\\mkern3mu ";break;case"comma enumeration S":t="{"+e.p1+"}\\mkern1mu ";break;case"hyphen":t="\\text{-}";break;case"addition compound":t="\\,{\\cdot}\\,";break;case"electron dot":t="\\mkern1mu \\bullet\\mkern1mu ";break;case"KV x":t="{\\times}";break;case"prime":t="\\prime ";break;case"cdot":t="\\cdot ";break;case"tight cdot":t="\\mkern1mu{\\cdot}\\mkern1mu ";break;case"times":t="\\times ";break;case"circa":t="{\\sim}";break;case"^":t="uparrow";break;case"v":t="downarrow";break;case"ellipsis":t="\\ldots ";break;case"/":t="/";break;case" / ":t="\\,/\\,";break;default:throw["MhchemBugT","mhchem bug T. Please report."]}return t},_getArrow:function(e){switch(e){case"->":case"→":case"⟶":return"rightarrow";case"<-":return"leftarrow";case"<->":return"leftrightarrow";case"<--\x3e":return"leftrightarrows";case"<=>":case"⇌":return"rightleftharpoons";case"<=>>":return"Rightleftharpoons";case"<<=>":return"Leftrightharpoons";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getBond:function(e){switch(e){case"-":case"1":return"{-}";case"=":case"2":return"{=}";case"#":case"3":return"{\\equiv}";case"~":return"{\\tripledash}";case"~-":return"{\\rlap{\\lower.1em{-}}\\raise.1em{\\tripledash}}";case"~=":case"~--":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";case"-~-":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{-}}\\tripledash}";case"...":return"{{\\cdot}{\\cdot}{\\cdot}}";case"....":return"{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";case"->":return"{\\rightarrow}";case"<-":return"{\\leftarrow}";case"<":return"{<}";case">":return"{>}";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getOperator:function(e){switch(e){case"+":return" {}+{} ";case"-":return" {}-{} ";case"=":return" {}={} ";case"<":return" {}<{} ";case">":return" {}>{} ";case"<<":return" {}\\ll{} ";case">>":return" {}\\gg{} ";case"\\pm":return" {}\\pm{} ";case"\\approx":case"$\\approx$":return" {}\\approx{} ";case"v":case"(v)":return" \\downarrow{} ";case"^":case"(^)":return" \\uparrow{} ";default:throw["MhchemBugT","mhchem bug T. Please report."]}}};var rl=class e extends Ds{constructor(e){super(d(u({},e),{type:"delim"})),this.value=e.delim,this.size=e.size}static fromJson(t){return new e(t)}toJson(){return d(u({},super.toJson()),{delim:this.value,size:this.size})}render(e){return new cs(this.value,{type:"middle"})}_serialize(e){if(!(e.expandMacro||e.skipStyles||e.skipPlaceholders)&&"string"==typeof this.verbatimLatex)return this.verbatimLatex;const t=se(this.command,this.mode);return(null==t?void 0:t.serialize)?t.serialize(this,e):Ja(this.command,this.value)}},al=class e extends Ds{constructor(e){super(d(u({},e),{type:"sizeddelim",value:e.delim})),this.delimType=e.delimType,this.size=e.size}static fromJson(t){return new e(t)}toJson(){return d(u({},super.toJson()),{delim:this.value,size:this.size,delimType:this.delimType})}render(e){let t=function(e,t,n,i){return void 0===e||"."===e?Lo(n,i.classes):("<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),wo.has(e)||ko.has(e)?yo(e,t,!1,n,i):xo.has(e)?_o(e,So[t],!1,n,i):(console.assert(!1,"Unknown delimiter '"+e+"'"),null))}(this.value,this.size,e,{classes:{open:"mopen",close:"mclose"}[this.delimType],type:this.delimType,isSelected:this.isSelected});return t?(t=this.bind(e,t),this.caret&&(t.caret=this.caret),t):null}_serialize(e){if(!(e.expandMacro||e.skipStyles||e.skipPlaceholders)&&"string"==typeof this.verbatimLatex)return this.verbatimLatex;const t=se(this.command,this.mode);return(null==t?void 0:t.serialize)?t.serialize(this,e):Ja(this.command,this.value)}},sl=class e extends Ds{constructor(e,t,n,i){var r,a;super({type:"enclose",command:e,style:i.style}),this.body=t,this.backgroundcolor=i.backgroundcolor,n.updiagonalarrow&&(n.updiagonalstrike=!1),n.box&&(n.left=!1,n.right=!1,n.bottom=!1,n.top=!1),this.notation=n,this.shadow=null!=(r=i.shadow)?r:"none",this.strokeWidth=null!=(a=i.strokeWidth)?a:"0.06em",this.strokeWidth||(this.strokeWidth="0.06em"),this.strokeStyle=i.strokeStyle,this.svgStrokeStyle=i.svgStrokeStyle,this.strokeColor=i.strokeColor,this.borderStyle=i.borderStyle,this.padding=i.padding,this.captureSelection=!1}static fromJson(t){return new e(t.command,t.body,t.notation,t)}toJson(){return d(u({},super.toJson()),{notation:this.notation,shadow:this.shadow,strokeWidth:this.strokeWidth,strokeStyle:this.strokeStyle,svgStrokeStyle:this.svgStrokeStyle,strokeColor:this.strokeColor,borderStyle:this.borderStyle,padding:this.padding})}_serialize(e){var t;if(!(e.expandMacro||e.skipStyles||e.skipPlaceholders)&&"string"==typeof this.verbatimLatex)return this.verbatimLatex;const n=se(this.command,this.mode);if(null==n?void 0:n.serialize)return n.serialize(this,e);let i=null!=(t=this.command)?t:"";if("\\enclose"===this.command){i+="{"+Object.keys(this.notation).join(" ")+"}";let e="",t="";this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+this.backgroundcolor+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+this.strokeColor+'"',t=","),e&&(i+=`[${e}]`)}return Ja(i,this.bodyToLatex(e))}render(e){const t=new Ts({parent:e},this.style),n=Ds.createBox(t,this.body);if(!n)return null;const i=function(e){if(!e)return"1px";const t=e.match(/([0-9][a-zA-Z\%]+)/);return null===t?"1px":t[1]}(this.borderStyle),r=t.toEm(this.padding&&"auto"!==this.padding?{string:this.padding}:{register:"fboxsep"});n.setStyle("position","relative"),n.setStyle("display","inline-block"),n.setStyle("top",r,"em"),n.setStyle("height",n.height+n.depth,"em"),n.setStyle("width",n.width,"em");const a=new cs(null,{classes:"ML__notation"});let s=n.height+n.depth+2*r;const o=n.width+2*r;let l="";if(this.notation.horizontalstrike&&(l+=this.line(3,50,97,50)),this.notation.verticalstrike&&(l+=this.line(50,3,50,97)),this.notation.updiagonalstrike&&(l+=this.line(3,97,97,3)),this.notation.downdiagonalstrike&&(l+=this.line(3,3,97,97)),this.notation.updiagonalarrow){l+=this.line(r.toString(),(r+n.depth+n.height).toString(),(r+n.width).toString(),r.toString());const e=1,t=.03*Math.sqrt(o*o+s*s)*e,i=n.width*t,a=(n.depth+n.height)*t,c=r+n.width;let u=r;u+a-.4*i<0&&(u=.4*i-a),l+='<polygon points="',l+=`${c},${u} ${c-i-.4*a},${u+a-.4*i} `,l+=`${c-.7*i},${u+.7*a} ${c-i+.4*a},${u+a+.4*i} `,l+=`${c},${u}`,l+=`" stroke='none' fill="${this.strokeColor}"`,l+="/>"}let c=0;if(this.notation.phasorangle){const e=ll(t),i=(n.height+n.depth+2*e+r).toString(),a=(n.height+n.depth)/2;l+=this.line(r.toString(),i,(r+a+n.width).toString(),i),l+=this.line(r.toString(),i,(r+a).toString(),(r-e).toString()),s+=e,c=a,n.left+=s/2-r}if(this.notation.longdiv){const e=ll(t);s+=e,l+=this.line(r.toString(),r.toString(),(r+n.width).toString(),r.toString());const i=.3;c=i+e,n.left+=i+e,n.setTop(r+e),l+='<path d="',l+=`M ${r} ${r} a${i} ${(n.depth+n.height+2*e)/2}, 0, 1, 1, 0 ${n.depth+n.height+2*e} "`,l+=` stroke-width="${u=t,(Math.floor(100*u.metrics.sqrtRuleThickness/u.scalingFactor)/100/10).toString()+"em"}" stroke="${this.strokeColor}" fill="none"`,l+="/>"}var u;if(a.width=n.width+2*r+c,a.height=n.height+r,a.depth=n.depth+r,a.setStyle("box-sizing","border-box"),a.setStyle("left",`calc(-${i} / 2 )`),a.setStyle("height",Math.floor(100*s)/100+"em"),a.setStyle("top",`calc(${i} / 2 )`),this.backgroundcolor&&a.setStyle("background-color",this.backgroundcolor),this.notation.box&&a.setStyle("border","1px solid red"),this.notation.actuarial&&(a.setStyle("border-top",this.borderStyle),a.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(a.setStyle("border-bottom",this.borderStyle),a.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(a.setStyle("border-radius","8px"),a.setStyle("border",this.borderStyle)),this.notation.circle&&(a.setStyle("border-radius","50%"),a.setStyle("border",this.borderStyle)),this.notation.top&&a.setStyle("border-top",this.borderStyle),this.notation.left&&a.setStyle("border-left",this.borderStyle),this.notation.right&&a.setStyle("border-right",this.borderStyle),this.notation.bottom&&a.setStyle("border-bottom",this.borderStyle),l){let e="";"auto"===this.shadow&&(e+="filter: drop-shadow(0 0 .5px rgba(255, 255, 255, .7)) drop-shadow(1px 1px 2px #333)"),"none"!==this.shadow&&(e+=`filter: drop-shadow(${this.shadow})`),e+=` stroke-width="${this.strokeWidth}" stroke="${this.strokeColor}"`,e+=' stroke-linecap="round"',this.svgStrokeStyle&&(e+=` stroke-dasharray="${this.svgStrokeStyle}"`),a.svgStyle=e,a.svgOverlay=l}const d=new cs([a,n]);return d.setStyle("position","relative"),d.setStyle("vertical-align",r,"em"),d.setStyle("height",Math.floor(100*(n.height+n.depth+2*r))/100+"em"),d.setStyle("display","inline-block"),d.height=a.height,d.depth=a.depth,d.width=a.width-2*r,d.left=r,d.right=r,this.caret&&(d.caret=this.caret),d.wrap(t)}line(e,t,n,i){return`<line x1="${ol(e)}" y1="${ol(t)}" x2="${ol(n)}" y2="${ol(i)}" vector-effect="non-scaling-stroke"></line>`}};function ol(e){return"number"==typeof e?Math.floor(100*e)/100+"%":e}function ll(e){const t=e.isDisplayStyle?Pa:e.metrics.defaultRuleThickness;return e.metrics.defaultRuleThickness+e.scalingFactor*t/4}var cl=class e extends Ds{constructor(e,t,n){var i,r;super(d(u({},n),{type:"genfrac",displayContainsHighlight:!0})),this.above=e,this.below=t,this.hasBarLine=null==(i=null==n?void 0:n.hasBarLine)||i,this.continuousFraction=null!=(r=null==n?void 0:n.continuousFraction)&&r,this.numerPrefix=null==n?void 0:n.numerPrefix,this.denomPrefix=null==n?void 0:n.denomPrefix,this.mathstyleName=null==n?void 0:n.mathstyleName,this.leftDelim=null==n?void 0:n.leftDelim,this.rightDelim=null==n?void 0:n.rightDelim,this.fractionNavigationOrder=null==n?void 0:n.fractionNavigationOrder}static fromJson(t){return new e(t.above,t.below,t)}toJson(){const e={};return this.continuousFraction&&(e.continuousFraction=!0),this.numerPrefix&&(e.numerPrefix=this.numerPrefix),this.denomPrefix&&(e.denomPrefix=this.denomPrefix),this.leftDelim&&(e.leftDelim=this.leftDelim),this.rightDelim&&(e.rightDelim=this.rightDelim),this.hasBarLine||(e.hasBarLine=!1),this.mathstyleName&&(e.mathstyleName=this.mathstyleName),this.fractionNavigationOrder&&(e.fractionNavigationOrder=this.fractionNavigationOrder),u(u({},super.toJson()),e)}get children(){if(this._children)return this._children;const e=[];if("denominator-numerator"===this.fractionNavigationOrder){for(const t of this.below)e.push(...t.children),e.push(t);for(const t of this.above)e.push(...t.children),e.push(t)}else{for(const t of this.above)e.push(...t.children),e.push(t);for(const t of this.below)e.push(...t.children),e.push(t)}return this._children=e,e}render(e){var t,n;const i=new Ts({parent:e,mathstyle:this.mathstyleName},this.style),r=i.metrics,a=new Ts({parent:i,mathstyle:this.continuousFraction?"":"numerator"},this.style),s=this.numerPrefix?new cs([new cs(this.numerPrefix),Ds.createBox(a,this.above)],{isTight:a.isTight,type:"ignore"}):null!=(t=Ds.createBox(a,this.above,{type:"ignore"}))?t:new cs(null,{type:"ignore"}),o=new Ts({parent:i,mathstyle:this.continuousFraction?"":"denominator"},this.style),l=this.denomPrefix?new cs([new cs(this.denomPrefix),Ds.createBox(o,this.below,{type:"ignore"})]):null!=(n=Ds.createBox(o,this.below,{type:"ignore"}))?n:new cs(null,{type:"ignore"}),c=this.hasBarLine?r.defaultRuleThickness:0;let u,d,h=0;i.isDisplayStyle?(u=a.metrics.num1,h=c>0?3*c:7*c,d=o.metrics.denom1):(c>0?(u=a.metrics.num2,h=c):(u=a.metrics.num3,h=3*r.defaultRuleThickness),d=o.metrics.denom2);const p=[];this.isSelected&&p.push("ML__selected");const f=s.depth,m=l.height;let g;if(c<=0){const e=u-f-(m-d);e<h&&(u+=(h-e)/2,d+=(h-e)/2),g=new ms({individualShift:[{box:s,shift:-u,classes:[...p,"ML__center"]},{box:l,shift:d,classes:[...p,"ML__center"]}]}).wrap(i)}else{const e=new cs(null,{classes:"ML__frac-line",mode:this.mode,style:this.style});e.softWidth=Math.max(s.width,l.width),e.height=c/2,e.depth=c/2;const t=Ra+c/2;u<h+f+t&&(u=h+f+t);const n=Ra-c/2;d<h+m-n&&(d=h+m-n),g=new ms({individualShift:[{box:l,shift:d,classes:[...p,"ML__center"]},{box:e,shift:-n,classes:p},{box:s,shift:-u,classes:[...p,"ML__center"]}]}).wrap(i)}const v=i.isDisplayStyle?r.delim1:r.delim2,b=this.leftDelim?this.bind(e,Ao("open",this.leftDelim,v,!0,e,{style:this.style,mode:this.mode,isSelected:this.isSelected})):Lo(i,"open");let y=null;y=this.continuousFraction?new cs(null,{type:"close"}):this.rightDelim?this.bind(e,Ao("close",this.rightDelim,v,!0,e,{style:this.style,mode:this.mode,isSelected:this.isSelected})):Lo(i,"close");const _=new cs([b,g,y],{isTight:i.isTight,type:"inner",classes:"mfrac"}),w=this.bind(e,_);return this.caret&&(w.caret=this.caret),this.attachSupsub(e,{base:w})}},ul=class e extends Ds{constructor(e,t){var n;super({type:"latex",value:e,mode:"latex"}),this.isSuggestion=null!=(n=null==t?void 0:t.isSuggestion)&&n,this.isError=!1}static fromJson(t){const n=new e(t.value);return t.isSuggestion&&(n.isSuggestion=!0),t.isError&&(n.isError=!0),n}toJson(){const e={};return this.isSuggestion&&(e.isSuggestion=!0),this.isError&&(e.isError=!0),u({type:"latex",value:this.value},e)}get computedStyle(){return{}}render(e){const t=new cs(this.value,{classes:this.isSuggestion?"ML__suggestion":this.isError?"ML__error":"",type:"latex",maxFontSize:1});return t?(this.caret&&(t.caret=this.caret),this.bind(e,t)):null}},dl=class e extends Ds{constructor(e){super({type:"latexgroup",mode:"latex"}),this.body=[...e].map((e=>new ul(e))),this.skipBoundary=!1}static fromJson(t){return new e("")}toJson(){return super.toJson()}render(e){const t=Ds.createBox(e,this.body);return t?(this.caret&&(t.caret=this.caret),this.bind(e,t)):null}_serialize(e){var t,n;return null!=(n=null==(t=this.body)?void 0:t.map((e=>e.value)).join(""))?n:""}},hl=class e extends Ds{constructor(e,t){super(d(u({},t),{type:"extensible-symbol",isFunction:null==t?void 0:t.isFunction})),this.value=e,this.variant=null==t?void 0:t.variant,this.subsupPlacement=null==t?void 0:t.limits}static fromJson(t){return new e(t.symbol,t)}toJson(){const e=super.toJson();return this.variant&&(e.variant=this.variant),this.subsupPlacement&&(e.limits=this.subsupPlacement),this.isExtensibleSymbol&&(e.isExtensibleSymbol=!0),this.value&&(e.symbol=this.value),e}render(e){var t;const n=e.isDisplayStyle&&"\\smallint"!==this.value,i=new cs(this.value,{fontFamily:n?"Size2-Regular":"Size1-Regular",classes:"op-symbol "+(n?"large-op":"small-op"),type:"op",maxFontSize:e.scalingFactor,isSelected:this.isSelected});if(!i)return null;i.right=i.italic;const r=(i.height-i.depth)/2-Ra*e.scalingFactor,a=i.italic;i.setTop(r);let s=i;if(this.superscript||this.subscript){const n=null!=(t=this.subsupPlacement)?t:"auto";s="over-under"===n||"auto"===n&&e.isDisplayStyle?this.attachLimits(e,{base:i,baseShift:r,slant:a}):this.attachSupsub(e,{base:i})}return new cs(this.bind(e,s),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(e)}_serialize(e){if(!(e.expandMacro||e.skipStyles||e.skipPlaceholders)&&"string"==typeof this.verbatimLatex)return this.verbatimLatex;const t=se(this.command,this.mode);if(null==t?void 0:t.serialize)return t.serialize(this,e);const n=[];return n.push(this.command),this.explicitSubsupPlacement&&("over-under"===this.subsupPlacement&&n.push("\\limits"),"adjacent"===this.subsupPlacement&&n.push("\\nolimits"),"auto"===this.subsupPlacement&&n.push("\\displaylimits")),n.push(this.supsubToLatex(e)),Xa(n)}},pl=class e extends Ds{constructor(e){const t=e.body;super(d(u({},e),{type:"overlap",body:"string"==typeof t?[new Ds({value:t})]:t,style:null==e?void 0:e.style})),this.skipBoundary=!0,this.align=null==e?void 0:e.align,this.boxType=null==e?void 0:e.boxType}static fromJson(t){return new e(t)}toJson(){const e={};return this.align&&(e.align=this.align),this.boxType&&(e.boxType=this.boxType),u(u({},super.toJson()),e)}render(e){const t=Ds.createBox(e,this.body,{classes:"inner"});return t?(this.caret&&(t.caret=this.caret),this.bind(e,new cs([t,new cs(null,{classes:"fix"})],{classes:"right"===this.align?"rlap":"llap",type:this.boxType}))):null}},fl=class e extends Ds{constructor(e){var t,n,i,r;super({type:"overunder",command:e.command,style:e.style,mode:e.mode,body:e.body,skipBoundary:null==(t=e.skipBoundary)||t}),this.subsupPlacement=e.supsubPlacement,this.svgAbove=e.svgAbove,this.svgBelow=e.svgBelow,this.svgBody=e.svgBody,this.above=e.above,this.below=e.below,this.boxType=null!=(n=e.boxType)?n:"ord",this.paddedBody=null!=(i=e.paddedBody)&&i,this.paddedLabels=null!=(r=e.paddedLabels)&&r}static fromJson(t){return new e(t)}toJson(){const e=super.toJson();return this.skipBoundary||(e.skipBoundary=!1),this.subsupPlacement&&(e.subsupPlacement=this.subsupPlacement),this.svgAbove&&(e.svgAbove=this.svgAbove),this.svgBelow&&(e.svgBelow=this.svgBelow),this.svgBody&&(e.svgBody=this.svgBody),"ord"!==this.boxType&&(e.boxType=this.boxType),this.paddedBody&&(e.paddedBody=!0),this.paddedLabels&&(e.paddedLabels=!0),e}render(e){let t=this.svgBody?ps(this.svgBody):Ds.createBox(e,this.body,{type:"ignore"});const n=new Ts({parent:e,mathstyle:"scriptstyle"},this.style);let i=null;this.svgAbove?i=ps(this.svgAbove):this.above&&(i=Ds.createBox(n,this.above,{type:"ignore"}));let r=null;this.svgBelow?r=ps(this.svgBelow):this.below&&(r=Ds.createBox(n,this.below,{type:"ignore"})),this.paddedBody&&(t=new cs([Lo(e,"open"),t,Lo(e,"close")],{type:"ignore"}));let a=function(e,t){if(!t.base)return null;if(!t.above&&!t.below){const e=new cs(t.base,{type:t.type});return e.setStyle("position","relative"),e}let n=0;t.above&&(n=e.metrics.bigOpSpacing5);let i=null;const r=t.base,a=0,s=["ML__center"];t.paddedAboveBelow&&s.push("ML__label_padding");if(t.below&&t.above){const o=e.metrics.bigOpSpacing5+t.below.height+t.below.depth+r.depth+a;i=new ms({bottom:o,children:[e.metrics.bigOpSpacing5,{box:t.below,classes:s},{box:r,classes:["ML__center"]},n,{box:t.above,classes:s},e.metrics.bigOpSpacing5]})}else t.below?i=new ms({top:r.height-a,children:[e.metrics.bigOpSpacing5,{box:t.below,classes:s},{box:r,classes:["ML__center"]}]}):t.above&&(i=new ms({bottom:r.depth+a,children:[{box:r,classes:["ML__center"]},n,{box:t.above,classes:s},e.metrics.bigOpSpacing5]}));return new cs(i,{type:t.type})}(e,{base:t,above:i,below:r,type:"bin"===this.boxType||"rel"===this.boxType?this.boxType:"ord",paddedAboveBelow:this.paddedLabels});return a?(a="over-under"===this.subsupPlacement?this.attachLimits(e,{base:a,type:a.type}):this.attachSupsub(e,{base:a}),this.caret&&(a.caret=this.caret),this.bind(e,a)):null}};var ml=class e extends Ds{constructor(e){var t,n,i,r;super(d(u({},e),{type:"phantom"})),this.captureSelection=!0,this.isInvisible=null!=(t=e.isInvisible)&&t,this.smashDepth=null!=(n=e.smashDepth)&&n,this.smashHeight=null!=(i=e.smashHeight)&&i,this.smashWidth=null!=(r=e.smashWidth)&&r}static fromJson(t){return new e(t)}toJson(){const e={};return this.isInvisible&&(e.isInvisible=!0),this.smashDepth&&(e.smashDepth=!0),this.smashHeight&&(e.smashHeight=!0),this.smashWidth&&(e.smashWidth=!0),u(u({},super.toJson()),e)}render(e){const t=new Ts({parent:e,isPhantom:!0});if(!this.smashDepth&&!this.smashHeight&&!this.smashWidth)return console.assert(this.isInvisible),Ds.createBox(t,this.body,{classes:"inner"});const n=Ds.createBox(this.isInvisible?t:e,this.body);if(!n)return null;if(this.smashWidth){const t=new cs(null,{classes:"fix"});return new cs([n,t],{classes:"rlap"}).wrap(e)}if(!this.smashHeight&&!this.smashDepth)return n;if(this.smashHeight&&(n.height=0),this.smashDepth&&(n.depth=0),n.children)for(const e of n.children)this.smashHeight&&(e.height=0),this.smashDepth&&(e.depth=0);return new ms({firstBaseline:[{box:n}]},{type:n.type}).wrap(e)}},gl=class e extends Ds{constructor(e){var t;super(u({type:"spacing"},e)),this.width=null==e?void 0:e.width,this._braced=null!=(t=null==e?void 0:e.braced)&&t}static fromJson(t){return new e(t)}toJson(){const e=super.toJson();return void 0!==this.width&&(e.width=this.width),this._braced&&(e.braced=!0),e}render(e){var t;if("space"===this.command)return new cs("math"===this.mode?null:" ");let n;if(void 0!==this.width)n=new cs(null,{classes:"mspace"}),n.left=e.toEm(this.width);else{const e=null!=(t={"\\qquad":"qquad","\\quad":"quad","\\enspace":"enspace","\\;":"thickspace","\\:":"mediumspace","\\>":"mediumspace","\\,":"thinspace","\\!":"negativethinspace"}[this.command])?t:"mediumspace";n=new cs(null,{classes:e})}return n=this.bind(e,n),this.caret&&(n.caret=this.caret),n}_serialize(e){var t;if(!e.expandMacro&&"string"==typeof this.verbatimLatex)return this.verbatimLatex;const n=se(this.command,this.mode);if(null==n?void 0:n.serialize)return n.serialize(this,e);const i=null!=(t=this.command)?t:"";return void 0===this.width?i:this._braced&&!("register"in this.width)?`${i}{${xs(this.width)}}`:`${i}${xs(this.width)}`}},vl=class e extends Ds{constructor(e){var t;super(d(u({},e),{type:"surd",mode:null!=(t=e.mode)?t:"math",style:e.style,displayContainsHighlight:!0,body:e.body})),this.above=e.index}static fromJson(t){return new e(d(u({},t),{index:t.above}))}_serialize(e){if(!(e.expandMacro||e.skipStyles||e.skipPlaceholders)&&"string"==typeof this.verbatimLatex)return this.verbatimLatex;const t=se(this.command,this.mode);if(null==t?void 0:t.serialize)return t.serialize(this,e);const n=this.command,i=this.bodyToLatex(e);return this.above&&!this.hasEmptyBranch("above")?Ja(`${n}[${this.aboveToLatex(e)}]`,i):/^[0-9]$/.test(i)?`${n}${i}`:Ja(n,i)}get children(){if(this._children)return this._children;const e=[];if(this.above)for(const t of this.above)e.push(...t.children),e.push(t);if(this.body)for(const t of this.body)e.push(...t.children),e.push(t);return this._children=e,e}render(e){var t;const n=new Ts({parent:e,mathstyle:"cramp"},this.style),i=null!=(t=Ds.createBox(n,this.body,{type:"inner"}))?t:new cs(null),r=n.scalingFactor,a=n.metrics.defaultRuleThickness/r,s=e.isDisplayStyle?Pa:a,o=new cs(null,{classes:"ML__sqrt-line",style:this.style});o.height=a,o.softWidth=i.width;let l=r*(a+s/4);const c=Math.max(2*r*s,i.height+i.depth)+l+a,u=new Ts({parent:e},this.style),d=this.bind(u,new cs(Ao("inner","\\surd",c,!1,u,{isSelected:this.isSelected}),{isSelected:this.isSelected,classes:"ML__sqrt-sign",style:this.style}));if(!d)return null;const h=d.height+d.depth-a;h>i.height+i.depth+l&&(l=(l+h-(i.height+i.depth))/2),d.setTop(d.height-i.height-l);const p=this.bind(e,new ms({firstBaseline:[{box:new cs(i)},l-2*a,{box:o},a]})),f=Ds.createBox(new Ts({parent:e,mathstyle:"scriptscriptstyle"}),this.above,{type:"ignore"});if(!f){const t=new cs([d,p],{classes:this.containsCaret?"ML__contains-caret":"",type:"inner"});return t.setStyle("display","inline-block"),t.setStyle("height",t.height+t.depth,"em"),this.caret&&(t.caret=this.caret),this.bind(e,t)}const m=new ms({shift:-.6*(Math.max(d.height,p.height)-Math.max(d.depth,p.depth)),children:[{box:f}]}),g=new cs([new cs(m,{classes:"ML__sqrt-index",type:"ignore"}),d,p],{type:"inner",classes:this.containsCaret?"ML__contains-caret":""});return g.height=d.height,g.depth=d.depth,this.caret&&(g.caret=this.caret),this.bind(e,g)}},bl=class extends cs{constructor(e){super(null,{type:"skip"}),this._width=e}toMarkup(){return`<span style="display:inline-block;width:${Math.ceil(100*this.width)/100}em"></span>`}};function yl(e,t){if(!e.parent)return;const n=e.parent.children,i=n.indexOf(e);let r=i-1;for(;r>=0&&"ignore"===n[r].type;)r-=1;r<0&&e.parent.parent&&"lift"===e.parent.type?yl(e.parent,t):i>0&&"skip"===n[i-1].type?n[i-1].width+=t:n.splice(i,0,new bl(t))}var _l={ord:{op:3,bin:4,rel:5,inner:3},op:{ord:3,op:3,rel:5,inner:3},bin:{ord:4,op:4,open:4,inner:4},rel:{ord:5,op:5,open:5,inner:5},close:{op:3,bin:4,rel:5,inner:3},punct:{ord:3,op:3,rel:3,open:3,punct:3,inner:3},inner:{ord:3,op:3,bin:4,rel:5,open:3,punct:3,inner:3}},wl={ord:{op:3},op:{ord:3,op:3},close:{op:3},inner:{op:3}};function xl(e,t){if(!e.children)return e;const n=e.children;!function(e){kl(e,((e,t)=>{"bin"!==t.type||e&&!/^(middle|bin|op|rel|open|punct)$/.test(e.type)||(t.type="ord"),"bin"===(null==e?void 0:e.type)&&/^(rel|close|punct)$/.test(t.type)&&(e.type="ord"),"ignore"!==t.type&&(e=t)}))}(n);const i=t.getRegisterAsEm("thinmuskip"),r=t.getRegisterAsEm("medmuskip"),a=t.getRegisterAsEm("thickmuskip");return kl(n,((e,t)=>{var n,s,o;if(!e)return;const l=e.type,c=t.isTight?null!=(n=wl[l])?n:null:null!=(s=_l[l])?s:null,u=null!=(o=null==c?void 0:c[t.type])?o:null;3===u&&yl(t,i),4===u&&yl(t,r),5===u&&yl(t,a)})),e}function kl(e,t,n){if(!e)return n;e=[...e];for(const i of e)"lift"===i.type?n=kl(i.children,t,n):"ignore"===i.type?kl(i.children,t):(t(n,i),kl(i.children,t),n=i);return n}var Sl=class e extends Ds{constructor(e){super({type:"tooltip",command:e.command,mode:e.mode,style:e.style,body:e.body,displayContainsHighlight:!0}),this.tooltip=new Ds({type:"root",mode:e.content,body:e.tooltip,style:{}}),this.skipBoundary=!0,this.captureSelection=!1}static fromJson(t){return new e(d(u({},t),{tooltip:Cl(t.tooltip)}))}toJson(){var e;const t=null==(e=this.tooltip.body)?void 0:e.filter((e=>"first"!==e.type)).map((e=>e.toJson()));return d(u({},super.toJson()),{tooltip:t})}render(e){const t=Ds.createBox(new Ts,this.body);if(!t)return null;const n=new Ts({parent:e,mathstyle:"displaystyle"},{fontSize:5}),i=ds(xl(new cs(this.tooltip.render(n),{classes:"ML__tooltip-content"}),n)),r=new cs([i,t],{classes:"ML__tooltip-container"});return this.caret&&(r.caret=this.caret),this.bind(e,r)}},El=class e extends Ds{constructor(e,t){super(d(u({},t),{type:"operator",isFunction:null==t?void 0:t.isFunction})),this.value=e,this.variant=null==t?void 0:t.variant,this.variantStyle=null==t?void 0:t.variantStyle,this.subsupPlacement=null==t?void 0:t.limits}static fromJson(t){return new e(t.symbol,t)}toJson(){const e=super.toJson();return this.variant&&(e.variant=this.variant),this.variantStyle&&(e.variantStyle=this.variantStyle),this.subsupPlacement&&(e.limits=this.subsupPlacement),this.value&&(e.symbol=this.value),e}render(e){var t;const n=new cs(this.value,{type:"op",mode:"math",maxFontSize:e.scalingFactor,style:{variant:this.variant,variantStyle:this.variantStyle},isSelected:this.isSelected,letterShapeStyle:e.letterShapeStyle});let i=n;if(this.superscript||this.subscript){const r=null!=(t=this.subsupPlacement)?t:"auto";i="over-under"===r||"auto"===r&&e.isDisplayStyle?this.attachLimits(e,{base:n}):this.attachSupsub(e,{base:n})}return new cs(this.bind(e,i),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(e)}_serialize(e){if(!(e.expandMacro||e.skipStyles||e.skipPlaceholders)&&"string"==typeof this.verbatimLatex)return this.verbatimLatex;const t=se(this.command,this.mode);if(null==t?void 0:t.serialize)return t.serialize(this,e);const n=[this.command];return this.explicitSubsupPlacement&&("over-under"===this.subsupPlacement&&n.push("\\limits"),"adjacent"===this.subsupPlacement&&n.push("\\nolimits"),"auto"===this.subsupPlacement&&n.push("\\displaylimits")),n.push(this.supsubToLatex(e)),Xa(n)}};function Cl(e){if(f(e))return e.map((e=>Cl(e)));if("string"==typeof e)return Ds.fromJson(e);e=u({},e);for(const t of As)e[t]&&(e[t]=Cl(e[t]));e.args&&(e.args=function(e){return e&&Array.isArray(e)?e.map((e=>"<null>"===e?null:"object"==typeof e&&"group"in e?{group:e.group.map((e=>Cl(e)))}:"object"==typeof e&&"atoms"in e?e.atoms.map((e=>Cl(e))):e)):void 0}(e.args)),e.array&&(e.array=Cl(e.array));const t=e.type;let n;"accent"===t&&(n=mo.fromJson(e)),"array"===t&&(n=Bo.fromJson(e)),"box"===t&&(n=Ko.fromJson(e)),"chem"===t&&(n=tl.fromJson(e)),"composition"===t&&(n=Uo.fromJson(e)),"delim"===t&&(n=rl.fromJson(e)),"enclose"===t&&(n=sl.fromJson(e)),"error"===t&&(n=jo.fromJson(e)),"extensible-symbol"===t&&(n=hl.fromJson(e)),"genfrac"===t&&(n=cl.fromJson(e)),"group"===t&&(n=qo.fromJson(e)),"latex"===t&&(n=ul.fromJson(e)),"latexgroup"===t&&(n=dl.fromJson(e)),"leftright"===t&&(n=Ho.fromJson(e)),"macro"===t&&(n=Go.fromJson(e)),"macro-argument"===t&&(n=Zo.fromJson(e)),"operator"===t&&(n=El.fromJson(e)),"overlap"===t&&(n=pl.fromJson(e)),"overunder"===t&&(n=fl.fromJson(e)),"placeholder"===t&&(n=Do.fromJson(e)),"prompt"===t&&(n=Wo.fromJson(e)),"phantom"===t&&(n=ml.fromJson(e)),"sizeddelim"===t&&(n=al.fromJson(e)),"spacing"===t&&(n=gl.fromJson(e)),"subsup"===t&&(n=Yo.fromJson(e)),"surd"===t&&(n=vl.fromJson(e)),"text"===t&&(n=Ps.fromJson(e)),"tooltip"===t&&(n=Sl.fromJson(e)),n||(console.assert(!t||["first","mbin","mrel","mclose","minner","mop","mopen","mord","mpunct","root","space"].includes(t),`MathLive 0.98.5: an unexpected atom type "${t}" was encountered. Add new atom constructors to \`fromJson()\` in "atom.ts"`),n=Ds.fromJson(e));for(const t of As)e[t]&&n.setChildren(e[t],t);return void 0!==e.verbatimLatex&&(n.verbatimLatex=e.verbatimLatex),e.subsupPlacement&&(n.subsupPlacement=e.subsupPlacement),e.explicitSubsupPlacement&&(n.explicitSubsupPlacement=!0),e.isFunction&&(n.isFunction=!0),e.isExtensibleSymbol&&(n.isExtensibleSymbol=!0),e.skipBoundary&&(n.skipBoundary=!0),e.captureSelection&&(n.captureSelection=!0),n}var Tl={main:["Main-Regular","ML__cmr"],"main-italic":["Main-Italic","ML__cmr ML__it"],"main-bold":["Main-Bold","ML__cmr ML__bold"],"main-bolditalic":["Main-BoldItalic","ML__cmr ML__bold ML__it"],normal:["Main-Regular","ML__cmr"],"normal-bold":["Main-Bold","ML__mathbf"],"normal-italic":["Math-Italic","ML__mathit"],"normal-bolditalic":["Math-BoldItalic","ML__mathbfit"],ams:["AMS-Regular","ML__ams"],"ams-bold":["AMS-Regular","ML__ams"],"ams-italic":["AMS-Regular","ML__ams"],"ams-bolditalic":["AMS-Regular","ML__ams"],"sans-serif":["SansSerif-Regular","ML__sans"],"sans-serif-bold":["SansSerif-Regular","ML__sans ML__bold"],"sans-serif-italic":["SansSerif-Regular","ML__sans"],"sans-serif-bolditalic":["SansSerif-Regular","ML__sans"],calligraphic:["Caligraphic-Regular","ML__cal"],"calligraphic-bold":["Caligraphic-Regular","ML__cal ML__bold"],"calligraphic-italic":["Caligraphic-Regular","ML__cal ML__it"],"calligraphic-bolditalic":["Caligraphic-Regular","ML__cal ML__bold ML__it"],script:["Script-Regular","ML__script"],"script-bold":["Script-Regular","ML__script ML__bold"],"script-italic":["Script-Regular","ML__script ML__it"],"script-bolditalic":["Script-Regular","ML__script ML__bold ML__it"],fraktur:["Fraktur-Regular","ML__frak"],"fraktur-bold":["Fraktur-Regular","ML__frak"],"fraktur-italic":["Fraktur-Regular","ML__frak"],"fraktur-bolditalic":["Fraktur-Regular","ML__frak"],monospace:["Typewriter-Regular","ML__tt"],"monospace-bold":["Typewriter-Regular","ML__tt ML__bold"],"monospace-italic":["Typewriter-Regular","ML__tt ML__it"],"monospace-bolditalic":["Typewriter-Regular","ML__tt ML__bold ML__it"],"double-struck":["AMS-Regular","ML__bb"],"double-struck-bold":["AMS-Regular","ML__bb"],"double-struck-italic":["AMS-Regular","ML__bb"],"double-struck-bolditalic":["AMS-Regular","ML__bb"]},Al={"double-struck":/^[A-Z ]$/,script:/^[A-Z ]$/,calligraphic:/^[\dA-Z ]$/,fraktur:/^[\dA-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/,monospace:/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/,"sans-serif":/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/},Ml=/^[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5]$/,Ll=[/^[a-z]$/,/^[A-Z]$/,Ml,/^[\u0393|\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A6\u03A8\u03A9]$/],Dl={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]};function Il(e){if(!e)return"";const{style:t}=e;if(void 0===t.variant)return"";let n=t.variant;return!["calligraphic","fraktur","double-struck","script","monospace","sans-serif"].includes(t.variant)&&t.variantStyle&&"up"!==t.variantStyle&&(n+="-"+t.variantStyle),n}function Rl(e,t){return is(e,"fontSeries").map((e=>{const n=function(e,t){return is(e,"fontShape").map((e=>{const n=function(e,t){return e.map((e=>e._serialize(t)))}(e,t),{fontShape:i}=e[0].style;let r="";return"it"===i&&(r="\\textit"),"sl"===i&&(r="\\textsl"),"sc"===i&&(r="\\textsc"),"n"===i&&(r="\\textup"),!r&&i?`{${Ja("\\fontshape",i)}${Xa(n)}}`:r?Ja(r,Xa(n)):Xa(n)}))}(e,t),{fontSeries:i}=e[0].style;let r="";return"b"===i&&(r="\\textbf"),"l"===i&&(r="\\textlf"),"m"===i&&(r="\\textmd"),i&&!r?`{${Ja("\\fontseries",i)}${Xa(n)}}`:r?Ja(r,Xa(n)):Xa(n)}))}function Pl(e,t,n){return is(e,"fontFamily").map((e=>{var i,r;const a=function(e,t){return is(e,"fontSize").map((e=>{var n,i;const r=Rl(e,t),a=null!=(i=["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][null!=(n=e[0].style.fontSize)?n:""])?i:"";return a?`${a} ${Xa(r)}`:Xa(r)}))}(e,t),s=null!=(r={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[null!=(i=e[0].style.fontFamily)?i:""])?r:"";return s?`\\${s}{${Xa(a)}}`:e[0].style.fontFamily?`{\\fontfamily{${e[0].style.fontFamily}} ${Xa(a)}}`:n?`\\text{${Xa(a)}}`:Xa(a)}))}new class extends ts{constructor(){super("math")}createAtom(e,t,n){var i,r,a,s;if(null===t)return new Ds({type:"mord",mode:"math",command:e,value:e,style:n});const o=window.MathfieldElement.isFunction(null!=(i=t.command)?i:e);if("symbol"===t.definitionType){const i=new Ds({type:null!=(r=t.type)?r:"mord",mode:"math",command:null!=(a=t.command)?a:e,value:String.fromCodePoint(t.codepoint),style:n});return o&&(i.isFunction=!0),e.startsWith("\\")&&(i.verbatimLatex=e),i}const l=new Ds({type:"mord",mode:"math",command:null!=(s=t.command)?s:e,value:e,style:n});return o&&(l.isFunction=!0),e.startsWith("\\")&&(l.verbatimLatex=e),l}serialize(e,t){const n=function(e,t){const{parent:n}=e[0],i=Il(n);return is(e,"variant").map((e=>{const n=Il(e[0]);let r="";n&&n!==i&&(r={calligraphic:"\\mathcal",fraktur:"\\mathfrak","double-struck":"\\mathbb",script:"\\mathscr",monospace:"\\mathtt","sans-serif":"\\mathsf",normal:"\\mathrm","normal-italic":"\\mathnormal","normal-bold":"\\mathbf","normal-bolditalic":"\\mathbfit",ams:"","ams-italic":"\\mathit","ams-bold":"\\mathbf","ams-bolditalic":"\\mathbfit",main:"","main-italic":"\\mathit","main-bold":"\\mathbf","main-bolditalic":"\\mathbfit"}[n],console.assert(void 0!==r));const a=Xa(e.map((e=>e._serialize(t))));return r?Ja(r,a):a}))}(e,d(u({},t),{defaultMode:"math"}));return 0===n.length||"text"!==t.defaultMode?n:["$ ",...n," $"]}getFont(e,t){console.assert(void 0!==t.variant);let{variant:n}=t,{variantStyle:i}=t;"normal"===n&&!i&&/[\u00A3\u0131\u0237]/.test(e.value)&&(n="main",i="italic"),"normal"!==n||i||1!==e.value.length||Ll.forEach(((n,r)=>{var a;n.test(e.value)&&"it"===Dl[null!=(a=t.letterShapeStyle)?a:"tex"][r]&&(i="italic")})),"up"===i&&(i=void 0);const r=i?n+"-"+i:n;console.assert(void 0!==Tl[r]);const[a,s]=Tl[r];return Al[n]&&!Al[n].test(e.value)?(e.value=O(e.value,n,i),null):(Ml.test(e.value)&&(e.classes+=" lcGreek"),s&&(e.classes+=" "+s),a)}};var Ol={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"};new class extends ts{constructor(){super("text")}createAtom(e,t,n){return t&&"symbol"===t.definitionType?new Ps(e,String.fromCodePoint(t.codepoint),null!=n?n:{}):null}serialize(e,t){return Pl(e,d(u({},t),{defaultMode:"text"}),"text"!==t.defaultMode)}getFont(e,t){var n,i,r,a,s;const{fontFamily:o}=t;if(Ol[o]?e.classes+=" "+Ol[o]:o&&e.setStyle("font-family",o),t.fontShape&&(e.classes+=" ",e.classes+=null!=(n={it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape])?n:""),t.fontSeries){const n=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);n&&(e.classes+=" ",e.classes+=null!=(r={ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[null!=(i=n[1])?i:""])?r:"",e.classes+=" ",e.classes+=null!=(s={uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[null!=(a=n[2])?a:""])?s:"")}return"Main-Regular"}};new class extends ts{constructor(){super("latex")}createAtom(e){return new ul(e)}serialize(e,t){return e.filter((e=>e instanceof ul&&!e.isSuggestion)).map((e=>e.value))}getFont(){return null}};var Nl={id:"apple.en-intl",displayName:"English (international)",virtualLayout:"qwerty",platform:"apple",locale:"en",score:0,mapping:{KeyA:["a","A","å","Å"],KeyB:["b","B","∫","ı"],KeyC:["c","C","ç","Ç"],KeyD:["d","D","∂","Î"],KeyE:["e","E","´","´"],KeyF:["f","F","ƒ","Ï"],KeyG:["g","G","©","˝"],KeyH:["h","H","˙","Ó"],KeyI:["i","I","ˆ","ˆ"],KeyJ:["j","J","∆","Ô"],KeyK:["k","K","˚",""],KeyL:["l","L","¬","Ò"],KeyM:["m","M","µ","Â"],KeyN:["n","N","˜","˜"],KeyO:["o","O","ø","Ø"],KeyP:["p","P","π","∏"],KeyQ:["q","Q","œ","Œ"],KeyR:["r","R","®","‰"],KeyS:["s","S","ß","Í"],KeyT:["t","T","†","ˇ"],KeyU:["u","U","¨","¨"],KeyV:["v","V","√","◊"],KeyW:["w","W","∑","„"],KeyX:["x","X","≈","˛"],KeyY:["y","Y","¥","Á"],KeyZ:["z","Z","Ω","¸"],Digit1:["1","!","¡","⁄"],Digit2:["2","@","™","€"],Digit3:["3","#","£","‹"],Digit4:["4","$","¢","›"],Digit5:["5","%","∞","fi"],Digit6:["6","^","§","fl"],Digit7:["7","&","¶","‡"],Digit8:["8","*","•","°"],Digit9:["9","(","ª","·"],Digit0:["0",")","º","‚"],Space:[" "," "," "," "],Minus:["-","_","–","—"],Equal:["=","+","≠","±"],BracketLeft:["[","{","“","”"],BracketRight:["]","}","‘","’"],Backslash:["\\","|","«","»"],Semicolon:[";",":","…","Ú"],Quote:["'",'"',"æ","Æ"],Backquote:["`","˜","`","`"],Comma:[",","<","≤","¯"],Period:[".",">","≥","˘"],Slash:["/","?","÷","¿"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["§","±","§","±"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},Bl={id:"windows.en-intl",displayName:"English (international)",platform:"windows",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","á","Á"],KeyB:["b","B","",""],KeyC:["c","C","©","¢"],KeyD:["d","D","ð","Ð"],KeyE:["e","E","é","É"],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","í","Í"],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","ø","Ø"],KeyM:["m","M","µ",""],KeyN:["n","N","ñ","Ñ"],KeyO:["o","O","ó","Ó"],KeyP:["p","P","ö","Ö"],KeyQ:["q","Q","ä","Ä"],KeyR:["r","R","®",""],KeyS:["s","S","ß","§"],KeyT:["t","T","þ","Þ"],KeyU:["u","U","ú","Ú"],KeyV:["v","V","",""],KeyW:["w","W","å","Å"],KeyX:["x","X","",""],KeyY:["y","Y","ü","Ü"],KeyZ:["z","Z","æ","Æ"],Digit1:["1","!","¡","¹"],Digit2:["2","@","²",""],Digit3:["3","#","³",""],Digit4:["4","$","¤","£"],Digit5:["5","%","€",""],Digit6:["6","^","¼",""],Digit7:["7","&","½",""],Digit8:["8","*","¾",""],Digit9:["9","(","‘",""],Digit0:["0",")","’",""],Space:[" "," ","",""],Minus:["-","_","¥",""],Equal:["=","+","×","÷"],BracketLeft:["[","{","«",""],BracketRight:["]","}","»",""],Backslash:["\\","|","¬","¦"],Semicolon:[";",":","¶","°"],Quote:["'",'"',"´","¨"],Backquote:["`","~","",""],Comma:[",","<","ç","Ç"],Period:[".",">","",""],Slash:["/","?","¿",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["\\","|","",""]}},$l={id:"linux.en",displayName:"English",platform:"linux",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","a","A"],KeyB:["b","B","b","B"],KeyC:["c","C","c","C"],KeyD:["d","D","d","D"],KeyE:["e","E","e","E"],KeyF:["f","F","f","F"],KeyG:["g","G","g","G"],KeyH:["h","H","h","H"],KeyI:["i","I","i","I"],KeyJ:["j","J","j","J"],KeyK:["k","K","k","K"],KeyL:["l","L","l","L"],KeyM:["m","M","m","M"],KeyN:["n","N","n","N"],KeyO:["o","O","o","O"],KeyP:["p","P","p","P"],KeyQ:["q","Q","q","Q"],KeyR:["r","R","r","R"],KeyS:["s","S","s","S"],KeyT:["t","T","t","T"],KeyU:["u","U","u","U"],KeyV:["v","V","v","V"],KeyW:["w","W","w","W"],KeyX:["x","X","x","X"],KeyY:["y","Y","y","Y"],KeyZ:["z","Z","z","Z"],Digit1:["1","!","1","!"],Digit2:["2","@","2","@"],Digit3:["3","#","3","#"],Digit4:["4","$","4","$"],Digit5:["5","%","5","%"],Digit6:["6","^","6","^"],Digit7:["7","&","7","&"],Digit8:["8","*","8","*"],Digit9:["9","(","9","("],Digit0:["0",")","0",")"],Space:[" "," "," "," "],Minus:["-","_","-","_"],Equal:["=","+","=","+"],BracketLeft:["[","{","[","{"],BracketRight:["]","}","]","}"],Backslash:["\\","|","\\","|"],Semicolon:[";",":",";",":"],Quote:["'",'"',"'",'"'],Backquote:["`","~","`","~"],Comma:[",","<",",","<"],Period:[".",">",".",">"],Slash:["/","?","/","?"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","¦"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}};function Fl(e){const t=e.split("+"),n={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:t.pop()};return t.includes("shift")&&(n.shift=!0),t.includes("alt")&&(n.alt=!0),t.includes("ctrl")&&(n.ctrl=!0),t.includes("cmd")&&(n.cmd=!0),t.includes("win")&&(n.win=!0),t.includes("meta")&&(n.meta=!0),n}function zl(e){let t="";return e.shift&&(t+="shift+"),e.alt&&(t+="alt+"),e.ctrl&&(t+="ctrl+"),e.cmd&&(t+="cmd+"),e.win&&(t+="win+"),e.meta&&(t+="meta+"),t+e.key}var Kl,Ul={enter:"[Enter]",escape:"[Escape]",backspace:"[Backspace]",tab:"[Tab]",space:"[Space]",pausebreak:"[Pause]",insert:"[Insert]",home:"[Home]",pageup:"[PageUp]",delete:"[Delete]",end:"[End]",pagedown:"[PageDown]",right:"[ArrowRight]",left:"[ArrowLeft]",down:"[ArrowDown]",up:"[ArrowUp]",numpad0:"[Numpad0]",numpad1:"[Numpad1]",numpad2:"[Numpad2]",numpad3:"[Numpad3]",numpad4:"[Numpad4]",numpad5:"[Numpad5]",numpad6:"[Numpad6]",numpad7:"[Numpad7]",numpad8:"[Numpad8]",numpad9:"[Numpad9]",numpad_divide:"[NumpadDivide]",numpad_multiply:"[NumpadMultiply]",numpad_subtract:"[NumpadSubtract]",numpad_add:"[NumpadAdd]",numpad_decimal:"[NumpadDecimal]",numpad_separator:"[NumpadComma]",capslock:"[Capslock]",f1:"[F1]",f2:"[F2]",f3:"[F3]",f4:"[F4]",f5:"[F5]",f6:"[F6]",f7:"[F7]",f8:"[F8]",f9:"[F9]",f10:"[F10]",f11:"[F11]",f12:"[F12]",f13:"[F13]",f14:"[F14]",f15:"[F15]",f16:"[F16]",f17:"[F17]",f18:"[F18]",f19:"[F19]"},jl=[];function ql(){switch(v()){case"macos":case"ios":return"apple";case"windows":return"windows"}return"linux"}function Hl(e){e.platform&&e.platform!==ql()||jl.push(e)}function Vl(){return null!=Kl?Kl:jl[0]}switch(ql()){case"apple":Hl(Nl),Hl({id:"apple.french",locale:"fr",displayName:"French",platform:"apple",virtualLayout:"azerty",score:0,mapping:{KeyA:["q","Q","‡","Ω"],KeyB:["b","B","ß","∫"],KeyC:["c","C","©","¢"],KeyD:["d","D","∂","∆"],KeyE:["e","E","ê","Ê"],KeyF:["f","F","ƒ","·"],KeyG:["g","G","fi","fl"],KeyH:["h","H","Ì","Î"],KeyI:["i","I","î","ï"],KeyJ:["j","J","Ï","Í"],KeyK:["k","K","È","Ë"],KeyL:["l","L","¬","|"],KeyM:[",","?","∞","¿"],KeyN:["n","N","~","ı"],KeyO:["o","O","œ","Œ"],KeyP:["p","P","π","∏"],KeyQ:["a","A","æ","Æ"],KeyR:["r","R","®","‚"],KeyS:["s","S","Ò","∑"],KeyT:["t","T","†","™"],KeyU:["u","U","º","ª"],KeyV:["v","V","◊","√"],KeyW:["z","Z","Â","Å"],KeyX:["x","X","≈","⁄"],KeyY:["y","Y","Ú","Ÿ"],KeyZ:["w","W","‹","›"],Digit1:["&","1","","´"],Digit2:["é","2","ë","„"],Digit3:['"',"3","“","”"],Digit4:["'","4","‘","’"],Digit5:["(","5","{","["],Digit6:["§","6","¶","å"],Digit7:["è","7","«","»"],Digit8:["!","8","¡","Û"],Digit9:["ç","9","Ç","Á"],Digit0:["à","0","ø","Ø"],Space:[" "," "," "," "],Minus:[")","°","}","]"],Equal:["-","_","—","–"],BracketLeft:["^","¨","ô","Ô"],BracketRight:["$","*","€","¥"],Backslash:["`","£","@","#"],Semicolon:["m","M","µ","Ó"],Quote:["ù","%","Ù","‰"],Backquote:["<",">","≤","≥"],Comma:[";",".","…","•"],Period:[":","/","÷","\\"],Slash:["=","+","≠","±"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",".",",","."],IntlBackslash:["@","#","•","Ÿ"],NumpadEqual:["=","=","=","="]}}),Hl({id:"apple.spanish",locale:"es",displayName:"Spanish ISO",platform:"apple",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","å","Å"],KeyB:["b","B","ß",""],KeyC:["c","C","©"," "],KeyD:["d","D","∂","∆"],KeyE:["e","E","€","€"],KeyF:["f","F","ƒ","fi"],KeyG:["g","G","","fl"],KeyH:["h","H","™"," "],KeyI:["i","I"," "," "],KeyJ:["j","J","¶","¯"],KeyK:["k","K","§","ˇ"],KeyL:["l","L"," ","˘"],KeyM:["m","M","µ","˚"],KeyN:["n","N"," ","˙"],KeyO:["o","O","ø","Ø"],KeyP:["p","P","π","∏"],KeyQ:["q","Q","œ","Œ"],KeyR:["r","R","®"," "],KeyS:["s","S","∫"," "],KeyT:["t","T","†","‡"],KeyU:["u","U"," "," "],KeyV:["v","V","√","◊"],KeyW:["w","W","æ","Æ"],KeyX:["x","X","∑","›"],KeyY:["y","Y","¥"," "],KeyZ:["z","Z","Ω","‹"],Digit1:["1","!","|","ı"],Digit2:["2",'"',"@","˝"],Digit3:["3","·","#","•"],Digit4:["4","$","¢","£"],Digit5:["5","%","∞","‰"],Digit6:["6","&","¬"," "],Digit7:["7","/","÷","⁄"],Digit8:["8","(","“","‘"],Digit9:["9",")","”","’"],Digit0:["0","=","≠","≈"],Space:[" "," "," "," "],Minus:["'","?","´","¸"],Equal:["¡","¿","‚","˛"],BracketLeft:["`","^","[","ˆ"],BracketRight:["+","*","]","±"],Backslash:["ç","Ç","}","»"],Semicolon:["ñ","Ñ","~","˜"],Quote:["´","¨","{","«"],Backquote:["<",">","≤","≥"],Comma:[",",";","„",""],Period:[".",":","…","…"],Slash:["-","_","–","—"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[",",",",",",","],IntlBackslash:["º","ª","\\","°"]}}),Hl({id:"apple.german",locale:"de",displayName:"German",virtualLayout:"qwertz",platform:"apple",score:0,mapping:{KeyA:["a","A","å","Å"],KeyB:["b","B","∫","‹"],KeyC:["c","C","ç","Ç"],KeyD:["d","D","∂","™"],KeyE:["e","E","€","‰"],KeyF:["f","F","ƒ","Ï"],KeyG:["g","G","©","Ì"],KeyH:["h","H","ª","Ó"],KeyI:["i","I","⁄","Û"],KeyJ:["j","J","º","ı"],KeyK:["k","K","∆","ˆ"],KeyL:["l","L","@","fl"],KeyM:["m","M","µ","˘"],KeyN:["n","N","~","›"],KeyO:["o","O","ø","Ø"],KeyP:["p","P","π","∏"],KeyQ:["q","Q","«","»"],KeyR:["r","R","®","¸"],KeyS:["s","S","‚","Í"],KeyT:["t","T","†","˝"],KeyU:["u","U","¨","Á"],KeyV:["v","V","√","◊"],KeyW:["w","W","∑","„"],KeyX:["x","X","≈","Ù"],KeyY:["z","Z","Ω","ˇ"],KeyZ:["y","Y","¥","‡"],Digit1:["1","!","¡","¬"],Digit2:["2",'"',"“","”"],Digit3:["3","§","¶","#"],Digit4:["4","$","¢","£"],Digit5:["5","%","[","fi"],Digit6:["6","&","]","^"],Digit7:["7","/","|","\\"],Digit8:["8","(","{","˜"],Digit9:["9",")","}","·"],Digit0:["0","=","≠","¯"],Space:[" "," "," "," "],Minus:["ß","?","¿","˙"],Equal:["´","`","'","˚"],BracketLeft:["ü","Ü","•","°"],BracketRight:["+","*","±",""],Backslash:["#","'","‘","’"],Semicolon:["ö","Ö","œ","Œ"],Quote:["ä","Ä","æ","Æ"],Backquote:["<",">","≤","≥"],Comma:[",",";","∞","˛"],Period:[".",":","…","÷"],Slash:["-","_","–","—"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",",",".","."],IntlBackslash:["^","°","„","“"],NumpadEqual:["=","=","=","="]}});break;case"windows":Hl(Bl),Hl({id:"windows.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"windows",score:0,mapping:{KeyA:["q","Q","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","€",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:[",","?","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["a","A","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["z","Z","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["w","W","",""],Digit1:["&","1","",""],Digit2:["é","2","~",""],Digit3:['"',"3","#",""],Digit4:["'","4","{",""],Digit5:["(","5","[",""],Digit6:["-","6","|",""],Digit7:["è","7","`",""],Digit8:["_","8","\\",""],Digit9:["ç","9","^",""],Digit0:["à","0","@",""],Space:[" "," ","",""],Minus:[")","°","]",""],Equal:["=","+","}",""],BracketLeft:["^","¨","",""],BracketRight:["$","£","¤",""],Backslash:["*","µ","",""],Semicolon:["m","M","",""],Quote:["ù","%","",""],Backquote:["²","","",""],Comma:[";",".","",""],Period:[":","/","",""],Slash:["!","§","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}}),Hl({id:"windows.spanish",locale:"es",displayName:"Spanish",platform:"windows",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","€",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["z","Z","",""],Digit1:["1","!","|",""],Digit2:["2",'"',"@",""],Digit3:["3","·","#",""],Digit4:["4","$","~",""],Digit5:["5","%","€",""],Digit6:["6","&","¬",""],Digit7:["7","/","",""],Digit8:["8","(","",""],Digit9:["9",")","",""],Digit0:["0","=","",""],Space:[" "," ","",""],Minus:["'","?","",""],Equal:["¡","¿","",""],BracketLeft:["`","^","[",""],BracketRight:["+","*","]",""],Backslash:["ç","Ç","}",""],Semicolon:["ñ","Ñ","",""],Quote:["´","¨","{",""],Backquote:["º","ª","\\",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}}),Hl({id:"windows.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","€",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","µ",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","@",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["z","Z","",""],KeyZ:["y","Y","",""],Digit1:["1","!","",""],Digit2:["2",'"',"²",""],Digit3:["3","§","³",""],Digit4:["4","$","",""],Digit5:["5","%","",""],Digit6:["6","&","",""],Digit7:["7","/","{",""],Digit8:["8","(","[",""],Digit9:["9",")","]",""],Digit0:["0","=","}",""],Space:[" "," ","",""],Minus:["ß","?","\\","ẞ"],Equal:["´","`","",""],BracketLeft:["ü","Ü","",""],BracketRight:["+","*","~",""],Backslash:["#","'","",""],Semicolon:["ö","Ö","",""],Quote:["ä","Ä","",""],Backquote:["^","°","",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","|",""]}});break;case"linux":Hl($l),Hl({id:"linux.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"linux",score:0,mapping:{KeyA:["q","Q","@","Ω"],KeyB:["b","B","”","’"],KeyC:["c","C","¢","©"],KeyD:["d","D","ð","Ð"],KeyE:["e","E","€","¢"],KeyF:["f","F","đ","ª"],KeyG:["g","G","ŋ","Ŋ"],KeyH:["h","H","ħ","Ħ"],KeyI:["i","I","→","ı"],KeyJ:["j","J","̉","̛"],KeyK:["k","K","ĸ","&"],KeyL:["l","L","ł","Ł"],KeyM:[",","?","́","̋"],KeyN:["n","N","n","N"],KeyO:["o","O","ø","Ø"],KeyP:["p","P","þ","Þ"],KeyQ:["a","A","æ","Æ"],KeyR:["r","R","¶","®"],KeyS:["s","S","ß","§"],KeyT:["t","T","ŧ","Ŧ"],KeyU:["u","U","↓","↑"],KeyV:["v","V","“","‘"],KeyW:["z","Z","«","<"],KeyX:["x","X","»",">"],KeyY:["y","Y","←","¥"],KeyZ:["w","W","ł","Ł"],Digit1:["&","1","¹","¡"],Digit2:["é","2","~","⅛"],Digit3:['"',"3","#","£"],Digit4:["'","4","{","$"],Digit5:["(","5","[","⅜"],Digit6:["-","6","|","⅝"],Digit7:["è","7","`","⅞"],Digit8:["_","8","\\","™"],Digit9:["ç","9","^","±"],Digit0:["à","0","@","°"],Enter:["\r","\r","\r","\r"],Escape:["","","",""],Backspace:["\b","\b","\b","\b"],Tab:["\t","","\t",""],Space:[" "," "," "," "],Minus:[")","°","]","¿"],Equal:["=","+","}","̨"],BracketLeft:["̂","̈","̈","̊"],BracketRight:["$","£","¤","̄"],Backslash:["*","µ","̀","̆"],Semicolon:["m","M","µ","º"],Quote:["ù","%","̂","̌"],Backquote:["²","~","¬","¬"],Comma:[";",".","─","×"],Period:[":","/","·","÷"],Slash:["!","§","̣","̇"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","¦"]}}),Hl({id:"linux.spanish",locale:"es",displayName:"Spanish",platform:"linux",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","æ","Æ"],KeyB:["b","B","”","’"],KeyC:["c","C","¢","©"],KeyD:["d","D","ð","Ð"],KeyE:["e","E","€","¢"],KeyF:["f","F","đ","ª"],KeyG:["g","G","ŋ","Ŋ"],KeyH:["h","H","ħ","Ħ"],KeyI:["i","I","→","ı"],KeyJ:["j","J","̉","̛"],KeyK:["k","K","ĸ","&"],KeyL:["l","L","ł","Ł"],KeyM:["m","M","µ","º"],KeyN:["n","N","n","N"],KeyO:["o","O","ø","Ø"],KeyP:["p","P","þ","Þ"],KeyQ:["q","Q","@","Ω"],KeyR:["r","R","¶","®"],KeyS:["s","S","ß","§"],KeyT:["t","T","ŧ","Ŧ"],KeyU:["u","U","↓","↑"],KeyV:["v","V","“","‘"],KeyW:["w","W","ł","Ł"],KeyX:["x","X","»",">"],KeyY:["y","Y","←","¥"],KeyZ:["z","Z","«","<"],Digit1:["1","!","|","¡"],Digit2:["2",'"',"@","⅛"],Digit3:["3","·","#","£"],Digit4:["4","$","~","$"],Digit5:["5","%","½","⅜"],Digit6:["6","&","¬","⅝"],Digit7:["7","/","{","⅞"],Digit8:["8","(","[","™"],Digit9:["9",")","]","±"],Digit0:["0","=","}","°"],Enter:["\r","\r","\r","\r"],Escape:["","","",""],Backspace:["\b","\b","\b","\b"],Tab:["\t","","\t",""],Space:[" "," "," "," "],Minus:["'","?","\\","¿"],Equal:["¡","¿","̃","~"],BracketLeft:["̀","̂","[","̊"],BracketRight:["+","*","]","̄"],Backslash:["ç","Ç","}","̆"],Semicolon:["ñ","Ñ","~","̋"],Quote:["́","̈","{","{"],Backquote:["º","ª","\\","\\"],Comma:[",",";","─","×"],Period:[".",":","·","÷"],Slash:["-","_","̣","̇"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadEnter:["\r","\r","\r","\r"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","¦"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}}),Hl({id:"linux.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","æ","Æ"],KeyB:["b","B","“","‘"],KeyC:["c","C","¢","©"],KeyD:["d","D","ð","Ð"],KeyE:["e","E","€","€"],KeyF:["f","F","đ","ª"],KeyG:["g","G","ŋ","Ŋ"],KeyH:["h","H","ħ","Ħ"],KeyI:["i","I","→","ı"],KeyJ:["j","J","̣","̇"],KeyK:["k","K","ĸ","&"],KeyL:["l","L","ł","Ł"],KeyM:["m","M","µ","º"],KeyN:["n","N","”","’"],KeyO:["o","O","ø","Ø"],KeyP:["p","P","þ","Þ"],KeyQ:["q","Q","@","Ω"],KeyR:["r","R","¶","®"],KeyS:["s","S","ſ","ẞ"],KeyT:["t","T","ŧ","Ŧ"],KeyU:["u","U","↓","↑"],KeyV:["v","V","„","‚"],KeyW:["w","W","ł","Ł"],KeyX:["x","X","«","‹"],KeyY:["z","Z","←","¥"],KeyZ:["y","Y","»","›"],Digit1:["1","!","¹","¡"],Digit2:["2",'"',"²","⅛"],Digit3:["3","§","³","£"],Digit4:["4","$","¼","¤"],Digit5:["5","%","½","⅜"],Digit6:["6","&","¬","⅝"],Digit7:["7","/","{","⅞"],Digit8:["8","(","[","™"],Digit9:["9",")","]","±"],Digit0:["0","=","}","°"],Enter:["\r","\r","\r","\r"],Escape:["","","",""],Backspace:["\b","\b","\b","\b"],Tab:["\t","","\t",""],Space:[" "," "," "," "],Minus:["ß","?","\\","¿"],Equal:["́","̀","̧","̨"],BracketLeft:["ü","Ü","̈","̊"],BracketRight:["+","*","~","¯"],Backslash:["#","'","’","̆"],Semicolon:["ö","Ö","̋","̣"],Quote:["ä","Ä","̂","̌"],Backquote:["̂","°","′","″"],Comma:[",",";","·","×"],Period:[".",":","…","÷"],Slash:["-","_","–","—"],PrintScreen:["","","",""],PageUp:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",",","",","],IntlBackslash:["<",">","|","̱"],AltRight:["\r","\r","\r","\r"],MetaRight:[".",".",".","."]}})}function Gl(e){var t;const n=/macos|ios/.test(v()),i=e.split("+");let r="";for(const e of i)r&&(r+=n?" ":'<span class="ML__shortcut-join">+</span>'),e.startsWith("[Key")?r+=e.slice(4,5):e.startsWith("Key")?r+=e.slice(3,4):e.startsWith("[Digit")?r+=e.slice(6,7):e.startsWith("Digit")?r+=e.slice(5,6):r+=null!=(t={cmd:"⌘",meta:n?"⌘":"Ctrl",shift:n?"⇧":"Shift",alt:n?"⌥":"Alt",ctrl:n?"⌃":"Ctrl","\n":n?"⏎":"Return","[return]":n?"⏎":"Return","[enter]":n?"⌤":"Enter","[tab]":n?"⇥":"Tab","[escape]":"Esc","[backspace]":n?"⌫":"Backspace","[delete]":n?"⌦":"Del","[pageup]":n?"⇞":"Page Up","[pagedown]":n?"⇟":"Page Down","[home]":n?"⤒":"Home","[end]":n?"⤓":"End","[space]":"Space","[equal]":"=","[minus]":"-","[comma]":",","[slash]":"/","[backslash]":"\\","[bracketleft]":"[","[bracketright]":"]",semicolon:";",period:".",comma:",",minus:"-",equal:"=",quote:"'",backslash:"\\",intlbackslash:"\\",backquote:"`",slash:"/",numpadmultiply:"* 🔢",numpaddivide:"/ 🔢",numpadsubtract:"- 🔢",numpadadd:"+ 🔢",numpaddecimal:". 🔢",numpadcomma:", 🔢",help:"help",left:"⇠",up:"⇡",right:"⇢",down:"⇣","[arrowleft]":"⇠","[arrowup]":"⇡","[arrowright]":"⇢","[arrowdown]":"⇣"}[e.toLowerCase()])?t:e.toUpperCase();return r}function Zl(e){if(e instanceof MouseEvent||e instanceof PointerEvent)return{x:e.clientX,y:e.clientY};if(e instanceof TouchEvent){const t=[...e.touches].reduce(((e,t)=>({x:e.x+t.clientX,y:e.y+t.clientY})),{x:0,y:0}),n=e.touches.length;return{x:t.x/n,y:t.y/n}}}function Wl(e){const t={alt:!1,control:!1,shift:!1,meta:!1};return(e instanceof MouseEvent||e instanceof PointerEvent||e instanceof TouchEvent||e instanceof KeyboardEvent)&&(e.altKey&&(t.alt=!0),e.ctrlKey&&(t.control=!0),e.metaKey&&(t.meta=!0),e.shiftKey&&(t.shift=!0)),t}Hl({id:"dvorak",locale:"en",displayName:"Dvorak",virtualLayout:"dvorak",platform:"",score:0,mapping:{KeyA:["a","A","å","Å"],KeyB:["x","X","≈","˛"],KeyC:["j","J","∆","Ô"],KeyD:["e","E","´","´"],KeyE:[".",">","≥","˘"],KeyF:["u","U","¨","¨"],KeyG:["i","I","ˆ","ˆ"],KeyH:["d","D","∂","Î"],KeyI:["c","C","ç","Ç"],KeyJ:["h","H","˙","Ó"],KeyK:["t","T","†","ˇ"],KeyL:["n","N","˜","˜"],KeyM:["m","M","µ","Â"],KeyN:["b","B","∫","ı"],KeyO:["r","R","®","‰"],KeyP:["l","L","¬","Ò"],KeyQ:["'",'"',"æ","Æ"],KeyR:["p","P","π","∏"],KeyS:["o","O","ø","Ø"],KeyT:["y","Y","¥","Á"],KeyU:["g","G","©","˝"],KeyV:["k","K","˚",""],KeyW:[",","<","≤","¯"],KeyX:["q","Q","œ","Œ"],KeyY:["f","F","ƒ","Ï"],KeyZ:[";",":","…","Ú"],Digit1:["1","!","¡","⁄"],Digit2:["2","@","™","€"],Digit3:["3","#","£","‹"],Digit4:["4","$","¢","›"],Digit5:["5","%","∞","fi"],Digit6:["6","^","§","fl"],Digit7:["7","&","¶","‡"],Digit8:["8","*","•","°"],Digit9:["9","(","ª","·"],Digit0:["0",")","º","‚"],Space:[" "," "," "," "],Minus:["[","{","“","”"],Equal:["]","}","‘","’"],BracketLeft:["/","?","÷","¿"],BracketRight:["=","+","≠","±"],Backslash:["\\","|","«","»"],Semicolon:["s","S","ß","Í"],Quote:["-","_","–","—"],Backquote:["`","~","`","`"],Comma:["w","W","∑","„"],Period:["v","V","√","◊"],Slash:["z","Z","Ω","¸"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["§","±","§","±"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}});var Yl=new Set(["Backquote","Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","Minus","Equal","IntlYen","KeyQ","KeyW","KeyE","KeyR","KeyT","KeyY","KeyU","KeyI","KeyO","KeyP","BracketLeft","BracketRight","Backslash","KeyA","KeyS","KeyD","KeyF","KeyG","KeyH","KeyJ","KeyK","KeyL","Semicolon","Quote","IntlBackslash","KeyZ","KeyX","KeyC","KeyV","KeyB","KeyN","KeyM","Comma","Period","Slash","IntlRo","Space","Numpad0","Numpad1","Numpad2","Numpad3","Numpad4","Numpad5","Numpad6","Numpad7","Numpad8","Numpad9","NumpadAdd","NumpadComma","NumpadDecimal","NumpadDivide","NumpadEqual","NumpadHash","NumpadMultiply","NumpadParenLeft","NumpadParenRight","NumpadStar","NumpadSubstract"]);function Xl(e){return!e.ctrlKey&&!e.metaKey&&(!["Dead","Process"].includes(e.key)&&(""===e.code||Yl.has(e.code)))}function Jl(){var e;let t=document.activeElement;for(;null==(e=null==t?void 0:t.shadowRoot)?void 0:e.activeElement;)t=t.shadowRoot.activeElement;return t}var Ql=class e{static get scrim(){return e._scrim||(e._scrim=new e),e._scrim}static open(t){e.scrim.open(t)}static close(){e.scrim.close()}static get state(){return e.scrim.state}static get element(){return e.scrim.element}constructor(e){var t,n;this.lightDismiss=null==(t=null==e?void 0:e.lightDismiss)||t,this.translucent=null!=(n=null==e?void 0:e.translucent)&&n,this.state="closed"}get element(){if(this._element)return this._element;const e=document.createElement("div");return e.setAttribute("role","presentation"),e.style.position="fixed",e.style.contain="content",e.style.top="0",e.style.left="0",e.style.right="0",e.style.bottom="0",e.style.zIndex="var(--scrim-zindex, 10099)",e.style.outline="none",this.translucent?(e.style.background="rgba(255, 255, 255, .2)",e.style.backdropFilter="contrast(40%)"):e.style.background="transparent",this._element=e,e}open(e){var t;if("closed"!==this.state)return;this.state="opening",this.onDismiss=null==e?void 0:e.onDismiss,this.savedActiveElement=Jl();const{element:n}=this;(null!=(t=null==e?void 0:e.root)?t:document.body).appendChild(n),n.addEventListener("click",this),document.addEventListener("touchmove",this,!1),document.addEventListener("scroll",this,!1);const i=window.innerWidth-document.documentElement.clientWidth;this.savedMarginRight=document.body.style.marginRight,this.savedOverflow=document.body.style.overflow,document.body.style.overflow="hidden";const r=Number.parseFloat(getComputedStyle(document.body).marginRight);document.body.style.marginRight=`${r+i}px`,(null==e?void 0:e.child)&&n.append(e.child),this.state="open"}close(){var e,t,n,i;if("open"!==this.state)return void console.assert(null!==this.element.parentElement);this.state="closing","function"==typeof this.onDismiss&&this.onDismiss(),this.onDismiss=void 0;const{element:r}=this;r.removeEventListener("click",this),document.removeEventListener("touchmove",this,!1),document.removeEventListener("scroll",this,!1),r.remove(),document.body.style.overflow=null!=(e=this.savedOverflow)?e:"",document.body.style.marginRight=null!=(t=this.savedMarginRight)?t:"",Jl()!==this.savedActiveElement&&(null==(i=null==(n=this.savedActiveElement)?void 0:n.focus)||i.call(n)),r.innerHTML="",this.state="closed"}handleEvent(e){this.lightDismiss&&(e.target===this._element&&"click"===e.type?(this.close(),e.preventDefault(),e.stopPropagation()):e.target!==document||"touchmove"!==e.type&&"scroll"!==e.type||(this.close(),e.preventDefault(),e.stopPropagation()))}};function ec(e){var t;if(!e||!Xl(e))return"";let n;return"Unidentified"===e.key&&e.target&&(n=e.target.value),n=null!=(t=null!=n?n:e.key)?t:e.code,/^(Dead|Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(n)&&(n=""),n}function tc(e){const t=[];return(e=function(e){if(e.code)return e;const t=Object.entries(Vl().mapping);let n=!1,i=!1,r="";for(let a=0;a<4;a++){for(const[s,o]of t)if(o[a]===e.key){r=s,3===a?(n=!0,i=!0):2===a?n=!0:1===a&&(i=!0);break}if(r)break}return new KeyboardEvent(e.type,d(u({},e),{altKey:n,shiftKey:i,code:r}))}(e)).ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),e.altKey&&t.push("alt"),e.shiftKey&&t.push("shift"),0===t.length?`[${e.code}]`:(t.push(`[${e.code}]`),t.join("+"))}function nc(e){let t=e;return f(t)&&(t=t.length>0?t[0]+"("+t.slice(1).join("")+")":""),t}function ic(e,t){let n=[];if("string"==typeof t){const e=Js[t];f(e)?n=e.slice():e&&n.push(e)}const i=nc(t),r=new RegExp("^"+i.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");for(const t of e)r.test(nc(t.command))&&n.push(t.key);return n.map(Gl)}function rc(e,t){if(e.ifPlatform&&!/^!?(macos|windows|android|ios|chromeos|other)$/.test(e.ifPlatform))throw new Error(`Unexpected platform "${e.ifPlatform}" for keybinding ${e.key}`);if(void 0!==e.ifLayout&&(0===t.score||!e.ifLayout.includes(t.id)))return;const n=Fl(e.key);let i=e.ifPlatform;if(n.cmd){if(i&&"macos"!==i&&"ios"!==i)throw new Error('Unexpected "cmd" modifier with platform "'+i+'"\n"cmd" modifier can only be used with macOS or iOS platform.');i||(i="ios"===v()?"ios":"macos"),n.win=!1,n.cmd=!1,n.meta=!0}if(n.win){if(i&&"windows"!==i)throw new Error('Unexpected "win" modifier with platform "'+i+'"\n"win" modifier can only be used with Windows platform.');i="windows",n.win=!1,n.cmd=!1,n.meta=!0}if(i&&!function(e){if(m()){const t=v(),n=e.startsWith("!"),i=e.endsWith(t);if(n&&!i)return!0;if(!n&&i)return!0}return"!other"!==e&&"other"===e}(i))return;if(/^\[.+\]$/.test(n.key))return d(u({},e),{key:zl(n)});const r=function(e,t){var n;const i={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:""};if(!e)return i;for(const[n,r]of Object.entries(t.mapping)){if(r[0]===e)return i.key=`[${n}]`,i;if(r[1]===e)return i.shift=!0,i.key=`[${n}]`,i;if(r[2]===e)return i.alt=!0,i.key=`[${n}]`,i;if(r[3]===e)return i.shift=!0,i.alt=!0,i.key=`[${n}]`,i}return i.key=null!=(n=Ul[e])?n:"",i}(n.key,t);if(!r)return d(u({},e),{key:zl(n)});if(r.shift&&n.shift||r.alt&&n.alt)throw new Error(`The keybinding ${e.key} (${ac(e.command)}) is conflicting with the key combination ${zl(r)} using the ${t.displayName} keyboard layout`);return r.shift=r.shift||n.shift,r.alt=r.alt||n.alt,r.meta=n.meta,r.ctrl=n.ctrl,d(u({},e),{key:zl(r)})}function ac(e){if(Array.isArray(e)){const t=[...e];return t.shift()+"("+t.map((e=>"string"==typeof e?`"${e}"`:e.toString())).join(", ")+")"}return e}function sc(e){var t,n;const i=e.atoms.find((e=>"latexgroup"===e.type));return i&&null!=(n=null==(t=i.body)?void 0:t.filter((e=>"latex"===e.type)))?n:[]}function oc(e,t){var n;let i=0,r=!1;const a=Number.isFinite(null==t?void 0:t.before)?null!=(n=null==t?void 0:t.before)?n:0:e.lastOffset;for(;i<=a&&!r;){const t=e.at(i);r=t instanceof ul&&t.isSuggestion,r||i++}if(!r)return[void 0,void 0];let s=i,o=!1;for(;s<=a&&!o;){const t=e.at(s);o=!(t instanceof ul&&t.isSuggestion),o||s++}return[i-1,s-1]}function lc(e){const t=sc(e.model).filter((e=>e.isSuggestion));if(0!==t.length){e.model.position=e.model.offsetOf(t[0].leftSibling);for(const e of t)e.parent.removeChild(e)}}function cc(e,t){var n;const{model:i}=e;lc(e);for(const e of sc(i))e.isError=!1;if(!i.selectionIsCollapsed||"off"===e.options.popoverPolicy)return void vc(e);const r=[];let a=i.at(i.position);for(;a&&a instanceof ul&&/^[a-zA-Z\*]$/.test(a.value);)a=a.leftSibling;if(a&&a instanceof ul&&"\\"===a.value)for(r.push(a),a=a.rightSibling;a&&a instanceof ul&&/^[a-zA-Z\*]$/.test(a.value);)r.push(a),a=a.rightSibling;const s=r.map((e=>e.value)).join(""),o=function(e,t){var n,i;if(0===t.length||"\\"===t||!t.startsWith("\\"))return[];const r=[];for(const e in j)e.startsWith(t)&&!j[e].infix&&r.push({match:e,frequency:null!=(n=j[e].frequency)?n:0});for(const e in K)e.startsWith(t)&&r.push({match:e,frequency:null!=(i=K[e].frequency)?i:0});const a=t.substring(1);for(const t of Object.keys(e.options.macros))t.startsWith(a)&&r.push({match:"\\"+t,frequency:0});return r.sort(((e,t)=>{var n,i;return e.frequency===t.frequency?e.match.length===t.match.length?e.match<t.match?-1:1:e.match.length-t.match.length:(null!=(n=t.frequency)?n:0)-(null!=(i=e.frequency)?i:0)})),r.map((e=>e.match))}(e,s);if(0===o.length){if(/^\\[a-zA-Z\*]+$/.test(s))for(const e of r)e.isError=!0;return void vc(e)}const l=null!=(n=null==t?void 0:t.atIndex)?n:0;e.suggestionIndex=l<0?o.length-1:l%o.length;const c=o[e.suggestionIndex];if(c!==s){const t=r[r.length-1];t.parent.addChildrenAfter([...c.slice(s.length-c.length)].map((e=>new ul(e,{isSuggestion:!0}))),t),Ac(e,{interactive:!0})}!function(e,t){var n;if(0===t.length)return void vc(e);let i="";for(const[n,r]of t.entries()){const t=r,a=fc(e,r),s=ic(e.keybindings,t).join("<br>");i+=`<li role="button" data-command="${t}" ${n===e.suggestionIndex?"class=ML__popover__current":""}><span class="ML__popover__latex">${t}</span><span class="ML__popover__command">${a}</span>`,s&&(i+=`<span class="ML__popover__keybinding">${s}</span>`),i+="</li>"}const r=function(e,t){let n=document.getElementById("mathlive-suggestion-popover");n||(n=hc("mathlive-suggestion-popover"),po("suggestion-popover"),po("core"),n.addEventListener("pointerdown",(e=>e.preventDefault())),n.addEventListener("click",(t=>{let n=t.target;for(;n&&!n.dataset.command;)n=n.parentElement;n&&(dc(e,"reject"),Ys.insert(e.model,n.dataset.command,{selectionMode:"placeholder",format:"latex",mode:"math"}),e.dirty=!0,e.focus())})));return n.innerHTML=window.MathfieldElement.createHTML(t),n}(e,`<ul>${i}</ul>`);mc()&&(null==(n=r.querySelector(".ML__popover__current"))||n.scrollIntoView({block:"nearest",inline:"nearest"}));setTimeout((()=>{var t;r&&!mc()&&(r.classList.add("is-visible"),gc(e),null==(t=r.querySelector(".ML__popover__current"))||t.scrollIntoView({block:"nearest",inline:"nearest"}))}),32)}(e,o)}function uc(e){const[t,n]=oc(e,{before:e.position});if(void 0===t||void 0===n)return!1;let i=!1;return e.getAtoms([t,n]).forEach((e=>{e.isSuggestion&&(e.isSuggestion=!1,i=!0)})),i}function dc(e,t="accept",n){var i,r;vc(e);const a=e.model.atoms.find((e=>"latexgroup"===e.type));if(!a)return!1;if("accept-suggestion"===t||"accept-all"===t){const n=sc(e.model).filter((e=>e.isSuggestion));if(0!==n.length){for(const e of n)e.isSuggestion=!1;e.model.position=e.model.offsetOf(n[n.length-1])}if("accept-suggestion"===t)return 0!==n.length}const s=sc(e.model).filter((e=>!e.isSuggestion)).map((e=>e.value)).join(""),o=a.leftSibling;return a.parent.removeChild(a),e.model.position=e.model.offsetOf(o),e.switchMode(null!=(i=null==n?void 0:n.mode)?i:"math"),"reject"===t||(Ys.insert(e.model,s,{selectionMode:null!=(r=null==n?void 0:n.selectItem)&&r?"item":"placeholder",format:"latex",mode:"math"}),e.snapshot(),e.model.announce("replacement"),e.switchMode("math")),!0}function hc(e){var t;let n=document.getElementById(e);return n?n.dataset.refcount=Number(Number.parseInt(null!=(t=n.dataset.refcount)?t:"0")+1).toString():(n=document.createElement("div"),n.setAttribute("aria-hidden","true"),n.dataset.refcount="1",n.id=e,document.body.append(n)),n}function pc(e){var t;const n=document.getElementById(e);if(!n)return;const i=Number.parseInt(null!=(t=n.getAttribute("data-refcount"))?t:"0");i<=1?n.remove():n.dataset.refcount=Number(i-1).toString()}function fc(e,t){const n=new Ts({from:e.context}),i=new Ds({mode:"math",type:"root",body:Qo(t,{context:n})});return hs(ds(xl(new cs(i.render(n),{classes:"ML__base"}),n)),{classes:"ML__latex"}).toMarkup()}function mc(){const e=document.getElementById("mathlive-suggestion-popover");return!!e&&e.classList.contains("is-visible")}function gc(e,t){var n;if(!e.element||e.element.mathfield!==e)return;if(!mc())return;if("latex"!==(null==(n=e.model.at(e.model.position))?void 0:n.type))return void vc(e);if(null==t?void 0:t.deferred)return void setTimeout((()=>gc(e)),32);const i=eo(e.field);if(!i)return;const r=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,a=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,s=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,l=window.mathVirtualKeyboard.boundingRect.height,c=document.getElementById("mathlive-suggestion-popover");i.x+c.offsetWidth/2>a-s?c.style.left=a-c.offsetWidth-s+"px":i.x-c.offsetWidth/2<0?c.style.left="0":c.style.left=i.x-c.offsetWidth/2+"px";const u=i.y-i.height;r-o-l-i.y<u?(c.classList.add("ML__popover--reverse-direction"),c.classList.remove("top-tip"),c.classList.add("bottom-tip"),c.style.top=i.y-i.height-c.offsetHeight-15+"px"):(c.classList.remove("ML__popover--reverse-direction"),c.classList.add("top-tip"),c.classList.remove("bottom-tip"),c.style.top=`${i.y+15}px`)}function vc(e){e.suggestionIndex=0;const t=document.getElementById("mathlive-suggestion-popover");t&&(t.classList.remove("is-visible"),t.innerHTML="")}new class extends Ys{constructor(){super("latex")}createAtom(e){return new ul(e)}onPaste(e,t){if(!t)return!1;const n="string"==typeof t?t:t.getData("application/x-latex")||t.getData("text/plain");return!(!n||!e.model.contentWillChange({inputType:"insertFromPaste",data:n}))&&(e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,n)&&(e.startRecording(),e.snapshot("paste"),e.model.contentDidChange({inputType:"insertFromPaste"}),Cc(e)),e.startRecording(),!0)}insert(e,t,n){if(!e.contentWillChange({data:t,inputType:"insertText"}))return!1;n||(n={}),n.insertionMode||(n.insertionMode="replaceSelection"),n.selectionMode||(n.selectionMode="placeholder");const{silenceNotifications:i}=e;n.silenceNotifications&&(e.silenceNotifications=!0);const r=e.silenceNotifications;e.silenceNotifications=!0,"replaceSelection"!==n.insertionMode||e.selectionIsCollapsed?"replaceAll"===n.insertionMode?(e.root.setChildren([],"body"),e.position=0):"insertBefore"===n.insertionMode?e.collapseSelection("backward"):"insertAfter"===n.insertionMode&&e.collapseSelection("forward"):e.deleteAtoms(Ns(e.selection));const a=[];for(const e of t)G.test(e)&&a.push(new ul(e));let s=e.at(e.position);if(s instanceof dl&&(s=s.lastChild),!(s.parent instanceof dl)){const e=new dl("");s.parent.addChildAfter(e,s),s=e.firstChild}const o=s.parent.addChildrenAfter(a,s);return e.silenceNotifications=r,"before"===n.selectionMode||("item"===n.selectionMode?e.setSelection(e.anchor,e.offsetOf(o)):o&&(e.position=e.offsetOf(o))),e.contentDidChange({data:t,inputType:"insertText"}),e.silenceNotifications=i,!0}};var bc,yc,_c=null,wc=(null==(yc=null==(bc=null==globalThis?void 0:globalThis.document)?void 0:bc.currentScript)?void 0:yc.src)||function(){const e=String((new Error).stack).replace(/^Error.*\n/,"").split("\n");if(0===e.length)return console.error(`Can't use relative paths to specify assets location because the sourcefile location could not be determined (unexpected stack trace format "${(new Error).stack}").`),"";let t=e[1],n=t.match(/http.*\.ts[\?:]/);return n&&(t=e[2]),n=t.match(/(https?:.*):[0-9]+:[0-9]+/),n||(n=t.match(/at (.*(\.ts))[\?:]/),n||(n=t.match(/at (.*(\.mjs|\.js))[\?:]/))),n?n[1]:(console.error(e),console.error(`Can't use relative paths to specify assets location because the source file location could not be determined (unexpected location "${t}").`),"")}();async function xc(e){if(/^(?:[a-z+]+:)?\/\//i.test(e))return new URL(e).href;if(null===_c)try{const e=await fetch(wc,{method:"HEAD"});200===e.status&&(_c=e.url)}catch(t){console.error(`Invalid URL "${e}" (relative to "${wc}")`)}return new URL(e,null!=_c?_c:wc).href}var kc="not-loaded";async function Sc(){var e;if("not-loaded"!==kc)return;kc="loading";if(null!=(e=getComputedStyle(document.documentElement).getPropertyValue("--ML__static-fonts"))&&e)kc="ready";else if(document.body.classList.remove("ML__fonts-did-not-load"),"fonts"in document){const e=["KaTeX_Main","KaTeX_Math","KaTeX_AMS","KaTeX_Caligraphic","KaTeX_Fraktur","KaTeX_SansSerif","KaTeX_Script","KaTeX_Typewriter","KaTeX_Size1","KaTeX_Size2","KaTeX_Size3","KaTeX_Size4"],t=Array.from(document.fonts).map((e=>e.family));if(e.every((e=>t.includes(e))))return void(kc="ready");if(!window.MathfieldElement.fontsDirectory)return void(kc="not-loaded");const n=await xc(window.MathfieldElement.fontsDirectory);if(!n)return document.body.classList.add("ML__fonts-did-not-load"),void(kc="error");const i=[["KaTeX_Main-Regular"],["KaTeX_Main-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_Main-Bold",{weight:"bold"}],["KaTeX_Main-Italic",{style:"italic"}],["KaTeX_Math-Italic",{style:"italic"}],["KaTeX_Math-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_AMS-Regular"],["KaTeX_Caligraphic-Regular"],["KaTeX_Caligraphic-Bold",{weight:"bold"}],["KaTeX_Fraktur-Regular"],["KaTeX_Fraktur-Bold",{weight:"bold"}],["KaTeX_SansSerif-Regular"],["KaTeX_SansSerif-Bold",{weight:"bold"}],["KaTeX_SansSerif-Italic",{style:"italic"}],["KaTeX_Script-Regular"],["KaTeX_Typewriter-Regular"],["KaTeX_Size1-Regular"],["KaTeX_Size2-Regular"],["KaTeX_Size3-Regular"],["KaTeX_Size4-Regular"]].map((e=>function(e,t,n={}){return new FontFace(e,`url(${t}.woff2) format('woff2')`,n)}(e[0].replace(/-[a-zA-Z]+$/,""),`${n}/${e[0]}`,e[1])));try{return(await Promise.all(i.map((e=>{try{return e.load()}catch(e){}})))).forEach((e=>document.fonts.add(e))),void(kc="ready")}catch(e){console.error(`MathLive 0.98.5: The math fonts could not be loaded from "${n}"`,{cause:e}),document.body.classList.add("ML__fonts-did-not-load")}kc="error"}}function Ec(e){let t=0;for(let n=0;n<e.length;n++)t=31*t+e.charCodeAt(n),t|=0;return Math.abs(t)}function Cc(e,t){e&&(e.dirty||(e.dirty=!0,requestAnimationFrame((()=>{Qs(e)&&e.dirty&&(e.atomBoundsCache=new Map,Ac(e,t),e.atomBoundsCache=void 0)}))))}function Tc(e,t){const{model:n}=e;n.root.caret=void 0,n.root.isSelected=!1,n.root.containsCaret=!0;for(const e of n.atoms)e.caret=void 0,e.isSelected=!1,e.containsCaret=!1;if(n.selectionIsCollapsed){const t=n.at(n.position);t.caret=e.model.mode;let i=t.parent;for(;i;)i.containsCaret=!0,i=i.parent}else{const e=n.getAtoms(n.selection,{includeChildren:!0});for(const t of e)t.isSelected=!0}const i=function(e,t){var n;t=null!=t?t:{};const i=new Ts({from:d(u({},e.context),{atomIdsSettings:{seed:t.forHighlighting?Ec(Ds.serialize([e.model.root],{expandMacro:!1,defaultMode:e.options.defaultMode})):"random",groupNumbers:null!=(n=t.forHighlighting)&&n},letterShapeStyle:e.options.letterShapeStyle}),mathstyle:"inline-math"===e.options.defaultMode?"textstyle":"displaystyle"});return hs(xl(e.model.root.render(i),i),{classes:e.hasEditablePrompts?"ML__latex ML__prompting":"ML__latex",attributes:{translate:"no","aria-hidden":"true"}})}(e,t);return i.toMarkup()}function Ac(e,t){if(!Qs(e))return;null!=t||(t={});const n=e.element.querySelector("[part=virtual-keyboard-toggle]");n&&(n.style.display=e.hasEditableContent?"":"none");const i=e.field;if(!i)return;const r=e.isSelectionEditable&&e.hasFocus(),a=i.classList.contains("ML__focused");a&&!r?i.classList.remove("ML__focused"):!a&&r&&i.classList.add("ML__focused");let s=Tc(e,t);const o=e.element.querySelector("[part=menu-toggle]");if(o&&(e.model.atoms.length<=1||e.disabled||e.readOnly&&!e.hasEditableContent||"none"===e.userSelect?o.style.display="none":o.style.display=""),e.model.atoms.length<=1){const t=e.options.contentPlaceholder;t&&(s+=`<span part=placeholder class="ML__content-placeholder">${_h(t)}</span>`)}i.innerHTML=window.MathfieldElement.createHTML(s),Mc(e,t.interactive),e.dirty=!1}function Mc(e,t){const n=e.field;if(!n)return;for(const e of n.querySelectorAll(".ML__selection, .ML__contains-highlight"))e.remove();null!=t&&t||"error"===kc||"ready"===kc||setTimeout((()=>{"ready"===kc?Mc(e):setTimeout((()=>Mc(e)),128)}),32);const i=e.model,r=n.offsetWidth,a=n.getBoundingClientRect().width;let s=Math.floor(a)/r;if(s=isNaN(s)?1:s,i.selectionIsCollapsed){gc(e,{deferred:!0});let t=i.at(i.position);for(;t&&"prompt"!==t.type&&(!t.containsCaret||!t.displayContainsHighlight);)t=t.parent;if((null==t?void 0:t.containsCaret)&&t.displayContainsHighlight){const i=no(e,ro(e,t),s);if(i){i.left/=s,i.right/=s,i.top/=s,i.bottom/=s;const e=document.createElement("div");e.classList.add("ML__contains-highlight"),e.style.position="absolute",e.style.left=`${i.left+1}px`,e.style.top=`${Math.ceil(i.top)}px`,e.style.width=`${Math.ceil(i.right-i.left)}px`,e.style.height=`${Math.ceil(i.bottom-i.top)}px`,n.insertBefore(e,n.childNodes[0])}}}else for(const t of function(e){let t=[];for(const n of e){let e=!1;for(const i of t)if(n.left===i.left&&n.right===i.right&&n.top===i.top&&n.bottom===i.bottom){e=!0;break}e||t.push(n)}e=t,t=[];for(const n of e){let i=0;for(const t of e)if(n.left>=t.left&&n.right<=t.right&&n.top>=t.top&&n.bottom<=t.bottom&&(i+=1,i>1))break;1===i&&t.push(n)}return t}(ao(e,{excludeAtomsWithBackground:!0}))){t.left/=s,t.right/=s,t.top/=s,t.bottom/=s;const e=document.createElement("div");e.classList.add("ML__selection"),e.style.position="absolute",e.style.left=`${t.left}px`,e.style.top=`${t.top}px`,e.style.width=`${Math.ceil(t.right-t.left)}px`,e.style.height=`${Math.ceil(t.bottom-t.top-1)}px`,n.insertBefore(e,n.childNodes[0])}}var Lc;function Dc(e,t){t=u({target:"mathfield",canUndo:!1,audioFeedback:void 0,changeContent:!1,changeSelection:!1},null!=t?t:{}),Lc||(Lc={});for(const n of Object.keys(e))console.assert(!Lc[n],"Selector already defined: ",n),Lc[n]=d(u({},t),{fn:e[n]})}function Ic(e){let t;if(Array.isArray(e)){if("performWithFeedback"===e[0])return Ic(e[1]);t=e[0]}else t=e;return t=t.replace(/-\w/g,(e=>e[1].toUpperCase())),Lc[t]}function Rc(e){var t;return null==(t=Ic(e))?void 0:t.target}Dc({performWithFeedback:(e,t)=>function(e,t){var n;if(!e)return!1;e.focus(),hp.keypressVibration&&g()&&navigator.vibrate(3);const i=Ic(t);window.MathfieldElement.playSound(null!=(n=null==i?void 0:i.audioFeedback)?n:"keypress");const r=e.executeCommand(t);return e.scrollIntoView(),r}(e,t)}),Dc({complete:dc},{target:"mathfield",audioFeedback:"return",canUndo:!0,changeContent:!0,changeSelection:!0}),Dc({nextSuggestion:function(e){return cc(e,{atIndex:e.suggestionIndex+1}),!1},previousSuggestion:function(e){return cc(e,{atIndex:e.suggestionIndex-1}),!1}},{target:"mathfield",audioFeedback:"keypress",changeSelection:!0});var Pc="mathlive#virtual-keyboard-message";function Oc(e){var t;if("message"!==e.type)return!1;return(null==(t=e.data)?void 0:t.type)===Pc}var Nc,Bc=class e{constructor(){this.targetOrigin=window.origin,this.originValidator="none",this._boundingRect=new DOMRect(0,0,0,0),this._isShifted=!1,window.addEventListener("message",this),this.sendMessage("proxy-created"),this.listeners={}}static get singleton(){return this._singleton||(this._singleton=new e),this._singleton}set alphabeticLayout(e){this.sendMessage("update-setting",{alphabeticLayout:e})}set layouts(e){this.sendMessage("update-setting",{layouts:e})}get normalizedLayouts(){return[]}set editToolbar(e){this.sendMessage("update-setting",{editToolbar:e})}set actionKeycap(e){this.sendMessage("update-setting",{actionKeycap:e})}set shiftKeycap(e){this.sendMessage("update-setting",{shiftKeycap:e})}set backspaceKeycap(e){this.sendMessage("update-setting",{backspaceKeycap:e})}set tabKeycap(e){this.sendMessage("update-setting",{tabKeycap:e})}set container(e){throw new Error("Container inside an iframe cannot be changed")}show(e){this.sendMessage("show",e)}hide(e){this.sendMessage("hide",e)}get isShifted(){return this._isShifted}get visible(){return this._boundingRect.height>0}set visible(e){e?this.show():this.hide()}get boundingRect(){return this._boundingRect}executeCommand(e){return this.sendMessage("execute-command",{command:e}),!0}updateToolbar(e){this.sendMessage("update-toolbar",e)}update(e){this.sendMessage("update-setting",e)}connect(){this.sendMessage("connect")}disconnect(){this.sendMessage("disconnect")}addEventListener(e,t,n){this.listeners[e]||(this.listeners[e]=new Set),this.listeners[e].has(t)||this.listeners[e].add(t)}dispatchEvent(e){return!this.listeners[e.type]||0===this.listeners[e.type].size||(this.listeners[e.type].forEach((t=>{"function"==typeof t?t(e):null==t||t.handleEvent(e)})),!e.defaultPrevented)}removeEventListener(e,t,n){this.listeners[e]&&this.listeners[e].delete(t)}handleEvent(e){if(Oc(e)){if(!so(e.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${e.origin}) cannot be handled`,"SecurityError");this.handleMessage(e.data)}}handleMessage(e){const{action:t}=e;if("execute-command"!==t)return"synchronize-proxy"===t?(this._boundingRect=e.boundingRect,void(this._isShifted=e.isShifted)):"geometry-changed"===t?(this._boundingRect=e.boundingRect,void this.dispatchEvent(new Event("geometrychange"))):void 0;{const{command:t}=e;"virtual-keyboard"===Rc(t)&&this.executeCommand(t)}}sendMessage(e,t={}){if(!window.top)throw new DOMException("A frame does not have access to the top window and can‘t communicate with the keyboard. Review virtualKeyboardTargetOrigin and originValidator on mathfields embedded in an iframe","SecurityError");window.top.postMessage(u({type:Pc,action:e},t),this.targetOrigin)}},$c={numeric:{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",rows:[[{latex:"x",shift:"y",variants:["y","z","t","r","x^2","x^n","x^{#?}","x_n","x_i","x_{#?}",{latex:"f(#?)",class:"small"},{latex:"g(#?)",class:"small"}]},{latex:"n",shift:"a",variants:["i","j","p","k","a","u"]},"[separator-5]","[7]","[8]","[9]","[/]","[separator-5]",{latex:"\\exponentialE",shift:"\\ln",variants:["\\exp","\\times 10^{#?}","\\ln","\\log_{10}","\\log"]},{latex:"\\imaginaryI",variants:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"]},{latex:"\\pi",shift:"\\sin",variants:["\\prod",{latex:"\\theta",aside:"theta"},{latex:"\\rho",aside:"rho"},{latex:"\\tau",aside:"tau"},"\\sin","\\cos","\\tan"]}],[{label:"<",latex:"<",class:"hide-shift",shift:{latex:"\\le",label:"≤"}},{label:">",latex:">",class:"hide-shift",shift:{latex:"\\ge",label:"≥"}},"[separator-5]","[4]","[5]","[6]","[*]","[separator-5]",{class:"hide-shift",latex:"#@^2}",shift:"#@^{\\prime}}"},{latex:"#@^{#0}}",class:"hide-shift",shift:"#@_{#?}"},{class:"hide-shift",latex:"\\sqrt{#0}",shift:{latex:"\\sqrt[#0]{#?}}"}}],["[(]","[)]","[separator-5]","[1]","[2]","[3]","[-]","[separator-5]",{latex:"\\int^{\\infty}_{0}\\!#?\\,\\mathrm{d}x",class:"small hide-shift",shift:"\\int",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{class:"hide-shift",latex:"\\forall",shift:"\\exists"},{label:"[backspace]",width:1}],[{label:"[shift]",width:2},"[separator-5]","[0]","[.]","[=]","[+]","[separator-5]","[left]","[right]",{label:"[action]",width:1}]]},greek:{label:"αβγ",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.greek",rows:[[{label:"<i>φ</i>",class:"MLK__tex hide-shift",insert:"\\varphi",aside:"phi var.",shift:"\\Phi"},{label:"<i>ς</i>",class:"MLK__tex hide-shift",insert:"\\varsigma",aside:"sigma var.",shift:"\\Sigma"},{label:"<i>ϵ</i>",class:"MLK__tex hide-shift",insert:"\\epsilon",aside:"espilon",shift:'\\char"0190'},{label:"<i>ρ</i>",class:"MLK__tex hide-shift",insert:"\\rho",aside:"rho",shift:'\\char"3A1'},{label:"<i>τ</i>",class:"MLK__tex hide-shift",insert:"\\tau",aside:"tau",shift:'\\char"3A4'},{label:"<i>υ</i>",class:"MLK__tex hide-shift",insert:"\\upsilon",aside:"upsilon",shift:"\\Upsilon"},{label:"<i>θ</i>",class:"MLK__tex hide-shift",insert:"\\theta",aside:"theta",shift:"\\Theta"},{label:"<i>ι</i>",class:"MLK__tex hide-shift",insert:"\\iota",aside:"iota",shift:'\\char"399'},{label:"<i>ο</i>",class:"MLK__tex hide-shift",insert:"\\omicron",aside:"omicron",shift:'\\char"39F'},{label:"<i>π</i>",class:"MLK__tex hide-shift",insert:"\\pi",aside:"pi",shift:"\\Pi"}],["[separator-5]",{label:"<i>α</i>",class:"MLK__tex hide-shift",insert:"\\alpha",aside:"alpha",shift:'\\char"391'},{label:"<i>σ</i>",class:"MLK__tex hide-shift",insert:"\\sigma",aside:"sigma",shift:"\\Sigma"},{label:"<i>δ</i>",class:"MLK__tex hide-shift",insert:"\\delta",aside:"delta",shift:"\\Delta"},{latex:"\\phi",class:"MLK__tex hide-shift",insert:"\\phi",aside:"phi",shift:"\\Phi"},{label:"<i>γ</i>",class:"MLK__tex hide-shift",insert:"\\gamma",aside:"gamma",shift:"\\Gamma"},{label:"<i>η</i>",class:"MLK__tex hide-shift",insert:"\\eta",aside:"eta",shift:'\\char"397'},{label:"<i>ξ</i>",class:"MLK__tex hide-shift",insert:"\\xi",aside:"xi",shift:"\\Xi"},{label:"<i>κ</i>",class:"MLK__tex hide-shift",insert:"\\kappa",aside:"kappa",shift:"\\Kappa"},{label:"<i>λ</i>",class:"MLK__tex hide-shift",insert:"\\lambda",aside:"lambda",shift:"\\Lambda"},"[separator-5]"],["[shift]",{label:"<i>ζ</i>",class:"MLK__tex hide-shift",insert:"\\zeta",aside:"zeta",shift:'\\char"396'},{label:"<i>χ</i>",class:"MLK__tex hide-shift",insert:"\\chi",aside:"chi",shift:'\\char"3A7'},{label:"<i>ψ</i>",class:"MLK__tex hide-shift",insert:"\\psi",aside:"zeta",shift:"\\Psi"},{label:"<i>ω</i>",class:"MLK__tex hide-shift",insert:"\\omega",aside:"omega",shift:"\\Omega"},{label:"<i>β</i>",class:"MLK__tex hide-shift",insert:"\\beta",aside:"beta",shift:'\\char"392'},{label:"<i>ν</i>",class:"MLK__tex hide-shift",insert:"\\nu",aside:"nu",shift:'\\char"39D'},{label:"<i>μ</i>",class:"MLK__tex hide-shift",insert:"\\mu",aside:"mu",shift:'\\char"39C'},"[backspace]"],["[separator]",{label:"<i>ε</i>",class:"MLK__tex",insert:"\\varepsilon",aside:"espilon var."},{label:"<i>ϑ</i>",class:"MLK__tex",insert:"\\vartheta",aside:"theta var."},{label:"<i>ϰ</i>",class:"MLK__tex",insert:"\\varkappa",aside:"kappa var."},{label:"<i>ϖ</i>",class:"MLK__tex",insert:"\\varpi",aside:"pi var."},{label:"<i>ϱ</i>",class:"MLK__tex",insert:"\\varrho",aside:"rho var."},"[left]","[right]","[action]"]]},symbols:{label:"∞≠∈",labelClass:"MLK__tex",tooltip:"keyboard.tooltip.symbols",rows:[[{latex:"\\sin",shift:"\\sin^{-1}",variants:[{class:"small",latex:"\\sinh"},{class:"small",latex:"\\sin^{-1}"},{class:"small",latex:"\\arsinh"}]},"\\ln",{latex:"\\mathrm{abs}",insert:"\\mathrm{abs}\\left(#0\\right)"},{latex:"\\rarr",shift:"\\rArr",variants:[{latex:"\\implies",aside:"implies"},{latex:"\\to",aside:"to"},"\\dashv",{latex:"\\roundimplies",aside:"round implies"}]},{latex:"\\exists",variants:["\\nexists"],shift:"\\nexists"},{latex:"\\in",shift:"\\notin",variants:["\\notin","\\owns"]},"\\cup",{latex:"\\overrightarrow{#@}",shift:"\\overleftarrow{#@}",variants:["\\overleftarrow{#@}","\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"]},{class:"small",latex:"\\lim_{#?}",shift:"\\lim_{x\\to\\infty}",variants:[{class:"small",latex:"\\liminf_{#?}"},{class:"small",latex:"\\limsup_{#?}"}]},"\\exponentialE"],[{latex:"\\cos",shift:"\\cos^{-1}",variants:[{class:"small",latex:"\\cosh"},{class:"small",latex:"\\cos^{-1}"},{class:"small",latex:"\\arcosh"}]},{latex:"\\log",shift:"\\log_{10}",variants:["\\log_{#0}","\\log_{10}"]},"\\left\\vert#0\\right\\vert",{latex:"\\larr",shift:"\\lArr",variants:[{latex:"\\impliedby",aside:"implied by"},{latex:"\\gets",aside:"gets"},"\\lArr","\\vdash",{latex:"\\models",aside:"models"}]},{latex:"\\forall",shift:"\\lnot",variants:[{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"}]},{latex:"\\ni",shift:"\\not\\owns"},"\\cap",{latex:"\\overline{#@}",shift:"\\underline{#@}",variants:["\\overbrace{#@}","\\overlinesegment{#@}","\\overleftrightarrow{#@}","\\overrightarrow{#@}","\\overleftarrow{#@}","\\overgroup{#@}","\\underbrace{#@}","\\underlinesegment{#@}","\\underleftrightarrow{#@}","\\underrightarrow{#@}","\\underleftarrow{#@}","\\undergroup{#@}"]},{class:"hide-shift",latex:"\\int",shift:"\\iint",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\smallint",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\intop","\\iiint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"]},{latex:"\\pi",shift:"\\tau",variants:["\\tau"]}],[{latex:"\\tan",shift:"\\tan^{-1}",variants:[{class:"small",latex:"\\tanh"},{class:"small",latex:"\\tan^{-1}"},{class:"small",latex:"\\artanh"},{class:"small",latex:"\\arctan"},{class:"small",latex:"\\arctg"},{class:"small",latex:"\\tg"}]},{latex:"\\exp",insert:"\\exp\\left(#0\\right)",variants:["\\exponentialE^{#0}"]},"\\left\\Vert#0\\right\\Vert",{latex:"\\lrArr",shift:"\\leftrightarrow",variants:[{latex:"\\iff",aside:"if and only if"},"\\leftrightarrow","\\leftrightarrows","\\Leftrightarrow",{latex:"^\\biconditional",aside:"biconditional"}]},{latex:"\\vert",shift:"!"},{latex:"#@^{\\complement}",aside:"complement",variants:[{latex:"\\setminus",aside:"set minus"},{latex:"\\smallsetminus",aside:"small set minus"}]},{latex:"\\subset",shift:"\\subseteq",variants:["\\subset","\\subseteq","\\subsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsubseteq","\\supset","\\supseteq","\\supsetneq","\\supsetneqq","\\nsupset","\\nsupseteq"]},{latex:"#@^{\\prime}",shift:"#@^{\\doubleprime}",variants:["#@^{\\doubleprime}","#@\\degree"]},{latex:"\\mathrm{d}",shift:"\\partial",variants:["\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{latex:"\\infty",variants:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"]}],[{label:"[shift]",width:2},{class:"box",latex:",",shift:";",variants:[";","?"]},{class:"box",latex:"\\colon",shift:"\\Colon",variants:[{latex:"\\Colon",aside:"such that",class:"box"},{latex:":",aside:"ratio",class:"box"},{latex:"\\vdots",aside:"",class:"box"},{latex:"\\ddots",aside:"",class:"box"},{latex:"\\ldotp",aside:"low dot",class:"box"},{latex:"\\cdotp",aside:"center dot",class:"box"},{latex:"\\ldots",aside:"low ellipsis",class:"box"},{latex:"\\cdots",aside:"center ellipsis",class:"box"},{latex:"\\therefore",aside:"therefore",class:"box"},{latex:"\\because",aside:"because",class:"box"}]},{class:"box",latex:"\\cdot",aside:"centered dot",shift:"\\ast",variants:["\\circ","\\bigcirc","\\bullet","\\odot","\\oslash","\\circledcirc","\\ast","\\star","\\times","\\doteq","\\doteqdot"]},"[separator]","[left]","[right]",{label:"[backspace]",width:1,class:"action hide-shift"},{label:"[action]",width:1}]]},compact:{label:"compact",rows:[["[+]","[-]","[*]","[/]","[=]","[.]","[(]","[)]","\\sqrt{#0}","#@^{#?}"],["[1]","[2]","[3]","[4]","[5]","[6]","[7]","[8]","[9]","[0]"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]},minimalist:{label:"minimalist",layers:[{style:"\n .minimalist-backdrop {\n display: flex;\n justify-content: center;\n } \n .minimalist-container {\n --keycap-height: 40px;\n --keycap-max-width: 53px;\n --keycap-small-font-size: 12px;\n background: var(--keyboard-background);\n padding: 20px;\n border-top-left-radius: 8px;\n border-top-right-radius: 8px;\n border: 1px solid var(--keyboard-border);\n box-shadow: 0 0 32px rgb(0 0 0 / 30%);\n } \n ",backdrop:"minimalist-backdrop",container:"minimalist-container",rows:[["+","-","\\times",{latex:"\\frac{#@}{#0}",class:"small"},"=","[.]","(",")",{latex:"\\sqrt{#0}",class:"small"},{latex:"#@^{#?}",class:"small"}],["1","2","3","4","5","6","7","8","9","0"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]}]},"numeric-only":{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",id:"numeric-only",rows:[["7","8","9","[separator]",{label:"[backspace]",width:2}],["4","5","6","[separator]","[separator]","[separator]"],["1","2","3","[separator]","[separator]","[separator]"],["0",{label:"[.]",variants:[]},"-","[separator]","[left]","[right]"]]}},Fc={0:["\\varnothing","\\infty"],1:["\\frac{1}{#@}","#@^{-1}","\\times 10^{#?}","\\phi","\\imaginaryI"],2:["\\frac{1}{2}","#@^2","\\sqrt2","\\exponentialE"],3:["\\frac{1}{3}","#@^3","\\sqrt3","\\pi"],4:["\\frac{1}{4}","#@^4"],5:["\\frac{1}{5}","#@^5","\\sqrt5"],6:["\\frac{1}{6}","#@^6"],7:["\\frac{1}{7}","#@^7"],8:["\\frac{1}{8}","#@^8"],9:["\\frac{1}{9}","#@^9"],".":[".",",",";","\\colon"],",":["{,}",".",";","\\colon"],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"},"à","á","â","ä","æ"],b:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"},"ç"],d:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},"è","é","ê","ë"],g:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"},"ì","í","î","ï"],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\mathbb{N}",aside:"set of natural numbers"},"ñ"],o:["ø","œ","ò","ó","ô","ö","œ"],p:[{latex:"\\mathbb{P}",aside:"set of primes"}],q:[{latex:"\\mathbb{Q}",aside:"set of rational numbers"}],r:[{latex:"\\mathbb{R}",aside:"set of real numbers"}],u:["ù","ú","û","ü"],z:[{latex:"\\mathbb{Z}",aside:"set of integers"}],y:["ý","ÿ"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space<br>⁻³⧸₁₈ em"},{latex:'\\char"203A\\,\\char"2039',insert:"\\,",aside:"thin space<br>³⧸₁₈ em"},{latex:'\\char"203A\\:\\char"2039',insert:"\\:",aside:"medium space<br>⁴⧸₁₈ em"},{latex:'\\char"203A\\;\\char"2039',insert:"\\;",aside:"thick space<br>⁵⧸₁₈ em"},{latex:'\\char"203A\\ \\char"2039',insert:"\\ ",aside:"⅓ em"},{latex:'\\char"203A\\enspace\\char"2039',insert:"\\enspace",aside:"½ em"},{latex:'\\char"203A\\quad\\char"2039',insert:"\\quad",aside:"1 em"},{latex:'\\char"203A\\qquad\\char"2039',insert:"\\qquad",aside:"2 em"}]};function zc(e,t){var n,i,r;const a=lu.singleton;if(!a)return;const s=su(e),o=null!=(i=null==(n=a.getKeycap(null==s?void 0:s.id))?void 0:n.variants)?i:"";if("string"==typeof o&&!Uc(o)||Array.isArray(o)&&0===o.length)return void(null==t||t());const l={};let c="";for(const e of function(e){var t;if("string"!=typeof e)return e;Fc[e]||(Fc[e]=null!=(t=function(e){if("foreground-color"===e){const e=[];for(const t of Object.keys(S))e.push({class:"swatch-button",label:'<span style="border: 3px solid '+S[t]+'"></span>',command:["applyStyle",{color:t}]});return e}if("background-color"===e){const e=[];for(const t of Object.keys(k))e.push({class:"swatch-button",label:'<span style="background:'+k[t]+'"></span>',command:["applyStyle",{backgroundColor:t}]});return e}return}(e))?t:[]);return Fc[e]}(o)){const t=tu(e),n=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36);l[n]=t;const[i,r]=Jc(t);c+=`<div id=${n} class="item ${r}">${i}</div>`}const u=document.createElement("div");u.setAttribute("aria-hidden","true"),u.className="MLK__variant-panel",u.style.height="auto";const d=Object.keys(l).length;let h=5;1===d?h=1:2===d||4===d?h=2:3===d||5===d||6===d?h=3:d>=7&&d<14&&(h=4),u.style.width=`calc(var(--variant-keycap-length) * ${h} + 12px)`,u.innerHTML=hp.createHTML(c),Ql.open({root:null==(r=null==a?void 0:a.container)?void 0:r.querySelector(".ML__keyboard"),child:u}),Nc=new AbortController;const{signal:p}=Nc,f=null==e?void 0:e.getBoundingClientRect();if(f){f.top-u.clientHeight<0&&(u.style.width="auto",d<=6?u.style.height="56px":d<=12?u.style.height="108px":d<=18?u.style.height="205px":u.classList.add("compact"));const e=Math.max(0,Math.min(window.innerWidth-u.offsetWidth,(f.left+f.right-u.offsetWidth)/2)),n=f.top-u.clientHeight+5;u.style.transform=`translate(${e}px, ${n}px)`,u.classList.add("is-visible"),requestAnimationFrame((()=>{u.addEventListener("pointerup",(e=>{const n=su(e.target);(null==n?void 0:n.id)&&l[n.id]&&(ru(l[n.id]),Kc(),null==t||t(),e.preventDefault())}),{capture:!0,passive:!1,signal:p}),u.addEventListener("pointerenter",(e=>{const t=su(e.target);(null==t?void 0:t.id)&&l[t.id]&&t.classList.add("is-active")}),{capture:!0,signal:p}),u.addEventListener("pointerleave",(e=>{const t=su(e.target);(null==t?void 0:t.id)&&l[t.id]&&t.classList.remove("is-active")}),{capture:!0,signal:p}),window.addEventListener("pointercancel",(()=>{Kc(),null==t||t()}),{signal:p}),window.addEventListener("pointerup",(()=>{Kc(),null==t||t()}),{signal:p})}))}}function Kc(){null==Nc||Nc.abort(),Nc=null,"open"===Ql.state&&Ql.close()}function Uc(e){return void 0!==Fc[e]}function jc(e){return Object.keys(e).map((t=>`${t} {${function(e){return"string"==typeof e?e:Object.entries(e).map((([e,t])=>`${e}:${t} !important`)).join(";")}(e[t])}}`)).join("")}function qc(e){if(!e)return"";const t=new Ts,n=new Ds({mode:"math",type:"root",body:Qo(e,{context:t,args:e=>"@"===e?"{\\class{ML__box-placeholder}{\\blacksquare}}":"\\placeholder{}"})});return hs(ds(xl(new cs(n.render(t),{classes:"ML__base"}),t)),{classes:"ML__latex"}).toMarkup()}function Hc(e){if(Array.isArray(e))return e.map((e=>Hc(e))).flat();const t="string"==typeof e?{markup:e}:e;return"rows"in t&&Array.isArray(t.rows)&&(t.rows=t.rows.map((e=>e.map((e=>tu(e)))))),null!=t.id||(t.id="ML__layer_"+Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36)),[t]}function Vc(e){if("alphabetic"===e)return function(){var e,t;let n=window.mathVirtualKeyboard.alphabeticLayout;if("auto"===n){const t=Vl();t&&(n=t.virtualLayout),n&&"auto"!==n||(n=null!=(e={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[y.locale.slice(0,2)])?e:"qwerty")}const i={qwerty:["qwertyuiop"," asdfghjkl ","^zxcvbnm~"],azerty:["azertyuiop","qsdfghjklm","^ wxcvbn ~"],qwertz:["qwertzuiop"," asdfghjkl ","^yxcvbnm~"],dvorak:["^ pyfgcrl ","aoeuidhtns","qjkxbmwvz~"],colemak:[" qwfpgjluy ","arstdhneio","^zxcvbkm~"]},r=null!=(t=i[n])?t:i.qwerty,a="azerty"===n?[[{label:"1",variants:"1"},{label:"2",shift:{latex:"é"},variants:"2"},{label:"3",shift:{latex:"ù"},variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{label:"(",latex:"("},variants:"5"},{label:"6",shift:{label:")",latex:")"},variants:"6"},{label:"7",shift:{latex:"è"},variants:"7"},{label:"8",shift:{latex:"ê"},variants:"8"},{label:"9",shift:{latex:"ç"},variants:"9"},{label:"0",shift:{latex:"à"},variants:"0"}]]:[[{label:"1",variants:"1"},{label:"2",variants:"2"},{label:"3",variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{latex:"\\frac{#@}{#?}"},variants:"5"},{label:"6",shift:{latex:"#@^#?"},variants:"6"},{label:"7",variants:"7"},{label:"8",shift:{latex:"\\times"},variants:"8"},{label:"9",shift:{label:"(",latex:"("},variants:"9"},{label:"0",shift:{label:")",latex:")"},variants:"0"}]];for(const e of r){const t=[];for(const i of e)/[a-z]/.test(i)?t.push({label:i,class:"hide-shift",shift:{label:i.toUpperCase()},variants:Uc(i)?i:void 0}):"~"===i?"dvorak"!==n?t.push("[backspace]"):t.push({label:"[backspace]",width:1}):"^"===i?t.push("[shift]"):" "===i&&t.push("[separator-5]");a.push(t)}return a.push(["[-]","[+]","[=]",{label:" ",width:1.5},{label:",",shift:";",variants:".",class:"hide-shift"},"[.]","[left]","[right]",{label:"[action]",width:1.5}]),{label:"abc",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.alphabetic",layers:Hc({rows:a})}}();if("string"==typeof e)return console.assert(void 0!==$c[e],`MathLive 0.98.5: unknown keyboard layout "${e}"`),Vc($c[e]);let t;if("rows"in e&&Array.isArray(e.rows)){console.assert(!("layers"in e||"markup"in e),'MathLive 0.98.5: when providing a "rows" property, "layers" and "markup" are ignored');const n=e,{rows:i}=n,r=p(n,["rows"]);t=d(u({},r),{layers:Hc({rows:e.rows})})}else if("markup"in e&&"string"==typeof e.markup){const n=e,{markup:i}=n,r=p(n,["markup"]);t=d(u({},r),{layers:Hc(e.markup)})}else t=u({},e),"layers"in e?t.layers=Hc(e.layers):console.error('MathLive 0.98.5: provide either a "rows", "markup" or "layers" property');let n=!1,i=!1;for(const e of t.layers)if(e.rows)for(const t of e.rows.flat()){ou(t)&&(n=!0);const e=t.command;"string"==typeof e&&["undo","redo","cut","copy","paste"].includes(e)&&(i=!0)}return"displayShiftedKeycaps"in e&&void 0!==e.displayShiftedKeycaps||(t.displayShiftedKeycaps=n),"displayEditToolbar"in e&&void 0!==e.displayEditToolbar||(t.displayEditToolbar=!i),t}function Gc(e,t){var n,i;let r='<div class="left">';if(e.normalizedLayouts.length>1)for(const[a,s]of e.normalizedLayouts.entries()){const e=s,o=[a===t?"selected":"layer-switch"];e.tooltip&&o.push("MLK__tooltip"),e.labelClass&&o.push(...e.labelClass.split(" ")),r+=`<div class="${o.join(" ")}"`,e.tooltip&&(r+=" data-tooltip='"+(null!=(n=_(e.tooltip))?n:e.tooltip)+"' "),a!==t&&(r+=`data-layer="${e.layers[0].id}"`),r+=`>${null!=(i=e.label)?i:"untitled"}</div>`}return r+="</div>",r}function Zc(e,t){let n="";if("none"===e.editToolbar)return"";const i=[];t.selectionIsCollapsed?i.push("undo","redo","pasteFromClipboard"):i.push("cutToClipboard","copyToClipboard","pasteFromClipboard");const r={undo:`<div class='action ${!1===t.canUndo?"disabled":""}'\n data-command='"undo"'\n data-tooltip='${_("tooltip.undo")}'>\n <svg><use xlink:href='#svg-undo' /></svg>\n </div>`,redo:`<div class='action ${!1===t.canRedo?"disabled":""}'\n data-command='"redo"'\n data-tooltip='${_("tooltip.redo")}'>\n <svg><use xlink:href='#svg-redo' /></svg>\n </div>`,cutToClipboard:`\n <div class='action'\n data-command='"cutToClipboard"'\n data-tooltip='${_("tooltip.cut to clipboard")}'>\n <svg><use xlink:href='#svg-cut' /></svg>\n </div>\n `,copyToClipboard:`\n <div class='action'\n data-command='"copyToClipboard"'\n data-tooltip='${_("tooltip.copy to clipboard")}'>\n <svg><use xlink:href='#svg-copy' /></svg>\n </div>\n `,pasteFromClipboard:`\n <div class='action'\n data-command='"pasteFromClipboard"'\n data-tooltip='${_("tooltip.paste from clipboard")}'>\n <svg><use xlink:href='#svg-paste' /></svg>\n </div>\n `};return n+=i.map((e=>r[e])).join(""),n}function Wc(e){const t=lu.singleton;if(!t)return;const n={};if(!e.id){if(e.hasAttribute("data-label")&&(n.label=e.dataset.label),e.hasAttribute("data-latex")&&(n.latex=e.dataset.latex),e.hasAttribute("data-key")&&(n.key=e.dataset.key),e.hasAttribute("data-insert")&&(n.insert=e.dataset.insert),e.hasAttribute("data-variants")&&(n.variants=e.dataset.variants),e.hasAttribute("data-aside")&&(n.aside=e.dataset.aside),e.className&&(n.class=e.className),n.label||n.latex||n.key||n.insert||(n.latex=e.innerText,n.label=e.innerHTML),e.hasAttribute("data-command"))try{n.command=JSON.parse(e.dataset.command)}catch(e){}e.id=t.registerKeycap(n)}if(!e.innerHTML){const[t,i]=Jc(n);e.innerHTML=window.MathfieldElement.createHTML(t)}}function Yc(e){e.resetKeycapRegistry(),po("virtual-keyboard"),po("core"),Sc();const t=document.createElement("div");t.className="ML__keyboard";const n=document.createElement("div");n.className="MLK__plate",n.innerHTML=window.MathfieldElement.createHTML('<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">\n\n<symbol id="svg-delete-backward" viewBox="0 0 576 512">\n <path d="M432.1 208.1L385.9 256L432.1 303C442.3 312.4 442.3 327.6 432.1 336.1C423.6 346.3 408.4 346.3 399 336.1L352 289.9L304.1 336.1C295.6 346.3 280.4 346.3 271 336.1C261.7 327.6 261.7 312.4 271 303L318.1 256L271 208.1C261.7 199.6 261.7 184.4 271 175C280.4 165.7 295.6 165.7 304.1 175L352 222.1L399 175C408.4 165.7 423.6 165.7 432.1 175C442.3 184.4 442.3 199.6 432.1 208.1V208.1zM512 64C547.3 64 576 92.65 576 128V384C576 419.3 547.3 448 512 448H205.3C188.3 448 172 441.3 160 429.3L9.372 278.6C3.371 272.6 0 264.5 0 256C0 247.5 3.372 239.4 9.372 233.4L160 82.75C172 70.74 188.3 64 205.3 64L512 64zM528 128C528 119.2 520.8 112 512 112H205.3C201 112 196.9 113.7 193.9 116.7L54.63 256L193.9 395.3C196.9 398.3 201 400 205.3 400H512C520.8 400 528 392.8 528 384V128z"/>\n</symbol>\n\n<symbol id="svg-shift" viewBox="0 0 384 512">\n <path d="M2.438 252.3C7.391 264.2 19.06 272 32 272h80v160c0 26.51 21.49 48 48 48h64C250.5 480 272 458.5 272 432v-160H352c12.94 0 24.61-7.797 29.56-19.75c4.953-11.97 2.219-25.72-6.938-34.88l-160-176C208.4 35.13 200.2 32 192 32S175.6 35.13 169.4 41.38l-160 176C.2188 226.5-2.516 240.3 2.438 252.3zM192 86.63L313.4 224H224v208H160V224H70.63L192 86.63z"/>\n</symbol>\n\n<symbol id="svg-commit" viewBox="0 0 512 512">\n <path d="M135 432.1l-128-128C2.344 300.3 0 294.2 0 288s2.344-12.28 7.031-16.97l128-128c9.375-9.375 24.56-9.375 33.94 0s9.375 24.56 0 33.94L81.94 264H464v-208C464 42.75 474.8 32 488 32S512 42.75 512 56V288c0 13.25-10.75 24-24 24H81.94l87.03 87.03c9.375 9.375 9.375 24.56 0 33.94S144.4 442.3 135 432.1z"/>\n</symbol>\n\n\n<symbol id="circle-plus" viewBox="0 0 512 512"><path d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344c0 13.3 10.7 24 24 24s24-10.7 24-24V280h64c13.3 0 24-10.7 24-24s-10.7-24-24-24H280V168c0-13.3-10.7-24-24-24s-24 10.7-24 24v64H168c-13.3 0-24 10.7-24 24s10.7 24 24 24h64v64z"/></symbol>\n\n<symbol id="svg-command" viewBox="0 0 640 512">\n <path d="M34.495 36.465l211.051 211.05c4.686 4.686 4.686 12.284 0 16.971L34.495 475.535c-4.686 4.686-12.284 4.686-16.97 0l-7.071-7.07c-4.686-4.686-4.686-12.284 0-16.971L205.947 256 10.454 60.506c-4.686-4.686-4.686-12.284 0-16.971l7.071-7.07c4.686-4.687 12.284-4.687 16.97 0zM640 468v-10c0-6.627-5.373-12-12-12H300c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h328c6.627 0 12-5.373 12-12z"/>\n</symbol>\n\n<symbol id="svg-undo" viewBox="0 0 512 512">\n <path d="M20 8h10c6.627 0 12 5.373 12 12v110.625C85.196 57.047 165.239 7.715 256.793 8.001 393.18 8.428 504.213 120.009 504 256.396 503.786 393.181 392.834 504 256 504c-63.926 0-122.202-24.187-166.178-63.908-5.113-4.618-5.354-12.561-.482-17.433l7.069-7.069c4.503-4.503 11.749-4.714 16.482-.454C150.782 449.238 200.935 470 256 470c117.744 0 214-95.331 214-214 0-117.744-95.331-214-214-214-82.862 0-154.737 47.077-190.289 116H180c6.627 0 12 5.373 12 12v10c0 6.627-5.373 12-12 12H20c-6.627 0-12-5.373-12-12V20c0-6.627 5.373-12 12-12z"/>\n</symbol>\n<symbol id="svg-redo" viewBox="0 0 512 512">\n <path d="M492 8h-10c-6.627 0-12 5.373-12 12v110.625C426.804 57.047 346.761 7.715 255.207 8.001 118.82 8.428 7.787 120.009 8 256.396 8.214 393.181 119.166 504 256 504c63.926 0 122.202-24.187 166.178-63.908 5.113-4.618 5.354-12.561.482-17.433l-7.069-7.069c-4.503-4.503-11.749-4.714-16.482-.454C361.218 449.238 311.065 470 256 470c-117.744 0-214-95.331-214-214 0-117.744 95.331-214 214-214 82.862 0 154.737 47.077 190.289 116H332c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h160c6.627 0 12-5.373 12-12V20c0-6.627-5.373-12-12-12z"/>\n</symbol>\n<symbol id="svg-arrow-left" viewBox="0 0 320 512">\n <path d="M206.7 464.6l-183.1-191.1C18.22 267.1 16 261.1 16 256s2.219-11.97 6.688-16.59l183.1-191.1c9.152-9.594 24.34-9.906 33.9-.7187c9.625 9.125 9.938 24.37 .7187 33.91L73.24 256l168 175.4c9.219 9.5 8.906 24.78-.7187 33.91C231 474.5 215.8 474.2 206.7 464.6z"/>\n</symbol>\n<symbol id="svg-arrow-right" viewBox="0 0 320 512">\n <path d="M113.3 47.41l183.1 191.1c4.469 4.625 6.688 10.62 6.688 16.59s-2.219 11.97-6.688 16.59l-183.1 191.1c-9.152 9.594-24.34 9.906-33.9 .7187c-9.625-9.125-9.938-24.38-.7187-33.91l168-175.4L78.71 80.6c-9.219-9.5-8.906-24.78 .7187-33.91C88.99 37.5 104.2 37.82 113.3 47.41z"/>\n</symbol>\n<symbol id="svg-tab" viewBox="0 0 448 512">\n <path d="M32 217.1c0-8.8 7.2-16 16-16h144v-93.9c0-7.1 8.6-10.7 13.6-5.7l143.5 143.1c6.3 6.3 6.3 16.4 0 22.7L205.6 410.4c-5 5-13.6 1.5-13.6-5.7v-93.9H48c-8.8 0-16-7.2-16-16v-77.7m-32 0v77.7c0 26.5 21.5 48 48 48h112v61.9c0 35.5 43 53.5 68.2 28.3l143.6-143c18.8-18.8 18.8-49.2 0-68L228.2 78.9c-25.1-25.1-68.2-7.3-68.2 28.3v61.9H48c-26.5 0-48 21.6-48 48zM436 64h-8c-6.6 0-12 5.4-12 12v360c0 6.6 5.4 12 12 12h8c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12z"/>\n</symbol>\n<symbol id="svg-paste" viewBox="0 0 512 512"><path d="M160 32c11.6 0 21.3 8.2 23.5 19.2C185 58.6 191.6 64 199.2 64H208c8.8 0 16 7.2 16 16V96H96V80c0-8.8 7.2-16 16-16h8.8c7.6 0 14.2-5.4 15.7-12.8C138.7 40.2 148.4 32 160 32zM64 64h2.7C65 69 64 74.4 64 80V96c0 17.7 14.3 32 32 32H224c17.7 0 32-14.3 32-32V80c0-5.6-1-11-2.7-16H256c17.7 0 32 14.3 32 32h32c0-35.3-28.7-64-64-64H210.6c-9-18.9-28.3-32-50.6-32s-41.6 13.1-50.6 32H64C28.7 32 0 60.7 0 96V384c0 35.3 28.7 64 64 64H192V416H64c-17.7 0-32-14.3-32-32V96c0-17.7 14.3-32 32-32zM288 480c-17.7 0-32-14.3-32-32V192c0-17.7 14.3-32 32-32h96v56c0 22.1 17.9 40 40 40h56V448c0 17.7-14.3 32-32 32H288zM416 165.3L474.7 224H424c-4.4 0-8-3.6-8-8V165.3zM448 512c35.3 0 64-28.7 64-64V235.9c0-12.7-5.1-24.9-14.1-33.9l-59.9-59.9c-9-9-21.2-14.1-33.9-14.1H288c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H448z"/></symbol>\n<symbol id="svg-cut" viewBox="0 0 512 512"><path d="M485.6 444.2L333.6 314.9C326.9 309.2 326.1 299.1 331.8 292.4C337.5 285.6 347.6 284.8 354.4 290.5L506.4 419.8C513.1 425.5 513.9 435.6 508.2 442.4C502.5 449.1 492.4 449.9 485.6 444.2zM485.7 67.76C492.5 62.07 502.5 62.94 508.2 69.69C513.9 76.45 513.1 86.55 506.3 92.24L208.5 343.1C218.3 359.7 224 379.2 224 400C224 461.9 173.9 512 112 512C50.14 512 0 461.9 0 400C0 338.1 50.14 288 112 288C141.5 288 168.4 299.4 188.4 318.1L262.2 256L188.4 193.9C168.4 212.6 141.5 224 112 224C50.14 224 0 173.9 0 112C0 50.14 50.14 0 112 0C173.9 0 224 50.14 224 112C224 132.8 218.3 152.3 208.5 168.9L287 235.1L485.7 67.76zM32 112C32 156.2 67.82 192 112 192C156.2 192 192 156.2 192 112C192 67.82 156.2 32 112 32C67.82 32 32 67.82 32 112zM112 480C156.2 480 192 444.2 192 400C192 355.8 156.2 320 112 320C67.82 320 32 355.8 32 400C32 444.2 67.82 480 112 480z"/></symbol>\n<symbol id="svg-copy" viewBox="0 0 512 512"><path d="M272 416C263.2 416 256 423.2 256 432V448c0 17.67-14.33 32-32 32H64c-17.67 0-32-14.33-32-32V192c0-17.67 14.33-32 32-32h112C184.8 160 192 152.8 192 144C192 135.2 184.8 128 176 128H63.99c-35.35 0-64 28.65-64 64l.0098 256C0 483.3 28.65 512 64 512h160c35.35 0 64-28.65 64-64v-16C288 423.2 280.8 416 272 416zM502.6 86.63l-77.25-77.25C419.4 3.371 411.2 0 402.7 0H288C252.7 0 224 28.65 224 64v256c0 35.35 28.65 64 64 64h160c35.35 0 64-28.65 64-64V109.3C512 100.8 508.6 92.63 502.6 86.63zM416 45.25L466.7 96H416V45.25zM480 320c0 17.67-14.33 32-32 32h-160c-17.67 0-32-14.33-32-32V64c0-17.67 14.33-32 32-32h96l.0026 64c0 17.67 14.33 32 32 32H480V320z"/>\n</symbol>\n<symbol id="svg-angle-double-right" viewBox="0 0 512 512"><path d="M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"/>\n</symbol>\n<symbol id="svg-angle-double-left" viewBox="0 0 512 512"><path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L301.3 256 438.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z"/>\n</symbol>\n<symbol id="svg-trash" viewBox="0 0 448 512">\n <path d="M336 64l-33.6-44.8C293.3 7.1 279.1 0 264 0h-80c-15.1 0-29.3 7.1-38.4 19.2L112 64H24C10.7 64 0 74.7 0 88v2c0 3.3 2.7 6 6 6h26v368c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V96h26c3.3 0 6-2.7 6-6v-2c0-13.3-10.7-24-24-24h-88zM184 32h80c5 0 9.8 2.4 12.8 6.4L296 64H152l19.2-25.6c3-4 7.8-6.4 12.8-6.4zm200 432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V96h320v368zm-176-44V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm-80 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm160 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12z"/>\n</symbol>\n<symbol id="svg-keyboard-down" viewBox="0 0 576 512"><path d="M64 48c-8.8 0-16 7.2-16 16V240c0 8.8 7.2 16 16 16H512c8.8 0 16-7.2 16-16V64c0-8.8-7.2-16-16-16H64zM0 64C0 28.7 28.7 0 64 0H512c35.3 0 64 28.7 64 64V240c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zM159 359c9.4-9.4 24.6-9.4 33.9 0l95 95 95-95c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L305 505c-4.5 4.5-10.6 7-17 7s-12.5-2.5-17-7L159 393c-9.4-9.4-9.4-24.6 0-33.9zm1-167c0-8.8 7.2-16 16-16H400c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V192zM120 88h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H120c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H200c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H280c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H360c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H440c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16z"/></symbol>\n</svg>'+e.normalizedLayouts.map(((t,n)=>function(e,t,n){const i=[];if(!("layers"in t))return"";for(const r of t.layers)i.push(`<div tabindex="-1" class="MLK__layer" id="${r.id}">`),(e.normalizedLayouts.length>1||t.displayEditToolbar)&&(i.push("<div class='MLK__toolbar' role='toolbar'>"),i.push(Gc(e,n)),t.displayEditToolbar&&i.push('<div class="ML__edit-toolbar right"></div>'),i.push("</div>")),i.push(Xc(e,r)),i.push("</div>");return i.join("")}(e,t,n))).join(""));const i=document.createElement("div");i.className="MLK__backdrop",i.appendChild(n),t.appendChild(i),t.addEventListener("pointerdown",nu,{passive:!1});const r=t.querySelectorAll(".ML__edit-toolbar");if(r)for(const t of r)t.addEventListener("click",(t=>{var n,i;let r=t.target,a="";for(;r&&!a;)a=null!=(n=null==r?void 0:r.getAttribute("data-command"))?n:"",r=null!=(i=null==r?void 0:r.parentElement)?i:null;a&&e.executeCommand(JSON.parse(a))}));!function(e){for(const t of e)Wc(t)}(t.querySelectorAll(".MLK__keycap, .action, .fnbutton, .bigfnbutton"));const a=t.querySelectorAll(".MLK__layer");console.assert(a.length>0,"No virtual keyboards available");for(const e of a)e.addEventListener("pointerdown",(e=>e.preventDefault()));return e.currentLayer=e.latentLayer,t}function Xc(e,t){if("string"==typeof t)return t;let n="";if("string"==typeof t.style?n+=`<style>${t.style}</style>`:"object"==typeof t.style&&(n+=`<style>${jc(t.style)}</style>`),t.backdrop&&(n+=`<div class='${t.backdrop}'>`),t.container&&(n+=`<div class='${t.container}'>`),t.rows){n+="<div class=MLK__rows>";for(const i of t.rows){n+="<div dir='ltr' class=MLK__row>";for(const t of i)if(t){const i=e.registerKeycap(t),[r,a]=Jc(t);/(^|\s)separator/.test(a)?n+=`<div class="${a}"`:n+=`<div tabindex="-1" id="${i}" class="${a}"`,t.tooltip&&(n+=` data-tooltip="${t.tooltip}"`),n+=`>${r}</div>`}n+="</div>"}n+="</div>"}else t.markup&&(n+=t.markup);return t.container&&(n+="</div>"),t.backdrop&&(n+="</div>"),n}function Jc(e,t={shifted:!1}){var n,i,r,a,s,o,l;let c="",u=null!=(n=e.class)?n:"";if(t.shifted&&ou(e)&&(u+=" is-active"),t.shifted&&"shift"in e)"string"==typeof e.shift?c=qc(e.shift):"object"==typeof e.shift&&(c=e.shift.label?e.shift.label:null!=(i=qc(e.shift.latex||e.shift.insert||"")||e.shift.key)?i:""),"object"==typeof e.shift&&(u=null!=(a=null!=(r=e.shift.class)?r:e.class)?a:"");else{if(c=e.label?e.label:null!=(s=qc(e.latex||e.insert||"")||e.key)?s:"",e.shift){let t;t="string"==typeof e.shift?qc(e.shift):e.shift.label?e.shift.label:null!=(o=qc(e.shift.latex||e.shift.insert||"")||e.shift.key)?o:"",c+=`<span class="MLK__shift">${t}</span>`}e.aside&&(c+=`<aside>${e.aside}</aside>`)}return e.layer&&!/layer-switch/.test(u)&&(u+=" layer-switch"),/(^|\s)(separator|action|shift|fnbutton|bigfnbutton)($|\s)/.test(u)||(u+=" MLK__keycap"),!/\bw[0-9]+\b/.test(u)&&e.width&&(u+=null!=(l={0:" w0",.5:" w5",1.5:" w15",2:" w20",5:" w50"}[e.width])?l:""),[c,u||"MLK__keycap"]}var Qc,eu={"[left]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-left /></svg>",command:["performWithFeedback","moveToPreviousChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-left /></svg>",command:["performWithFeedback","extendSelectionBackward"]}},"[right]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-right /></svg>",command:["performWithFeedback","moveToNextChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-right /></svg>",command:["performWithFeedback","extendSelectionForward"]}},"[up]":{class:"action hide-shift",label:"↑",command:["performWithFeedback","moveUp"],shift:{label:"↟",command:["performWithFeedback","extendSelectionUpward"]}},"[down]":{class:"action hide-shift",label:"↓",command:["performWithFeedback","moveDown"],shift:{label:"↡",command:["performWithFeedback","extendSelectionDownward"]}},"[return]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[action]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{label:"<svg class=svg-glyph><use xlink:href=#circle-plus /></svg>",command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[hr]":{class:"separator horizontal-rule"},"[hide-keyboard]":{class:"action",command:["hideVirtualKeyboard"],width:1.5,label:"<svg class=svg-glyph-lg><use xlink:href=#svg-keyboard-down /></svg>"},"[.]":{variants:".",command:["performWithFeedback","insertDecimalSeparator"],shift:",",class:"big-op hide-shift",label:"."},"[,]":{variants:",",command:["performWithFeedback","insertDecimalSeparator"],shift:".",class:"big-op hide-shift",label:","},"[+]":{variants:[{latex:"\\sum_{#0}^{#0}",class:"small"},"\\oplus"],latex:"+",label:"+",class:"big-op hide-shift",shift:{latex:"\\sum",insert:"\\sum",class:"small"}},"[-]":{variants:["\\pm","\\ominus"],latex:"-",label:"−",shift:"\\pm",class:"big-op hide-shift"},"[/]":{class:"big-op hide-shift",shift:{class:"",latex:"\\frac{1}{#@}"},variants:["/","\\div","\\%","\\oslash"],latex:"\\frac{#@}{#?}",label:"÷"},"[*]":{variants:[{latex:"\\prod_{#0}^{#0}",class:"small"},"\\otimes","\\cdot"],latex:"\\cdot",label:"×",shift:{latex:"\\times"},class:"big-op hide-shift"},"[=]":{variants:["\\neq","\\equiv","\\varpropto","\\thickapprox","\\lt","\\gt","\\le","\\ge"],latex:"=",label:"=",shift:{label:"≠",latex:"\\ne"},class:"big-op hide-shift"},"[backspace]":{class:"action bottom right hide-shift",width:1.5,command:["performWithFeedback","deleteBackward"],label:"<svg class=svg-glyph><use xlink:href=#svg-delete-backward /></svg>",shift:{class:"action warning",label:"<svg class=svg-glyph><use xlink:href=#svg-trash /></svg>",command:"deleteAll"}},"[undo]":{class:"ghost if-can-undo",command:"undo",label:"<svg class=svg-glyph><use xlink:href=#svg-undo /></svg>",tooltip:"tooltip.undo"},"[redo]":{class:"ghost if-can-redo",command:"redo",label:"<svg class=svg-glyph><use xlink:href=#svg-redo /></svg>",tooltip:"tooltip.redo"},"[(]":{variants:[{latex:"\\lbrack",key:"["},"\\langle","\\lfloor","\\lceil",{latex:"\\lbrace",key:"{"}],key:"(",label:"(",shift:{label:"[",key:"["},class:"hide-shift"},"[)]":{variants:[{latex:"\\rbrack",key:"]"},"\\rangle","\\rfloor","\\rceil",{latex:"\\rbrace",key:"]"}],key:")",label:")",shift:{label:"]",latex:"\\rbrack"},class:"hide-shift"},"[0]":{variants:"0",latex:"0",label:"0",shift:"\\infty",class:"hide-shift"},"[1]":{variants:"1",latex:"1",label:"1",shift:"#@^{-1}",class:"hide-shift"},"[2]":{variants:"2",latex:"2",label:"2",shift:"#@^2",class:"hide-shift"},"[3]":{variants:"3",latex:"3",label:"3",shift:"#@^3",class:"hide-shift"},"[4]":{variants:"4",latex:"4",label:"4",shift:"#@^4",class:"hide-shift"},"[5]":{variants:"5",latex:"5",label:"5",shift:"#@^5",class:"hide-shift"},"[6]":{variants:"6",latex:"6",label:"6",shift:"#@^6",class:"hide-shift"},"[7]":{variants:"7",latex:"7",label:"7",shift:"#@^7",class:"hide-shift"},"[8]":{variants:"8",latex:"8",label:"8",shift:"#@^8",class:"hide-shift"},"[9]":{variants:"9",latex:"9",label:"9",shift:"#@^9",class:"hide-shift"},"[separator-5]":{class:"separator",width:.5},"[separator]":{class:"separator"},"[separator-10]":{class:"separator"},"[separator-15]":{class:"separator",width:1.5},"[separator-20]":{class:"separator",width:2},"[separator-50]":{class:"separator",width:5},"[shift]":{class:"shift bottom left",width:1.5,label:"<span class=caps-lock-indicator></span><svg class=svg-glyph><use xlink:href=#svg-shift /></svg>"},"[foreground-color]":{variants:"foreground-color",command:["applyStyle",{color:"red"}],label:"<span style='border-radius: 50%;width:22px;height:22px; border: 3px solid #cc2428; box-sizing: border-box'>"},"[background-color]":{variants:"background-color",command:["applyStyle",{backgroundColor:"yellow"}],label:"<span style='border-radius: 50%;width:22px;height:22px; background:#fff590; box-sizing: border-box'></span>"}};function tu(e){var t;if("string"==typeof e){if("[.]"===e&&","===window.MathfieldElement.decimalSeparator&&(e="[,]"),!eu[e])return{latex:e};e={label:e}}let n;return"label"in e&&e.label&&eu[e.label]&&(n=d(u(u({},eu[e.label]),e),{label:eu[e.label].label})),"key"in e&&e.key&&eu[e.key]&&(n=d(u(u({},eu[e.key]),e),{key:eu[e.key].key})),n?("insertDecimalSeparator"===n.command&&(n.label=null!=(t=window.MathfieldElement.decimalSeparator)?t:"."),"[action]"===e.label&&(n=u(u({},n),window.mathVirtualKeyboard.actionKeycap)),"[shift]"===e.label&&(n=u(u({},n),window.mathVirtualKeyboard.shiftKeycap)),"[backspace]"===e.label&&(n=u(u({},n),window.mathVirtualKeyboard.backspaceKeycap)),"[tab]"===e.label&&(n=u(u({},n),window.mathVirtualKeyboard.tabKeycap)),n):e}function nu(e){var t;if(0!==e.button)return;const n=lu.singleton;if(!n)return;let i=e.target;for(;i&&!i.getAttribute("data-layer");)i=i.parentElement;if(i)return n.currentLayer=null!=(t=i.getAttribute("data-layer"))?t:"",void e.preventDefault();const r=su(e.target);if(!(null==r?void 0:r.id))return;const a=n.getKeycap(r.id);if(!a)return;console.assert("pointerdown"===e.type);const s=new AbortController,o=s.signal;r.classList.add("is-pressed"),r.addEventListener("pointerenter",iu(s),{capture:!0,signal:o}),r.addEventListener("pointerleave",iu(s),{capture:!0,signal:o}),r.addEventListener("pointercancel",iu(s),{signal:o}),r.addEventListener("pointerup",iu(s),{signal:o}),ou(a)&&(r.classList.add("is-active"),n.shiftPressCount++),a.variants&&(Qc&&clearTimeout(Qc),Qc=setTimeout((()=>{r.classList.contains("is-pressed")&&(r.classList.remove("is-pressed"),r.classList.add("is-active"),e.target&&"releasePointerCapture"in e.target&&e.target.releasePointerCapture(e.pointerId),zc(r,(()=>{s.abort(),null==r||r.classList.remove("is-active")})))}),300)),e.preventDefault()}function iu(e){return t=>{const n=su(t.target);if(!(null==n?void 0:n.id))return;const i=lu.singleton;if(!i)return;const r=i.getKeycap(n.id);if(r){if("pointerenter"===t.type&&t.target===n){t.isPrimary&&n.classList.add("is-pressed")}return"pointercancel"===t.type?(n.classList.remove("is-pressed"),ou(r)&&(i.shiftPressCount--,n.classList.toggle("is-active",i.isShifted)),void e.abort()):"pointerleave"===t.type&&t.target===n?(n.classList.remove("is-pressed"),void(ou(r)&&(i.shiftPressCount--,n.classList.toggle("is-active",i.isShifted)))):"pointerup"===t.type?(Qc&&clearTimeout(Qc),ou(r)?n.classList.toggle("is-active",i.isShifted):n.classList.contains("is-pressed")&&(n.classList.remove("is-pressed"),i.isShifted&&r.shift?"string"==typeof r.shift?i.executeCommand(["insert",r.shift,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]):ru(r.shift):ru(r),1!==i.shiftPressCount||t.shiftKey||(i.shiftPressCount=0)),e.abort(),void t.preventDefault()):void 0}}}function ru(e){var t;let n=e.command;!n&&e.insert&&(n=["insert",e.insert,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),!n&&e.key&&(n=["typedText",e.key,{focus:!0,feedback:!0,simulateKeystroke:!0}]),!n&&e.latex&&(n=["insert",e.latex,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),n||(n=["typedText",e.label,{focus:!0,feedback:!0,simulateKeystroke:!0}]),null==(t=lu.singleton)||t.executeCommand(n)}function au(e){if(1!==e.nodeType)return!1;const t=e.classList;return t.contains("MLK__keycap")||t.contains("shift")||t.contains("action")||t.contains("fnbutton")||t.contains("bigfnbutton")}function su(e){if(!e)return;let t=e;for(;t&&!au(t);)t=t.parentElement;return null!=t?t:void 0}function ou(e){return!!e.class&&/(^|\s)shift($|\s)/.test(e.class)}var lu=class e{constructor(){var e,t,n;this.originalContainerBottomPadding=null,this.keycapRegistry={},this._shiftPressCount=0,this.targetOrigin=window.origin,this.originValidator="none",this._alphabeticLayout="auto",this._layouts=Object.freeze(["default"]),this._editToolbar="default",this._container=null!=(t=null==(e=window.document)?void 0:e.body)?t:null,this._visible=!1,this._rebuilding=!1,this.observer=new ResizeObserver((e=>{this.adjustBoundingRect(),this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect})})),this.listeners={};try{null==(n=window.top)||n.addEventListener("message",this)}catch(e){window.addEventListener("message",this)}document.body.addEventListener("focusin",(e=>{const t=e.target;(null==t?void 0:t.isConnected)&&setTimeout((()=>{const e=cu();e&&!e.readOnly&&"auto"===e.mathVirtualKeyboardPolicy&&("matchMedia"in window?window.matchMedia("(pointer: coarse)").matches:"ontouchstart"in window||navigator.maxTouchPoints>0)&&this.show({animate:!0})}),300)})),document.addEventListener("focusout",(e=>{"manual"!==e.target.mathVirtualKeyboardPolicy&&setTimeout((()=>{cu()||this.hide()}),300)}))}get currentLayer(){var e,t,n;return null!=(n=null==(t=null==(e=this._element)?void 0:e.querySelector(".MLK__layer.is-visible"))?void 0:t.id)?n:""}set currentLayer(e){var t;if(!this._element)return void(this.latentLayer=e);let n=e?this._element.querySelector(`#${e}.MLK__layer`):null;n||(n=this._element.querySelector(".MLK__layer")),n&&(null==(t=this._element.querySelector(".MLK__layer.is-visible"))||t.classList.remove("is-visible"),n.classList.add("is-visible")),this.render()}get shiftPressCount(){return this._shiftPressCount}set shiftPressCount(e){var t;this._shiftPressCount=e>2||e<0?0:e,null==(t=this._element)||t.classList.toggle("is-caps-lock",2===this.shiftPressCount),this.render()}get isShifted(){return this._shiftPressCount>0}resetKeycapRegistry(){this.keycapRegistry={}}registerKeycap(e){const t="ML__k"+Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36);return this.keycapRegistry[t]=e,t}getKeycap(e){return e?this.keycapRegistry[e]:void 0}getLayer(e){const t=this.normalizedLayouts;for(const n of t)for(const t of n.layers)if(t.id===e)return t}get alphabeticLayout(){return this._alphabeticLayout}set alphabeticLayout(e){this._alphabeticLayout=e,this.rebuild()}get actionKeycap(){return this._actionKeycap}set actionKeycap(e){this._actionKeycap="string"==typeof e?{label:e}:e}get shiftKeycap(){return this._shiftKeycap}set shiftKeycap(e){this._shiftKeycap="string"==typeof e?{label:e}:e}get backspaceKeycap(){return this._backspaceKeycap}set backspaceKeycap(e){this._backspaceKeycap="string"==typeof e?{label:e}:e}get tabKeycap(){return this._tabKeycap}set tabKeycap(e){this._tabKeycap="string"==typeof e?{label:e}:e}get layouts(){return this._layouts}set layouts(e){this.updateNormalizedLayouts(e),this.rebuild()}updateNormalizedLayouts(e){const t=Array.isArray(e)?[...e]:[e],n=t.findIndex((e=>"default"===e));n>=0&&t.splice(n,1,"numeric","symbols","alphabetic","greek"),this._layouts=Object.freeze(t),this._normalizedLayouts=t.map((e=>Vc(e)))}get normalizedLayouts(){return this._normalizedLayouts||this.updateNormalizedLayouts(this._layouts),this._normalizedLayouts}get editToolbar(){return this._editToolbar}set editToolbar(e){this._editToolbar=e,this.rebuild()}get container(){return this._container}set container(e){this._container=e,this.rebuild()}static get singleton(){if(void 0===this._singleton)try{this._singleton=new e}catch(e){this._singleton=null}return this._singleton}get style(){return this._style}addEventListener(e,t,n){this.listeners[e]||(this.listeners[e]=new Set),this.listeners[e].has(t)||this.listeners[e].add(t)}dispatchEvent(e){return!this.listeners[e.type]||0===this.listeners[e.type].size||(this.listeners[e.type].forEach((t=>{"function"==typeof t?t(e):null==t||t.handleEvent(e)})),!e.defaultPrevented)}removeEventListener(e,t,n){this.listeners[e]&&this.listeners[e].delete(t)}get element(){return this._element}set element(e){var t;this._element!==e&&(null==(t=this._element)||t.remove(),this._element=e)}get visible(){return this._visible}set visible(e){e?this.show():this.hide()}get boundingRect(){var e;if(!this._visible)return new DOMRect;const t=null==(e=this._element)?void 0:e.getElementsByClassName("MLK__plate")[0];return t?t.getBoundingClientRect():new DOMRect}adjustBoundingRect(){var e,t;const n=this.boundingRect.height;if(this.container===document.body){null==(e=this._element)||e.style.setProperty("--_keyboard-height",`calc(${n}px + var(--_padding-top) + var(--_padding-bottom) + env(safe-area-inset-bottom, 0))`);const t=n-1;this.container.style.paddingBottom=this.originalContainerBottomPadding?`calc(${this.originalContainerBottomPadding} + ${t}px)`:`${t}px`}else null==(t=this._element)||t.style.setProperty("--_keyboard-height",`${n}px`)}rebuild(){if(this._rebuilding||!this._element)return;this._rebuilding=!0;const e=this.currentLayer;requestAnimationFrame((()=>{this._rebuilding=!1,this._element&&(this._element.remove(),this._element=void 0),this.visible&&(this.buildAndAttachElement(),this.currentLayer=e,this.render(),this.adjustBoundingRect(),this._element.classList.add("is-visible"))}))}render(){if(!this._element)return;const e=this.getLayer(this.currentLayer);this._element.classList.toggle("backdrop-is-transparent",Boolean(e&&(e.backdrop||e.container)));const t=this._element.querySelectorAll(".MLK__layer.is-visible .MLK__keycap, .MLK__layer.is-visible .action, .fnbutton, .MLK__layer.is-visible .bigfnbutton, .MLK__layer.is-visible .shift");if(t)for(const e of t){const t=this.getKeycap(e.id);if(t){const[n,i]=Jc(t,{shifted:this.isShifted});e.innerHTML=window.MathfieldElement.createHTML(n),e.className=i}}}show(e){var t;if(this._visible)return;const n=this.container;if(n&&window.mathVirtualKeyboard&&this.stateWillChange(!0)){if(this._element||(this.buildAndAttachElement(),this.adjustBoundingRect()),!this._visible){const e=this._element.getElementsByClassName("MLK__plate")[0];if(e&&this.observer.observe(e),n===window.document.body){const t=n.style.paddingBottom;this.originalContainerBottomPadding=t;const i=e.offsetHeight-1;n.style.paddingBottom=t?`calc(${t} + ${i}px)`:`${i}px`}window.addEventListener("mouseup",this),window.addEventListener("blur",this),window.addEventListener("keydown",this,{capture:!0}),window.addEventListener("keyup",this,{capture:!0}),null==(t=this._element)||t.classList.toggle("is-caps-lock",2===this.shiftPressCount),this.currentLayer=this.latentLayer}this._visible=!0,(null==e?void 0:e.animate)?requestAnimationFrame((()=>{this._element&&(this._element.classList.add("animate"),this._element.addEventListener("transitionend",(()=>{var e;return null==(e=this._element)?void 0:e.classList.remove("animate")}),{once:!0}),this._element.classList.add("is-visible"),this.stateChanged())})):(this._element.classList.add("is-visible"),this.stateChanged())}}hide(e){var t;const n=this.container;if(n&&this._visible&&this.stateWillChange(!1)){if(this._visible=!1,this._element){this.latentLayer=this.currentLayer;const e=this._element.getElementsByClassName("MLK__plate")[0];e&&this.observer.unobserve(e),window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("keydown",this,{capture:!0}),window.removeEventListener("keyup",this,{capture:!0}),window.removeEventListener("contextmenu",this,{capture:!0}),Kc(),fo("core"),fo("virtual-keyboard"),null==(t=this._element)||t.remove(),this._element=void 0,null!==this.originalContainerBottomPadding&&(n.style.paddingBottom=this.originalContainerBottomPadding)}this.stateChanged()}}get height(){var e,t;return null!=(t=null==(e=this.element)?void 0:e.offsetHeight)?t:0}buildAndAttachElement(){var e;console.assert(!this.element),this.element=Yc(this),window.addEventListener("contextmenu",this,{capture:!0}),this.element.addEventListener("contextmenu",(e=>{e.shiftKey||((e.ctrlKey||2===e.button)&&zc(e.target),e.preventDefault(),e.stopPropagation())}),{capture:!0}),null==(e=this.container)||e.appendChild(this.element)}handleEvent(e){if(Oc(e)){if(!so(e.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${e.origin}) cannot be handled`,"SecurityError");"disconnect"===e.data.action?this.connectedMathfieldWindow=void 0:"update-setting"!==e.data.action&&"proxy-created"!==e.data.action&&"execute-command"!==e.data.action&&(console.assert(void 0!==e.source),this.connectedMathfieldWindow=e.source),this.handleMessage(e.data,e.source)}if(this._element)switch(e.type){case"mouseup":case"blur":document.body.style.userSelect="",this.shiftPressCount=0;break;case"contextmenu":2!==e.button&&e.preventDefault();break;case"keydown":"Shift"!==e.key||e.repeat||(this.shiftPressCount=1);break;case"keyup":("Shift"===e.key||!e.getModifierState("Shift")&&2!==this.shiftPressCount)&&(this.shiftPressCount=0)}}handleMessage(e,t){const{action:n}=e;if("execute-command"!==n){if("connect"!==n&&"show"!==n||this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},t),"disconnect"!==n&&window===window.top)if("show"!==n){if("hide"!==n)return"update-setting"===n?(e.alphabeticLayout&&(this.alphabeticLayout=e.alphabeticLayout),e.layouts&&(this.layouts=e.layouts),void(e.editToolbar&&(this.editToolbar=e.editToolbar))):void("proxy-created"!==n||this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},t));void 0!==e.animate?this.hide({animate:e.animate}):this.hide()}else void 0!==e.animate?this.show({animate:e.animate}):this.show()}else{const{command:t}=e,n=Rc(t);if(void 0!==window.top&&"virtual-keyboard"!==n)return;this.executeCommand(t)}}sendMessage(e,t,n){if(n||(n=this.connectedMathfieldWindow),null!==this.targetOrigin&&"null"!==this.targetOrigin&&n!==window){if(n)n.postMessage(u({type:Pc,action:e},t),{targetOrigin:this.targetOrigin});else if(t.command&&this.dispatchEvent(new CustomEvent("math-virtual-keyboard-command",{detail:t.command})),"execute-command"===e&&Array.isArray(t.command)&&"insert"===t.command[0]){const e=t.command[1].split("");for(const t of e)this.dispatchEvent(new KeyboardEvent("keydown",{key:t,bubbles:!0})),this.dispatchEvent(new KeyboardEvent("keyup",{key:t,bubbles:!0}))}}else window.dispatchEvent(new MessageEvent("message",{source:window,data:u({type:Pc,action:e},t)}))}stateWillChange(e){return this.dispatchEvent(new CustomEvent("before-virtual-keyboard-toggle",{detail:{visible:e},bubbles:!0,cancelable:!0,composed:!0}))}stateChanged(){this.dispatchEvent(new Event("virtual-keyboard-toggle")),this._visible||(this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect}))}focus(){this.sendMessage("focus",{})}blur(){this.sendMessage("blur",{})}updateToolbar(e){const t=this._element;if(!t)return;t.classList.toggle("is-math-mode","math"===e.mode),t.classList.toggle("is-text-mode","text"===e.mode),t.classList.toggle("can-undo",e.canUndo),t.classList.toggle("can-redo",e.canRedo),t.classList.toggle("can-copy",!e.selectionIsCollapsed),t.classList.toggle("can-copy",!e.selectionIsCollapsed),t.classList.toggle("can-paste",!0);const n=t.querySelectorAll(".ML__edit-toolbar");if(n)for(const t of n)t.innerHTML=Zc(this,e)}update(e){this._style=e.style,this.updateToolbar(e)}connect(){this.connectedMathfieldWindow=window}disconnect(){this.connectedMathfieldWindow=void 0}executeCommand(e){let t,n=[],i=Rc(e);return f(e)?(t=e[0],"performWithFeedback"===t&&(i=Rc(e=e.slice(1))),n=e.slice(1)):t=e,t=t.replace(/-\w/g,(e=>e[1].toUpperCase())),"virtual-keyboard"===i?Lc[t].fn(void 0,...n):(this.sendMessage("execute-command",{command:e}),!1)}dispose(){window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("message",this)}};function cu(){var e,t;let n=Jl(),i=null;for(;n;){if("host"in n&&"math-field"===(null==(t=null==(e=n.host)?void 0:e.tagName)?void 0:t.toLowerCase())){i=n.host;break}n=n.parentNode}return i}if(m()&&!("mathVirtualKeyboard"in window))if(window===window.top){const e=lu.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>e})}else Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>Bc.singleton,configurable:!0});function uu(e){const t={};for(const n of Object.keys(e))switch(n){case"scriptDepth":const i=e.scriptDepth;if(f(i))t.scriptDepth=[i[0],i[1]];else if("number"==typeof i)t.scriptDepth=[i,i];else{if("string"!=typeof i)throw new TypeError("Unexpected value for scriptDepth");{const[e,n]=i.split(",").map((e=>parseInt(e.trim())));t.scriptDepth=[e,n]}}break;case"mathVirtualKeyboardPolicy":let r=e.mathVirtualKeyboardPolicy.toLowerCase();if("sandboxed"===r){if(window!==window.top){const e=lu.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>e})}r="manual"}t.mathVirtualKeyboardPolicy=r;break;case"letterShapeStyle":"auto"===e.letterShapeStyle?y.locale.startsWith("fr")?t.letterShapeStyle="french":t.letterShapeStyle="tex":t.letterShapeStyle=e.letterShapeStyle;break;case"defaultMode":["text","math","inline-math"].includes(e.defaultMode)?t.defaultMode=e.defaultMode:(console.error('MathLive 0.98.5: valid values for defaultMode are "text", "math" or "inline-math"'),t.defaultMode="math");break;case"macros":t.macros=ae(e.macros);break;default:f(e[n])?t[n]=[...e[n]]:"object"!=typeof e[n]||e[n]instanceof Element||"computeEngine"===n?t[n]=e[n]:t[n]=u({},e[n])}return t}function du(e,t){let n;n="string"==typeof t?[t]:void 0===t?Object.keys(e):t;const i={};for(const t of n)null===e[t]?i[t]=null:f(e[t])?i[t]=[...e[t]]:"object"!=typeof e[t]||e[t]instanceof Element||"computeEngine"===t?i[t]=e[t]:i[t]=u({},e[t]);return"string"==typeof t?i[t]:i}function hu(){return{readOnly:!1,defaultMode:"math",macros:{},registers:{},colorMap:T,backgroundColorMap:A,letterShapeStyle:y.locale.startsWith("fr")?"french":"tex",minFontScale:0,smartMode:!1,smartFence:!0,smartSuperscript:!0,scriptDepth:[1/0,1/0],removeExtraneousParentheses:!0,isImplicitFunction:e=>["\\sin","\\cos","\\tan","\\arcsin","\\arccos","\\arctan","\\arcsec","\\arccsc","\\arsinh","\\arcosh","\\artanh","\\arcsech","\\arccsch","\\arg","\\ch","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\sec","\\sinh","\\sh","\\tanh","\\tg","\\th","\\lg","\\lb","\\log","\\ln"].includes(e),mathModeSpace:"",placeholderSymbol:"▢",contentPlaceholder:"",popoverPolicy:"auto",environmentPopoverPolicy:"off",keybindings:Xs,inlineShortcuts:Ks,inlineShortcutTimeout:0,mathVirtualKeyboardPolicy:"auto",virtualKeyboardTargetOrigin:null==window?void 0:window.origin,originValidator:"none",onInlineShortcut:()=>"",onScrollIntoView:null,onExport:Zs,value:""}}function pu(e){return"inline-math"===e.defaultMode?"math":e.defaultMode}function fu(e,t){e&&t&&(f(e)?e.forEach((e=>fu(e,t))):"object"==typeof e&&(e.style.color||e.style.backgroundColor||e.style.fontFamily||e.style.fontShape||e.style.fontSeries||e.style.fontSize||e.style.variant||e.style.variantStyle||(e.applyStyle(t),fu(e.body,t),fu(e.above,t),fu(e.below,t),fu(e.subscript,t),fu(e.superscript,t))))}function mu(e,t,n,i){function r(e,t){for(const n of a)if(n.style[e]!==t)return!1;return!0}if((t=e.normalizeRange(t))[0]===t[1])return!1;const a=e.getAtoms(t,{includeChildren:!0});"toggle"===i.operation&&(n.color&&r("color",n.color)&&(n.color="none",delete n.verbatimColor),n.backgroundColor&&r("backgroundColor",n.backgroundColor)&&(n.backgroundColor="none",delete n.verbatimBackgroundColor),n.fontFamily&&r("fontFamily",n.fontFamily)&&(n.fontFamily="none"),n.fontSeries&&r("fontSeries",n.fontSeries)&&(n.fontSeries="auto"),n.fontShape&&r("fontShape",n.fontShape)&&(n.fontShape="auto"),n.fontSize&&r("fontSize",n.fontSize)&&(n.fontSize=5),n.variant&&r("variant",n.variant)&&(n.variant="normal"),n.variantStyle&&r("variantStyle",n.variantStyle)&&(n.variantStyle=""));for(const e of a)e.applyStyle(n);return!0}function gu(e,t=1){return function(e){for(const t of e)for(const e of t)if(e.length>0)return!1;return!0}(e)?Array(t).fill([[new Ds({type:"first"}),new Do]]):e.map((e=>0===e.length?[[new Ds({type:"first"})]]:e.map((e=>0===e.length?[new Ds({type:"first"})]:("first"!==e[0].type&&e.unshift(new Ds({type:"first"})),e)))))}function vu(e,t=[[[]]],n=[],i=[]){switch(t=gu(t,["split","align","align*","aligned","eqnarray"].includes(e)?2:1),e){case"math":case"displaymath":return new Bo(e,t,n,{mathstyleName:"textstyle"});case"center":return new Bo(e,t,n,{columns:[{align:"c"}]});case"multline":case"multline*":return new Bo(e,t,n,{columns:[{align:"m"}],leftDelim:".",rightDelim:"."});case"split":return new Bo(e,t,n,{columns:[{align:"r"},{align:"l"}],minColumns:2});case"gather":case"gathered":return new Bo(e,t,n,{columns:[{gap:.25},{align:"c"},{gap:0}]});case"pmatrix":case"pmatrix*":return new Bo(e,t,n,{mathstyleName:"textstyle",leftDelim:"(",rightDelim:")",columns:bu(i[0])});case"bmatrix":case"bmatrix*":return new Bo(e,t,n,{mathstyleName:"textstyle",leftDelim:"[",rightDelim:"]",columns:bu(i[0])});case"Bmatrix":case"Bmatrix*":return new Bo(e,t,n,{mathstyleName:"textstyle",leftDelim:"\\lbrace",rightDelim:"\\rbrace",columns:bu(i[0])});case"vmatrix":case"vmatrix*":return new Bo(e,t,n,{mathstyleName:"textstyle",leftDelim:"\\vert",rightDelim:"\\vert",columns:bu(i[0])});case"Vmatrix":case"Vmatrix*":return new Bo(e,t,n,{mathstyleName:"textstyle",leftDelim:"\\Vert",rightDelim:"\\Vert",columns:bu(i[0])});case"matrix":case"matrix*":return new Bo(e,t,n,{mathstyleName:"textstyle",leftDelim:".",rightDelim:".",columns:bu(null==i?void 0:i[0])});case"smallmatrix":case"smallmatrix*":return new Bo(e,t,n,{mathstyleName:"scriptstyle",columns:bu(null==i?void 0:i[0]),colSeparationType:"small",arraystretch:.5});case"cases":case"dcases":return new Bo(e,t,n,{mathstyleName:"dcases"===e?"displaystyle":"textstyle",arraystretch:1.2,leftDelim:"\\lbrace",rightDelim:".",columns:[{align:"l"},{gap:1},{align:"l"}]});case"rcases":return new Bo(e,t,n,{arraystretch:1.2,leftDelim:".",rightDelim:"\\rbrace",columns:[{align:"l"},{gap:1},{align:"l"}]});case"lines":return new Bo(e,t,n,{leftDelim:".",rightDelim:".",columns:[{align:"l"}]});case"align":case"align*":case"aligned":case"eqnarray":{let i=0;for(const e of t)i=Math.max(i,e.length);const r=[{gap:0},{align:"r"},{gap:.25},{align:"l"}];let a=2;for(;a<i;)r.push({gap:1},{align:"r"},{gap:.25},{align:"l"}),a+=2;return r.push({gap:0}),new Bo(e,t,n,{arraycolsep:0,columns:r,minColumns:2})}}return new Bo(e,t,n,{mathstyleName:"textstyle"})}function bu(e){return null!=e?e:[{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"}]}function yu(e,t,n){const i=e.getCell(t,n);return!(!i||2!==i.length)&&"placeholder"===i[1].type}function _u(e,t,n,i){const r=function(e,t,n,i){const r=t.getCell(n,i);return r?[e.offsetOf(r[0]),e.offsetOf(r[r.length-1])]:-1}(e,t,n,i);"number"!=typeof r&&e.setSelection(r)}function wu(e,t,n,i,r){const a=t.getCell(n,i);a&&e.setPositionHandlingPlaceholder(e.offsetOf(a["start"===r?0:a.length-1]))}function xu(e,t){const[n,[i,r]]=function(e,t){let n=e.at(e.position);for(;n&&!(n.parent instanceof Bo);)n=n.parent;n&&"array"===n.type&&n.environmentName;if(!(n&&n.parent instanceof Bo)){const i=e.at(e.position);if(n=i,!n.parent.parent){let n,r=e.extractAtoms([e.position,e.lastOffset]),a=e.extractAtoms([0,e.position]);return 0===a.length&&(a=Tu()),0===r.length&&(r=Tu()),t.endsWith("column")?(n=vu("split",[[a,r]]),e.root=n,yu(n,0,0)?_u(e,n,0,0):yu(n,0,1)?_u(e,n,0,1):e.position=e.offsetOf(i)):(n=vu("lines",[[a],[r]]),e.root=n,yu(n,0,0)?_u(e,n,0,0):yu(n,1,0)?_u(e,n,1,0):e.position=e.offsetOf(i)),[void 0,[0,0]]}if(n.parent instanceof Ho){const i=n.parent;let r=e.extractAtoms([e.position,e.offsetOf(i.lastChild)]),a=e.extractAtoms([e.offsetOf(i.firstChild),e.position]);0===a.length&&(a=Tu()),0===r.length&&(r=Tu());let s="pmatrix";const o=i.leftDelim,l=i.rightDelim;"("!==o||")"!==l&&"?"!==l?"["!==o&&"\\lbrack"!==o||"]"!==l&&"\\rbrack"!==l&&"?"!==l?"\\vert"===o&&"\\vert"===l?s="vmatrix":"\\Vert"===o&&"\\Vert"===l?s="Vmatrix":"{"!==o&&"\\lbrace"!==o||"."!==l&&"?"!==l||(s="cases"):s="bmatrix":s="pmatrix";const c=vu(s,t.endsWith("column")?[[a,r]]:[[a],[r]]);return i.parent.addChildBefore(c,i),i.parent.removeChild(i),yu(c,0,0)?_u(e,c,0,0):t.endsWith("column")?yu(c,0,1)?_u(e,c,0,1):e.position=e.offsetOf(n):yu(c,1,0)?_u(e,c,1,0):e.position=e.offsetOf(n),[void 0,[0,0]]}}return n&&n.parent instanceof Bo?[n.parent,n.parentBranch]:[void 0,[0,0]]}(e,t);if(n)switch(t){case"after row":n.addRowAfter(i),wu(e,n,i+1,0,"end");break;case"after column":if(n.maxColumns<=n.colCount)return void e.announce("plonk");n.addColumnAfter(r),wu(e,n,i,r+1,"end");break;case"before row":n.addRowBefore(i),wu(e,n,i,0,"start");break;case"before column":if(n.maxColumns<=n.colCount)return void e.announce("plonk");n.addColumnBefore(r),wu(e,n,i,r,"start")}}function ku(e){return!!e.contentWillChange({inputType:"insertText"})&&(xu(e,"after row"),e.contentDidChange({inputType:"insertText"}),!0)}function Su(e){return!!e.contentWillChange({inputType:"insertText"})&&(xu(e,"after column"),e.contentDidChange({inputType:"insertText"}),!0)}function Eu(e,t){if(!e.contentWillChange({}))return!1;e.mathfield.snapshot();let n=".",i=".";switch(t){case"pmatrix":case"pmatrix*":n="(",i=")";break;case"bmatrix":case"bmatrix*":n="[",i="]";break;case"Bmatrix":case"Bmatrix*":n="\\lbrace",i="\\rbrace";break;case"vmatrix":case"vmatrix*":n="\\vert",i="\\vert";break;case"Vmatrix":case"Vmatrix*":n="\\Vert",i="\\Vert";break;case"matrix":case"matrix*":n=".",i=".";break;case"cases":case"dcases":n="\\lbrace";break;case"rcases":i="\\rbrace"}const r=e.at(e.position),a="array"===r.type?r:e.parentEnvironment;return a.environmentName=t,a.leftDelim=n,a.rightDelim=i,e.contentDidChange({}),!0}function Cu(e,t){let n=e.at(e.position);for(;n&&!(Array.isArray(n.parentBranch)&&n.parent instanceof Bo);)n=n.parent;if(Array.isArray(null==n?void 0:n.parentBranch)&&(null==n?void 0:n.parent)instanceof Bo){const i=n.parent,r=n.parentBranch;let a;switch(t){case"row":if(i.rowCount>1){i.removeRow(r[0]);const t=i.getCell(Math.max(0,r[0]-1),r[1]);a=e.offsetOf(t[t.length-1])}break;case"column":if(i.colCount>i.minColumns){i.removeColumn(r[1]);const t=i.getCell(r[0],Math.max(0,r[1]-1));a=e.offsetOf(t[t.length-1])}}a&&e.setPositionHandlingPlaceholder(a)}}function Tu(){return[new Do]}ee(["math","displaymath"],vu),ee("center",vu),ne("displaylines","",{parse:e=>{const t=[];let n=[];for(e.beginContext({tabular:!0});;){if(e.end())break;if(e.match("<}>"))break;e.matchColumnSeparator()||e.matchRowSeparator()?(t.push([n]),n=[]):n.push(...e.scan((e=>["<}>","&","\\cr","\\\\","\\tabularnewline"].includes(e))))}return e.endContext(),t.push([n]),t},createAtom:e=>new Bo("lines",e.args,[],{leftDelim:".",rightDelim:".",columns:[{align:"l"}]})}),te("array","{columns:colspec}",((e,t,n,i)=>new Bo(e,gu(t),n,{columns:i[0],mathstyleName:"textstyle"}))),te(["equation","equation*","subequations"],"",((e,t,n)=>new Bo(e,gu(t),n,{columns:[{align:"c"}]}))),te(["multline","multline*"],"",vu),te(["align","align*","aligned","eqnarray"],"",vu),te("split","",vu),te(["gather","gathered"],"",vu),te(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],"[columns:colspec]",vu),te(["smallmatrix","smallmatrix*"],"[columns:colspec]",vu),te(["cases","dcases","rcases"],"",vu),Dc({addRowAfter:ku,addColumnAfter:Su,addRowBefore:function(e){return!!e.contentWillChange({inputType:"insertText"})&&(xu(e,"before row"),e.contentDidChange({inputType:"insertText"}),!0)},addColumnBefore:function(e){return!!e.contentWillChange({inputType:"insertText"})&&(xu(e,"before column"),e.contentDidChange({inputType:"insertText"}),!0)},removeRow:function(e){return!!e.contentWillChange({inputType:"deleteContent"})&&(Cu(e,"row"),e.contentDidChange({inputType:"deleteContent"}),!0)},removeColumn:function(e){return!!e.contentWillChange({inputType:"deleteContent"})&&(Cu(e,"column"),e.contentDidChange({inputType:"deleteContent"}),!0)},setEnvironment:Eu},{target:"model",canUndo:!0,changeContent:!0,changeSelection:!0});var Au=class e{constructor(e){this.recording=!1,this.model=e,this.reset()}reset(){this.stack=[],this.index=-1,this.lastOp=""}startRecording(){this.recording=!0}stopRecording(){this.recording=!1}canUndo(){return this.index-1>=0}canRedo(){return this.stack.length-1>this.index}stopCoalescing(e){e&&this.index>=0&&(this.stack[this.index].selection=e),this.lastOp=""}undo(){return!!this.canUndo()&&(this.model.setState(this.stack[this.index-1],{silenceNotifications:!1,type:"undo"}),this.index-=1,this.lastOp="",!0)}redo(){return!!this.canRedo()&&(this.index+=1,this.model.setState(this.stack[this.index],{silenceNotifications:!1,type:"redo"}),this.lastOp="",!0)}pop(){this.canUndo()&&(this.stack.splice(this.index,this.stack.length-this.index),this.index-=1)}snapshot(t){return!!this.recording&&(t&&t===this.lastOp&&this.pop(),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push(this.model.getState()),this.index+=1,this.stack.length>e.maximumDepth&&(this.stack.shift(),this.index-=1),this.lastOp=null!=t?t:"",!0)}};Au.maximumDepth=1e3;var Mu=Au;function Lu(e,t,n){if("text"!==e.at(t).mode)return t;const i="backward"===n?-1:1;let r;if(F.test(e.at(t).value)){let n,a=t;do{n="text"===e.at(a).mode&&F.test(e.at(a).value),a+=i}while(e.at(a)&&n);r=e.at(a)?a-2*i:a-i}else if(/\s/.test(e.at(t).value)){let n=t;for(;e.at(n)&&"text"===e.at(n).mode&&/\s/.test(e.at(n).value);)n+=i;if(e.at(n)){let t=!0;do{t="text"===e.at(n).mode&&!/\s/.test(e.at(n).value),n+=i}while(e.at(n)&&t);r=e.at(n)?n-2*i:n-i}else r=n-i}else{let n=t;for(;e.at(n)&&"text"===e.at(n).mode&&!/\s/.test(e.at(n).value);)n+=i;r=e.at(n)?n:n-i;let a=!0;for(;e.at(n)&&a;)a="text"===e.at(n).mode&&/\s/.test(e.at(n).value),a&&(r=n),n+=i;r=e.at(n)?n-2*i:n-i}return r-(i>0?0:1)}function Du(e,t,n){var i,r,a,s,o,l,c;const u=e.position;null!=(i=null==n?void 0:n.extend)&&i||e.collapseSelection(t);let d=e.at(e.position);if("forward"===t&&("subsup"===d.type?(d=d.rightSibling,d||(d=e.at(e.position+1))):d=e.at(e.position+1)),!d)return e.announce("plonk"),!1;let h=e.offsetOf(d);if(d instanceof Ps)h=Lu(e,h,t);else if(d instanceof ul)if(d.isSuggestion)for(console.assert("forward"===t);d&&d instanceof ul;)d.isSuggestion=!1,h=e.offsetOf(d),d=d.rightSibling;else if("forward"===t){if(d=d.rightSibling,!(d&&d instanceof ul))return e.announce("plonk"),!1;for(;d&&d instanceof ul&&/[a-zA-Z\*]/.test(d.value);)h=e.offsetOf(d),d=d.rightSibling}else{if(d=d.leftSibling,!(d&&d instanceof ul))return e.announce("plonk"),!1;for(;d&&d instanceof ul&&/[a-zA-Z\*]/.test(d.value);)h=e.offsetOf(d),d=d.leftSibling}else if("forward"===t&&"mopen"===d.type){let t=0;do{"mopen"===d.type?t+=1:"mclose"===d.type&&(t-=1),d=d.rightSibling}while(!d.isLastSibling&&0!==t);h=e.offsetOf(d.leftSibling)}else if("backward"===t&&"mclose"===d.type){let t=0;do{"mopen"===d.type?t+=1:"mclose"===d.type&&(t-=1),d=d.leftSibling}while(!d.isFirstSibling&&0!==t);h=e.offsetOf(d)}else if("backward"===t)if("first"===d.type)for(;h>0&&"first"===d.type;)h-=1,d=e.at(h);else{const t=d.type;"subsup"===d.type&&(h=e.offsetOf(e.at(h).leftSibling)),h-=1;let n=null==(r=e.at(h))?void 0:r.type;for(;h>=0&&n===t;)"subsup"===(null==(a=e.at(h))?void 0:a.type)?h=e.offsetOf(e.at(h).leftSibling):h-=1,n=e.at(h).type}else{const{type:t}=d;let n=null==(s=e.at(h))?void 0:s.type;const{lastOffset:i}=e;for(;h<=i&&(n===t||"subsup"===n);){for(;"subsup"===(null==(o=e.at(h).rightSibling)?void 0:o.type);)h=e.offsetOf(e.at(h).rightSibling);h+=1,n=null==(l=e.at(h))?void 0:l.type}h-=1}if(null!=(c=null==n?void 0:n.extend)&&c){if(!e.setSelection(e.anchor,h))return e.announce("plonk"),!1}else{if(h===e.position)return e.announce("plonk"),!1;e.position=h}return e.announce("move",u),e.mathfield.stopCoalescingUndo(),!0}function Iu(e,t,n){var i,r;if(n=null!=n?n:{extend:!1},e.mathfield.adoptStyle="backward"===t?"right":"left","forward"!==t){const[t,n]=oc(e);void 0!==t&&void 0!==n&&e.deleteAtoms([t,n])}if("upward"===t)return function(e,t){var n,i;const r=null!=(n=null==t?void 0:t.extend)&&n;r||e.collapseSelection("backward");const a=()=>{var t,n;let i=!0;return e.silenceNotifications||(i=null==(n=null==(t=e.mathfield.host)?void 0:t.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"upward"},cancelable:!0,bubbles:!0,composed:!0})))||n),e.announce(i?"plonk":"line"),i},s=e.at(e.position);let o=s;for(;o&&"below"!==o.parentBranch&&!(Array.isArray(o.parentBranch)&&o.parent instanceof Bo);)o=o.parent;if(Array.isArray(null==o?void 0:o.parentBranch)&&o.parent instanceof Bo){const t=o.parent;if(o.parentBranch[0]<1)return a();const n=o.parentBranch[0]-1,i=t.array[n][o.parentBranch[1]];if(!i.some((e=>"prompt"===e.type&&!e.captureSelection))&&e.mathfield.hasEditablePrompts)return a();Ou(e,s,i,r,"up")}else{if(!o)return a();{const t=null!=(i=o.parent.branch("above"))?i:o.parent.createBranch("above");if(!t.some((e=>"prompt"===e.type&&e.placeholderId))&&e.mathfield.hasEditablePrompts)return a();Ou(e,s,t,r,"up")}}return e.mathfield.stopCoalescingUndo(),!0}(e,n);if("downward"===t)return function(e,t){var n,i;const r=null!=(n=null==t?void 0:t.extend)&&n;r||e.collapseSelection("forward");const a=()=>{var t,n;let i=!0;return e.silenceNotifications||(i=null==(n=null==(t=e.mathfield.host)?void 0:t.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"downward"},cancelable:!0,bubbles:!0,composed:!0})))||n),e.announce(i?"plonk":"line"),i},s=e.at(e.position);let o=s;for(;o&&"above"!==o.parentBranch&&!(Array.isArray(o.parentBranch)&&o.parent instanceof Bo);)o=o.parent;if(Array.isArray(null==o?void 0:o.parentBranch)&&o.parent instanceof Bo){const t=o.parent;if(o.parentBranch[0]+1>t.array.length-1)return a();const n=o.parentBranch[0]+1,i=t.array[n][o.parentBranch[1]];if(!i.some((e=>"prompt"===e.type&&!e.captureSelection))&&e.mathfield.hasEditablePrompts)return a();Ou(e,s,i,r,"down")}else{if(!o)return a();{const t=null!=(i=o.parent.branch("below"))?i:o.parent.createBranch("below");if(!t.some((e=>"prompt"===e.type))&&e.mathfield.hasEditablePrompts)return a();Ou(e,s,t,r,"down")}}return!0}(e,n);if(n.extend){let n=Ru(e,e.position,t);n<0&&(n=0),n>e.lastOffset&&(n=e.lastOffset);const i=e.setSelection(e.anchor,n);return e.mathfield.stopCoalescingUndo(),i}if(e.selectionIsPlaceholder){e.collapseSelection(t);const n=Iu(e,t);return e.mathfield.stopCoalescingUndo(),n}let a=e.position;const s=a;if(e.collapseSelection(t)?(a=e.position,Pu(e,a)||(a=Ru(e,a,t))):a=Ru(e,a,t),a<0||a>e.lastOffset){let n=!0;return e.silenceNotifications||(n=null==(r=null==(i=e.mathfield.host)?void 0:i.dispatchEvent(new CustomEvent("move-out",{detail:{direction:t},cancelable:!0,bubbles:!0,composed:!0})))||r),n&&e.announce("plonk"),n}return e.setPositionHandlingPlaceholder(a),e.mathfield.stopCoalescingUndo(),e.announce("move",s),!0}function Ru(e,t,n){return(t+="forward"===n?1:-1)<0||t>e.lastOffset||Pu(e,t)?t:Ru(e,t,n)}function Pu(e,t){var n;const i=e.at(t);let r=i.parent;for(;r&&!r.inCaptureSelection;)r=r.parent;if(null==r?void 0:r.inCaptureSelection)return!1;if(null==(n=i.parent)?void 0:n.skipBoundary){if(!i.isFirstSibling&&i.isLastSibling)return!1;if("first"===i.type)return!1}return!(e.mathfield.hasEditablePrompts&&!i.parentPrompt)}function Ou(e,t,n,i,r){const a=e.mathfield.hasEditablePrompts,s=a?n.filter((e=>"prompt"===e.type&&!e.captureSelection)):n,o=oo(e.mathfield.getHTMLElement(t)).right,l=e.offsetOf(function(e,t,n){let i=1/0,r=0;for(;r<t.length;r++){const a=oo(e.getHTMLElement(t[r])).right,s=Math.abs(n-a);if(!(s<=i))break;i=s}return t[r-1]}(e.mathfield,s,o))-(a?1:0);if(i){const[t,n]=e.selection.ranges[0];let i;i=l<("up"===r?t:n)?{ranges:[[l,n]],direction:"backward"}:{ranges:[[t,l]],direction:"forward"},e.setSelection(i)}else e.setPositionHandlingPlaceholder(l);e.announce(`move ${r}`)}function Nu(e){const t=e.position,n=e.at(t).parent;return(null==n?void 0:n.parent)?(e.position=e.offsetOf(n),e.mathfield.stopCoalescingUndo(),e.announce("move",t),!0):(e.announce("plonk"),!1)}function Bu(e){var t;if(e.collapseSelection(),function(e){let t=0,n=e.at(e.position),i=!1;for(;n;)n.hasEmptyBranch("superscript")&&n.hasEmptyBranch("subscript")||(t+=1),n.hasEmptyBranch("superscript")?n.hasEmptyBranch("subscript")||(i=!1):i=!0,n=n.parent;return i?t:0}(e)>=e.mathfield.options.scriptDepth[1])return e.announce("plonk"),!1;let n=e.at(e.position);return void 0===n.subsupPlacement&&("subsup"!==(null==(t=n.rightSibling)?void 0:t.type)&&n.parent.addChildAfter(new Yo({style:n.computedStyle}),n),n=n.rightSibling),n.createBranch("superscript"),e.setSelection(e.getSiblingsRange(e.offsetOf(n.superscript[0]))),!0}function $u(e){var t;if(e.collapseSelection(),function(e){let t=0,n=e.at(e.position),i=!1;for(;n;)n.hasEmptyBranch("superscript")&&n.hasEmptyBranch("subscript")||(t+=1),n.hasEmptyBranch("superscript")?n.hasEmptyBranch("subscript")||(i=!0):i=!1,n=n.parent;return i?t:0}(e)>=e.mathfield.options.scriptDepth[0])return e.announce("plonk"),!1;let n=e.at(e.position);return void 0===n.subsupPlacement&&("subsup"!==(null==(t=e.at(e.position+1))?void 0:t.type)&&n.parent.addChildAfter(new Yo({style:e.at(e.position).computedStyle}),n),n=e.at(e.position+1)),n.createBranch("subscript"),e.setSelection(e.getSiblingsRange(e.offsetOf(n.subscript[0]))),!0}function Fu(){function e(e){return!((n=e).disabled||"hidden"===n.type&&"INPUT"===n.tagName.toUpperCase()||function(e){if(!m()||e===document.activeElement||e.contains(document.activeElement))return!1;if("hidden"===getComputedStyle(e).visibility)return!0;const t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!0;for(;e;){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(n)||function(e){return"INPUT"===e.tagName.toUpperCase()&&"radio"===e.type&&!function(e){var t;if(!e.name)return!0;const n=null!=(t=e.form)?t:e.ownerDocument,i=n.querySelectorAll('input[type="radio"][name="'+e.name+'"]'),r=function(e,t){for(const n of e)if(n.checked&&n.form===t)return n;return null}(i,e.form);return!r||r===e}(e)}(e)||t(e)<0);var n}function t(e){var t;const n=Number.parseInt(null!=(t=e.getAttribute("tabindex"))?t:"NaN",10);return Number.isNaN(n)?"true"===e.contentEditable?0:"AUDIO"!==e.nodeName&&"VIDEO"!==e.nodeName||null!==e.getAttribute("tabindex")?e.tabIndex:0:n}return m()?function(n){const i=[],r=[];return[...n.querySelectorAll('input, select, textarea, a[href], button,\n [tabindex], audio[controls], video[controls],\n [contenteditable]:not([contenteditable="false"]), details>summary')].filter(e).forEach(((e,n)=>{const a=t(e);0===a?i.push(e):r.push({documentOrder:n,tabIndex:a,node:e})})),r.sort(((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex)).map((e=>e.node)).concat(i)}(document.body):[]}function zu(e,t,n="forward"){const i=e.position;if(Array.isArray(t)){const r=e.offsetOf(t[0]),a=e.offsetOf(t[t.length-1]);return"forward"===n?e.setSelection(r,a):e.setSelection(a,r),e.announce("move",i),e.mathfield.stopCoalescingUndo(),!0}return zu(e,"forward"===n?[t.leftSibling,t]:[t,t.leftSibling])}function Ku(e,t){const n=e.position;if("number"==typeof t&&(t=e.at(t)),"prompt"===t.type)e.setSelection(e.offsetOf(t.firstChild),e.offsetOf(t.lastChild));else{const n=e.offsetOf(t);"placeholder"===t.type?e.setSelection(n-1,n):e.position=n}return e.announce("move",n),e.mathfield.stopCoalescingUndo(),!0}function Uu(e,t,n=!0){var i,r;const a="forward"===t?1:-1;let s;"placeholder"===e.at(e.anchor).type&&Iu(e,t);const o=e.at(e.anchor).parentPrompt;s=o?"forward"===t?e.offsetOf(o)+1:e.offsetOf(o.leftSibling):Math.max(e.position+a,0);const l=ju(e,s,t);if(!l||"forward"===t&&e.offsetOf(l)<s||"backward"===t&&e.offsetOf(l)>s){if(!n||!(null==(r=null==(i=e.mathfield.host)?void 0:i.dispatchEvent(new CustomEvent("move-out",{detail:{direction:t},cancelable:!0,bubbles:!0,composed:!0})))||r))return e.announce("plonk"),!1;const s=Fu();if(!document.activeElement||s.length<=1)return e.announce("plonk"),!1;let o=s.indexOf(document.activeElement)+a;return o<0&&(o=s.length-1),o>=s.length&&(o=0),s[o].focus(),e.mathfield.stopCoalescingUndo(),!0}return Ku(e,l),!0}function ju(e,t=0,n="forward"){return e.findAtom((t=>"placeholder"===t.type||"prompt"===t.type||!e.mathfield.readOnly&&t.treeDepth>2&&t.isFirstSibling&&t.isLastSibling),t,n)}function qu(e,t,n,i){if("forward"===i){let e=t.rightSibling;for(;e&&!n(e);)e=e.rightSibling;return e}let r=t.leftSibling;for(;r&&!n(r);)r=r.leftSibling;return r}function Hu(e,t,n){"function"==typeof t&&(n=t,t=1/0),void 0===t&&(t=1/0);let i=e.position,r=!1,a="";for(;!r;){const s=e.at(i);r=0===t||void 0===s||"first"===s.type||"math"!==s.mode||!(s.type&&/mord|mpunct|operator/.test(s.type)||"mop"===s.type&&/[a-zA-Z ]+/.test(s.value))||!s.hasEmptyBranch("superscript")||!s.hasEmptyBranch("subscript")||"function"==typeof n&&!n(s),r||(s.mode="text",s.command=s.value,s.verbatimLatex=void 0,a+=s.value),i-=1,t-=1}e.contentDidChange({data:a,inputType:"insertText"})}function Vu(e,t,n){"function"==typeof t&&(n=t,t=1/0),void 0===t&&(t=1/0);let i=e.position,r=!1;const a=[];for(;!r;){const s=e.at(i);r=0===t||!s||"first"===s.type||s.isFirstSibling||"text"!==s.mode||" "===s.value||"function"==typeof n&&!n(s),r||(a.push(Ds.serialize([s],{defaultMode:"math"})),s.mode="math"),i-=1,t-=1}Gu(e),e.contentDidChange({data:Xa(a),inputType:"insertText"})}function Gu(e){var t;let n=e.position-1;for(;n>=0&&"math"===(null==(t=e.at(n))?void 0:t.mode);)n-=1;if(!(n<0)&&"text"===e.at(n).mode&&" "===e.at(n).value&&"math"===e.at(n-1).mode){e.at(n-1).parent.removeChild(e.at(n-1));const t=e.silenceNotifications;e.silenceNotifications=!0,e.position-=1,e.silenceNotifications=t,e.contentDidChange({inputType:"deleteContent"})}}function Zu(){const e=document.getElementById("mathlive-keystroke-caption-panel");return e||(po("keystroke-caption"),po("core"),hc("mathlive-keystroke-caption-panel"))}function Wu(e,t){var n,i,r;const{model:a}=e,s=tc(t);if(t.isTrusted){!function(e){var t,n;if(!e)return;if("Unidentified"===e.key)return;if("Dead"===e.key)return;const i=e.shiftKey&&e.altKey?3:e.altKey?2:e.shiftKey?1:0;for(const r of jl)(null==(t=r.mapping[e.code])?void 0:t[i])===e.key?r.score+=1:(null==(n=r.mapping[e.code])?void 0:n[i])&&(r.score=0);jl.sort(((e,t)=>t.score-e.score))}(t);const n=Vl();e.keyboardLayout!==n.id&&(e.keyboardLayout=n.id,e._keybindings=void 0)}if(clearTimeout(e.inlineShortcutBufferFlushTimer),e.inlineShortcutBufferFlushTimer=0,function(e,t){if(!e.isSelectionEditable||!e.keystrokeCaptionVisible)return;const n=Zu(),i=e.element.getBoundingClientRect();n.style.left=`${i.left}px`,n.style.top=i.top-64+"px",n.innerHTML=window.MathfieldElement.createHTML("<span>"+(Gl(t)||t)+"</span>"+n.innerHTML),n.style.visibility="visible",setTimeout((()=>{n.childNodes.length>0&&n.childNodes[n.childNodes.length-1].remove(),0===n.childNodes.length&&(n.style.visibility="hidden")}),3e3)}(e,s),t.isTrusted&&t.defaultPrevented)return e.flushInlineShortcutBuffer(),!1;let o,l,c="";const u=e.inlineShortcutBuffer;if(e.isSelectionEditable){if("math"===a.mode)if("[Backspace]"===s)u.pop();else if(Xl(t)){const r=ec(t),s=[...null!=(i=null==(n=u[u.length-1])?void 0:n.keystrokes)?i:[],r];u.push({state:a.getState(),keystrokes:s,leftSiblings:Xu(e)});let c=0,d="";for(;!o&&c<s.length;)l=u.length-(s.length-c),d=s.slice(c).join(""),o=zs(u[l].leftSiblings,d,e.options.inlineShortcuts),!o&&/^[a-zA-Z][a-zA-Z0-9]+?([_\^][a-zA-Z0-9\*\+\-]+?)?$/.test(d)&&(o=e.options.onInlineShortcut(e,d)),c+=1;e.flushInlineShortcutBuffer({defer:!0})}else e.flushInlineShortcutBuffer();e.options.smartMode&&(o?e.switchMode("math"):function(e,t,n){const{model:i}=e;if("latex"===i.mode)return!1;if(!i.at(i.position).isLastSibling)return!1;if(!n||!Xl(n))return!1;const r=ec(n);if(!i.selectionIsCollapsed)return!("text"!==e.model.mode||!/[/_^]/.test(r));const a=function(e){let t="",n=e.position,i=!1;for(;!i;){const r=e.at(n);i=!(r&&("text"===r.mode||"math"===r.mode&&r.type&&/mord|mpunct/.test(r.type))),i||(t=r.value+t),n-=1}return t}(i)+r;if("text"===e.model.mode){if("Esc"===t||/[/\\]/.test(r))return!0;if(/[\^_]/.test(r))return/(^|\s)[a-zA-Z][^_]$/.test(a)&&Vu(i,1),!0;const e={")":"(","}":"{","]":"["}[r],{parent:n}=i.at(i.position);if(e&&n instanceof Ho&&n.leftDelim===e)return!0;if(/(^|[^a-zA-Z])(a|I) $/.test(a))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(r))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z] $/.test(a))return Vu(i,1),!1;if(/\D\.[^\d\s]$/.test(a)){Vu(i,1);const e=i.at(i.position);return e.value="⋅",e.style.variant="normal",e.command="\\cdot",e.verbatimLatex=void 0,i.contentDidChange({data:"\\cdot",inputType:"insertText"}),!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(a))return Vu(i,1),!0;if(/\.\d$/.test(a))return Vu(i,1),!0;if(/\([\d+\-.]$/.test(a))return Vu(i,1),!0;if(/\([a-z][,;]$/.test(a))return Vu(i,2),!0;if(/[\d+\-=><*|]$/.test(r))return Gu(i),!0}else{if("[Space]"===t)return Hu(i,void 0,(e=>/[a-z][:,;.]$/.test(e.value))),!0;if(/[a-zA-Z]{3,}$/.test(a)&&!/(dxd|abc|xyz|uvw)$/.test(a))return Hu(i,void 0,(e=>/[a-zA-Z]/.test(e.value))),!0;if(/(^|\W)(if)$/i.test(a))return Hu(i,1),!0;if(/(\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5){3,}$/u.test(a)&&!/(αβγ)$/.test(a))return Hu(i,void 0,(e=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5)/u.test(e.value))),!0;if("?"===r)return!0;if("."===r&&!/[\d-+]\.$/.test(a))return!0}return!1}(e,s,t)&&(e.switchMode({math:"text",text:"math"}[a.mode]),c=""))}if(!o){if(c||(c=function(e,t,n){if(0===e.length)return"";const i=zl(Fl(tc(n))),r=zl({key:n.key,shift:n.shiftKey,alt:n.altKey,ctrl:n.ctrlKey,meta:n.metaKey||n.ctrlKey&&/macos|ios/.test(v()),cmd:!1,win:!1});for(let n=e.length-1;n>=0;n--)if(!(e[n].key!==i&&e[n].key!==r||e[n].ifMode&&e[n].ifMode!==t))return e[n].command;return""}(e.keybindings,a.mode,t)),!c&&("[Enter]"===s||"[Return]"===s)){let n=!1;return a.contentWillChange({inputType:"insertLineBreak"})&&(e.host&&(n=!e.host.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),n||t.preventDefault&&(t.preventDefault(),t.stopPropagation()),a.contentDidChange({inputType:"insertLineBreak"})),n}if((!c||"[Space]"===s)&&"math"===a.mode){if("[Space]"===s){if(e.adoptStyle="none",e.flushInlineShortcutBuffer(),e.options.mathModeSpace)return Ys.insert(a,e.options.mathModeSpace,{format:"latex",mode:"math"}),e.snapshot("insert-space"),c="",e.dirty=!0,e.scrollIntoView(),t.preventDefault&&(t.preventDefault(),t.stopPropagation()),!1;const n=a.at(a.position+1),i=a.at(a.position-1);if("text"===(null==n?void 0:n.mode)||"text"===(null==i?void 0:i.mode))return Ys.insert(a," ",{mode:"text"}),e.snapshot("insert-space"),e.dirty=!0,e.scrollIntoView(),!1}(null==(r=a.at(a.position))?void 0:r.isDigit())&&","===window.MathfieldElement.decimalSeparator&&","===ec(t)&&(c="insertDecimalSeparator")}}if(!o&&!c){if(a.mathfield.smartFence){if(Qu(a,ec(t),e.effectiveStyle))return e.dirty=!0,e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1}else{const{parent:n}=a.at(a.position);if(n instanceof Ho&&"?"===n.rightDelim&&a.at(a.position).isLastSibling&&/^[)}\]|]$/.test(s))return e.snapshot(),n.isDirty=!0,n.rightDelim=s,a.position+=1,a.selectionDidChange(),a.contentDidChange({data:ec(t),inputType:"insertText"}),e.snapshot("insert-fence"),e.dirty=!0,e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1;if(!a.selectionIsCollapsed){const n=ec(t);if("("===n||"{"===n||"["===n){const i={"(":"(","{":"\\lbrace","[":"\\lbrack"}[n],r={"(":")","{":"\\rbrace","[":"\\rbrack"}[n],[s,o]=Ns(a.selection);return e.snapshot(),a.position=o,Ys.insert(a,r,{format:"latex"}),a.position=s,Ys.insert(a,i,{format:"latex"}),a.setSelection(s+1,o+1),a.contentDidChange({data:n,inputType:"insertText"}),e.snapshot("insert-fence"),e.dirty=!0,e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1}}}return!0}const d=a.at(Math.max(a.position,a.anchor)),{parent:h}=d;if("moveAfterParent"===c&&"leftright"===(null==h?void 0:h.type)&&d.isLastSibling&&e.options.smartFence&&Qu(a,".",e.defaultStyle)&&(c="",Cc(e)),e.keyboardDelegate.cancelComposition(),c)e.executeCommand(c);else if(o){const t=e.effectiveStyle;a.setState(u[l].state);const n=u[u.length-1].keystrokes;for(const e of n)Ys.insert(a,e,{silenceNotifications:!0,style:t});e.snapshot("insert-shortcut"),a.setState(u[l].state),a.deferNotifications({content:!0,selection:!0,data:o,type:"insertText"},(()=>(Ys.insert(a,o,{format:"latex",style:t}),Gu(e.model),o.endsWith(" ")&&(e.switchMode("text"),Ys.insert(a," ",{style:t,mode:"text"})),e.snapshot(),a.selectionIsCollapsed||e.flushInlineShortcutBuffer(),!0))),e.dirty=!0,a.announce("replacement")}return e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1}function Yu(e,t,n){const{model:i}=e;if(!e.isSelectionEditable)return void i.announce("plonk");null!=n||(n={}),n.focus&&e.focus(),n.feedback&&window.MathfieldElement.playSound("keypress"),"string"==typeof n.mode&&(e.switchMode(n.mode),e.snapshot());let r=Za(t);const a=window.mathVirtualKeyboard;if((null==a?void 0:a.isShifted)&&(r="string"==typeof r?r.toUpperCase():r.map((e=>e.toUpperCase()))),n.simulateKeystroke){let t=!0;for(const n of r)Wu(e,new KeyboardEvent("keypress",{key:n}))&&(t=!1);if(t)return}const s=i.at(i.position),o=u(u({},s.computedStyle),e.defaultStyle);if(i.selectionIsCollapsed||(i.deleteAtoms(Ns(i.selection)),e.snapshot("delete")),"latex"===i.mode)i.deferNotifications({content:!0,selection:!0,data:t,type:"insertText"},(()=>{lc(e);for(const e of r)Ys.insert(i,e);e.snapshot("insert-latex"),cc(e)}));else if("text"===i.mode){for(const e of r)Ys.insert(i,e,{style:o});e.snapshot("insert-text")}else if("math"===i.mode)for(const t of r)Ju(e,t,o,s);e.dirty=!0,e.scrollIntoView()}function Xu(e){const t=e.model,n=[];let i=t.at(Math.min(t.position,t.anchor));for(;"first"!==i.type;)n.push(i),i=i.leftSibling;return n}function Ju(e,t,n,i){const r=e.model;let a={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(" "===t&&e.options.mathModeSpace&&(a=["insert",e.options.mathModeSpace]),a)e.executeCommand(a);else{if(/\d/.test(t)&&e.options.smartSuperscript&&"superscript"===i.parentBranch&&"mop"!==i.parent.type&&"operator"!==i.parent.type&&"extensible-symbol"!==i.parent.type&&i.hasNoSiblings)return function(e){e.selectionIsCollapsed||(e.deleteAtoms(Ns(e.selection)),e.mathfield.snapshot("delete"))}(r),Ys.insert(r,t,{style:n}),e.snapshot(),Nu(r),void e.snapshot();if(/[a-zA-Z0-9]/.test(t)&&"none"!==e.adoptStyle){const t="left"===e.adoptStyle?i:i.parent?i.rightSibling:null;"mord"===(null==t?void 0:t.type)&&/[a-zA-Z0-9]/.test(t.value)&&(n=u({},n),t.style.variant&&(n.variant=t.style.variant),t.style.variantStyle&&(n.variantStyle=t.style.variantStyle))}Ys.insert(r,t,{style:n}),e.snapshot(`insert-${r.at(r.position).type}`)}}function Qu(e,t,n){if(!t)return!1;if("math"!==e.mode)return!1;const i=e.at(e.position),{parent:r}=i,a={"(":"(",")":")","{":"\\lbrace","}":"\\rbrace","[":"\\lbrack","]":"\\rbrack","|":"|"}[t];if(!a)return!1;const s=vo[a],o=go[a];if(!e.selectionIsCollapsed){e.mathfield.snapshot();const[t,n]=Ns(e.selection),i=e.extractAtoms([t,n]),s=r.addChildrenAfter([new Ho("left...right",i,{leftDelim:a,rightDelim:o})],e.at(t));return e.setSelection(e.offsetOf(s.firstChild),e.offsetOf(s.lastChild)),e.mathfield.snapshot("insert-fence"),e.contentDidChange({data:a,inputType:"insertText"}),!0}if("|"===a){const t=r instanceof Ho?r.leftDelim+r.rightDelim:"";if("\\lbrace\\rbrace"===t||"\\{\\}"===t||"\\lbrace?"===t)return e.mathfield.snapshot(),Ys.insert(e,"\\,\\middle\\vert\\,",{format:"latex",style:n}),e.mathfield.snapshot("insert-fence"),e.contentDidChange({data:a,inputType:"insertText"}),!0}if(o){if(r instanceof Ho&&r.firstChild===i&&("?"===r.leftDelim||"."===r.leftDelim))return r.leftDelim=a,r.isDirty=!0,e.mathfield.snapshot(),e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;if(!(r instanceof Ho)){let t=i;for(;t&&("mclose"!==t.type||t.value!==o);)t=t.rightSibling;if(t){e.mathfield.snapshot();const n=e.extractAtoms([e.offsetOf(i),e.offsetOf(t)]);return n.pop(),r.addChildrenAfter([new Ho("left...right",n,{leftDelim:a,rightDelim:o})],i),e.position=e.offsetOf(r.firstChild)+1,e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}}const t=e.offsetOf(i.lastSibling);let s;for(s=e.position;s<=t;s++){const t=e.at(s);if(t instanceof Ho&&("?"===t.leftDelim||"."===t.leftDelim)&&td(a,t.rightDelim))break}const l=e.at(s);if(s<=t&&l instanceof Ho){l.leftDelim=a,e.mathfield.snapshot();let t=e.extractAtoms([e.position,s-1]);return t=t.filter((e=>"first"!==e.type)),l.addChildren(t,l.parentBranch),e.position+=1,e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}if(r instanceof Ho&&("?"===r.leftDelim||"."===r.leftDelim)&&td(a,r.rightDelim)){r.isDirty=!0,r.leftDelim=a,e.mathfield.snapshot();const t=e.extractAtoms([e.offsetOf(i.firstSibling),e.position]);for(const e of t)r.parent.addChildBefore(e,r);return e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}if(!(r instanceof Ho&&"|"===r.leftDelim)){if(e.mathfield.snapshot(),Ys.insert(e,`\\left${a}\\right?`,{format:"latex",style:n}),"first"!==i.lastSibling.type){const t=e.offsetOf(i.lastSibling),n=e.extractAtoms([e.position,t]);e.at(e.position).body=n,e.position-=1}return e.mathfield.snapshot("insert-fence"),!0}}if(s){let t=i;for(;t;){if("mopen"===t.type&&t.value===s){e.mathfield.snapshot();const n=t.leftSibling,o=e.extractAtoms([e.offsetOf(t.leftSibling),e.offsetOf(i)]);o.shift();const l=new Ho("left...right",o,{leftDelim:s,rightDelim:a});return r.addChildrenAfter([l],n),e.position=e.offsetOf(l),e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}t=t.leftSibling}if(r instanceof Ho&&i.isLastSibling&&ed(r.leftDelim,a))return e.mathfield.snapshot(),r.isDirty=!0,r.rightDelim=a,e.position+=1,e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;const o=e.offsetOf(i.firstSibling);let l;for(l=e.position;l>=o;l--){const t=e.at(l);if(t instanceof Ho&&("?"===t.rightDelim||"."===t.rightDelim)&&ed(t.leftDelim,a))break}const c=e.at(l);if(l>=o&&c instanceof Ho)return e.mathfield.snapshot(),c.rightDelim=a,c.addChildren(e.extractAtoms([l,e.position]),c.parentBranch),e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;if(r instanceof Ho&&("?"===r.rightDelim||"."===r.rightDelim)&&ed(r.leftDelim,a))return e.mathfield.snapshot(),r.isDirty=!0,r.rightDelim=a,r.parent.addChildren(e.extractAtoms([e.position,e.offsetOf(i.lastSibling)]),r.parentBranch),e.position=e.offsetOf(r),e.contentDidChange({data:a,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;const u=r.parent;return!(!(u instanceof Ho)||"?"!==u.rightDelim&&"."!==u.rightDelim||!e.at(e.position).isLastSibling)&&(e.position=e.offsetOf(u),Qu(e,a,n))}return!1}function ed(e,t){return!e||(["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(e)?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(t):go[e]===t)}function td(e,t){return!t||([")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(t)?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(e):vo[t]===e)}function nd(e,t){var n,i,r,a,s,o,l,c,u,d;const h={};if("string"==typeof t.color){const a=null!=(i=e.colorMap(null!=(n=t.color)?n:t.verbatimColor))?i:"none";a!==t.color&&(h.verbatimColor=null!=(r=t.verbatimColor)?r:t.color),h.color=a}if("string"==typeof t.backgroundColor){const n=null!=(s=e.backgroundColorMap(null!=(a=t.backgroundColor)?a:t.verbatimBackgroundColor))?s:"none";n!==t.backgroundColor&&(h.verbatimBackgroundColor=null!=(o=t.verbatimBackgroundColor)?o:t.backgroundColor),h.backgroundColor=n}"string"==typeof t.fontFamily&&(h.fontFamily=t.fontFamily),"string"==typeof t.series&&(h.fontSeries=t.series),"string"==typeof t.fontSeries&&(h.fontSeries=t.fontSeries.toLowerCase()),h.fontSeries&&(h.fontSeries=null!=(l={bold:"b",medium:"m",normal:"m"}[h.fontSeries])?l:h.fontSeries),"string"==typeof t.shape&&(h.fontShape=t.shape),"string"==typeof t.fontShape&&(h.fontShape=t.fontShape.toLowerCase()),h.fontShape&&(h.fontShape=null!=(c={italic:"it",up:"n",upright:"n",normal:"n"}[h.fontShape])?c:h.fontShape),t.variant&&(h.variant=t.variant.toLowerCase()),t.variantStyle&&(h.variantStyle=t.variantStyle.toLowerCase());const p=null!=(u=t.size)?u:t.fontSize;return"number"==typeof p?h.fontSize=Math.max(1,Math.min(10,p)):"string"==typeof p&&(h.fontSize=null!=(d={size1:1,size2:2,size3:3,size4:4,size5:5,size6:6,size7:7,size8:8,size9:9,size10:10}[p.toLowerCase()])?d:{tiny:1,scriptsize:2,footnotesize:3,small:4,normal:5,normalsize:5,large:6,Large:7,LARGE:8,huge:9,Huge:10}[p]),h}function id(e){let[t,n]=Ns(e.selection);if(t=rd(e,t,"backward"),n=rd(e,n,"forward"),t===n){const i=e.at(t);if("leftright"===i.type)return e.setSelection(e.offsetOf(i.firstChild)-1,n);if("first"===i.type&&("leftright"===i.parent.type||"surd"===i.parent.type))return e.setSelection(t-1,e.offsetOf(i.parent.lastChild)+1);e.setSelection(t-1,n)}else e.setSelection(t,n);return!0}function rd(e,t,n){var i,r,a;let s=e.at(t);if(!s)return t;const o="forward"===n?1:-1;if("text"===s.mode){for(;s&&"text"===s.mode&&F.test(s.value);)t+=o,s=e.at(t);return"backward"===n?t-1:t}if("latex"===s.mode){if(/[a-zA-Z\*]/.test(s.value))if("backward"===n)for(;s&&"latex"===s.mode&&"\\"!==s.value&&/[a-zA-Z]/.test(s.value);)t+=o,s=e.at(t);else for(;s&&"latex"===s.mode&&/[a-zA-Z\*]/.test(s.value);)t+=o,s=e.at(t);else{if("{"===s.value){if("forward"===n){for(;s&&"latex"===s.mode&&"}"!==s.value;)t+=o,s=e.at(t);return t}return t-1}if("}"===s.value){if("backward"===n){for(;s&&"latex"===s.mode&&"{"!==s.value;)t+=o,s=e.at(t);return t-1}return t}}return t-1}if("math"===s.mode){if(s.isDigit()){for(;null==(i=e.at(t+o))?void 0:i.isDigit();)t+=o;return"backward"===n?t-1:t}if(s.style.variant||s.style.variantStyle){let i=null==(r=e.at(t))?void 0:r.style;for(;i&&i.variant===s.style.variant&&i.variantStyle===s.style.variantStyle;)i=null==(a=e.at(t+o))?void 0:a.style,t+=o;return"backward"===n?t-1:t}return t}return t}Dc({moveToOpposite:e=>{const t=e.at(e.position),{parent:n}=t;if(!n)return e.announce("plonk"),!1;const i=t.parentBranch;let r;if("string"==typeof i&&(r={superscript:"subscript",subscript:"superscript",above:"below",below:"above"}[i]),!r){const n=t.subsupPlacement?$u(e):Bu(e);return e.mathfield.stopCoalescingUndo(),n}n.branch(r)||n.createBranch(r);const a=e.setSelection(e.getBranchRange(e.offsetOf(n),r));return e.mathfield.stopCoalescingUndo(),a},moveBeforeParent:e=>{const{parent:t}=e.at(e.position);return t?(e.position=e.offsetOf(t),e.mathfield.stopCoalescingUndo(),!0):(e.announce("plonk"),!1)},moveAfterParent:e=>Nu(e),moveToNextChar:e=>Iu(e,"forward"),moveToPreviousChar:e=>Iu(e,"backward"),moveUp:e=>Iu(e,"upward"),moveDown:e=>Iu(e,"downward"),moveToNextWord:e=>Du(e,"forward"),moveToPreviousWord:e=>Du(e,"backward"),moveToGroupStart:e=>{const t=e.offsetOf(e.at(e.position).firstSibling);return t===e.position?(e.announce("plonk"),!1):(e.position=t,e.mathfield.stopCoalescingUndo(),!0)},moveToGroupEnd:e=>{const t=e.offsetOf(e.at(e.position).lastSibling);return t===e.position?(e.announce("plonk"),!1):(e.position=t,e.mathfield.stopCoalescingUndo(),!0)},moveToNextGroup:e=>{var t,n,i,r;if(e.position===e.lastOffset&&e.anchor===e.lastOffset)return Uu(e,"forward");const a=e.at(e.position);if("text"===a.mode){if(e.selectionIsCollapsed){let n=a;for(;n&&"text"===n.mode;)n=n.leftSibling;let i=a;for(;"text"===(null==(t=i.rightSibling)?void 0:t.mode);)i=i.rightSibling;if(n&&i)return zu(e,[n,i])}if("text"===a.rightSibling.mode){let t=a;for(;t&&"text"===t.mode;)t=t.rightSibling;return t?(Ku(e,null!=(n=t.leftSibling)?n:t),e.mathfield.switchMode("math"),!0):Ku(e,e.lastOffset)}}const s=e.at(e.anchor).parentPrompt,o=s?e.offsetOf(s)+1:Math.max(e.position+1,0),l=ju(e,o,"forward");if(l)return Ku(e,l);const c=qu(e,a,(e=>"leftright"===e.type||"text"===e.type),"forward");if(c){if("text"===c.mode){let t=c;for(;t&&"text"===t.mode;)t=t.rightSibling;return zu(e,[null!=(i=c.leftSibling)?i:c,null!=(r=t.leftSibling)?r:t])}return zu(e,c)}const u=a.parent;if(u){if("leftright"===u.type||"surd"===u.type)return zu(e,u);if("superscript"===a.parentBranch&&u.subscript)return zu(e,u.subscript);if("above"===a.parentBranch&&u.below)return zu(e,u.below);if("superscript"===a.parentBranch||"subscript"===a.parentBranch)return Ku(e,u);if("above"===a.parentBranch||"below"===a.parentBranch)return zu(e,u)}return Ku(e,e.lastOffset)},moveToPreviousGroup:e=>{var t;if(0===e.position&&0===e.anchor)return Uu(e,"backward");let n=e.at(e.position);const i=n.mode;if("text"===i){if(e.selectionIsCollapsed){let i=n;for(;i&&"text"===i.mode;)i=i.leftSibling;let r=n;for(;"text"===(null==(t=r.rightSibling)?void 0:t.mode);)r=r.rightSibling;if(i&&r)return zu(e,[i,r])}for(;n&&"text"===n.mode;)n=n.leftSibling;return Ku(e,n?n:0)}const r=e.at(e.anchor).parentPrompt,a=r?e.offsetOf(r.leftSibling):Math.max(e.position-1,0),s=ju(e,a,"backward");if(s)return Ku(e,s);if("math"===i){const t=qu(e,n,(e=>"leftright"===e.type||"text"===e.type),"backward");if(t){if("text"===t.mode){let n=t;for(;n&&"text"===n.mode;)n=n.leftSibling;return zu(e,[t,n])}return zu(e,t)}const i=n.parent;if(i){if("leftright"===i.type||"surd"===i.type)return zu(e,i);if("subscript"===n.parentBranch&&i.superscript)return zu(e,i.superscript);if("below"===n.parentBranch&&i.above)return zu(e,i.above);if("superscript"===n.parentBranch||"subscript"===n.parentBranch)return Ku(e,i);if("above"===n.parentBranch||"below"===n.parentBranch)return zu(e,i)}return Ku(e,0)}return!1},moveToMathfieldStart:e=>e.selectionIsCollapsed&&0===e.position?(e.announce("plonk"),!1):(e.position=0,e.mathfield.stopCoalescingUndo(),!0),moveToMathfieldEnd:e=>e.selectionIsCollapsed&&e.position===e.lastOffset?(e.announce("plonk"),!1):(e.position=e.lastOffset,e.mathfield.stopCoalescingUndo(),!0),moveToSuperscript:Bu,moveToSubscript:$u},{target:"model",changeSelection:!0}),Dc({moveToNextPlaceholder:e=>Uu(e,"forward"),moveToPreviousPlaceholder:e=>Uu(e,"backward")},{target:"model",changeSelection:!0,audioFeedback:"return"}),Dc({undo:e=>(e.undo(),!0),redo:e=>(e.redo(),!0),scrollIntoView:e=>(e.scrollIntoView(),!0),scrollToStart:e=>(e.field.scroll(0,0),!0),scrollToEnd:e=>{const t=e.field.getBoundingClientRect();return e.field.scroll(t.left-window.scrollX,0),!0},toggleKeystrokeCaption:function(e){if(e.keystrokeCaptionVisible=!e.keystrokeCaptionVisible,e.keystrokeCaptionVisible){Zu().innerHTML=""}else{hc("mathlive-keystroke-caption-panel").style.visibility="hidden"}return!1},toggleContextMenu:e=>{const t=e.toggleContextMenu();return t||e.model.announce("plonk"),t},plonk:e=>(e.model.announce("plonk"),!0),switchMode:(e,t,n,i)=>(e.switchMode(t,n,i),!0),insert:(e,t,n)=>e.insert(t,n),typedText:(e,t,n)=>(Yu(e,t,n),!0),insertDecimalSeparator:e=>{const t=e.model;if("math"===t.mode&&","===window.MathfieldElement.decimalSeparator){if(t.at(Math.max(t.position,t.anchor)).isDigit())return e.insert("{,}",{format:"latex"}),e.snapshot("insert-mord"),!0}return e.insert("."),!0},commit:e=>{var t;return e.model.contentWillChange({inputType:"insertLineBreak"})&&(null==(t=e.host)||t.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),e.model.contentDidChange({inputType:"insertLineBreak"})),!0},insertPrompt:(e,t,n)=>{const i=e.getPrompts();let r="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36),a=0;for(;i.includes(r)&&a<100;){if(99===a)return console.error("could not find a unique ID after 100 tries"),!1;r="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36),a++}return e.insert(`\\placeholder[${null!=t?t:r}]{}`,n),!0}}),Dc({copyToClipboard:e=>(e.focus(),e.model.selectionIsCollapsed&&e.select(),"queryCommandSupported"in document&&document.queryCommandSupported("copy")?document.execCommand("copy"):e.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("copy",{bubbles:!0,composed:!0})),!1)},{target:"mathfield"}),Dc({cutToClipboard:e=>(e.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("cut")?document.execCommand("cut"):e.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("cut",{bubbles:!0,composed:!0})),!0),pasteFromClipboard:e=>(e.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("paste")?(document.execCommand("paste"),!0):(navigator.clipboard.readText().then((t=>{t&&e.model.contentWillChange({inputType:"insertFromPaste",data:t})?(e.stopCoalescingUndo(),e.stopRecording(),e.insert(t,{mode:e.model.mode})&&(cc(e),e.startRecording(),e.snapshot("paste"),e.model.contentDidChange({inputType:"insertFromPaste"}),Cc(e))):e.model.announce("plonk"),e.startRecording()})),!0))},{target:"mathfield",canUndo:!0,changeContent:!0,changeSelection:!0}),Dc({applyStyle:function(e,t){e.flushInlineShortcutBuffer(),e.stopCoalescingUndo();const n=nd(e,t),{model:i}=e;return i.selectionIsCollapsed?(e.defaultStyle.fontSeries&&n.fontSeries===e.defaultStyle.fontSeries&&(n.fontSeries="auto"),n.fontShape&&n.fontShape===e.defaultStyle.fontShape&&(n.fontShape="auto"),n.color&&n.color===e.defaultStyle.color&&(n.color="none"),n.backgroundColor&&n.backgroundColor===e.defaultStyle.backgroundColor&&(n.backgroundColor="none"),n.fontSize&&n.fontSize===e.defaultStyle.fontSize&&(n.fontSize="auto"),e.defaultStyle=u(u({},e.defaultStyle),n)):e.model.deferNotifications({content:!0,type:"insertText"},(()=>{i.selection.ranges.forEach((e=>mu(i,e,n,{operation:"toggle"}))),e.snapshot("style-change")})),!0}},{target:"mathfield",canUndo:!0,changeContent:!0}),Dc({selectGroup:e=>{const t=id(e);return t||e.announce("plonk"),t},selectAll:e=>e.setSelection(0,e.lastOffset),extendSelectionForward:e=>Iu(e,"forward",{extend:!0}),extendSelectionBackward:e=>Iu(e,"backward",{extend:!0}),extendToNextWord:e=>Du(e,"forward",{extend:!0}),extendToPreviousWord:e=>Du(e,"backward",{extend:!0}),extendSelectionUpward:e=>Iu(e,"upward",{extend:!0}),extendSelectionDownward:e=>Iu(e,"downward",{extend:!0}),extendToNextBoundary:e=>Du(e,"forward",{extend:!0}),extendToPreviousBoundary:e=>Du(e,"backward",{extend:!0}),extendToGroupStart:e=>{const t=e.setSelection(e.anchor,e.offsetOf(e.at(e.position).firstSibling));return t||e.announce("plonk"),t},extendToGroupEnd:e=>{const t=e.setSelection(e.anchor,e.offsetOf(e.at(e.position).lastSibling));return t||e.announce("plonk"),t},extendToMathFieldStart:e=>{const t=e.setSelection(e.anchor,0);return t||e.announce("plonk"),t},extendToMathFieldEnd:e=>{const t=e.setSelection(e.anchor,e.lastOffset);return t||e.announce("plonk"),t}},{target:"model",changeSelection:!0});var ad=null,sd=0,od=class e{static start(t,n,i,r){var a;e.element=t,null==(a=e.controller)||a.abort(),e.controller=new AbortController;const s={signal:e.controller.signal};"PointerEvent"in window?(t.addEventListener("pointermove",i,s),t.addEventListener("pointerup",r,s),t.addEventListener("pointercancel",r,s),ld(n)&&(e.pointerId=n.pointerId,t.setPointerCapture(n.pointerId))):(window.addEventListener("mousemove",i,s),window.addEventListener("blur",r,s),window.addEventListener("mouseup",r,s))}static stop(){var t;null==(t=e.controller)||t.abort(),e.controller=void 0,"number"==typeof e.pointerId&&(e.element.releasePointerCapture(e.pointerId),e.pointerId=void 0)}};function ld(e){return null!==e&&void 0!==globalThis.PointerEvent&&e instanceof PointerEvent}function cd(e,t){var n;if(t.buttons>1)return;e.atomBoundsCache=new Map;const i=e;let r,a=!1,s=!1,o="none",l=!1,c=!1;const u=t.clientX,d=t.clientY,h=Date.now(),p=i.field,f=setInterval((()=>{l?p.scroll({top:0,left:p.scrollLeft-16}):c&&p.scroll({top:0,left:p.scrollLeft+16})}),32);function m(){od.stop(),a=!1,clearInterval(f),e.element.classList.remove("tracking"),t&&t.preventDefault()}ad&&Math.abs(ad.x-u)<5&&Math.abs(ad.y-d)<5&&Date.now()<ad.time+500?(sd+=1,ad.time=h):(ad={x:u,y:d,time:h},sd=1);const g=p.getBoundingClientRect();if(u>=g.left&&u<=g.right&&d>=g.top&&d<=g.bottom){if(e.flushInlineShortcutBuffer(),e.adoptStyle="left",r=pd(e,u,d,{bias:0}),r>=0){if(e.element.classList.add("tracking"),t.shiftKey){const t=e.model.selectionIsCollapsed;e.model.extendSelectionTo(e.model.anchor,r),o=uc(e.model)||t?"all":"selection"}else"placeholder"===e.model.at(r).type?(e.model.setSelection(r-1,r),o="selection"):"placeholder"===(null==(n=e.model.at(r).rightSibling)?void 0:n.type)?(e.model.setSelection(r,r+1),o="selection"):(e.model.position=r,o=uc(e.model)?"all":"selection");e.defaultStyle={},3===t.detail||sd>2?(m(),3!==t.detail&&3!==sd||(e.model.selection={ranges:[[0,e.model.lastOffset]]},o="all")):a||(a=!0,od.start(p,t,(function(t){if(!i.hasFocus())return void m();const n=t.clientX,a=t.clientY,o=ld(t)&&"touch"===t.pointerType?20:5;if(Date.now()<h+500&&Math.abs(u-n)<o&&Math.abs(d-a)<o)return t.preventDefault(),void t.stopPropagation();const f=p.getBoundingClientRect();c=n>f.right,l=n<f.left;let g=r;ld(t)&&(t.isPrimary||(g=pd(i,t.clientX,t.clientY,{bias:0})));const v=pd(i,n,a,{bias:n<=u?n===u?0:-1:1});g>=0&&v>=0&&(i.model.extendSelectionTo(g,v),Cc(e)),s&&id(i.model)}),m),2!==t.detail&&2!==sd||(s=!0,id(e.model),o="all"))}e.hasFocus()||(o="none",e.focus({preventScroll:!0}))}else ad=null;e.stopCoalescingUndo(),"none"!==o&&(e.model.selectionIsCollapsed&&(o="all"),Cc(e)),t.preventDefault()}function ud(e,t,n){if(e>=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom)return 0;const i=e-(n.left+n.right)/2,r=t-(n.top+n.bottom)/2;return i*i+r*r}function dd(e,t,n,i,r){if(!n.id)return[1/0,null];if(t.has(n.id))return t.get(n.id);const a=ro(e,n);if(!a)return[1/0,null];let s=[1/0,null];if(n.hasChildren&&!n.captureSelection&&i>=a.left&&i<=a.right)for(const a of n.children){const n=dd(e,t,a,i,r);n[0]<=s[0]&&(s=n)}return s[1]||(s=[ud(i,r,a),n]),t.set(n.id,s),s}function hd(e,t,n){const[,i]=dd(e,new Map,e.model.root,t,n);return i}function pd(e,t,n,i){var r;const a=e.field.querySelector(".ML__latex").getBoundingClientRect();if(!a)return 0;if(t>a.right||n>a.bottom+8)return e.model.lastOffset;if(t<a.left||n<a.top-8)return 0;(i=null!=i?i:{}).bias=null!=(r=i.bias)?r:0;let s=hd(e,t,n);const o=[];let l=s;for(;l;)o.unshift(l),l=l.parent;for(const e of o)if(e.captureSelection){s=e;break}let c=e.model.offsetOf(s);if(c<0)return-1;if(s.leftSibling)if(0===i.bias&&"placeholder"!==s.type){const n=ro(e,s);n&&t<(n.left+n.right)/2&&(c=e.model.offsetOf(s.leftSibling))}else i.bias<0&&(c=e.model.offsetOf(s.leftSibling));return c}function fd(e,t,n,i){var r;let a,s=[];if("string"!=typeof t||"math-json"===i.format){const n=window.MathfieldElement.computeEngine;if(!n)return["math-json",[]];[a,t]=["latex",n.box(t).latex],s=Qo(t,{context:e.mathfield.context})}else"string"==typeof t&&"ascii-math"===i.format?([a,t]=Us(t,{format:"ascii-math",inlineShortcuts:e.mathfield.options.inlineShortcuts}),s=Qo(t,{context:e.mathfield.context}),"latex"!==a&&e.mathfield.options.removeExtraneousParentheses&&gd(s)):("auto"===i.format||(null==(r=i.format)?void 0:r.startsWith("latex")))&&("auto"===i.format&&([a,t]=Us(t,{format:"auto",inlineShortcuts:e.mathfield.options.inlineShortcuts})),"latex"===i.format&&([,t]=Gs(t)),s=Qo(t,{context:e.mathfield.context,args:n}),"latex"!==i.format&&e.mathfield.options.removeExtraneousParentheses&&gd(s));return fu(s,i.style),[null!=a?a:"latex",s]}function md(e){if(!e)return null;if(console.assert("first"===e[0].type),e.length>1)return null;const t=e[0];return t instanceof Ho&&"("===t.leftDelim&&")"===t.rightDelim?t.removeBranch("body"):null}function gd(e){if(e){for(let t=0;e[t];t++){const n=e[t];if(n instanceof Ho&&"("===n.leftDelim){let i=0,r=0,a=0;for(let e=0;n.body[e];e++)"genfrac"===n.body[e].type&&(i++,r=e),a++;0===a&&1===i&&(e[t]=n.body[r])}}for(const t of e){for(const e of t.branches)if(!t.hasEmptyBranch(e)){gd(t.branch(e));const n=md(t.branch(e));n&&t.setChildren(n,e)}if(t instanceof Bo)for(const e of t.cells)gd(e)}}}function vd(e){return!!e.isDigit()||!(!e.type||!/^(mord|surd|subsup|leftright|mop|mclose)$/.test(e.type))&&!e.isExtensibleSymbol}new class extends Ys{constructor(){super("math")}onPaste(e,t){if(!t)return!1;if(!e.model.contentWillChange({data:"string"==typeof t?t:null,dataTransfer:"string"==typeof t?null:t,inputType:"insertFromPaste"}))return!1;let n="",i="auto",r="string"!=typeof t?t.getData("application/json+mathlive"):"";if(r)try{const t=JSON.parse(r);if(t&&Array.isArray(t)){e.snapshot();const n=Cl(t),{model:i}=e;i.selectionIsCollapsed||i.deleteAtoms(Ns(i.selection));const r=i.at(i.position);if(r.parent instanceof Bo){console.assert(void 0!==r.parentBranch);const e=[];let t=[];"first"===n[0].type&&n.shift(),"first"===n[n.length-1].type&&n.pop();for(const i of n)"first"===i.type&&t.length>0?(e.push(t),t=[i]):t.push(i);t.length>0&&e.push(t);let i=Number(r.parentBranch[0]),a=Number(r.parentBranch[1]);const s=r.parent.maxColumns;for(;r.parent.colCount-a<e.length&&r.parent.colCount<s;)r.parent.addColumn();r.parent.addChildrenAfter(e[0],r);for(let t=1;t<e.length;t++)a++,a>=s&&(a=0,r.parent.addRowAfter(i),i++),r.parent.setCell(i,a,e[t])}else r.parent.addChildrenAfter(n.filter((e=>"first"!==e.type)),r);return i.position=i.offsetOf(n[n.length-1]),i.contentDidChange({inputType:"insertFromPaste"}),Cc(e),!0}}catch(e){}if(r="string"!=typeof t?t.getData("application/json"):"",r&&window.MathfieldElement.computeEngine)try{const e=JSON.parse(r);if("object"==typeof e&&"latex"in e&&e.latex&&(n=e.latex),!n){const t=window.MathfieldElement.computeEngine.box(e);t&&!t.has("Error")&&(n=t.latex)}n||(i="latex")}catch(e){}if(n||"string"==typeof t||(n=t.getData("application/x-latex"),n&&(i="latex")),n||(n="string"==typeof t?t:t.getData("text/plain")),n){let t;return[t,n]=Gs(n),"auto"===i&&t&&(i="latex"),e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,n,{format:i})&&(e.startRecording(),e.snapshot("paste"),Cc(e)),e.startRecording(),!0}return!1}insert(e,t,n){var i,r;const a="string"==typeof t?t:null!=(r=null==(i=window.MathfieldElement.computeEngine)?void 0:i.box(t).latex)?r:"";if(!n.silenceNotifications&&!e.contentWillChange({data:a,inputType:"insertText"}))return!1;n.insertionMode||(n.insertionMode="replaceSelection"),n.selectionMode||(n.selectionMode="placeholder"),n.format||(n.format="auto");const{silenceNotifications:s}=e;n.silenceNotifications&&(e.silenceNotifications=!0);const o=e.silenceNotifications;e.silenceNotifications=!0;const l={"?":"\\placeholder{}","@":"\\placeholder{}"};l[0]="replaceAll"===n.insertionMode?"":e.getValue(e.selection,"latex-unstyled"),"replaceSelection"!==n.insertionMode||e.selectionIsCollapsed?"replaceAll"===n.insertionMode?(e.root.setChildren([],"body"),e.position=0):"insertBefore"===n.insertionMode?e.collapseSelection("backward"):"insertAfter"===n.insertionMode&&e.collapseSelection("forward"):e.deleteAtoms(Ns(e.selection)),e.at(e.position).isLastSibling||"placeholder"!==e.at(e.position+1).type?"placeholder"===e.at(e.position).type&&e.deleteAtoms([e.position-1,e.position]):e.deleteAtoms([e.position,e.position+1]);let c=-1;l[0]?l["@"]=l[0]:"string"==typeof t&&/(^|[^\\])#@/.test(t)&&(c=function(e){let t=e.at(e.position);if("text"===t.mode){for(;!t.isFirstSibling&&"text"===t.mode;)t=t.leftSibling;return e.offsetOf(t)}const n=t;let i=!1;if("mclose"===t.type){const e=vo[t.value];for(;!t.isFirstSibling&&("mopen"!==t.type||t.value!==e);)t=t.leftSibling;t.isFirstSibling||(t=t.leftSibling),i=!0}else"leftright"===t.type&&(t=t.leftSibling,i=!0);if(i)for(;!t.isFirstSibling&&(t.isFunction||vd(t));)t=t.leftSibling;else{const e=[];for(;!t.isFirstSibling&&(vd(t)||e.length>0);)"mclose"===t.type&&e.unshift(t.value),"mopen"===t.type&&e.length>0&&t.value===vo[e[0]]&&e.shift(),t=t.leftSibling}return n===t?-1:e.offsetOf(t)}(e),c>=0&&(l["@"]=e.getValue(c,e.position,"latex"))),l[0]||(l[0]=l["?"]);let u=!1;const d=e=>(u=!0,l[e]);let[h,p]=fd(e,t,d,n);if(!p)return!1;const f=1===p.length&&"genfrac"===p[0].type;f&&c>=0&&"function"==typeof e.mathfield.options.isImplicitFunction&&e.mathfield.options.isImplicitFunction(e.at(e.position).command)?(l["@"]=l["?"],u=!1,[h,p]=fd(e,t,d,n)):c>=0&&e.deleteAtoms([c,e.position]);const{parent:m}=e.at(e.position),g=m.hasEmptyBranch("body");if(f&&"latex"!==h&&e.mathfield.options.removeExtraneousParentheses&&m instanceof Ho&&"("===m.leftDelim&&g){const e=m.parent,t=m.parentBranch;e.removeChild(m),e.setChildren(p,t)}const v=e.at(e.position);v.parent.addChildrenAfter(p,v),"latex"===h&&"string"==typeof t&&"root"===(null==m?void 0:m.type)&&g&&!u&&(m.verbatimLatex=t),e.silenceNotifications=o;const b=p[p.length-1];if("placeholder"===n.selectionMode){const t=p.flatMap((e=>[e,...e.children])).find((e=>"placeholder"===e.type));if(t){const n=e.offsetOf(t);e.setSelection(n-1,n),e.announce("move")}else b&&(e.position=e.offsetOf(b))}else"before"===n.selectionMode||("after"===n.selectionMode?b&&(e.position=e.offsetOf(b)):"item"===n.selectionMode&&e.setSelection(e.anchor,e.offsetOf(b)));return e.contentDidChange({data:a,inputType:"insertText"}),e.silenceNotifications=s,!0}};function bd(e){return{value:e.model.getValue(),selectionIsCollapsed:e.model.selectionIsCollapsed,canUndo:e.canUndo(),canRedo:e.canRedo(),style:e.selectionStyle,mode:e.model.mode}}new class extends Ys{constructor(){super("text")}onPaste(e,t){if(!t)return!1;const n="string"==typeof t?t:t.getData("text/plain");return!(!n||!e.model.contentWillChange({inputType:"insertFromPaste",data:n}))&&(e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,n)&&(e.model.contentDidChange({inputType:"insertFromPaste"}),e.startRecording(),e.snapshot("paste"),Cc(e)),e.startRecording(),!0)}insert(e,t,n={}){if(!e.contentWillChange({data:t,inputType:"insertText"}))return!1;n.insertionMode||(n.insertionMode="replaceSelection"),n.selectionMode||(n.selectionMode="placeholder"),n.format||(n.format="auto");const{silenceNotifications:i}=e;n.silenceNotifications&&(e.silenceNotifications=!0);const r=e.silenceNotifications;e.silenceNotifications=!0,"replaceSelection"!==n.insertionMode||e.selectionIsCollapsed?"replaceAll"===n.insertionMode?(e.root.setChildren([],"body"),e.position=0):"insertBefore"===n.insertionMode?e.collapseSelection("backward"):"insertAfter"===n.insertionMode&&e.collapseSelection("forward"):e.deleteAtoms(Ns(e.selection));const a=(s=t,o=e.mathfield.context,Qo(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=s.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/lbrace/g,"\\textbraceleft ")).replace(/rbrace/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),{context:o,parseMode:"text"}));var s,o;if(fu(a,n.style),!a)return!1;const l=e.at(e.position),c=l.parent.addChildrenAfter(a,l);return e.silenceNotifications=r,"before"===n.selectionMode||("item"===n.selectionMode?e.setSelection(e.anchor,e.offsetOf(c)):c&&(e.position=e.offsetOf(c))),e.contentDidChange({data:t,inputType:"insertText"}),e.silenceNotifications=i,!0}};var yd=20,_d=(e,t)=>`\n <line x1="${e+yd}" y1="${t+yd}" \n x2="${e>t?e+yd:180}" \n y2="${e<t?t+yd:180}"/>\n <svg id="plus" viewBox="0 0 40 40" x="${e}" y="${t}" width="40" height="40">\n <circle class="cls-2" cx="20" cy="20" r="20"/>\n <path class="font" d="m33.33,20c0,1.84-1.49,3.34-3.33,3.34h-6.67v6.66c0,1.84-1.49,3.34-3.33,3.34s-3.34-1.5-3.34-3.34v-6.66h-6.66c-1.84,0-3.34-1.5-3.34-3.34s1.5-3.33,3.34-3.33h6.66v-6.67c0-1.84,1.5-3.33,3.34-3.33s3.33,1.49,3.33,3.33v6.67h6.67c1.84,0,3.33,1.49,3.33,3.33Z"/>\n </svg>`,wd=(e,t)=>`\n <line x1="${e+yd}" y1="${t+yd}" \n x2="${e>t?e+yd:180}" \n y2="${e<t?t+yd:180}"/>\n <svg id="minus" viewBox="0 0 40 40" x="${e}" y="${t}" width="40" height="40">\n <circle class="cls-2" cx="20" cy="20" r="20"/>\n <path class="font" d="m33.33,20c0,1.84-1.49,3.33-3.33,3.33H10c-1.84,0-3.34-1.49-3.34-3.33s1.5-3.34,3.34-3.34h20c1.84,0,3.33,1.5,3.33,3.34Z"/>\n </svg>`,xd=(e,t,n)=>`\n <svg id="arrow" viewBox="0 0 40 40" x="${e}" y="${t}" width="40" height="40">\n <circle class="cls-2" cx="20" cy="20" r="20"/>\n <g transform="rotate(${n})" transform-origin="20 20">\n <path class="font" d="m17.7,7.23h4.6c.52,0,.94.42.94.94v13.82c0,.52.42.94.94.94h3.39c.83,0,1.25,1.01.66,1.6l-7.56,7.56c-.37.37-.96.37-1.32,0l-7.56-7.56c-.59-.59-.17-1.6.66-1.6h3.39c.52,0,.94-.42.94-.94v-13.82c0-.52.42-.94.94-.94Z"/>\n </g> \n </svg>`,kd=`\n<svg class="MLEP__array-buttons" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" \nviewBox=\n"-2 -2 205 205">\n <rect \n class="MLEP__array-insert-background rows"\n x="0" \n y="52" \n height="144" \n width="48" \n rx="24"/>\n <rect \n class="MLEP__array-insert-background columns"\n x="52" \n y="0" \n height="48" \n width="144" \n rx="24"/>\n <g data-command='"moveDown"'>\n ${xd(104,152,0)}\n </g>\n <g data-command='"moveUp"'>\n ${xd(104,56,180)}\n </g>\n <g data-command='"moveToNextWord"'>\n ${xd(152,104,-90)}\n </g>\n <g data-command='"moveToPreviousWord"'>\n ${xd(56,104,90)}\n </g>\n <g>\n\n <g data-command='"addColumnBefore"'>\n ${_d(56,4)}\n </g>\n <g data-command='"removeColumn"'>\n ${wd(104,4)}\n </g>\n <g data-command='"addColumnAfter"'>\n ${_d(152,4)}\n </g>\n <g data-command='"addRowBefore"'>\n ${_d(4,56)}\n </g>\n <g data-command='"removeRow"'>\n ${wd(4,104)}\n </g>\n <g data-command='"addRowAfter"'>\n ${_d(4,152)}\n </g>\n</svg>`,Sd=e=>`\n<svg id="Bmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24" \n data-command='["setEnvironment","Bmatrix"]'>\n <rect class="cls-1" width="28" height="24"/>\n <path class="cls-2" d="m6,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>\n <path class="cls-2" d="m22,4c1.1,0,2,.9,2,2v3c0,1.66.9,3,2,3-1.1,0-2,1.34-2,3v3c0,1.1-.9,2-2,2"/>\n <circle cx="10" cy="8" r="1"/>\n <circle cx="14" cy="12" r="1"/>\n <circle cx="18" cy="16" r="1"/>\n</svg>`,Ed={matrix:e=>`\n<svg id="matrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24" \n data-command='["setEnvironment","matrix"]'>\n <rect class="cls-1" width="28" height="24"/>\n <circle cx="10" cy="8" r="1"/>\n <circle cx="14" cy="12" r="1"/>\n <circle cx="18" cy="16" r="1"/></svg>`,pmatrix:e=>`\n<svg id="pmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24" \ndata-command='["setEnvironment","pmatrix"]'>\n <rect class="cls-1" width="28" height="24"/>\n <path class="cls-2" d="m6,4c-3.96,4.6-3.96,11.4,0,16"/>\n <path class="cls-2" d="m22,4c3.96,4.6,3.96,11.4,0,16"/>\n <circle cx="10" cy="8" r="1"/>\n <circle cx="14" cy="12" r="1"/>\n <circle cx="18" cy="16" r="1"/></svg>`,bmatrix:e=>`\n<svg id="bmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24" \n data-command='["setEnvironment","bmatrix"]'>\n <rect class="cls-1" width="28" height="24"/>\n <path class="cls-2" d="m6,4h-3v16h3"/>\n <path class="cls-2" d="m22,4h3v16h-3"/>\n <circle cx="10" cy="8" r="1"/>\n <circle cx="14" cy="12" r="1"/>\n <circle cx="18" cy="16" r="1"/>\n</svg>`,Bmatrix:Sd,vmatrix:e=>`\n<svg id="vmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24" \n data-command='["setEnvironment","vmatrix"]'>\n <rect class="cls-1" width="28" height="24"/>\n <circle cx="10" cy="8" r="1"/>\n <circle cx="14" cy="12" r="1"/>\n <circle cx="18" cy="16" r="1"/>\n <line class="cls-2" x1="4" y1="4" x2="4" y2="20"/>\n <line class="cls-2" x1="24" y1="4" x2="24" y2="20"/>\n</svg>`,Vmatrix:e=>`\n<svg id="Vmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="-3.5 -3 35 30" \n data-command='["setEnvironment","Vmatrix"]'>\n <rect class="cls-1" width="28" height="24"/>\n <circle cx="10" cy="8" r="1"/>\n <circle cx="14" cy="12" r="1"/>\n <circle cx="18" cy="16" r="1"/>\n <line class="cls-2" x1="6" y1="4" x2="6" y2="20"/>\n <line class="cls-2" x1="22" y1="4" x2="22" y2="20"/>\n <line class="cls-2" x1="2" y1="4" x2="2" y2="20"/>\n <line class="cls-2" x1="26" y1="4" x2="26" y2="20"/>\n</svg>`},Cd={cases:e=>`\n<svg id="cases" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24" \n data-command='["setEnvironment","cases"]'>\n <rect class="cls-1" width="28" height="24"/>\n <path class="cls-2" d="m10,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>\n <circle cx="13" cy="8" r="1"/>\n <circle cx="13" cy="16" r="1"/>\n <circle cx="21" cy="8" r="1"/>\n <circle cx="21" cy="16" r="1"/>\n</svg>`,rcases:e=>`\n<svg id="rcases" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24" \n data-command='["setEnvironment","rcases"]'>\n <rect class="cls-1" width="28" height="24"/>\n <path class="cls-2" d="m18,20c1.1,0,2-.9,2-2v-3c0-1.66.9-3,2-3-1.1,0-2-1.34-2-3v-3c0-1.1-.9-2-2-2"/>\n <circle cx="15" cy="8" r="1"/>\n <circle cx="15" cy="16" r="1"/>\n <circle cx="7" cy="8" r="1"/>\n <circle cx="7" cy="16" r="1"/>\n</svg>`,Bmatrix:Sd};function Td(e){var t,n;const i=null==(t=e.model.parentEnvironment)?void 0:t.array;if(!i)return;let r=0;i.forEach((e=>{(!r||e.length>r)&&(r=e.length)}));let a,s=document.getElementById("mathlive-environment-popover");s||(s=hc("mathlive-environment-popover"),po("environment-popover"),po("core"),s.setAttribute("aria-hidden","true"));const o=s.querySelector(".MLEP__environment-controls");o?a=o:(a=document.createElement("div"),s.innerHTML="",s.appendChild(a)),a.className="MLEP__environment-controls",a.style.display="flex",a.style.width="100%",a.style.height="100%",a.style.boxSizing="border-box",a.innerHTML=kd;let l=[],c="";const u=e.model.parentEnvironment.environmentName;if(No(u)){const e=function(e){return e.replace("*","")}(u);c=Ed[e]("active");const t=Ed,{[e]:n}=t,i=p(t,[h(e)]);l=Object.values(i).map((e=>e("inactive")))}else if(function(e){return Ro.includes(e)}(u)){const e=function(e){return"dcases"===e?"cases":e}(u);c=Cd[e]("active");const t=Cd,{[e]:n}=t,i=p(t,[h(e)]);l=Object.values(i).map((e=>e("inactive")))}else(function(e){return Po.includes(e)})(u)&&(c=Ed.matrix("active"),l=Object.values(Cd).map((e=>e("inactive"))));const d=document.createElement("div");d.className="MLEP__environment-delimiter-controls",d.style.display="flex",d.style.flexDirection="column",d.innerHTML=`\n <div class='MLEP__array-delimiter-options'>\n ${c}\n ${l.join("")}\n </div>`,c&&a.appendChild(d);a.querySelectorAll("[data-command]").forEach((t=>{const n=t.dataset.command;let i=n;try{i=JSON.parse(n)}catch(e){}t.addEventListener("mousedown",(e=>e.preventDefault())),i&&t.addEventListener("click",(()=>e.executeCommand(i)))}));const f=null==(n=e.field)?void 0:n.getBoundingClientRect();f&&(s.style.top=`${window.scrollY+(f.top-s.clientHeight-15)}px`,s.style.left=`${f.left+20}px`,s.classList.add("is-visible"))}function Ad(){const e=document.getElementById("mathlive-environment-popover");null==e||e.classList.remove("is-visible")}function Md(e){if(!e.hasFocus())return;let t=!1;if("math"===e.model.mode){const i=e.model.parentEnvironment;if((null==i?void 0:i.array)&&(n=i.environmentName,Oo.concat(Po).concat(Ro).concat(Io).includes(n))){const n=e.options.environmentPopoverPolicy;t="auto"===n||"on"===n}}var n;t?Td(e):Ad()}function Ld(e){const t=getComputedStyle(e).direction;return"ltr"===t||"rtl"===t?t:"ltr"}function Dd(e,t,n){return"left"===t||"leading"===t&&"ltr"===n||"trailing"===t&&"rtl"===n?e.left:e.right}function Id(e,t,n,i){return"middle"===n?e-t/2:"start"===n&&"rtl"===i||"end"===n&&"ltr"===i||"top"===n||"right"===n?Math.max(0,e-t):e}function Rd(e){return"submenu"in e}function Pd(e){return"type"in e&&"command"===e.type||"onMenuSelect"in e||"id"in e}function Od(e){return"type"in e&&"divider"===e.type}function Nd(e){return"type"in e&&"heading"===e.type}var Bd={};function $d(e){let t=Bd[e];if(!t){let n;switch(e){case"checkmark":n='<span aria-hidden="true" class="ui-checkmark"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z"></path></svg>\n </span>';break;case"trailing-chevron":n='<span aria-hidden="true" class="ui-trailing-chevron"><svg focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"></path></svg></span>';break;case"mixedmark":n='<span aria-hidden="true" class="ui-mixedmark"><svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 512 512"><path fill="currentColor" d="M0 256c0-13.3 10.7-24 24-24H488c13.3 0 24 10.7 24 24s-10.7 24-24 24H24c-13.3 0-24-10.7-24-24z"/></svg></span>'}if(n){const i=document.createElement("template");i.innerHTML=n,Bd[e]=i,t=i}}if(t){if("content"in t)return t.content.cloneNode(!0);const e=document.createElement("svg");return e.innerHTML=t.innerHTML,e}}var Fd=class{constructor(e,t){var n;this._element=null,this.parentMenu=t,this._declaration=e,Rd(e)?(this.type="submenu",this.submenu=new Kd(e.submenu,{parentMenu:t,submenuClass:e.submenuClass,columnCount:e.columnCount})):this.type=null!=(n=e.type)?n:"command",this.hasCheck=Pd(e)&&void 0!==e.checked}get rootMenu(){return this.parentMenu.rootMenu}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}dispose(){var e,t;null==(e=this._abortController)||e.abort(),this._abortController=void 0,null==(t=this._element)||t.remove(),this._element=null,this.submenu&&this.submenu.dispose(),this.submenu=void 0}get menuItem(){return this._declaration}get label(){var e;return null!=(e=this._label)?e:""}set label(e){void 0===e&&(e=""),e!==this._label&&(this._label=e,this.dirty=!0)}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.dirty=!0)}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.element&&(e?this.element.removeAttribute("aria-disabled"):this.element.setAttribute("aria-disabled","true")),this.dirty=!0}get checked(){return this._checked}set checked(e){this._checked=e,this.dirty=!0}get tooltip(){return this._tooltip}set tooltip(e){e!==this._tooltip&&(this._tooltip=e,this.dirty=!0)}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){e!==this._ariaLabel&&(this._ariaLabel=e,this.dirty=!0)}get active(){var e,t;return null!=(t=null==(e=this.element)?void 0:e.classList.contains("active"))&&t}set active(e){this.element&&this.element.classList.toggle("active",e)}updateState(e){var t,n,i;const r=this._declaration;if(Od(r))return this.enabled=!1,void(this.checked=!1);Nd(r)&&(this.enabled=!1,this.checked=!1,this.visible=!0),Pd(r)&&(this.checked=Pd(r)&&null!=(t=zd(r.checked,e))&&t),(Pd(r)||Rd(r))&&(this.enabled=null==(n=zd(r.enabled,e))||n,this.visible=null==(i=zd(r.visible,e))||i,this.visible&&this.enabled&&this.submenu&&(this.submenu.updateState(e),this.submenu.visible||(this.visible=!1))),(Pd(r)||Nd(r)||Rd(r))&&(this.label=zd(r.label,e),this.tooltip=zd(r.tooltip,e),this.ariaLabel=zd(r.ariaLabel,e)),this._element&&this.updateElement()}set dirty(e){console.assert(!0===e),e&&this.parentMenu&&(this.parentMenu.dirty=!0)}updateElement(){if(!this.visible||!this.element)return;const e=this.element;e.textContent="",this.enabled?e.removeAttribute("aria-disabled"):e.setAttribute("aria-disabled","true"),!0===this.checked?(e.setAttribute("aria-checked","true"),e.append($d("checkmark"))):"mixed"===this.checked?(e.setAttribute("aria-checked","mixed"),e.append($d("mixedmark"))):e.removeAttribute("aria-checked"),this.ariaLabel&&e.setAttribute("aria-label",this.ariaLabel);const t=document.createElement("span");if(t.className=this.parentMenu.hasCheck?"label indent":"label","heading"===this.type&&t.classList.add("heading"),t.innerHTML=this.label,e.append(t),this._tooltip&&e.setAttribute("data-tooltip",this._tooltip),Pd(this._declaration)&&this._declaration.keyboardShortcut){const t=document.createElement("kbd");t.innerHTML=Gl(this._declaration.keyboardShortcut),e.append(t)}"submenu"===this.type&&e.append($d("trailing-chevron"))}get element(){if(this._element)return this._element;if(Od(this._declaration)){const e=document.createElement("li");return e.setAttribute("part","menu-divider"),e.setAttribute("role","divider"),this._element=e,e}const e=document.createElement("li");this._element=e,(Pd(this._declaration)||Nd(this._declaration)||Rd(this._declaration))&&this._declaration.class&&(e.className=this._declaration.class),e.setAttribute("part","menu-item"),e.setAttribute("tabindex","-1"),this.hasCheck?e.setAttribute("role","menuitemcheckbox"):e.setAttribute("role","menuitem"),"submenu"===this.type&&(e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded","false"));const t=this.abortController.signal;return e.addEventListener("pointerenter",this,{signal:t}),e.addEventListener("pointerleave",this,{signal:t}),e.addEventListener("pointerup",this,{signal:t}),e.addEventListener("click",this,{signal:t}),this._element}dispatchSelect(){if(!Pd(this._declaration))return;const e=new CustomEvent("menu-select",{cancelable:!0,bubbles:!0,detail:{modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data}});this.parentMenu.dispatchEvent(e)&&"function"==typeof this._declaration.onMenuSelect&&this._declaration.onMenuSelect({modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data})}handleEvent(e){var t;if(this.visible&&this.enabled){if("click"===e.type)return"modal"===this.rootMenu.state&&this.select(),e.stopPropagation(),void e.preventDefault();if("pointerenter"===e.type){const n=e;return this.rootMenu.cancelDelayedOperation(),void(this.parentMenu.isSubmenuOpen&&(null==(t=this.parentMenu.activeMenuItem)?void 0:t.movingTowardSubmenu(n))?this.rootMenu.scheduleOperation((()=>{this.parentMenu.activeMenuItem=this,this.openSubmenu()})):(this.parentMenu.activeMenuItem=this,this.openSubmenu({withDelay:!0})))}if("pointerleave"!==e.type)return"pointerup"===e.type?("modal"!==this.rootMenu.state&&this.select(),e.stopPropagation(),void e.preventDefault()):void 0;this.rootMenu.activeSubmenu===this.parentMenu&&(this.parentMenu.activeMenuItem=null)}}select(){this.rootMenu.cancelDelayedOperation(),"submenu"!==this.type?(this.active=!1,setTimeout((()=>{this.active=!0,setTimeout((()=>{this.rootMenu.hide(),this.dispatchSelect()}),80)}),80)):this.openSubmenu()}openSubmenu(e){var t;if("submenu"!==this.type||!this.element)return;if(null!=(t=null==e?void 0:e.withDelay)&&t)return void this.rootMenu.scheduleOperation((()=>this.openSubmenu()));const n=this.element.getBoundingClientRect(),i=Ld(this.element);this.submenu.show({container:this.rootMenu.element.parentNode,location:{x:Dd(n,"trailing",i),y:n.top-4},alternateLocation:{x:Dd(n,"leading",i),y:n.top-4}})}movingTowardSubmenu(e){if(!this.element)return!1;if("submenu"!==this.type)return!1;const t=this.rootMenu.lastMoveEvent;if(!t)return!1;const n=e.timeStamp-t.timeStamp;if(n>500)return!1;const i=e.clientX-t.clientX;var r,a,s;if((r=i,a=t.clientY-e.clientY,s=n,Math.hypot(r,a)/s)<=.2)return!1;let o="right";if(this.submenu.element){const e=this.submenu.element.getBoundingClientRect(),t=this.element.getBoundingClientRect();e.left<t.left+t.width/2&&(o="left")}return"right"===o?i>0:i<0}};function zd(e,t){return void 0===e||"function"!=typeof e?e:(null!=t||(t={alt:!1,control:!1,shift:!1,meta:!1}),e(t))}var Kd=class e{constructor(e,t){var n,i;this._element=null,this._activeMenuItem=null,this._dirty=!0,this.parentMenu=null!=(n=null==t?void 0:t.parentMenu)?n:null,this._submenuClass=null==t?void 0:t.submenuClass,this.columnCount=null!=(i=null==t?void 0:t.columnCount)?i:1,this.isSubmenuOpen=!1,this.menuItems=e}get children(){return this._menuItems}set menuItems(e){const t=this.parentMenu;this.dispose(),this.parentMenu=t,e=[...e],this._menuItems=e.map((e=>e.onCreate?e.onCreate(e,this):new Fd(e,this))),this.hasCheck=void 0,this.dirty=!0}dispose(){var e;this.hide(),this._element&&this._element.remove(),this._abortController&&this._abortController.abort(),null==(e=this._menuItems)||e.forEach((e=>e.dispose())),this._menuItems=[],this._activeMenuItem=null,this.parentMenu=null}handleEvent(e){if("wheel"===e.type&&this._element){const t=e;this._element.scrollBy(0,t.deltaY),e.stopPropagation()}}dispatchEvent(e){return this.rootMenu.dispatchEvent(e)}get rootMenu(){return this.parentMenu.rootMenu}updateState(e){var t,n,i;this._menuItems.forEach((t=>t.updateState(e)));const r=this.hasCheck;let a;this.hasCheck=this._menuItems.some((e=>e.visible&&e.hasCheck)),this.hasCheck!==r&&this._menuItems.forEach((t=>t.updateState(e)));let s=0;for(const e of this._menuItems)"heading"===e.type?(a&&0===s&&(a.visible=!1),a=e,s=0):"divider"===e.type&&a?(a.visible=s>0,a=void 0,s=0):a&&e.visible&&(s+=1);a&&(a.visible=s>0);let o=!0;for(const e of this._menuItems)"divider"===e.type?(e.visible=!o,o=!0):e.visible&&(o=!1);(null==(t=this.activeMenuItem)?void 0:t.visible)||(this.activeMenuItem=null),(null==(n=this.activeMenuItem)?void 0:n.enabled)||"submenu"!==(null==(i=this.activeMenuItem)?void 0:i.type)||this._activeMenuItem.submenu.hide(),this._dirty=!1}get enabled(){return this.updateIfDirty(),this._menuItems.some((e=>"divider"!==e.type&&e.visible&&e.enabled))}get visible(){return this.updateIfDirty(),this._menuItems.some((e=>"divider"!==e.type&&e.visible))}set dirty(e){console.assert(!0===e),this._dirty!==e&&e&&this.parentMenu&&(this._dirty=!0,this.parentMenu.dirty=!0)}updateIfDirty(){this._dirty&&this.updateState(this.rootMenu.modifiers)}updateElement(){var e;if(this._element){this._element.textContent="";for(const{element:e,visible:t}of this._menuItems)e&&t&&this._element.append(e);null==(e=this._element.querySelector("li:first-of-type"))||e.setAttribute("tabindex","0")}}get element(){if(this._element)return this._element;const e=document.createElement("menu");e.setAttribute("role","menu"),e.setAttribute("tabindex","-1"),e.setAttribute("aria-orientation","vertical"),e.setAttribute("part","ui-menu-container"),this._submenuClass&&e.classList.add(this._submenuClass),e.classList.add("ui-menu-container"),this._abortController||(this._abortController=new AbortController);const t=this._abortController.signal;return e.addEventListener("focus",this,{signal:t}),e.addEventListener("wheel",this,{passive:!0,signal:t}),this._element=e,this.updateElement(),e}get activeMenuItem(){return this._activeMenuItem}set activeMenuItem(e){var t,n,i,r;if(this.rootMenu.cancelDelayedOperation(),e!==this._activeMenuItem){if(this.activeMenuItem){const e=this.activeMenuItem;e.active=!1,null==(t=e.submenu)||t.hide()}if(null!=(n=null==e?void 0:e.visible)&&!n)return void(this._activeMenuItem=null);this._activeMenuItem=e,e&&(e.active=!0)}e?null==(i=e.element)||i.focus({preventScroll:!0}):null==(r=this._element)||r.focus({preventScroll:!0})}get firstMenuItem(){this.updateIfDirty();let e=0,t=!1;const n=this._menuItems;for(;!t&&e<=n.length-1;){const i=n[e];t="divider"!==i.type&&i.visible&&i.enabled,e+=1}return t?n[e-1]:null}get lastMenuItem(){this.updateIfDirty();const e=this._menuItems;let t=e.length-1,n=!1;for(;!n&&t>=0;){const i=e[t];n="divider"!==i.type&&i.visible&&i.enabled,t-=1}return n?e[t+1]:null}nextMenuItem(e){if(0===e)return this._activeMenuItem;if(!this._activeMenuItem)return e>0?this.firstMenuItem:this.lastMenuItem;if(!this.firstMenuItem||!this.lastMenuItem||!this._activeMenuItem)return null;this.updateIfDirty();const t=this._menuItems.indexOf(this.firstMenuItem),n=this._menuItems.indexOf(this.lastMenuItem);let i=this._menuItems.indexOf(this._activeMenuItem),r=1;for(;i>=t&&i<=n;){i+=e>0?1:-1;const t=this._menuItems[i];if(!t)break;if(t.visible&&t.enabled){if(r===Math.abs(e))return this._menuItems[i];r+=1}}return e>0?this.lastMenuItem:this.firstMenuItem}getMenuItemColumn(e){this.updateIfDirty();const t=this._menuItems.filter((e=>e.visible&&e.enabled)).indexOf(e);return t<0?-1:t%this.columnCount}static get collator(){return e._collator||(e._collator=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),e._collator}findMenuItem(t){var n;this.updateIfDirty();const i=this._menuItems.filter((e=>"divider"!==e.type&&e.visible&&e.enabled));if(0===i.length)return null;const r=Math.max(...i.map((e=>e.label.length)))-t.length;if(r<0)return null;let a=null,s=0;for(;s<r&&!a;)a=null!=(n=i.find((n=>0===e.collator.compare(t,n.label.substring(s,t.length)))))?n:null,s++;return a}show(e){return!(!this.visible||!e.container)&&(this.updateElement(),e.container.appendChild(this.element),b()&&(this.element.popover="manual",this.element.showPopover()),e.location&&function(e,t){var n,i,r;const a=null!=(n=Ld(e))?n:"ltr";e.style.position="fixed",e.style.left="",e.style.top="",e.style.right="",e.style.bottom="",e.style.height="",e.style.width="";const s=e.getBoundingClientRect(),o=Number.isFinite(t.maxHeight)?Math.min(t.maxHeight,window.innerHeight):window.innerHeight;let l=Math.min(o,null!=(i=t.height)?i:s.height),c=Id(t.location.y,l,t.verticalPos,a);c+l>window.innerHeight-8&&(t.alternateLocation?(c=Id(t.alternateLocation.y,l,t.verticalPos,a),c+l>window.innerHeight-8&&(c=void 0)):c=void 0),Number.isFinite(c)||(c=Math.max(8,window.innerHeight-8-l),8+l>window.innerHeight-8&&(e.style.bottom="8px")),l=Math.min(c+l,window.innerHeight-8)-c;const u=Number.isFinite(t.maxWidth)?Math.min(t.maxWidth,window.innerWidth):window.innerWidth;let d=Math.min(u,null!=(r=t.width)?r:s.width),h=Id(t.location.x,d,t.horizontalPos,a);h+d>window.innerWidth-8&&(t.alternateLocation?(h=function(e,t,n,i){return"middle"===n?e-t/2:"start"===n&&"ltr"===i||"end"===n&&"rtl"===i||"top"===n||"right"===n?e:e-t}(t.alternateLocation.x,d,t.verticalPos,a),h+d>window.innerWidth-8&&(h=void 0)):h=void 0),Number.isFinite(h)||(h=Math.max(8,window.innerWidth-8-d),8+d>window.innerWidth-8&&(e.style.right="8px")),d=Math.min(h+d,window.innerWidth-8)-h,"rtl"===a?e.style.right=`${Math.ceil(window.innerWidth-h-d).toString()}px`:e.style.left=`${Math.ceil(h).toString()}px`,e.style.top=`${Math.ceil(c).toString()}px`,l!==s.height&&(e.style.height=`${Math.ceil(l).toString()}px`),d!==s.width&&(e.style.width=`${Math.ceil(d).toString()}px`)}(this.element,{location:e.location,alternateLocation:e.alternateLocation,verticalPos:"bottom",horizontalPos:"start"}),this.element.focus({preventScroll:!0}),this.parentMenu&&(this.parentMenu.openSubmenu=this),!0)}hide(){var e,t,n,i,r;this.openSubmenu=null,this.activeMenuItem=null,this.parentMenu&&(this.parentMenu.openSubmenu=null),b()&&(null==(e=this._element)?void 0:e.popover)&&this.element.hidePopover(),null==(n=null==(t=this.parentMenu)?void 0:t.element)||n.focus(),null==(r=null==(i=this._element)?void 0:i.parentNode)||r.removeChild(this._element)}set openSubmenu(e){var t,n,i,r;const a=null!==e;"submenu"===(null==(t=this.activeMenuItem)?void 0:t.type)&&(null==(n=this.activeMenuItem.element)||n.setAttribute("aria-expanded",a.toString())),null==(r=null==(i=this.activeMenuItem)?void 0:i.element)||r.classList.toggle("is-submenu-open",a),this.isSubmenuOpen=a}},Ud=class e extends Kd{constructor(e,t){var n;super(e),this.state="closed",this.typingBufferResetTimer=0,this.hysteresisTimer=0,this._updating=!1,this._host=null!=(n=null==t?void 0:t.host)?n:null,this.isDynamic=e.some(qd),this._modifiers={shift:!1,control:!1,alt:!1,meta:!1},this.typingBuffer="",this.state="closed"}get modifiers(){return this._modifiers}set modifiers(e){var t,n;(t=this._modifiers,n=e,!t&&n||t&&!n||t&&n&&(t.alt!==n.alt||t.control!==n.control||t.shift!==n.shift||t.meta!==n.meta))&&(this._modifiers=e,this.dirty=!0)}get activeSubmenu(){let e=this;for(;e.isSubmenuOpen;)e=e.activeMenuItem.submenu;return e}set dirty(e){this._updating||(console.assert(!0===e),this._dirty!==e&&(this._dirty=!0,e&&setTimeout((()=>{this.updateState(this.modifiers),this.updateElement()}))))}updateState(e){this._updating=!0,this.modifiers=null!=e?e:this.modifiers,super.updateState(this.modifiers),this._updating=!1}handleKeyupEvent(e){this.isDynamic&&(this.modifiers=Wl(e)),e.stopImmediatePropagation()}handleKeydownEvent(e){var t,n,i;if("Tab"===e.key||"Escape"===e.key)return void this.hide();this.isDynamic&&(this.modifiers=Wl(e));let r=!0;const a=this.activeSubmenu,s=a.activeMenuItem;switch(e.key){case" ":case"Space":case"Return":case"Enter":null==s||s.select(Wl(e));break;case"ArrowRight":if("submenu"===(null==s?void 0:s.type))s.select(Wl(e)),this.activeSubmenu.activeMenuItem=this.activeSubmenu.firstMenuItem;else if(s){const e=null!=(t=a.getMenuItemColumn(s))?t:-1;if(e>=0&&e<(null!=(n=a.columnCount)?n:1)-1){const e=a.nextMenuItem(1);e&&(a.activeMenuItem=e)}}else a.activeMenuItem=a.firstMenuItem;break;case"ArrowLeft":if(a===this.rootMenu)s||(a.activeMenuItem=a.firstMenuItem);else{if((s&&null!=(i=a.getMenuItemColumn(s))?i:-1)<=0||!s){a.hide();const e=a.parentMenu.activeMenuItem;if(e){const{element:t}=e;null==t||t.focus(),null==t||t.classList.remove("is-submenu-open")}}else{const e=a.nextMenuItem(-1);e&&(a.activeMenuItem=e)}}break;case"ArrowDown":a.activeMenuItem=a.nextMenuItem(a.columnCount);break;case"ArrowUp":a.activeMenuItem=a.nextMenuItem(-a.columnCount);break;case"Home":case"PageUp":a.activeMenuItem=a.firstMenuItem;break;case"End":case"PageDown":a.activeMenuItem=a.lastMenuItem;break;case"Backspace":if(this.typingBuffer&&(this.typingBuffer=this.typingBuffer.slice(0,-1),this.typingBuffer)){clearTimeout(this.typingBufferResetTimer);const e=a.findMenuItem(this.typingBuffer);e&&(a.activeMenuItem=e),this.typingBufferResetTimer=setTimeout((()=>{this.typingBuffer=""}),500)}break;default:if(Xl(e)){isFinite(this.typingBufferResetTimer)&&clearTimeout(this.typingBufferResetTimer),this.typingBuffer+=e.key;const t=a.findMenuItem(this.typingBuffer);t&&(a.activeMenuItem=t),this.typingBufferResetTimer=setTimeout((()=>{this.typingBuffer=""}),500)}else r=!1}r&&(e.preventDefault(),e.stopPropagation())}handleEvent(e){if("keydown"===e.type)this.handleKeydownEvent(e);else if("keyup"===e.type)this.handleKeyupEvent(e);else if("pointermove"===e.type)this.lastMoveEvent=e;else if("pointerup"===e.type&&e.target===this.scrim)Number.isFinite(this.rootMenu._openTimestamp)&&Date.now()-this.rootMenu._openTimestamp<120?this.state="modal":"modal"===this.state&&this.hide();else if("contextmenu"===e.type)return e.preventDefault(),void e.stopPropagation();super.handleEvent(e)}dispatchEvent(e){return!this._host||this._host.dispatchEvent(e)}get scrim(){return Ql.element}connectScrim(e){const t=this.scrim;t.addEventListener("pointerup",this),t.addEventListener("contextmenu",this),t.addEventListener("keydown",this),t.addEventListener("keyup",this),t.addEventListener("pointermove",this),Ql.open({root:e,onDismiss:()=>this.hide()})}disconnectScrim(){const e=this.scrim;e.removeEventListener("pointerup",this),e.removeEventListener("contextmenu",this),e.removeEventListener("keydown",this),e.removeEventListener("keyup",this),e.removeEventListener("pointermove",this),"open"===Ql.state&&Ql.scrim.close()}get rootMenu(){return this}show(e){return this._onDismiss=null==e?void 0:e.onDismiss,(null==e?void 0:e.modifiers)&&(this.modifiers=e.modifiers),this.updateState(),this.connectScrim(null==e?void 0:e.target),super.show(d(u({},e),{container:this.scrim}))?(this._openTimestamp=Date.now(),this.state="open",!0):(this.disconnectScrim(),!1)}hide(){this.cancelDelayedOperation(),void 0!==this.state&&("closed"!==this.state&&(this.activeMenuItem=null,Ql.element.parentElement.focus(),super.hide(),this.state="closed",this.disconnectScrim()),this._onDismiss&&(this._onDismiss(),this._onDismiss=void 0))}scheduleOperation(t){this.cancelDelayedOperation();const n=e.SUBMENU_DELAY;n<=0?t():this.hysteresisTimer=setTimeout((()=>{this.hysteresisTimer=0,t()}),n)}cancelDelayedOperation(){this.hysteresisTimer&&(clearTimeout(this.hysteresisTimer),this.hysteresisTimer=0)}};Ud.SUBMENU_DELAY=120;var jd=Ud;function qd(e){return!Od(e)&&("function"==typeof e.label||"function"==typeof e.ariaLabel||"function"==typeof e.tooltip||(!(!Pd(e)&&!Rd(e)||"function"!=typeof e.enabled&&"function"!=typeof e.visible)||(!(!Pd(e)||"function"!=typeof e.checked)||!!Rd(e)&&e.submenu.some(qd))))}var Hd=class{};function Vd(e){return new Promise(((t,n)=>{const i=Zl(e);i||t(!1);let r=i;const a=setTimeout((()=>{var e,n;s.abort(),t((e=r,n=i,Math.hypot(n.x-e.x,n.y-e.y)<Hd.MAX_DISTANCE))}),Hd.DELAY),s=new AbortController,o=s.signal;for(const e of["pointermove","pointerup","pointercancel"])window.addEventListener(e,(e=>{if("pointerup"===e.type||"pointercancel"===e.type)clearTimeout(a),s.abort(),t(!1);else if("pointermove"===e.type){const t=Zl(e);t&&(r=t)}}),{passive:!0,signal:o})}))}async function Gd(e,t,n){if("contextmenu"===e.type){const i=e;if(n.show({target:t,location:Zl(i),modifiers:Wl(i)}))return e.preventDefault(),e.stopPropagation(),!0}if("keydown"===e.type){const i=e;if("ContextMenu"===i.code||"F10"===i.code&&i.shiftKey){const r=null==t?void 0:t.getBoundingClientRect();if(r&&n.show({target:t,location:{x:Math.ceil(r.left+r.width/2),y:Math.ceil(r.top+r.height/2)},modifiers:Wl(i)}))return e.preventDefault(),e.stopPropagation(),!0}}if("pointerdown"===e.type&&"mouse"!==e.pointerType&&0===e.button){let i=e.target;for(;i&&t!==i;)i=i.parentNode;if(!i)return!1;if(!n.visible)return!1;const r=Zl(e);if(await Vd(e))return"closed"===n.state&&(n.show({target:t,location:r}),!0)}return!1}Hd.DELAY=300,Hd.MAX_DISTANCE=10;var Zd={acute:714,grave:715,dot:729,ddot:168,mathring:730,tilde:126,bar:713,breve:728,check:711,hat:94,vec:8407};ne(Object.keys(Zd),"{body:auto}",{createAtom:e=>new mo(d(u({},e),{body:B(e.args[0]),accentChar:Zd[e.command.slice(1)]}))}),ne(["widehat","widecheck","widetilde"],"{body:auto}",{createAtom:e=>{const t=Q(B(e.args[0]));return new mo(d(u({},e),{body:B(e.args[0]),svgAccent:e.command.slice(1)+(t.length>5?"4":["1","1","2","2","3","3"][t.length])}))}}),ne(["overarc","overparen","wideparen"],"{body:auto}",{createAtom:e=>new mo(d(u({},e),{body:B(e.args[0]),svgAccent:"overarc"}))}),ne(["underarc","underparen"],"{body:auto}",{createAtom:e=>new fl(d(u({},e),{body:B(e.args[0]),svgBelow:"underarc"}))}),ne("utilde","{body:auto}",{createAtom:e=>{const t=B(e.args[0]),n=Q(t),i="widetilde"+(n.length>5?"4":["1","1","2","2","3","3"][n.length]);return new fl(d(u({},e),{body:t,svgBelow:i,boxType:os(t)}))}}),ne("^","{:string}",{createAtom:e=>{var t;return new Ds(d(u({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&null!=(t={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e.args[0]])?t:"^"}))}}),ne("`","{:string}",{createAtom:e=>{var t;return new Ds(d(u({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&null!=(t={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e.args[0]])?t:"`"}))}}),ne("'","{:string}",{createAtom:e=>{var t;return new Ds(d(u({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&null!=(t={a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e.args[0]])?t:"'"}))}}),ne('"',"{:string}",{createAtom:e=>{var t,n;return new Ds(d(u({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(null==(t=e.args)?void 0:t[0])?null!=(n={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",A:"Ä",E:"Ë",I:"Ë",O:"Ö",U:"Ü"}[e.args[0]])?n:'"'+e.args[0]:'"'}))}}),ne(".","{:string}",{createAtom:e=>{var t,n;return new Ds(d(u({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(null==(t=e.args)?void 0:t[0])?null!=(n={a:"ȧ",e:"ė",i:"̇i",o:"ȯ",u:"̇u",A:"Ȧ",E:"Ė",I:"İ",O:"Ȯ",U:"̇U"}[e.args[0]])?n:"."+e.args[0]:"."}))}}),ne("=","{:string}",{createAtom:e=>{var t,n;return new Ds(d(u({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(null==(t=e.args)?void 0:t[0])?null!=(n={a:"ā",e:"ē",i:"ī",o:"ō",u:"ū",A:"Ā",E:"Ē",I:"Ī",O:"Ō",U:"Ū"}[e.args[0]])?n:"="+e.args[0]:"="}))}}),ne("~","{:string}",{createAtom:e=>{var t;return new Ds(d(u({type:"mord"},e),{isFunction:!1,limits:"adjacent",value:e.args[0]&&null!=(t={n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e.args[0]])?t:"´"}))}}),ne("c","{:string}",{createAtom:e=>{var t;return new Ds(d(u({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&null!=(t={c:"ç",C:"Ç"}[e.args[0]])?t:""}))}}),ne("enclose","{notation:string}[style:string]{body:auto}",{createAtom:e=>{var t,n;const i=e.args,r={strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"none",svgStrokeStyle:void 0,borderStyle:void 0,style:null!=(t=e.style)?t:{}};if(i[1]){const e=i[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const t of e){const e=t.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(e)r.strokeWidth=e[1],r.strokeStyle=e[2],r.strokeColor=e[3];else{const e=t.match(/\s*([a-z]*)\s*=\s*"(.*)"/);e&&("mathbackground"===e[1]?r.backgroundcolor=e[2]:"mathcolor"===e[1]?r.strokeColor=e[2]:"padding"===e[1]?r.padding=e[2]:"shadow"===e[1]&&(r.shadow=e[2]))}}"dashed"===r.strokeStyle?r.svgStrokeStyle="5,5":"dotted"===r.strokeStyle&&(r.svgStrokeStyle="1,5")}r.borderStyle=`${r.strokeWidth} ${r.strokeStyle} ${r.strokeColor}`;const a={};return(null!=(n=i[0])?n:"").split(/[, ]/).filter((e=>e.length>0)).forEach((e=>{a[e.toLowerCase()]=!0})),new sl(e.command,B(i[2]),a,r)}}),ne("cancel","{body:auto}",{createAtom:e=>{var t;return new sl(e.command,B(e.args[0]),{updiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:null!=(t=e.style)?t:{}})}}),ne("bcancel","{body:auto}",{createAtom:e=>{var t;return new sl(e.command,B(e.args[0]),{downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:null!=(t=e.style)?t:{}})}}),ne("xcancel","{body:auto}",{createAtom:e=>{var t;return new sl(e.command,B(e.args[0]),{updiagonalstrike:!0,downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:null!=(t=e.style)?t:{}})}}),ne(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overlinesegment","overgroup"],"{:auto}",{createAtom:e=>{var t;return new fl(d(u({},e),{body:B(null==(t=e.args)?void 0:t[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgAbove:e.command.slice(1)}))}}),ne("overbrace","{:auto}",{createAtom:e=>new fl(d(u({},e),{body:B(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgAbove:e.command.slice(1)}))}),ne(["underrightarrow","underleftarrow","underleftrightarrow","underlinesegment","undergroup"],"{:auto}",{createAtom:e=>new fl(d(u({},e),{body:B(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgBelow:e.command.slice(1)}))}),ne(["underbrace"],"{:auto}",{createAtom:e=>new fl(d(u({},e),{body:B(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgBelow:e.command.slice(1)}))}),ne(["xrightarrow","longrightarrow","xleftarrow","longleftarrow","xRightarrow","xLeftarrow","xleftharpoonup","xleftharpoondown","xrightharpoonup","xrightharpoondown","xlongequal","xtwoheadleftarrow","xtwoheadrightarrow","xleftrightarrow","longleftrightarrow","xLeftrightarrow","xrightleftharpoons","longrightleftharpoons","xleftrightharpoons","xhookleftarrow","xhookrightarrow","xmapsto","xtofrom","xleftrightarrows","longleftrightarrows","xRightleftharpoons","longRightleftharpoons","xLeftrightharpoons","longLeftrightharpoons"],"[:auto]{:auto}",{createAtom:e=>{var t,n,i,r,a;return new fl(d(u({},e),{svgBody:e.command.slice(1),above:0===(null==(n=B(null==(t=e.args)?void 0:t[1]))?void 0:n.length)?void 0:B(null==(i=e.args)?void 0:i[1]),below:null!=(a=B(null==(r=e.args)?void 0:r[0]))?a:null,skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,paddedLabels:!0,boxType:"rel"}))},serialize:(e,t)=>e.command+(e.hasEmptyBranch("below")?"":`[${e.belowToLatex(t)}]`)+`{${e.aboveToLatex(t)}}${e.supsubToLatex(t)}`}),ne(["arccos","arcsin","arctan","arctg","arcctg","arg","ch","cos","cosh","cot","cotg","coth","ctg","cth","csc","cosec","deg","dim","exp","gcd","hom","inf","ker","lb","lg","ln","log","Pr","sec","sh","sin","sinh","sup","tan","tanh","tg","th","arcsec","arccsc","arsinh","arcosh","artanh","arcsech","arccsch"],"",{isFunction:!0,ifMode:"math",createAtom:e=>new El(e.command.slice(1),d(u({},e),{limits:"adjacent",isFunction:!0,variant:"main",variantStyle:"up"}))}),ne(["liminf","limsup"],"",{ifMode:"math",createAtom:e=>new El({"\\liminf":"lim inf","\\limsup":"lim sup"}[e.command],d(u({},e),{limits:"over-under",variant:"main"}))}),ne(["lim","mod"],"",{ifMode:"math",createAtom:e=>new El(e.command.slice(1),d(u({},e),{limits:"over-under",variant:"main"}))}),ne(["det","max","min"],"",{ifMode:"math",isFunction:!0,createAtom:e=>new El(e.command.slice(1),d(u({},e),{limits:"over-under",isFunction:!0,variant:"main"}))}),ne(["ang"],"{:math}",{ifMode:"math",createAtom:e=>new Ds(d(u({},e),{body:B(e.args[0])})),serialize:(e,t)=>`\\ang{${e.bodyToLatex(t)}}`,render:(e,t)=>{const n=e.createBox(t),i=n.caret;n.caret=void 0;const r=new cs("°",{style:d(u({},e.style),{variant:"normal",variantStyle:"up"})});return new cs([n,r],{type:"inner",isSelected:e.isSelected,caret:i})}}),ne("sqrt","[index:auto]{radicand:expression}",{ifMode:"math",createAtom:e=>new vl(d(u({},e),{body:B(e.args[1]),index:e.args[0]?B(e.args[0]):void 0}))}),ne(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{:expression}{:expression}",{ifMode:"math",createAtom:e=>{const t=u({},e),n=e.command,i=e.args;switch(n){case"\\dfrac":case"\\frac":case"\\tfrac":t.hasBarLine=!0;break;case"\\atopfrac":t.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":t.hasBarLine=!1,t.leftDelim="(",t.rightDelim=")";break;case"\\cfrac":t.hasBarLine=!0,t.continuousFraction=!0}switch(n){case"\\dfrac":case"\\dbinom":t.mathstyleName="displaystyle";break;case"\\tfrac":case"\\tbinom":t.mathstyleName="textstyle"}return new cl(i[0]?B(i[0]):[new Do],i[1]?B(i[1]):[new Do],t)},serialize:(e,t)=>{const n=e.aboveToLatex(t),i=e.belowToLatex(t);return/^[0-9]$/.test(n)&&/^[0-9]$/.test(i)?`${e.command}${n}${i}`:Ja(e.command,n,i)}}),ne(["brace","brack"],"",{infix:!0,createAtom:e=>new cl(B(e.args[0]),B(e.args[1]),d(u({},e),{hasBarLine:!1,leftDelim:"\\brace"===e.command?"\\lbrace":"\\lbrack",rightDelim:"\\brace"===e.command?"\\rbrace":"\\rbrack"})),serialize:(e,t)=>Xa([e.aboveToLatex(t),e.command,e.belowToLatex(t)])}),ne(["over","atop","choose"],"",{infix:!0,createAtom:e=>{let t,n;const i=e.args;return"\\choose"===e.command&&(t="(",n=")"),new cl(B(i[0]),B(i[1]),d(u({},e),{hasBarLine:"\\over"===e.command,leftDelim:t,rightDelim:n}))},serialize:(e,t)=>Xa([e.aboveToLatex(t),e.command,e.belowToLatex(t)])}),ne(["overwithdelims","atopwithdelims"],"{numer:auto}{denom:auto}{left-delim:delim}{right-delim:delim}",{infix:!0,createAtom:e=>{var t,n;const i=e.args;return new cl(B(i[0]),B(i[1]),d(u({},e),{leftDelim:null!=(t=i[2])?t:".",rightDelim:null!=(n=i[3])?n:".",hasBarLine:!1}))},serialize:(e,t)=>`${e.aboveToLatex(t)} ${e.command}${e.leftDelim}${e.rightDelim}${e.belowToLatex(t)}`}),ne("pdiff","{numerator}{denominator}",{ifMode:"math",createAtom:e=>new cl(B(e.args[0]),B(e.args[1]),d(u({},e),{hasBarLine:!0,numerPrefix:"∂",denomPrefix:"∂"}))}),ne(["sum","prod","bigcup","bigcap","coprod","bigvee","bigwedge","biguplus","bigotimes","bigoplus","bigodot","bigsqcup","intop"],"",{ifMode:"math",createAtom:e=>new hl({coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[e.command.slice(1)],d(u({},e),{limits:"auto",variant:"main"}))}),ne("smallint","",{ifMode:"math",createAtom:e=>new El("∫",d(u({},e),{limits:"adjacent",variant:"main"}))});var Wd={int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑",sqcup:"⊔",sqcap:"⊓",uplus:"⊎",wr:"≀",amalg:"⨿",Cap:"⋒",Cup:"⋓",doublecap:"⋒",doublecup:"⋓"};ne(Object.keys(Wd),"",{ifMode:"math",createAtom:e=>{const t=e.command,n=Wd[t.slice(1)];return new hl(n,d(u({},e),{limits:"adjacent",variant:{"⋒":"ams","⋓":"ams"}[n]}))}}),ne(["Re","Im"],"",{ifMode:"math",createAtom:e=>new El({"\\Re":"ℜ","\\Im":"ℑ"}[e.command],d(u({},e),{limits:"adjacent",isFunction:!0,variant:"fraktur"}))}),ne("middle","{:delim}",{ifMode:"math",createAtom:e=>{var t;return new rl(d(u({},e),{delim:null!=(t=e.args[0])?t:"|",size:1}))}}),ne("the","{:value}",{createAtom:e=>new Ds(d(u({},e),{captureSelection:!0,verbatimLatex:null})),render:(e,t)=>{var n;const i=new Ts({parent:t},e.style);let r="";e.isSelected&&(r+=" ML__selected");const a=i.evaluate(e.args[0]);return new cs((null!=(n=xs(a))?n:"").split("").map((t=>new cs(t,{type:"ord",classes:r,mode:e.mode,isSelected:e.isSelected,style:u({variant:"main"},e.style)}))),{type:"lift",style:e.style,caret:e.caret,isSelected:e.isSelected,classes:r}).wrap(i)},serialize:e=>{var t;return`\\the${null!=(t=xs(e.args[0]))?t:"\\relax"}`}}),ne("mathtip","{:auto}{:math}",{createAtom:e=>new Sl(d(u({},e),{body:B(e.args[0]),tooltip:B(e.args[1]),content:"math"})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`\\texttip{${e.bodyToLatex(t)}}{${Ds.serialize([e.tooltip],d(u({},t),{defaultMode:"math"}))}}`}),ne("texttip","{:auto}{:text}",{createAtom:e=>new Sl(d(u({},e),{body:B(e.args[0]),tooltip:B(e.args[1]),content:"text"})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`\\texttip{${e.bodyToLatex(t)}}{${Ds.serialize([e.tooltip],d(u({},t),{defaultMode:"text"}))}}`}),ne("error","{:math}",{createAtom:e=>new Ds(d(u({},e),{body:B(e.args[0])})),serialize:(e,t)=>`\\error{${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__error"})}),ne("ensuremath","{:math}",{createAtom:e=>new Ds(d(u({},e),{body:B(e.args[0])})),serialize:(e,t)=>`${e.command}{${e.bodyToLatex(d(u({},t),{defaultMode:"math"}))}}`}),ne("color","{:value}",{applyStyle:(e,t,n)=>{var i,r;return{verbatimColor:null!=(i=xs(t[0]))?i:void 0,color:n.toColor(null!=(r=t[0])?r:{string:"red"})}}}),ne("textcolor","{:value}{content:auto*}",{applyStyle:(e,t,n)=>{var i,r;return{verbatimColor:null!=(i=xs(t[0]))?i:void 0,color:n.toColor(null!=(r=t[0])?r:{string:"red"})}}}),ne("boxed","{content:math}",{createAtom:e=>new Ko(d(u({},e),{body:B(e.args[0]),framecolor:{string:"black"}}))}),ne("colorbox","{:value}{:text*}",{applyStyle:(e,t,n)=>{var i,r;return{verbatimBackgroundColor:null!=(i=xs(t[0]))?i:void 0,backgroundColor:n.toBackgroundColor(null!=(r=t[0])?r:{string:"yellow"})}}}),ne("fcolorbox","{frame-color:value}{background-color:value}{content:text}",{applyMode:"text",createAtom:e=>{var t,n;return new Ko(d(u({},e),{body:B(e.args[2]),framecolor:null!=(t=e.args[0])?t:{string:"blue"},backgroundcolor:null!=(n=e.args[1])?n:{string:"yellow"}}))},serialize:(e,t)=>{var n,i;return t.skipStyles?e.bodyToLatex(d(u({},t),{defaultMode:"text"})):Ja(e.command,null!=(n=xs(e.framecolor))?n:"",null!=(i=xs(e.backgroundcolor))?i:"",e.bodyToLatex(d(u({},t),{defaultMode:"text"})))}}),ne("bbox","[:bbox]{body:auto}",{createAtom:e=>{var t;const n=e.args[0],i=B(e.args[1]);return new Ko(d(u({},e),n?{body:i,padding:n.padding,border:n.border,backgroundcolor:null!=(t=n.backgroundcolor)?t:void 0}:{body:i}))},serialize:(e,t)=>{var n,i;if(t.skipStyles)return e.bodyToLatex(t);let r=e.command;if(Number.isFinite(e.padding)||void 0!==e.border||void 0!==e.backgroundcolor){const t=[];e.padding&&t.push(null!=(n=xs(e.padding))?n:""),e.border&&t.push(`border: ${e.border}`),e.backgroundcolor&&t.push(null!=(i=xs(e.backgroundcolor))?i:""),r+=`[${t.join(",")}]`}return Ja(r,e.bodyToLatex(t))}}),ne(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"{:rest}",{createAtom:e=>new Ds(d(u({},e),{body:B(e.args[0])})),render:(e,t)=>{const n=new Ts({parent:t,mathstyle:e.command.slice(1)},e.style),i=Ds.createBox(n,e.body,{type:"lift"});return e.caret&&(i.caret=e.caret),e.bind(t,i)},serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`{${Xa([e.command,e.bodyToLatex(t)])}}`}),ne(["tiny","scriptsize","footnotesize","small","normalsize","large","Large","LARGE","huge","Huge"],"",{applyStyle:e=>({fontSize:{"\\tiny":1,"\\scriptsize":2,"\\footnotesize":3,"\\small":4,"\\normalsize":5,"\\large":6,"\\Large":7,"\\LARGE":8,"\\huge":9,"\\Huge":10}[e]})}),ne("fontseries","{:string}",{ifMode:"text",applyStyle:(e,t)=>{var n;return{fontSeries:null!=(n=t[0])?n:"auto"}}}),ne("fontshape","{:string}",{ifMode:"text",applyStyle:(e,t)=>{var n;return{fontShape:null!=(n=t[0])?n:"auto"}}}),ne("fontfamily","{:string}",{ifMode:"text",applyStyle:(e,t)=>{var n;return{fontFamily:null!=(n=t[0])?n:"roman"}}}),ne("selectfont","",{ifMode:"text",applyStyle:()=>({})}),ne("bf","{:rest}",{applyStyle:()=>({fontSeries:"b",fontShape:"n",fontFamily:"roman"})}),ne(["boldsymbol","bm"],"{:math}",{applyMode:"math",createAtom:e=>new Ds(d(u({},e),{body:B(e.args[0])})),serialize:(e,t)=>`${e.command}{${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__boldsymbol"})}),ne("bold","{:math*}",{applyMode:"math",applyStyle:()=>({variantStyle:"bold"})}),ne("bfseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),ne("mdseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),ne("upshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),ne("slshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),ne("scshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),ne("textbf","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),ne("textmd","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),ne("textup","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),ne("textnormal","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n",fontSeries:"m"})}),ne("textsl","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),ne("textit","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"it"})}),ne("textsc","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),ne("textrm","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"roman"})}),ne("textsf","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"sans-serif"})}),ne("texttt","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"monospace"})}),ne("mathbf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"bold"})}),ne("mathit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"italic"})}),ne("mathnormal","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"italic"})}),ne("mathbfit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"bolditalic"})}),ne("mathrm","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"up"})}),ne("mathsf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"sans-serif",variantStyle:"up"})}),ne("mathtt","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"monospace",variantStyle:"up"})}),ne("it","{:rest}",{applyStyle:()=>({fontSeries:"m",fontShape:"it",fontFamily:"roman",variantStyle:"italic"})}),ne("rmfamily","",{applyStyle:()=>({fontFamily:"roman"})}),ne("sffamily","",{applyStyle:()=>({fontFamily:"sans-serif"})}),ne("ttfamily","",{applyStyle:()=>({fontFamily:"monospace"})}),ne(["Bbb","mathbb"],"{:math*}",{applyStyle:()=>({variant:"double-struck",variantStyle:"up"})}),ne(["frak","mathfrak"],"{:math*}",{applyStyle:()=>({variant:"fraktur",variantStyle:"up"})}),ne("mathcal","{:math*}",{applyStyle:()=>({variant:"calligraphic",variantStyle:"up"})}),ne("mathscr","{:math*}",{applyStyle:()=>({variant:"script",variantStyle:"up"})}),ne("mbox","{:text}",{ifMode:"math",createAtom:e=>new Ds(d(u({},e),{type:"mord",body:B(e.args[0]),mode:"math"})),serialize:(e,t)=>Ja("\\mbox",e.bodyToLatex(d(u({},t),{defaultMode:"text"})))}),ne("text","{:text}",{ifMode:"math",applyMode:"text"}),ne(["class","htmlClass"],"{name:string}{content:auto}",{createAtom:e=>new Ds(d(u({},e),{body:B(e.args[1])})),serialize:(e,t)=>!e.args[0]||t.skipStyles?e.bodyToLatex(t):`${e.command}{${e.args[0]}}{${e.bodyToLatex(t)}}`,render:(e,t)=>{var n;return e.createBox(t,{classes:null!=(n=e.args[0])?n:""})}}),ne(["cssId","htmlId"],"{id:string}{content:auto}",{createAtom:e=>new Ds(d(u({},e),{body:B(e.args[1])})),serialize:(e,t)=>{var n;return!(null==(n=e.args)?void 0:n[0])||t.skipStyles?e.bodyToLatex(t):`${e.command}{${e.args[0]}}{${e.bodyToLatex(t)}}`},render:(e,t)=>{var n;const i=e.createBox(t);return i.cssId=null!=(n=e.args[0])?n:"",i}}),ne("htmlData","{data:string}{content:auto}",{createAtom:e=>new Ds(d(u({},e),{body:B(e.args[1])})),serialize:(e,t)=>{var n;return!(null==(n=e.args)?void 0:n[0])||t.skipStyles?e.bodyToLatex(t):`\\htmlData{${e.args[0]}}{${e.bodyToLatex(t)}}`},render:(e,t)=>{var n;const i=e.createBox(t);return i.htmlData=null!=(n=e.args[0])?n:"",i}}),ne(["style","htmlStyle"],"{data:string}{content:auto}",{createAtom:e=>new Ds(d(u({},e),{body:B(e.args[1])})),serialize:(e,t)=>{var n;return!(null==(n=e.args)?void 0:n[0])||t.skipStyles?e.bodyToLatex(t):`${e.command}{${e.args[0]}}{${e.bodyToLatex(t)}}`},render:(e,t)=>{var n;const i=e.createBox(t);return i.htmlStyle=null!=(n=e.args[0])?n:"",i}}),ne("em","{:rest}",{createAtom:e=>new Ds(d(u({},e),{body:B(e.args[0])})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`{\\em ${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__emph",boxType:"lift"})}),ne("emph","{:auto}",{createAtom:e=>new Ds(d(u({},e),{body:B(e.args[1])})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`\\emph{${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__emph",boxType:"lift"})});var Yd={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};ne(["bigl","Bigl","biggl","Biggl","bigr","Bigr","biggr","Biggr","bigm","Bigm","biggm","Biggm","big","Big","bigg","Bigg"],"{:delim}",{createAtom:e=>{var t;return new al(d(u({},e),{delim:null!=(t=e.args[0])?t:".",size:Yd[e.command].size,delimType:Yd[e.command].mclass}))}}),ne(["hspace","hspace*"],"{width:value}",{createAtom:e=>{var t;return new gl(d(u({},e),{width:null!=(t=e.args[0])?t:{dimension:0}}))}}),ne(["mkern","kern","mskip","hskip","mspace"],"{width:value}",{createAtom:e=>{var t;return new gl(d(u({},e),{width:null!=(t=e.args[0])?t:{dimension:0}}))}}),ne("mathchoice","{:math}{:math}{:math}{:math}",{createAtom:e=>new Ds(e),render:(e,t)=>{let n=0;const i=t.mathstyle.id;5!==i&&4!==i||(n=1),3!==i&&2!==i||(n=2),1!==i&&0!==i||(n=3);const r=B(e.args[n]);return Ds.createBox(t,r)},serialize:(e,t)=>`\\mathchoice{${Ds.serialize(e.args[0],t)}}{${Ds.serialize(e.args[1],t)}}{${Ds.serialize(e.args[2],t)}}{${Ds.serialize(e.args[3],t)}}`}),ne("mathop","{:auto}",{createAtom:e=>new Ds(d(u({},e),{type:"mop",body:B(e.args[0]),limits:"over-under",isFunction:!0,captureSelection:!0})),render:(e,t)=>{var n;let i=Ds.createBox(t,e.body);if(e.superscript||e.subscript){const r=null!=(n=e.subsupPlacement)?n:"auto";i="over-under"===r||"auto"===r&&t.isDisplayStyle?e.attachLimits(t,{base:i}):e.attachSupsub(t,{base:i})}return new cs(e.bind(t,i),{type:"op",isSelected:e.isSelected,classes:"op-group"})},serialize:(e,t)=>{const n=[Ja(e.command,e.bodyToLatex(t))];return e.explicitSubsupPlacement&&("over-under"===e.subsupPlacement&&n.push("\\limits"),"adjacent"===e.subsupPlacement&&n.push("\\nolimits"),"auto"===e.subsupPlacement&&n.push("\\displaylimits")),n.push(e.supsubToLatex(t)),Xa(n)}}),ne(["mathbin","mathrel","mathopen","mathclose","mathpunct","mathord","mathinner"],"{:auto}",{createAtom:e=>new Ds(d(u({},e),{type:{"\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[e.command],body:B(e.args[0])}))}),ne(["operatorname","operatorname*"],"{operator:math}",{createAtom:e=>{const t=B(e.args[0]).map((e=>{var t;return"first"!==e.type&&(e.type="mord",e.value=null!=(t={"∗":"*","−":"-"}[e.value])?t:e.value,e.isFunction=!1,e.style.variant||e.style.variantStyle||(e.style.variant="main",e.style.variantStyle="up")),e}));return new Ds(d(u({},e),{type:"mop",body:t,isFunction:!0,limits:"\\operatorname"===e.command?"adjacent":"over-under"}))},render:(e,t)=>{var n;let i=Ds.createBox(t,e.body);if(e.superscript||e.subscript){const r=null!=(n=e.subsupPlacement)?n:"auto";i="over-under"===r||"auto"===r&&t.isDisplayStyle?e.attachLimits(t,{base:i}):e.attachSupsub(t,{base:i})}return e.caret&&(i.caret=e.caret),new cs(e.bind(t,i),{type:"op",isSelected:e.isSelected,classes:"op-group"})},serialize:(e,t)=>{const n=[Ja(e.command,e.bodyToLatex(t))];return e.explicitSubsupPlacement&&("over-under"===e.subsupPlacement&&n.push("\\limits"),"adjacent"===e.subsupPlacement&&n.push("\\nolimits"),"auto"===e.subsupPlacement&&n.push("\\displaylimits")),n.push(e.supsubToLatex(t)),Xa(n)}}),ne(["char","unicode"],"{charcode:value}",{createAtom:e=>new Ds(d(u({},e),{type:"text"===e.mode?"text":"mord"})),serialize:e=>{var t;return`${e.command}${xs(null!=(t=e.args[0])?t:{number:10067,base:"hexadecimal"})}`},render:(e,t)=>{let n=t.evaluate(e.args[0]);return n&&"number"in n||(n={number:10067,base:"hexadecimal"}),e.value=String.fromCodePoint(n.number),e.createBox(t)}}),ne("rule","[raise:value]{width:value}{thickness:value}",{createAtom:e=>new Ds(e),render:(e,t)=>{var n,i,r;const a=new Ts({parent:t,mathstyle:"textstyle"},e.style),s=a.toEm(null!=(n=e.args[0])?n:{dimension:0}),o=a.toEm(null!=(i=e.args[1])?i:{dimension:10}),l=a.toEm(null!=(r=e.args[2])?r:{dimension:10}),c=new cs(null,{classes:"rule",type:"ord"});return c.width=o,c.height=l+s,c.depth=-s,c.setStyle("border-right-width",o,"em"),c.setStyle("border-top-width",l,"em"),c.setStyle("border-color",e.style.color),c.setStyle("vertical-align",s,"em"),e.isSelected&&c.setStyle("opacity","50%"),e.bind(a,c),e.caret&&(c.caret=e.caret),c.wrap(t)},serialize:e=>`\\rule${e.args[0]?`[${xs(e.args[0])}]`:""}{${xs(e.args[1])}}{${xs(e.args[2])}}`}),ne(["overline","underline"],"{:auto}",{createAtom:e=>new Ds(d(u({},e),{body:B(e.args[0])})),render:(e,t)=>{const n=e.command.substring(1),i=new Ts({parent:t,mathstyle:"cramp"},e.style),r=Ds.createBox(i,e.body);if(!r)return null;const a=i.metrics.defaultRuleThickness/i.scalingFactor,s=new cs(null,{classes:n+"-line"});let o;return s.height=a,s.maxFontSize=1.125*a*i.scalingFactor,o=new ms("overline"===n?{shift:0,children:[{box:r},3*a,{box:s},a]}:{top:r.height,children:[a,{box:s},3*a,{box:r}]}),e.caret&&(o.caret=e.caret),new cs(o,{classes:n,type:"ignore"})}}),ne("overset","{:auto}{base:auto}",{createAtom:e=>{const t=B(e.args[1]);return new fl(d(u({},e),{above:B(e.args[0]),body:t,skipBoundary:!1,boxType:os(t)}))},serialize:(e,t)=>Ja(e.command,e.aboveToLatex(t),e.bodyToLatex(t))}),ne("underset","{:auto}{base:auto}",{createAtom:e=>{const t=B(e.args[1]);return new fl(d(u({},e),{below:B(e.args[0]),body:t,skipBoundary:!1,boxType:os(t)}))},serialize:(e,t)=>Ja(e.command,e.belowToLatex(t),e.bodyToLatex(t))}),ne("overunderset","{above:auto}{below:auto}{base:auto}",{createAtom:e=>{const t=B(e.args[2]);return new fl(d(u({},e),{above:B(e.args[0]),below:B(e.args[1]),body:t,skipBoundary:!1,boxType:os(t)}))},serialize:(e,t)=>Ja(e.command,e.belowToLatex(t),e.bodyToLatex(t))}),ne(["stackrel","stackbin"],"[below:auto]{above:auto}{base:auto}",{createAtom:e=>new fl(d(u({},e),{body:B(e.args[2]),above:B(e.args[1]),below:B(e.args[0]),skipBoundary:!1,boxType:"\\stackrel"===e.command?"rel":"bin"})),serialize:(e,t)=>Ja(e.command,e.aboveToLatex(t),e.bodyToLatex(t))}),ne("smash","[:string]{:auto}",{createAtom:e=>{var t,n,i,r;return new ml(d(u({},e),{body:B(e.args[1]),smashHeight:null==(n=null==(t=e.args[0])?void 0:t.includes("t"))||n,smashDepth:null==(r=null==(i=e.args[0])?void 0:i.includes("b"))||r}))}}),ne(["vphantom"],"{:auto}",{createAtom:e=>new ml(d(u({},e),{body:B(e.args[0]),isInvisible:!0,smashWidth:!0}))}),ne(["hphantom"],"{:auto}",{createAtom:e=>new ml(d(u({},e),{body:B(e.args[0]),isInvisible:!0,smashHeight:!0,smashDepth:!0}))}),ne(["phantom"],"{:auto}",{createAtom:e=>new ml(d(u({},e),{body:B(e.args[0]),isInvisible:!0}))}),ne("not","{:math}",{createAtom:e=>{const t=B(e.args[0]);return 0===t.length?new Ds(d(u({},e),{type:"mrel",value:""})):new Ds(d(u({},e),{body:[new pl(d(u({},e),{body:"",align:"right"})),...t],captureSelection:!0}))},serialize:(e,t)=>{const n=e.args[0],i=n&&"object"==typeof n&&"group"in n;return""!==e.value?i?`\\not{${Ds.serialize(n.group,t)}}`:`\\not${Ds.serialize(n,t)}`:i?"\\not{}":"\\not"},render:(e,t)=>{if(e.value)return e.createBox(t);const n=e.args[0]&&"object"==typeof e.args[0]&&"group"in e.args[0]?"ord":os(B(e.args[0])),i=Ds.createBox(t,e.body,{type:n});return e.caret&&(i.caret=e.caret),e.bind(t,i)}}),ne(["ne","neq"],"",{createAtom:e=>new Ds(d(u({},e),{type:"mrel",body:[new pl(d(u({},e),{body:"",align:"right",boxType:"rel"})),new Ds(d(u({},e),{value:"="}))],captureSelection:!0})),serialize:e=>e.command}),ne("rlap","{:auto}",{createAtom:e=>new pl(d(u({},e),{body:B(e.args[0]),align:"right"}))}),ne("llap","{:auto}",{createAtom:e=>new pl(d(u({},e),{body:B(e.args[0]),align:"left"}))}),ne("mathrlap","{:math}",{createAtom:e=>new pl(d(u({},e),{body:B(e.args[0]),align:"left"}))}),ne("mathllap","{:math}",{createAtom:e=>new pl(d(u({},e),{body:B(e.args[0]),align:"left"}))}),ne("raisebox","{:value}{:text}",{createAtom:e=>{var t;return new Ko(d(u({},e),{body:B(e.args[1]),padding:{dimension:0},offset:null!=(t=e.args[0])?t:{dimension:0}}))},serialize:(e,t)=>{var n;return Ja("\\raisebox",null!=(n=xs(e.offset))?n:"0pt",e.bodyToLatex(t))}}),ne("raise","{:value}{:auto}",{createAtom:e=>{var t;return new Ko(d(u({},e),{body:B(e.args[1]),padding:{dimension:0},offset:null!=(t=e.args[0])?t:{dimension:0}}))},serialize:(e,t)=>{var n;return Ja("\\raise",null!=(n=xs(e.offset))?n:"0pt",e.bodyToLatex(t))}}),ne("lower","{:value}{:auto}",{createAtom:e=>{var t;return new Ko(d(u({},e),{body:B(e.args[1]),padding:{dimension:0},offset:null!=(t=ks(e.args[0],-1))?t:{dimension:0}}))},serialize:(e,t)=>{var n,i;return Ja("\\lower",null!=(i=xs(ks(null!=(n=e.offset)?n:{dimension:0},-1)))?i:"0pt",e.bodyToLatex(t))}}),W("0123456789/@.?!"),Y(65,90),Y(97,122),W([["\\forall",8704],["\\exists",8707],["\\nexists",8708,"mord","ams"],["\\mid",8739,"mrel"],["\\top",8868],["\\bot",8869]]),W([["\\#",35],["\\&",38],["\\parallelogram",9649],["\\spadesuit",9824],["\\heartsuit",9825],["\\diamondsuit",9826],["\\clubsuit",9827],["\\flat",9837],["\\natural",9838],["\\sharp",9839]]),W([["\\backslash",92],["\\nabla",8711],["\\partial",8706],["\\ell",8467],["\\hbar",8463],["\\Q",81,"mord","double-struck"],["\\C",67,"mord","double-struck"],["\\P",80,"mord","double-struck"],["\\pounds",163],["\\euro",8364]]),W([["\\rightarrow",8594],["\\to",8594],["\\leftarrow",8592],["\\gets",8592],["\\Rightarrow",8658],["\\Leftarrow",8656],["\\longrightarrow",10230],["\\longleftarrow",10229],["\\Longrightarrow",10233],["\\implies",10233],["\\Longleftarrow",10232],["\\impliedby",10232],["\\longleftrightarrow",10231],["\\biconditional",10231],["\\Longleftrightarrow",10234],["\\mapsto",8614],["\\longmapsto",10236],["\\uparrow",8593],["\\downarrow",8595],["\\Uparrow",8657],["\\Downarrow",8659],["\\updownarrow",8597],["\\Updownarrow",8661],["\\hookrightarrow",8618],["\\hookleftarrow",8617],["\\rightharpoonup",8640],["\\leftharpoonup",8636],["\\rightharpoondown",8641],["\\leftharpoondown",8637],["\\searrow",8600],["\\nearrow",8599],["\\swarrow",8601],["\\nwarrow",8598],["\\originalof",8886],["\\laplace",8886],["\\imageof",8887],["\\Laplace",8887]],"mrel"),W([["\\mapsfrom",8612,"mrel"],["\\Mapsfrom",10502,"mrel"],["\\MapsTo",10503,"mrel"],["\\Yup",8516,"mord"],["\\lightning",8623,"mrel"],["\\leftarrowtriangle",8701,"mrel"],["\\rightarrowtriangle",8702,"mrel"],["\\leftrightarrowtriangle",8703,"mrel"],["\\boxdot",8865,"mbin"],["\\bigtriangleup",9651,"mbin"],["\\bigtriangledown",9661,"mbin"],["\\boxbar",9707,"mbin"],["\\Lbag",10181,"mopen"],["\\Rbag",10182,"mclose"],["\\llbracket",10214,"mopen"],["\\rrbracket",10215,"mclose"],["\\longmapsfrom",10235,"mrel"],["\\Longmapsfrom",10237,"mrel"],["\\Longmapsto",10238,"mrel"],["\\boxslash",10692,"mbin"],["\\boxbslash",10693,"mbin"],["\\boxast",10694,"mbin"],["\\boxcircle",10695,"mbin"],["\\boxbox",10696,"mbin"],["\\fatsemi",10783,"mop"],["\\leftslice",10918,"mrel"],["\\rightslice",10919,"mrel"],["\\interleave",10996,"mbin"],["\\biginterleave",11004,"mop"],["\\sslash",11005,"mbin"],["\\talloblong",11006,"mbin"]]),W([["\\lbrace",123,"mopen"],["\\rbrace",125,"mclose"],["\\lparen",40,"mopen"],["\\rparen",41,"mclose"],["\\langle",10216,"mopen"],["\\rangle",10217,"mclose"],["\\lfloor",8970,"mopen"],["\\rfloor",8971,"mclose"],["\\lceil",8968,"mopen"],["\\rceil",8969,"mclose"],["\\vert",8739],["\\lvert",8739,"mopen"],["\\rvert",8739,"mclose"],["\\|",8741],["\\Vert",8741],["\\mVert",8741],["\\lVert",8741,"mopen"],["\\rVert",8741,"mclose"],["\\lbrack",91,"mopen"],["\\rbrack",93,"mclose"],["\\{",123,"mopen"],["\\}",125,"mclose"],["(",40,"mopen"],[")",41,"mclose"],["[",91,"mopen"],["]",93,"mclose"],["\\ulcorner",9484,"mopen","ams"],["\\urcorner",9488,"mclose","ams"],["\\llcorner",9492,"mopen","ams"],["\\lrcorner",9496,"mclose","ams"],["\\lgroup",10222,"mopen"],["\\rgroup",10223,"mclose"],["\\lmoustache",9136,"mopen"],["\\rmoustache",9137,"mclose"]]),W([["\\dashrightarrow",8674],["\\dashleftarrow",8672],["\\Rrightarrow",8667],["\\Lleftarrow",8666],["\\leftrightarrows",8646],["\\rightleftarrows",8644],["\\curvearrowright",8631],["\\curvearrowleft",8630],["\\rightrightarrows",8649],["\\leftleftarrows",8647],["\\upuparrows",8648],["\\downdownarrows",8650],["\\vartriangle",9651],["\\triangleq",8796],["\\vartriangleleft",8882],["\\trianglelefteq",8884],["\\ntriangleleft",8938],["\\ntrianglelefteq",8940],["\\vartriangleright",8883],["\\trianglerighteq",8885],["\\ntriangleright",8939],["\\ntrianglerighteq",8941],["\\blacktriangleleft",9664],["\\blacktriangleright",9654],["\\leftarrowtail",8610],["\\rightarrowtail",8611],["\\looparrowright",8620],["\\looparrowleft",8619],["\\twoheadleftarrow",8606],["\\twoheadrightarrow",8608],["\\twoheadrightarrowtail",10518],["\\rightleftharpoons",8652],["\\leftrightharpoons",8651],["\\Rsh",8625],["\\Lsh",8624],["\\circlearrowright",8635],["\\circlearrowleft",8634],["\\restriction",8638],["\\upharpoonright",8638],["\\upharpoonleft",8639],["\\downharpoonright",8642],["\\downharpoonleft",8643],["\\rightsquigarrow",8669],["\\leadsto",8669],["\\leftrightsquigarrow",8621],["\\multimap",8888],["\\nleftarrow",8602],["\\nrightarrow",8603],["\\nRightarrow",8655],["\\nLeftarrow",8653],["\\nleftrightarrow",8622],["\\nLeftrightarrow",8654],["\\nvrightarrow",8696],["\\nvtwoheadrightarrow",10496],["\\nvrightarrowtail",10516],["\\nvtwoheadrightarrowtail",10519],["\\shortparallel",8741],["\\nless",8814],["\\nleqslant",57360],["\\lneq",10887],["\\lneqq",8808],["\\nleqq",57361],["\\lvertneqq",57356],["\\lnsim",8934],["\\lnapprox",10889],["\\nprec",8832],["\\npreceq",8928],["\\precnsim",8936],["\\precnapprox",10937],["\\nsim",8769],["\\nshortmid",57350],["\\nmid",8740],["\\nvdash",8876],["\\nvDash",8877],["\\ngtr",8815],["\\ngeqslant",57359],["\\ngeqq",57358],["\\gneq",10888],["\\gneqq",8809],["\\gvertneqq",57357],["\\gnsim",8935],["\\gnapprox",10890],["\\nsucc",8833],["\\nsucceq",8929],["\\succnsim",8937],["\\succnapprox",10938],["\\ncong",8774],["\\nshortparallel",57351],["\\nparallel",8742],["\\nVDash",8879],["\\nsupseteqq",57368],["\\supsetneq",8843],["\\varsupsetneq",57371],["\\supsetneqq",10956],["\\varsupsetneqq",57369],["\\nVdash",8878],["\\precneqq",10933],["\\succneqq",10934],["\\nsubseteqq",57366],["\\leqslant",10877],["\\geqslant",10878],["\\gtrsim",8819],["\\approxeq",8778],["\\thickapprox",8776],["\\lessapprox",10885],["\\gtrapprox",10886],["\\precapprox",10935],["\\succapprox",10936],["\\thicksim",8764],["\\succsim",8831],["\\precsim",8830],["\\backsim",8765],["\\eqsim",8770],["\\backsimeq",8909],["\\lesssim",8818],["\\nleq",8816],["\\ngeq",8817],["\\smallsmile",8995],["\\smallfrown",8994],["\\leqq",8806],["\\eqslantless",10901],["\\lll",8920],["\\lessgtr",8822],["\\lesseqgtr",8922],["\\lesseqqgtr",10891],["\\risingdotseq",8787],["\\fallingdotseq",8786],["\\subseteqq",10949],["\\Subset",8912],["\\sqsubset",8847],["\\preccurlyeq",8828],["\\curlyeqprec",8926],["\\vDash",8872],["\\Vvdash",8874],["\\bumpeq",8783],["\\Bumpeq",8782],["\\geqq",8807],["\\eqslantgtr",10902],["\\ggg",8921],["\\gtrless",8823],["\\gtreqless",8923],["\\gtreqqless",10892],["\\supseteqq",10950],["\\Supset",8913],["\\sqsupset",8848],["\\succcurlyeq",8829],["\\curlyeqsucc",8927],["\\Vdash",8873],["\\shortmid",8739],["\\between",8812],["\\pitchfork",8916],["\\varpropto",8733],["\\backepsilon",8717],["\\llless",8920],["\\gggtr",8921],["\\doteqdot",8785],["\\Doteq",8785],["\\eqcirc",8790],["\\circeq",8791],["\\therefore",8756],["\\because",8757]],"mrel","ams"),W([["+",43],["-",8722],["−",8722],["\\pm",177],["\\mp",8723],["*",8727],["\\times",215],["\\div",247],["\\divides",8739],["\\cdot",8901],["\\cap",8745],["\\cup",8746],["\\setminus",8726],["\\land",8743],["\\wedge",8743],["\\lor",8744],["\\vee",8744],["\\circ",8728],["\\bigcirc",9711],["\\bullet",8729],["\\oplus",8853],["\\ominus",8854],["\\otimes",8855],["\\odot",8857],["\\oslash",8856],["\\bigtriangleup",9651],["\\bigtriangledown",9661],["\\triangleleft",9667],["\\triangleright",9657],["\\And",38],["\\dagger",8224],["\\dag",8224],["\\ddag",8225],["\\ddagger",8225],["\\ast",8727],["\\star",8902],["\\bigstar",9733],["\\diamond",8900]],"mbin"),W([["\\lhd",8882],["\\rhd",8883],["\\lessdot",8918],["\\gtrdot",8919],["\\ltimes",8905],["\\rtimes",8906],["\\leftthreetimes",8907],["\\rightthreetimes",8908],["\\intercal",8890],["\\dotplus",8724],["\\doublebarwedge",10846],["\\divideontimes",8903],["\\centerdot",8901],["\\smallsetminus",8726],["\\barwedge",8892],["\\veebar",8891],["\\nor",8891],["\\curlywedge",8911],["\\curlyvee",8910],["\\boxminus",8863],["\\boxplus",8862],["\\boxtimes",8864],["\\boxdot",8865],["\\circleddash",8861],["\\circledast",8859],["\\circledcirc",8858],["\\unlhd",8884],["\\unrhd",8885]],"mbin","ams"),W([["\\surd",8730],["\\infty",8734],["\\prime",8242],["\\doubleprime",8243],["\\angle",8736],["`",8216],["\\$",36],["\\%",37],["\\_",95],["\\alpha",945],["\\beta",946],["\\gamma",947],["\\delta",948],["\\epsilon",1013],["\\varepsilon",949],["\\zeta",950],["\\eta",951],["\\theta",952],["\\vartheta",977],["\\iota",953],["\\kappa",954],["\\varkappa",1008,"mord","ams"],["\\lambda",955],["\\mu",956],["\\nu",957],["\\xi",958],["\\omicron",111],["\\pi",960],["\\varpi",982],["\\rho",961],["\\varrho",1009],["\\sigma",963],["\\varsigma",962],["\\tau",964],["\\phi",981],["\\varphi",966],["\\upsilon",965],["\\chi",967],["\\psi",968],["\\omega",969],["\\Gamma",915],["\\Delta",916],["\\Theta",920],["\\Lambda",923],["\\Xi",926],["\\Pi",928],["\\Sigma",931],["\\Upsilon",933],["\\Phi",934],["\\Psi",936],["\\Omega",937],["\\digamma",989,"mord","ams"],["\\emptyset",8709]]),W([["=",61],["<",60],["\\lt",60],[">",62],["\\gt",62],["\\le",8804],["\\leq",8804],["\\ge",8805],["\\geq",8805],["\\ll",8810],["\\gg",8811],["\\coloneq",8788],["\\coloneqq",8788],["\\colonequals",8788],["\\measeq",8797],["\\eqdef",8798],["\\questeq",8799],[":",58],["\\cong",8773],["\\equiv",8801],["\\prec",8826],["\\preceq",10927],["\\succ",8827],["\\succeq",10928],["\\perp",8869],["\\propto",8733],["\\Colon",8759],["\\smile",8995],["\\frown",8994],["\\sim",8764],["\\doteq",8784],["\\bowtie",8904],["\\Join",8904],["\\asymp",8781],["\\sqsubseteq",8849],["\\sqsupseteq",8850],["\\approx",8776],["\\~",126],["\\leftrightarrow",8596],["\\Leftrightarrow",8660],["\\models",8872],["\\vdash",8866],["\\dashv",8867],["\\roundimplies",10608],["\\in",8712],["\\notin",8713],["\\ni",8715],["\\owns",8715],["\\subset",8834],["\\supset",8835],["\\subseteq",8838],["\\supseteq",8839],["\\differencedelta",8710],["\\mvert",8739],["\\parallel",8741],["\\simeq",8771]],"mrel"),W([["\\lnot",172],["\\neg",172],["\\triangle",9651],["\\subsetneq",8842],["\\varsubsetneq",57370],["\\subsetneqq",10955],["\\varsubsetneqq",57367],["\\nsubset",8836],["\\nsupset",8837],["\\nsubseteq",8840],["\\nsupseteq",8841]],"mrel","ams"),W([["\\wp",8472],["\\aleph",8501]]),W([["\\blacktriangle",9650],["\\hslash",8463],["\\Finv",8498],["\\Game",8513],["\\eth",240],["\\mho",8487],["\\Bbbk",107],["\\yen",165],["\\square",9633],["\\Box",9633],["\\blacksquare",9632],["\\circledS",9416],["\\circledR",174],["\\triangledown",9661],["\\blacktriangledown",9660],["\\checkmark",10003],["\\diagup",9585],["\\measuredangle",8737],["\\sphericalangle",8738],["\\backprime",8245],["\\backdoubleprime",8246],["\\Diamond",9674],["\\lozenge",9674],["\\blacklozenge",10731],["\\varnothing",8709],["\\complement",8705],["\\maltese",10016],["\\beth",8502],["\\daleth",8504],["\\gimel",8503]],"mord","ams"),W([["\\ ",160],["~",160]],"space"),ne(["!",",",":",";",">","enskip","enspace","quad","qquad"],"",{createAtom:e=>new gl(e)}),ne("space","",{createAtom:e=>new gl(e)}),W([["\\colon",58],["\\cdotp",8901],["\\vdots",8942,"mord"],["\\ldotp",46],[",",44],[";",59]],"mpunct"),W([["\\cdots",8943],["\\ddots",8945],["\\ldots",8230],["\\mathellipsis",8230]],"minner"),W([["\\/",47],["|",8739,"mord"],["\\imath",305],["\\jmath",567],["\\degree",176],["'",8242],['"',8221]]);var Xd="<mo>⁡</mo>",Jd="<mo>⁢</mo>";function Qd(e){return e.replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function eh(e,t){return e&&t.generateID?` extid="${e}"`:""}function th(e,t,n){var i,r,a,s,o,l,c,u,d,h,p;let f=!1;t=null!=t?t:e.atoms.length;let m="",g="",v=e.atoms[e.index];const b=null!=(r=null==(i=v.style)?void 0:i.variant)?r:"",y=null!=(s=null==(a=v.style)?void 0:a.variantStyle)?s:"";let _="";if(b||y){const t=O(v.value,null==(o=v.style)?void 0:o.variant,null==(l=v.style)?void 0:l.variantStyle);if(t!==v.value)return e.index+=1,m=`<mi${eh(v.id,n)}>${t}</mi>`,nh(m,e,n)||(e.mathML+=m,e.lastType="mi"),!0;_=null!=(c={upnormal:"normal",boldnormal:"bold",italicmain:"italic",bolditalicmain:"bold-italic","updouble-struck":"double-struck","double-struck":"double-struck",boldfraktur:"bold-fraktur",calligraphic:"script",upcalligraphic:"script",script:"script",boldscript:"bold-script",boldcalligraphic:"bold-script",fraktur:"fraktur","upsans-serif":"sans-serif","boldsans-serif":"bold-sans-serif","italicsans-serif":"sans-serif-italic","bolditalicsans-serif":"sans-serif-bold-italic",monospace:"monospace"}[y+b])?c:"",_=` mathvariant="${_}"`}const w={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."};if("!"===v.command)return e.index+=1,m="<mo>!</mo>",nh(m,e,n)||(e.mathML+=m,e.lastType="mo"),!0;if(w[v.command]){e.index+=1;let t=`<mi${eh(v.id,n)}${_}>${w[v.command]}</mi>`;return"mi"!==e.lastType&&"mn"!==e.lastType&&"mtext"!==e.lastType&&"fence"!==e.lastType||(t=Jd+t),nh(t,e,n)||(e.mathML+=t,e.lastType="mi"),!0}if("\\operatorname"===v.command)g=ch(v.body),e.index+=1;else if(b||y)for(;e.index<t&&("mord"===v.type||"macro"===v.type)&&!v.isDigit()&&b===(null!=(d=null==(u=v.style)?void 0:u.variant)?d:"")&&y===(null!=(p=null==(h=v.style)?void 0:h.variantStyle)?p:"");)g+=ch([v]),e.index+=1,v=e.atoms[e.index];else"mord"!==v.type&&"macro"!==v.type||v.isDigit()||(g+=ch([v]),e.index+=1);if(g.length>0){f=!0,m=`<mi${_}>${g}</mi>`;const t=e.lastType;m.endsWith(">f</mi>")||m.endsWith(">g</mi>")?(m+=Xd,e.lastType="applyfunction"):e.lastType=/^<mo>(.*)<\/mo>$/.test(m)?"mo":"mi",nh(m,e,n)||("mi"!==t&&"mn"!==t&&"mtext"!==t&&"fence"!==t||(m=Jd+m),e.mathML+=m)}return f}function nh(e,t,n){var i;let r=t.atoms[t.index-1];if(!r)return!1;if(!r.superscript&&!r.subscript){if("subsup"!==(null==(i=t.atoms[t.index])?void 0:i.type))return!1;r=t.atoms[t.index],t.index+=1}const a=t.lastType;t.lastType="";const s=oh(r.superscript,n);t.lastType="";const o=oh(r.subscript,n);if(t.lastType=a,!s&&!o)return!1;let l="";return s&&o?l=`<msubsup>${e}${o}${s}</msubsup>`:s?l=`<msup>${e}${s}</msup>`:o&&(l=`<msub>${e}${o}</msub>`),t.mathML+=l,t.lastType="",!0}function ih(e,t,n){t=null!=t?t:e.atoms.length;const i=e.index;let r="";for(;e.index<t&&"text"===e.atoms[e.index].mode;)r+=e.atoms[e.index].value?e.atoms[e.index].value:" ",e.index+=1;return r.length>0&&(e.mathML+=`<mtext ${eh(e.atoms[i].id,n)}>${r}</mtext>`,e.lastType="mtext",!0)}function rh(e,t,n){t=null!=t?t:e.atoms.length;const i=e.index;let r="",a=function(e){let t=-1,n=e.index,i=!1,r=!1;for(;n<e.atoms.length&&!i&&!r;){const t=e.atoms[n];i=!t.isDigit(),r=!i&&void 0!==t.superscript,n++}return r&&(t=n-1),t}(e);for(a>=0&&a<t&&(t=a);e.index<t&&e.atoms[e.index].isDigit();)r+=e.atoms[e.index].asDigit(),e.index+=1;return!(r.length<=0)&&(r="<mn"+eh(e.atoms[i].id,n)+">"+r+"</mn>",a<0&&function(e){return e.index<e.atoms.length&&e.atoms[e.index].superscript&&"subsup"===e.atoms[e.index].type}(e)&&(a=e.index,e.index+=1),nh(r,e,n)||(e.mathML+=r,e.lastType="mn"),!0)}function ah(e,t,n){let i=!1;t=null!=t?t:e.atoms.length;let r="",a="";if(e.index<t&&"mopen"===e.atoms[e.index].type){let s=!1,o=0;const l=e.index;let c=-1,u=l+1;for(;u<t&&!s;)"mopen"===e.atoms[u].type?o+=1:"mclose"===e.atoms[u].type&&(o-=1),-1===o&&(s=!0,c=u),u+=1;s&&(r="<mrow>",r+=lh(e.atoms[l],n),r+=oh(e.atoms,n,l+1,c),r+=lh(e.atoms[c],n),r+="</mrow>",e.index=c+1,"mi"!==e.lastType&&"mn"!==e.lastType&&"mfrac"!==e.lastType&&"fence"!==e.lastType||(e.mathML+=Jd),nh(r,e,n)&&(i=!0,e.lastType="",r=""),a="fence")}return r.length>0&&(i=!0,e.mathML+=r,e.lastType=a),i}function sh(e,t,n){let i=!1;t=null!=t?t:e.atoms.length;let r="",a="";const s=e.atoms[e.index];if(!s)return!1;const o={"\\ne":"≠","\\neq":"&neq;","\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lbrack":"[","\\rbrack":"]","\\lparen":"(","\\rparen":")","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉"};if(o[s.command]){e.index+=1;const t=`<mo${eh(s.id,n)}>${o[s.command]}</mo>`;return nh(t,e,n)||(e.mathML+=t,e.lastType="mo"),!0}if(e.index<t&&("mbin"===s.type||"mrel"===s.type))r+=uh(e.atoms[e.index],n),e.index+=1,a="mo";else if(e.index<t&&("mop"===s.type||"operator"===s.type||"extensible-symbol"===s.type)){if("over-under"===s.subsupPlacement&&(s.superscript||s.subscript)){const t=lh(s,n);return s.superscript&&s.subscript?(r+="<munderover>"+t,r+=oh(s.subscript,n),r+=oh(s.superscript,n),r+="</munderover>"):s.superscript?(r+="<mover>"+t,r+=oh(s.superscript,n),r+="</mover>"):s.subscript&&(r+="<munder>"+t,r+=oh(s.subscript,n),r+="</munder>"),e.mathML+=r,e.lastType="mo",e.index+=1,!0}{const t=e.atoms[e.index],i="\\operatorname"===t.value,s=i?'<mi class="MathML-Unit"'+eh(t.id,n)+">"+ch(t.value)+"</mi>":lh(t,n);r+=s,i||/^<mo>(.*)<\/mo>$/.test(s)?a=i?"mi":"mo":(r+=Xd,a="applyfunction")}"mi"!==e.lastType&&"mn"!==e.lastType||/^<mo>(.*)<\/mo>$/.test(r)||(r=Jd+r),e.index+=1}return r.length>0&&(i=!0,nh(r,e,n)||(e.mathML+=r,e.lastType=a)),i}function oh(e,t,n,i){null!=t||(t={});const r={atoms:[],index:null!=n?n:0,mathML:"",lastType:""};if("number"==typeof e||"boolean"==typeof e)r.mathML=e.toString();else if("string"==typeof e)r.mathML=e;else if(e instanceof Ds)r.mathML=uh(e,t);else if(Array.isArray(e)){r.atoms=e;let n=0;for(i=i||(e?e.length:0);r.index<i;)if(ih(r,i,t)||rh(r,i,t)||th(r,i,t)||sh(r,i,t)||ah(r,i,t))n+=1;else if(r.index<i){let e=uh(r.atoms[r.index],t);"mn"===r.lastType&&e.length>0&&"genfrac"===r.atoms[r.index].type&&(e="<mo>⁤</mo>"+e),"genfrac"===r.atoms[r.index].type?r.lastType="mfrac":r.lastType="",r.index+=1,nh(e,r,t)?n+=1:e.length>0&&(r.mathML+=e,n+=1)}n>1&&(r.mathML="<mrow>"+r.mathML+"</mrow>")}return r.mathML}function lh(e,t){let n="";const i=ch(e.value);return i&&(n="<mo"+eh(e.id,t)+">"+i+"</mo>"),n}function ch(e){if(!e)return"";if("string"==typeof e)return Qd(e);if(!Array.isArray(e)&&"string"==typeof e.body)return Qd(e.body);let t="";for(const n of e)"string"==typeof n.value&&(t+=n.value);return Qd(t)}function uh(e,t){var n,i,r,a,s,o,l,c,u,d,h,p,f,m,g,v,b,y,_,w,x,k;if("text"===e.mode)return`<mi${eh(e.id,t)}>${e.value}</mi>`;const S={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",longleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",longrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",longrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xleftrightarrows:"⇄",xRightleftharpoons:"⇌",longRightleftharpoons:"⇌",xLeftrightharpoons:"⇋",longLeftrightharpoons:"⇋"},E={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\>":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let C,T,A,M,L,D,I="",R="";const{command:P}=e;if("\\error"===e.command)return`<merror${eh(e.id,t)}>${oh(e.body,t)}</merror>`;const O={"\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrack":"[","\\rbrack":"]","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉"},N={"\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};switch(e.type){case"first":case"line":case"overlap":case"subsup":case"phantom":case"composition":case"rule":case"chem":break;case"group":case"root":I=oh(e.body,t);break;case"array":if((e.leftDelim&&"."!==e.leftDelim||e.rightDelim&&"."!==e.rightDelim)&&(I+="<mrow>",e.leftDelim&&"."!==e.leftDelim&&(I+="<mo>"+(O[e.leftDelim]||e.leftDelim)+"</mo>")),I+="<mtable",e.colFormat){for(I+=' columnalign="',A=0;A<e.colFormat.length;A++)e.colFormat[A].align&&(I+={l:"left",c:"center",r:"right"}[e.colFormat[A].align]+" ");I+='"'}for(I+=">",T=0;T<e.array.length;T++){for(I+="<mtr>",C=0;C<e.array[T].length;C++)I+="<mtd>"+oh(e.array[T][C],t)+"</mtd>";I+="</mtr>"}I+="</mtable>",(e.leftDelim&&"."!==e.leftDelim||e.rightDelim&&"."!==e.rightDelim)&&(e.rightDelim&&"."!==e.rightDelim&&(I+="<mo>"+(O[e.leftDelim]||e.rightDelim)+"</mo>"),I+="</mrow>");break;case"genfrac":(e.leftDelim||e.rightDelim)&&(I+="<mrow>"),e.leftDelim&&"."!==e.leftDelim&&(I+="<mo"+eh(e.id,t)+">"+(O[e.leftDelim]||e.leftDelim)+"</mo>"),e.hasBarLine?(I+="<mfrac>",I+=oh(e.above,t)||"<mi> </mi>",I+=oh(e.below,t)||"<mi> </mi>",I+="</mfrac>"):(I+="<mtable"+eh(e.id,t)+">",I+="<mtr>"+oh(e.above,t)+"</mtr>",I+="<mtr>"+oh(e.below,t)+"</mtr>",I+="</mtable>"),e.rightDelim&&"."!==e.rightDelim&&(I+="<mo"+eh(e.id,t)+">"+(O[e.rightDelim]||e.rightDelim)+"</mo>"),(e.leftDelim||e.rightDelim)&&(I+="</mrow>");break;case"surd":e.hasEmptyBranch("above")?(I+="<msqrt"+eh(e.id,t)+">",I+=oh(e.body,t),I+="</msqrt>"):(I+="<mroot"+eh(e.id,t)+">",I+=oh(e.body,t),I+=oh(e.above,t),I+="</mroot>");break;case"leftright":const B=e,$=B.leftDelim;I="<mrow>",$&&"."!==$&&(I+=`<mo${eh(e.id,t)}>${null!=(n=O[$])?n:$}</mo>`),e.body&&(I+=oh(e.body,t));const F=B.matchingRightDelim();F&&"."!==F&&(I+=`<mo${eh(e.id,t)}>${null!=(i=O[F])?i:F}</mo>`),I+="</mrow>";break;case"sizeddelim":case"delim":I+=`<mo${eh(e.id,t)}>${O[e.value]||e.value}</mo>`;break;case"accent":I+='<mover accent="true"'+eh(e.id,t)+">",I+=oh(e.body,t),I+="<mo>"+(N[P]||e.accent)+"</mo>",I+="</mover>";break;case"overunder":L=e.above,M=e.below,(e.svgAbove||L)&&(e.svgBelow||M)?D=e.body:L&&L.length>0?(D=e.body,(null==(a=null==(r=e.body)?void 0:r[0])?void 0:a.below)?(M=e.body[0].below,D=e.body[0].body):"first"===(null==(o=null==(s=e.body)?void 0:s[0])?void 0:o.type)&&(null==(c=null==(l=e.body)?void 0:l[1])?void 0:c.below)&&(M=e.body[1].below,D=e.body[1].body)):M&&M.length>0&&(D=e.body,(null==(d=null==(u=e.body)?void 0:u[0])?void 0:d.above)?(L=e.body[0].above,D=e.body[0].body):"first"===(null==(p=null==(h=e.body)?void 0:h[0])?void 0:p.type)&&(null==(m=null==(f=e.body)?void 0:f[1])?void 0:m.above)&&(L=e.body[1].overscript,D=e.body[1].body)),(e.svgAbove||L)&&(e.svgBelow||M)?(I+=`<munderover ${eh(e.id,t)}>`,I+=null!=(g=S[e.svgBody])?g:oh(D,t),I+=null!=(v=S[e.svgBelow])?v:oh(M,t),I+=null!=(b=S[e.svgAbove])?b:oh(L,t),I+="</munderover>"):e.svgAbove||L?(I+=`<mover ${eh(e.id,t)}>`+(null!=(y=S[e.svgBody])?y:oh(D,t)),I+=null!=(_=S[e.svgAbove])?_:oh(L,t),I+="</mover>"):(e.svgBelow||M)&&(I+=`<munder ${eh(e.id,t)}>`+(null!=(w=S[e.svgBody])?w:oh(D,t)),I+=null!=(x=S[e.svgBelow])?x:oh(M,t),I+="</munder>");break;case"placeholder":I+="?";break;case"mord":{I="string"==typeof e.value?e.value:P,"\\char"===P?I="&#x"+("000000"+e.args[0].number.toString(16)).slice(-4)+";":I.length>0&&I.startsWith("\\")&&("string"==typeof e.value&&e.value.charCodeAt(0)>255?I="&#x"+("000000"+e.value.charCodeAt(0).toString(16)).slice(-4)+";":"string"==typeof e.value?I=e.value.charAt(0):(console.error("Did not expect this"),I=""));const n=/\d/.test(I)?"mn":"mi";I=`<${n}${eh(e.id,t)}>${Qd(I)}</${n}>`;break}case"mbin":case"mrel":case"minner":I=lh(e,t);break;case"mpunct":I='<mo separator="true"'+eh(e.id,t)+">"+P+"</mo>";break;case"mop":case"operator":case"extensible-symbol":""!==e.body&&(I="<mo"+eh(e.id,t)+">",I+="\\operatorname"===P?e.body:P||e.body,I+="</mo>");break;case"box":I='<menclose notation="box"',e.backgroundcolor&&(I+=' mathbackground="'+e.backgroundcolor+'"'),I+=eh(e.id,t)+">"+oh(e.body,t)+"</menclose>";break;case"spacing":I+='<mspace width="'+(null!=(k=E[P])?k:0)+'em"/>';break;case"enclose":I='<menclose notation="';for(const t in e.notation)Object.prototype.hasOwnProperty.call(e.notation,t)&&e.notation[t]&&(I+=R+t,R=" ");I+=eh(e.id,t)+'">'+oh(e.body,t)+"</menclose>";break;case"prompt":I='<menclose notation="roundexbox""">'+oh(e.body,t)+"</menclose>";break;case"space":I+=" ";break;case"mopen":case"mclose":I+=lh(e,t);break;case"macro":{const n=e.command+ch(e.macroArgs);n&&(I+=`<mo ${eh(e.id,t)}>${n}</mo>`)}break;case"latexgroup":case"tooltip":I+=oh(e.body,t);break;case"latex":I+="<mtext"+eh(e.id,t)+">"+e.value+"</mtext>";break;case"text":I+=`<mtext ${eh(e.id,t)}x>${e.value}</mtext>`;break;default:if("\\displaystyle"===e.command)return`<mrow ${eh(e.id,t)} displaystyle="true">${oh(e.body,t)}</mrow>`;if("\\textstyle"===e.command)return`<mrow ${eh(e.id,t)} displaystyle="false">${oh(e.body,t)}</mrow>`;console.info("Unexpected element in conversion to MathML:",e)}return I}var dh={"\\alpha":"alpha ","\\mu":"mew ","\\sigma":"sigma ","\\pi":"pie ","\\imaginaryI":"imaginary eye ","\\imaginaryJ":"imaginary jay ","\\sum":"Summation ","\\prod":"Product ","+":"plus ","-":"minus ",";":'<break time="150ms"/> semi-colon <break time="150ms"/>',",":'<break time="150ms"/> comma <break time="150ms"/>',"|":'<break time="150ms"/>Vertical bar<break time="150ms"/>',"(":'<break time="150ms"/>Open paren. <break time="150ms"/>',")":'<break time="150ms"/> Close paren. <break time="150ms"/>',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\pm":"plus or minus","\\mp":"minus or plus","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","\\ne":"is not equal to ","\\neq":"is not equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","":"","−":"minus ",":":'<break time="150ms"/> such that <break time="200ms"/> ',"\\colon":'<break time="150ms"/> such that <break time="200ms"/> ',"\\hbar":"etch bar ","\\iff":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\Longleftrightarrow":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set <break time="150ms"/><say-as interpret-as="character">n</say-as>',"\\C":'the set <break time="150ms"/><say-as interpret-as="character">c</say-as>',"\\Z":'the set <break time="150ms"/><say-as interpret-as="character">z</say-as>',"\\Q":'the set <break time="150ms"/><say-as interpret-as="character">q</say-as>',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdot":"times ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lparen":'<break time="150ms"/>open paren<break time="150ms"/>',"\\rparen":'<break time="150ms"/>close paren<break time="150ms"/>',"\\lbrace":'<break time="150ms"/>open brace<break time="150ms"/>',"\\{":'<break time="150ms"/>open brace<break time="150ms"/>',"\\rbrace":'<break time="150ms"/>close brace<break time="150ms"/>',"\\}":'<break time="150ms"/>close brace<break time="150ms"/>',"\\langle":'<break time="150ms"/>left angle bracket<break time="150ms"/>',"\\rangle":'<break time="150ms"/>right angle bracket<break time="150ms"/>',"\\lfloor":'<break time="150ms"/>open floor<break time="150ms"/>',"\\rfloor":'<break time="150ms"/>close floor<break time="150ms"/>',"\\lceil":'<break time="150ms"/>open ceiling<break time="150ms"/>',"\\rceil":'<break time="150ms"/>close ceiling<break time="150ms"/>',"\\vert":'<break time="150ms"/>vertical bar<break time="150ms"/>',"\\mvert":'<break time="150ms"/>divides<break time="150ms"/>',"\\lvert":'<break time="150ms"/>left vertical bar<break time="150ms"/>',"\\rvert":'<break time="150ms"/>right vertical bar<break time="150ms"/>',"\\lbrack":'<break time="150ms"/> open square bracket <break time="150ms"/>',"\\rbrack":'<break time="150ms"/> close square bracket <break time="150ms"/>',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"},hh={array:"array",matrix:"matrix",pmatrix:"parenthesis matrix",bmatrix:"square brackets matrix",Bmatrix:"braces matrix",vmatrix:"bars matrix",Vmatrix:"double bars matrix","matrix*":"matrix",smallmatrix:"small matrix"};function ph(e){let t=0;if(f(e))for(const n of e)"first"!==n.type&&(t+=1);return 1===t}function fh(e){let t="";if(f(e))for(const n of e)"first"!==n.type&&"string"==typeof n.value&&(t+=n.value);return t}function mh(e,t){var n,i,r,a,s;function o(e){return"<emphasis>"+e+"</emphasis>"}if(!t)return"";let l="";if(f(t)){let i=!1,r=!1;for(let a=0;a<t.length;a++)"first"!==t[a].type&&("text"!==t[a].mode&&(r=!1),a<t.length-2&&"mopen"===t[a].type&&"mclose"===t[a+2].type&&"mord"===t[a+1].type?(l+=" of ",l+=o(mh(e,t[a+1])),a+=2):"text"===t[a].mode?r?l+=null!=(n=t[a].value)?n:" ":(r=!0,l+=mh("text",t[a])):t[a].isDigit()?i?l+=t[a].asDigit():(i=!0,l+=mh(e,t[a])):(i=!1,l+=mh(e,t[a])))}else if("text"===t.mode)t.id&&"math"===e&&(l+='<mark name="'+t.id.toString()+'"/>'),l+=t.value;else{t.id&&"math"===e&&(l+='<mark name="'+t.id.toString()+'"/>');let n="",d="",h="",p=!1;const{command:m}=t;switch(m){case"\\vec":return"vector "+mh(e,t.body);case"\\acute":return mh(e,t.body)+" acute";case"\\grave":return mh(e,t.body)+" grave";case"\\dot":return"dot over"+mh(e,t.body);case"\\ddot":return"double dot over"+mh(e,t.body);case"\\mathring":return"ring over"+mh(e,t.body);case"\\tilde":case"\\widetilde":return"tilde over"+mh(e,t.body);case"\\bar":return mh(e,t.body)+" bar";case"\\breve":return mh(e,t.body)+" breve";case"\\check":case"\\widecheck":return"check over "+mh(e,t.body);case"\\hat":case"\\widehat":return"hat over"+mh(e,t.body);case"\\overarc":case"\\overparen":case"\\wideparen":return"arc over "+mh(e,t.body);case"\\underarc":case"\\underparen":return"arc under "+mh(e,t.body)}switch(t.type){case"prompt":l+=' <break time="300ms"/> '+(t.body.length>1?'start input . <break time="500ms"/> '+mh(e,t.body)+'. <break time="500ms"/> end input':"blank")+'. <break time="700ms"/>'+(null!=(i=t.correctness)?i:"")+' . <break time="700ms"/> ';break;case"array":const f=t.array,g=t.environmentName;if(Object.keys(hh).includes(g)){l+=` begin ${hh[g]} `;for(let e=0;e<f.length;e++){e>0&&(l+=","),l+=` row ${e+1} `;for(let t=0;t<f[e].length;t++)t>0&&(l+=","),l+=` column ${t+1}: `,l+=mh("math",f[e][t])}l+=` end ${hh[g]} `}break;case"group":"\\ne"===m?l+=" not equal ":"\\not"===m?(l+=" not ",l+=mh("math",t.body)):l+=mh("math",t.body);break;case"root":l+=mh("math",t.body);break;case"genfrac":if(n=mh("math",t.above),d=mh("math",t.below),ph(t.above)&&ph(t.below)){const e={"1/2":" half ","1/3":" one third ","2/3":" two third","1/4":" one quarter ","3/4":" three quarter ","1/5":" one fifth ","2/5":" two fifths ","3/5":" three fifths ","4/5":" four fifths ","1/6":" one sixth ","5/6":" five sixths ","1/8":" one eight ","3/8":" three eights ","5/8":" five eights ","7/8":" seven eights ","1/9":" one ninth ","2/9":" two ninths ","4/9":" four ninths ","5/9":" five ninths ","7/9":" seven ninths ","8/9":" eight ninths "}[fh(t.above)+"/"+fh(t.below)];e?l=e:l+=n+" over "+d}else l+=' the fraction <break time="150ms"/>'+n+' over <break time="150ms"/>'+d+'.<break time="150ms"/> End fraction.<break time="150ms"/>';break;case"surd":if(h=mh("math",t.body),t.hasEmptyBranch("above"))l+=ph(t.body)?" the square root of "+h+" , ":' the square root of <break time="200ms"/>'+h+'. <break time="200ms"/> End square root';else{let e=mh("math",t.above);e=e.trim();const n=e.replace(/<mark([^/]*)\/>/g,"");l+="3"===n?' the cube root of <break time="200ms"/>'+h+'. <break time="200ms"/> End cube root':"n"===n?' the nth root of <break time="200ms"/>'+h+'. <break time="200ms"/> End root':' the root with index: <break time="200ms"/>'+e+', of <break time="200ms"/>'+h+'. <break time="200ms"/> End root'}break;case"leftright":{const e=t;l+=null!=(r=e.leftDelim?dh[e.leftDelim]:void 0)?r:e.leftDelim,l+=mh("math",t.body),l+=null!=(a=e.rightDelim?dh[e.rightDelim]:void 0)?a:e.rightDelim}break;case"rule":case"overunder":case"overlap":case"space":case"spacing":break;case"macro":const v=m.replace(/^\\/g,""),b=ie()[v];b&&((null==b?void 0:b.expand)?l+=mh("math",t.body):l+=`${v} `);break;case"placeholder":l+="placeholder ";break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":{if("\\mathbin"===m||"\\mathrel"===m||"\\mathopen"===m||"\\mathclose"===m||"\\mathpunct"===m||"\\mathord"===m||"\\mathinner"===m){l=mh(e,t.body);break}let n=t.isDigit()?t.asDigit():t.value,i=t.command;if("delim"!==t.type&&"sizeddelim"!==t.type||(i=t.value,n=i),"text"===e)l+=n;else{if("mbin"===t.type&&(l+='<break time="150ms"/>'),n){const e=dh[n]||(i?dh[i.trim()]:"");if(e)l+=" "+e;else{const e=i?function(e){let t="";return e.startsWith("\\")&&(t=" "+e.replace("\\","")+" "),t}(i.trim()):"";l+=e||(u=n,window.MathfieldElement.textToSpeechMarkup?/[a-z]/.test(u)?` <say-as interpret-as="character">${u}</say-as>`:/[A-Z]/.test(u)?`capital <say-as interpret-as="character">${u.toLowerCase()}</say-as>`:u:/[a-z]/.test(u)?" '"+u.toUpperCase()+"'":/[A-Z]/.test(u)?" 'capital "+u.toUpperCase()+"'":u)}}else l+=mh("math",t.body);"mbin"===t.type&&(l+='<break time="150ms"/>')}break}case"mop":case"operator":case"extensible-symbol":if(""!==t.value){const e=t.command;if("\\sum"===e)if(t.hasEmptyBranch("superscript")||t.hasEmptyBranch("subscript"))if(t.hasEmptyBranch("subscript"))l+=" the summation of";else{let e=mh("math",t.subscript);e=e.trim(),l+=' the summation from <break time="200ms"/>'+e+'<break time="200ms"/> of <break time="150ms"/>',p=!0}else{let e=mh("math",t.superscript);e=e.trim();let n=mh("math",t.subscript);n=n.trim(),l+=' the summation from <break time="200ms"/>'+n+'<break time="200ms"/> to <break time="200ms"/>'+e+'<break time="200ms"/> of <break time="150ms"/>',p=!0}else if("\\prod"===e)if(t.hasEmptyBranch("superscript")||t.hasEmptyBranch("subscript"))if(t.hasEmptyBranch("subscript"))l+=" the product of ";else{let e=mh("math",t.subscript);e=e.trim(),l+=' the product from <break time="200ms"/>'+e+'<break time="200ms"/> of <break time="150ms"/>',p=!0}else{let e=mh("math",t.superscript);e=e.trim();let n=mh("math",t.subscript);n=n.trim(),l+=' the product from <break time="200ms"/>'+n+'<break time="200ms"/> to <break time="200ms"/>'+e+'<break time="200ms"/> of <break time="150ms"/>',p=!0}else if("\\int"===e)if(t.hasEmptyBranch("superscript")||t.hasEmptyBranch("subscript"))l+=' the integral of <break time="200ms"/> ';else{let e=mh("math",t.superscript);e=e.trim();let n=mh("math",t.subscript);n=n.trim(),l+=' the integral from <break time="200ms"/>'+o(n)+'<break time="200ms"/> to <break time="200ms"/>'+o(e)+' <break time="200ms"/> of ',p=!0}else if("string"==typeof t.value){const e=null!=(s=dh[t.value])?s:t.command?dh[t.command]:void 0;l+=e||" "+t.value}else t.command&&("\\mathop"===t.command?l+=mh("math",t.body):"\\operatorname"===t.command?l+=(c=t.body)?c.map((e=>e.value)).join(""):"":l+=t.command.startsWith("\\")?" "+t.command.slice(1):" "+t.command)}break;case"enclose":h=mh("math",t.body),l+=" crossed out "+h+". End crossed out."}if(!p&&!t.hasEmptyBranch("superscript")){let n=mh(e,t.superscript);n=n.trim();const i=n.replace(/<[^>]*>/g,"");if(ph(t.superscript)){if("math"===e){const e=function(e){if(f(e))for(const t of e)if("first"!==t.type&&t.id)return t.id.toString();return""}(t.superscript);e&&(l+='<mark name="'+e+'"/>')}"′"===i?l+=" prime ":"2"===i?l+=" squared ":"3"===i?l+=" cubed ":Number.isNaN(Number.parseInt(i))?l+=" to the "+n+"; ":l+=' to the <say-as interpret-as="ordinal">'+i+"</say-as> power; "}else Number.isNaN(Number.parseInt(i))?l+=" raised to the "+n+"; ":l+=' raised to the <say-as interpret-as="ordinal">'+i+"</say-as> power; "}if(!p&&!t.hasEmptyBranch("subscript")){let e=mh("math",t.subscript);e=e.trim(),l+=ph(t.subscript)?" sub "+e:" subscript "+e+". End subscript. "}}var c,u;return l}function gh(e){var t,n;if("sre"===window.MathfieldElement.textToSpeechRules&&("sre"in window||"SRE"in window)){const i=oh(e);if(i){window.MathfieldElement.textToSpeechMarkup&&(window.MathfieldElement.textToSpeechRulesOptions=null!=(t=window.MathfieldElement.textToSpeechRulesOptions)?t:{},window.MathfieldElement.textToSpeechRulesOptions=d(u({},window.MathfieldElement.textToSpeechRulesOptions),{markup:window.MathfieldElement.textToSpeechMarkup}),"ssml"===window.MathfieldElement.textToSpeechRulesOptions.markup&&(window.MathfieldElement.textToSpeechRulesOptions=d(u({},window.MathfieldElement.textToSpeechRulesOptions),{markup:"ssml_step"})),window.MathfieldElement.textToSpeechRulesOptions=d(u({},window.MathfieldElement.textToSpeechRulesOptions),{rate:window.MathfieldElement.speechEngineRate}));const e=null!=(n=window.SRE)?n:window.sre.System.getInstance();window.MathfieldElement.textToSpeechRulesOptions&&e.setupEngine(window.MathfieldElement.textToSpeechRulesOptions);let r="";try{r=e.toSpeech(i)}catch(e){console.error("MathLive 0.98.5: `SRE.toSpeech()` runtime error",e)}return r}return""}let i=mh("math",e);if("ssml"===window.MathfieldElement.textToSpeechMarkup){let e="";window.MathfieldElement.speechEngineRate&&(e='<prosody rate="'+window.MathfieldElement.speechEngineRate+'">'),i='<?xml version="1.0"?><speak version="1.1" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US"><amazon:auto-breaths>'+e+"<p><s>"+i+"</s></p>"+(e?"</prosody>":"")+"</amazon:auto-breaths></speak>"}else i="mac"===window.MathfieldElement.textToSpeechMarkup&&"macos"===v()?i.replace(/<mark([^/]*)\/>/g,"").replace(/<emphasis>/g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(/<break time="(\d*)ms"\/>/g,"[[slc $1]]").replace(/<say-as[^>]*>/g,"").replace(/<\/say-as>/g,""):i.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return i}var vh={"\\ne":"≠","\\neq":"≠","−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega","\\exponentialE":"e","\\imaginaryI":"i","\\imaginaryJ":"j","\\!":" ","\\,":" ","\\:":" ","\\>":" ","\\;":" ","\\enskip":" ","\\enspace":" ","\\qquad":" ","\\quad":" ","\\infty":"oo"},bh={"\\pm":"+-","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrack":"[","\\rbrack":"]","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"(:","\\rangle":":)","\\sum":" sum ","\\prod":" prod ","\\bigcap":" nnn ","\\bigcup":" uuu ","\\int":" int ","\\oint":" oint ","\\ge":">=","\\le":"<=","\\ne":"!=","\\neq":"!=","\\lt":"<","\\gt":">","\\gets":"<-","\\to":"->","\\land":" and ","\\lor":" or ","\\lnot":" not ","\\forall":" AA ","\\exists":" EE ","\\in":" in ","\\notin":" !in ","\\mapsto":"|->","\\implies":"=>","\\iff":"<=>","\\cdot":"*","\\ast":"**","\\star":"***","\\times":"xx","\\div":"-:","\\ltimes":"|><","\\rtimes":"><|","\\bowtie":"|><|","\\circ":"@"};function yh(e){var t,n,i,r,a,s,o,l,c,u,d,h,p;if(!e)return"";if(f(e)){if(0===e.length)return"";if("latex"===e[0].mode)return e.map(yh).join("");if("text"===e[0].mode){let n=0,i="";for(;"text"===(null==(t=e[n])?void 0:t.mode);)i+=e[n].body?yh(e[n].body):e[n].value,n++;return`"${i}" ${yh(e.slice(n))}`}let n=0;const i=[];for(;e[n]&&"math"===e[n].mode;){let t="";for(;e[n]&&"mord"===e[n].type&&/\d/.test(e[n].value);)t+=e[n++].value;t?i.push(t):i.push(yh(e[n++]))}return i.push(yh(e.slice(n))),function(e){let t="";for(const n of e){const e=t[t.length-1];void 0!==e&&/\d/.test(e)&&/^\d/.test(n)&&(t+=" "),t+=n}return t}(i)}if("text"===e.mode)return`"${e.value}"`;let m="";const{command:g}=e;let v;if("\\placeholder"===g)return`(${yh(e.body)})`;switch(e.type){case"accent":const t={"\\vec":"vec","\\dot":"dot","\\ddot":"ddot","\\bar":"bar","\\hat":"hat","\\acute":"acute;","\\grave":"grave","\\tilde":"tilde","\\breve":"breave","\\check":"check"}[g];m=`${null!=t?t:""} ${yh(e.body)} `;break;case"first":return"";case"latexgroup":return e.body.map((e=>e.value)).join("");case"group":case"root":m=null!=(n=vh[g])?n:yh(e.body);break;case"genfrac":{const t=e;(t.leftDelim||t.rightDelim)&&(m="."!==t.leftDelim&&t.leftDelim?t.leftDelim:"{:"),t.hasBarLine?(m+="(",m+=yh(t.above),m+=")/(",m+=yh(t.below),m+=")"):(m+="("+yh(t.above)+"),",m+="("+yh(t.below)+")"),(t.leftDelim||t.rightDelim)&&(m+="."!==t.rightDelim&&t.rightDelim?t.rightDelim:"{:")}break;case"surd":m+=e.hasEmptyBranch("above")?"sqrt("+yh(e.body)+")":"root("+yh(e.above)+")("+yh(e.body)+")";break;case"latex":case"sizeddelim":case"delim":case"mopen":case"mclose":m=e.value;break;case"leftright":{const t=e,n=t.leftDelim;m+="."!==n&&n?n:"{:",m+=yh(t.body);const i=t.matchingRightDelim();m+="."!==i&&i?i:":}"}break;case"overlap":case"overunder":case"box":break;case"mord":m=null!=(r=null!=(i=vh[g])?i:g)?r:"string"==typeof e.value?e.value:"",m.startsWith("\\")&&(m+=" "),v=g?g.match(/{?\\char"([\dabcdefABCDEF]+)}?/):null,v?m=String.fromCodePoint(Number.parseInt("0x"+v[1])):m.length>0&&m.startsWith("\\")&&(m="string"==typeof e.value?e.value.charAt(0):e.command),m=function(e,t){if(!t)return e;let n=e;"double-struck"===t.variant&&(n=`bbb "${n}"`);"script"===t.variant&&(n=`cc "${n}"`);"fraktur"===t.variant&&(n=`fr "${n}"`);"sans-serif"===t.variant&&(n=`sf "${n}"`);"monospace"===t.variant&&(n=`tt "${n}"`);"bold"===t.variantStyle&&(n=`bb "${n}"`);return t.color?`color({${t.color}})(${n})`:n}(m,e.style);break;case"mbin":case"mrel":case"minner":m=null!=(s=null!=(a=vh[g])?a:bh[g])?s:e.value;break;case"mpunct":m=null!=(o=bh[g])?o:g;break;case"mop":case"operator":case"extensible-symbol":""!==e.value&&(m=bh[g]?bh[g]:"\\operatorname"===g?yh(e.body):null!=(l=e.value)?l:g,m+=" ");break;case"array":const f=e.array,b=e.environmentName,y=null!=(c={bmatrix:["[","]"],"bmatrix*":["[","]"]}[b])?c:["(",")"],_=[];for(const e of f){const t=[];for(const n of e)t.push(y[0]+yh(n)+y[1]);_.push(t.join(","))}const w=null!=(u={bmatrix:["[","]"],"bmatrix*":["[","]"],cases:["{",":}"]}[b])?u:["(",")"];m=w[0]+_.join(",")+w[1];break;case"spacing":m=null!=(d=vh[g])?d:" ";break;case"enclose":m="("+yh(e.body)+")";break;case"space":m=" ";break;case"subsup":m="";break;case"macro":m=null!=(p=null!=(h=vh[g])?h:bh[g])?p:yh(e.body)}if(!e.hasEmptyBranch("subscript")){m+="_";const t=yh(e.subscript);m+=1!==t.length?`(${t})`:t}if(!e.hasEmptyBranch("superscript")){m+="^";const t=yh(e.superscript);m+=1!==t.length?`(${t})`:t}return m}function _h(e,t){var n,i;null!=t||(t={}),t.mathstyle=null!=(n=t.mathstyle)?n:"displaystyle";const r=new Ts({from:d(u({},Cs()),{renderPlaceholder:()=>new cs(160,{maxFontSize:1}),letterShapeStyle:null!=(i=null==t?void 0:t.letterShapeStyle)?i:"tex"}),mathstyle:t.mathstyle}),a=new Ds({mode:"math",type:"root",body:Qo(e,{context:r,parseMode:"math",mathstyle:t.mathstyle})}).render(r);if(!a)return"";ds(xl(a,r));return hs(a,{classes:"ML__latex"}).toMarkup()}function wh(e){if("string"==typeof e){const t=function(e){if(!e)return;if("#"!==e[0])return;let t;(e=e.slice(1)).length<=4?(t={r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16)},4===e.length&&(t.a=parseInt(e[3]+e[3],16)/255)):(t={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16)},8===e.length&&(t.a=parseInt(e[6]+e[7],16)/255));t&&void 0===t.a&&(t.a=1);return t}(e);if(!t)throw new Error(`Invalid color: ${e}`);return t}return"C"in e?Th(kh(e)):"a"in e?Th(e):e}function xh(e){return e<0?0:e>255?255:Math.round(e)}function kh(e){const[t,n,i]=[e.L,e.C,e.H],r=i*Math.PI/180,a={L:t,a:n*Math.cos(r),b:n*Math.sin(r)};return void 0!==e.alpha&&(a.alpha=e.alpha),a}function Sh(e){const[t,n,i]=[e.L,e.a,e.b],r=Math.pow(.9999999984505198*t+.39633779217376786*n+.2158037580607588*i,3),a=Math.pow(1.00000000888176*t-.10556134232365635*n-.0638541747717059*i,3),s=Math.pow(1.000000054672411*t-.0894841820949657*n-1.2914855378640917*i,3),o=-1.2684380040921763*r+2.6097574006633715*a-.3413193963102197*s,l=-.004196086541837188*r-.7034186144594493*a+1.7076147009309444*s,c=e=>{const t=Math.abs(e);return t<=.0031308?12.92*e:(Math.sign(e)||1)*(1.055*Math.pow(t,1/2.4)-.055)};return[c(4.076741661347994*r-3.307711590408193*a+.230969928729428*s),c(o),c(l)]}function Eh(e){const[t,n,i]=e;return t>=0&&t<=1&&n>=0&&n<=1&&i>=0&&i<=1}function Ch(e,t){let[n,i,r]=e;return n=xh(255*n),i=xh(255*i),r=xh(255*r),void 0!==t?{r:n,g:i,b:r,alpha:t}:{r:n,g:i,b:r}}function Th(e){let[t,n,i]=Sh(e);if(Eh([t,n,i]))return Ch([t,n,i],e.alpha);const r=function(e){const[t,n,i]=[e.L,e.a,e.b],r={L:t,C:Math.sqrt(n*n+i*i),H:180*Math.atan2(i,n)/Math.PI};return void 0!==e.alpha&&(r.alpha=e.alpha),r}(e);if(r.C=0,[t,n,i]=Sh(kh(r)),!Eh([t,n,i]))return Ch([t,n,i],e.alpha);let a=0,s=e.L,o=(a+s)/2;r.C=o;const l=.36/Math.pow(2,12);for(;s-a>l;)o=(a+s)/2,r.C=o,[t,n,i]=Sh(kh(r)),Eh([t,n,i])?a=o:s=o;return Ch([t,n,i],e.alpha)}function Ah(e,t){const n=wh(e),i=wh(t);function r(e){return e>=.022?e:e+(.022-e)**1.414}function a(e){return(e<0?-1:1)*Math.pow(Math.abs(e),2.4)}const s=r(.2126729*a(i.r/255)+.7151522*a(i.g/255)+.072175*a(i.b/255)),o=r(.2126729*a(n.r/255)+.7151522*a(n.g/255)+.072175*a(n.b/255));let l,c,u;return Math.abs(o-s)<5e-4?c=0:o>s?(l=o**.56-s**.57,c=1.14*l):(l=o**.65-s**.62,c=1.14*l),u=Math.abs(c)<.1?0:c>0?c-.027:c+.027,100*u}function Mh(e,t,n){null!=n||(n="#fff"),null!=t||(t="#000");const i=Ah(e,n),r=Ah(e,t);return Math.abs(i)>Math.abs(r)?n:t}function Lh(e){const t=wh(e);let n=((1<<24)+(xh(t.r)<<16)+(xh(t.g)<<8)+xh(t.b)).toString(16).slice(1);return void 0!==t.alpha&&t.alpha<1&&(n+=("00"+Math.round(255*t.alpha).toString(16)).slice(-2)),n[0]===n[1]&&n[2]===n[3]&&n[4]===n[5]&&n[6]===n[7]&&(n=n[0]+n[2]+n[4]+(void 0!==t.alpha&&t.alpha<1?n[6]:"")),"#"+n}function Dh(e){const t=Ih(e);let n="";for(const e of t){if("string"!=typeof e.value)return"";n+=e.value}return n}function Ih(e){const t=e.model.selection.ranges;return 1!==t.length?[]:e.model.getAtoms(t[0])}function Rh(e){return[jh(e,"double-struck","mathbb","tooltip.blackboard"),jh(e,"fraktur","mathfrak","tooltip.fraktur"),jh(e,"calligraphic","mathcal","tooltip.caligraphic"),qh(e,"up","mathrm","tooltip.roman-upright"),qh(e,"bold","mathbf","tooltip.bold"),qh(e,"italic","mathit","tooltip.italic")]}function Ph(e){return[{label:()=>_h(`\\vec{${Dh(e)}}`),visible:()=>1===Dh(e).length,onMenuSelect:()=>e.insert("\\vec{#@}",{selectionMode:"item"})},{label:()=>_h(`\\overrightarrow{${Dh(e)}}`),visible:()=>Dh(e).length>0,onMenuSelect:()=>e.insert("\\overrightarrow{#@}",{selectionMode:"item"})},{label:()=>_h(`\\overleftarrow{${Dh(e)}}`),visible:()=>Dh(e).length>0,onMenuSelect:()=>e.insert("\\overleftarrow{#@}",{selectionMode:"item"})},{label:()=>_h(`\\dot{${Dh(e)}}`),visible:()=>1===Dh(e).length,onMenuSelect:()=>e.insert("\\dot{#@}",{selectionMode:"item"})},{label:()=>_h(`\\ddot{${Dh(e)}}`),visible:()=>1===Dh(e).length,onMenuSelect:()=>e.insert("\\ddot{#@}",{selectionMode:"item"})},{label:()=>_h(`\\bar{${Dh(e)}}`),visible:()=>1===Dh(e).length,onMenuSelect:()=>e.insert("\\bar{#@}",{selectionMode:"item"})},{label:()=>_h(`\\overline{${Dh(e)}}`),visible:()=>Dh(e).length>0,onMenuSelect:()=>e.insert("\\overline{#@}",{selectionMode:"item"})},{label:()=>_h(`\\overgroup{${Dh(e)}}`),visible:()=>Dh(e).length>0,onMenuSelect:()=>e.insert("\\overgroup{#@}",{selectionMode:"item"})},{label:()=>_h(`\\overbrace{${Dh(e)}}`),visible:()=>Dh(e).length>0,onMenuSelect:()=>e.insert("\\overbrace{#@}",{selectionMode:"item"})},{label:()=>_h(`\\underline{${Dh(e)}}`),visible:()=>Dh(e).length>0,onMenuSelect:()=>e.insert("\\underline{#@}",{selectionMode:"item"})},{label:()=>_h(`\\undergroup{${Dh(e)}}`),visible:()=>Dh(e).length>0,onMenuSelect:()=>e.insert("\\undergroup{#@}",{selectionMode:"item"})},{label:()=>_h(`\\underbrace{${Dh(e)}}`),visible:()=>Dh(e).length>0,onMenuSelect:()=>e.insert("\\underbrace{#@}",{selectionMode:"item"})}]}function Oh(e){return[{label:()=>_h(`\\boxed{${e.getValue(e.model.selection)}}}`),onMenuSelect:()=>e.insert("\\boxed{#@}",{selectionMode:"item"})},{label:()=>_h(`\\bbox[5px, border: 2px solid red]{${e.getValue(e.model.selection)}}`),onMenuSelect:()=>e.insert("\\bbox[5px, border: 2px solid red]{#@}",{selectionMode:"item"})},{label:()=>_h(`\\bbox[5px, border: 2px dashed black]{${e.getValue(e.model.selection)}}`),onMenuSelect:()=>e.insert("\\bbox[5px, border: 2px dashed black]{#@}",{selectionMode:"item"})}]}function Nh(e){const t=[];for(const n of Object.keys(k))t.push({class:("#000"===Lh(Mh(k[n]))?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${k[n]} "></span>`,ariaLabel:()=>{var e;return null!=(e=_(n))?e:n},checked:()=>{var t;return{some:"mixed",all:!0}[null!=(t=e.queryStyle({backgroundColor:n}))&&t]},onMenuSelect:()=>{e.applyStyle({backgroundColor:n},{operation:"toggle"}),e.adoptStyle="none"}});return t}function Bh(e){const t=[];for(const n of Object.keys(S))t.push({class:("#000"===Mh(S[n])?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${S[n]} "></span>`,ariaLabel:()=>{var e;return null!=(e=_(n))?e:n},checked:()=>{var t;return{some:"mixed",all:!0}[null!=(t=e.queryStyle({color:n}))&&t]},onMenuSelect:()=>{e.applyStyle({color:n},{operation:"toggle"}),e.adoptStyle="none"}});return t}var $h=class extends Fd{constructor(e,t,n,i){super(e,t),this.row=n,this.col=i}set active(e){const t=this.parentMenu.children;if(e)for(const e of t)e.element.classList.toggle("active",e.row<=this.row&&e.col<=this.col);else for(const e of t)e.element.classList.remove("active")}};function Fh(e){const t=[];for(let n=1;n<=5;n++)for(let i=1;i<=5;i++)t.push({onCreate:(e,t)=>new $h(e,t,n,i),label:"☐",tooltip:()=>_("tooltip.row-by-col",n,i),data:{row:n,col:i},onMenuSelect:()=>{e.insert(`\\begin{pmatrix}${Array(n).fill(Array(i).fill("#?").join(" & ")).join("\\\\")}\\end{pmatrix}`,{selectionMode:"item"})}});return t}function zh(e){return[{label:()=>_("menu.array.add row above"),id:"add-row-above",onMenuSelect:()=>e.executeCommand("addRowBefore"),visible:()=>Kh(e)},{label:()=>_("menu.array.add row below"),id:"add-row-below",onMenuSelect:()=>e.executeCommand("addRowAfter"),visible:()=>Kh(e)},{label:()=>_("menu.array.add column before"),id:"add-column-before",onMenuSelect:()=>e.executeCommand("addColumnBefore"),visible:()=>Kh(e),enabled:()=>{const t=e.model.parentEnvironment;if(!t)return!1;const[n,i]=function(e){var t;const n=null==(t=e.model.parentEnvironment)?void 0:t.array;return n?[n.length,n.reduce(((e,t)=>Math.max(e,t.length)),0)]:[0,0]}(e);return n<t.maxColumns}},{label:()=>_("menu.array.add column after"),id:"add-column-after",onMenuSelect:()=>e.executeCommand("addColumnAfter"),visible:()=>Kh(e)},{type:"divider"},{label:()=>_("menu.array.delete row"),id:"delete-row",onMenuSelect:()=>e.executeCommand("removeRow"),visible:()=>Kh(e)},{label:()=>_("menu.array.delete column"),id:"delete-column",onMenuSelect:()=>e.executeCommand("removeColumn"),visible:()=>Kh(e)},{type:"divider"},{label:()=>_("menu.borders"),visible:()=>(function(e){return"array"===e.model.at(e.model.position).type}(e)||Kh(e))&&e.isSelectionEditable,submenu:[{label:" ⋱ ",id:"environment-no-border",onMenuSelect:()=>Uh(e,"matrix")},{label:"(⋱)",id:"environment-parentheses",onMenuSelect:()=>Uh(e,"pmatrix")},{label:"[⋱]",id:"environment-brackets",onMenuSelect:()=>Uh(e,"bmatrix")},{label:"|⋱|",id:"environment-bar",onMenuSelect:()=>Uh(e,"vmatrix")},{label:"{⋱}",id:"environment-braces",onMenuSelect:()=>Uh(e,"Bmatrix")}],submenuClass:"border-submenu"},{type:"divider"},{label:()=>_("menu.insert matrix"),id:"insert-matrix",visible:()=>e.isSelectionEditable,submenu:Fh(e),submenuClass:"insert-matrix-submenu",columnCount:5},{label:()=>_("menu.mode"),id:"mode",visible:()=>e.isSelectionEditable&&e.model.selectionIsCollapsed,submenu:[{label:()=>_("menu.mode-math"),id:"mode-math",onMenuSelect:()=>{dc(e,"accept-all"),e.executeCommand(["switchMode","math"])},checked:()=>"math"===e.model.mode},{label:()=>_("menu.mode-text"),id:"mode-text",onMenuSelect:()=>{dc(e,"accept-all"),e.executeCommand(["switchMode","text"])},checked:()=>"text"===e.model.mode},{label:()=>_("menu.mode-latex"),id:"mode-latex",onMenuSelect:()=>e.executeCommand(["switchMode","latex"]),checked:()=>"latex"===e.model.mode}]},{type:"divider"},{label:()=>_("menu.font-style"),id:"variant",visible:()=>e.isSelectionEditable,submenu:Rh(e),submenuClass:"variant-submenu"},{label:()=>_("menu.color"),id:"color",visible:()=>e.isSelectionEditable,submenu:Bh(e),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>_("menu.background-color"),id:"background-color",visible:()=>e.isSelectionEditable,submenu:Nh(e),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>_("menu.accent"),id:"accent",visible:()=>e.isSelectionEditable,submenu:Ph(e),submenuClass:"variant-submenu"},{label:()=>_("menu.decoration"),id:"decoration",visible:()=>e.isSelectionEditable&&Dh(e).length>0,submenu:Oh(e),submenuClass:"variant-submenu"},{type:"divider"},{label:()=>_("menu.evaluate"),id:"ce-evaluate",visible:()=>e.isSelectionEditable&&null!==window.MathfieldElement.computeEngine,onMenuSelect:()=>{const t=function(e){var t,n;let i;i=e.model.selectionIsCollapsed?null==(t=window.MathfieldElement.computeEngine)?void 0:t.parse(e.getValue(),{canonical:!1}):null==(n=window.MathfieldElement.computeEngine)?void 0:n.parse(e.getValue(e.model.selection),{canonical:!1});if(!i)return"";let r=i.evaluate();r.isSame(i)&&(r=i.N());return r.latex}(e);t?e.model.selectionIsCollapsed?(e.model.position=e.model.lastOffset,e.insert(`=${t}`,{insertionMode:"insertAfter",selectionMode:"item"})):e.insert(t,{insertionMode:"replaceSelection",selectionMode:"item"}):e.model.announce("plonk")}},{label:()=>_("menu.simplify"),id:"ce-simplify",visible:()=>e.isSelectionEditable&&null!==window.MathfieldElement.computeEngine,onMenuSelect:()=>{var t,n;if(e.model.selectionIsCollapsed){const n=null==(t=e.expression)?void 0:t.simplify();if(e.model.position=e.model.lastOffset,!n)return void e.model.announce("plonk");e.insert(`=${n.latex}`,{insertionMode:"insertAfter",selectionMode:"item"})}else{const t=null==(n=window.MathfieldElement.computeEngine)?void 0:n.parse(e.getValue(e.model.selection)).simplify();if(!t)return void e.model.announce("plonk");e.insert(t.latex,{insertionMode:"replaceSelection",selectionMode:"item"})}}},{label:()=>{var t;if(null===window.MathfieldElement.computeEngine)return"";const n=null==(t=e.expression)?void 0:t.unknowns[0];return n?_("menu.solve-for",_h(n)):_("menu.solve")},id:"ce-solve",visible:()=>{var t;return e.isSelectionEditable&&null!==window.MathfieldElement.computeEngine&&1===(null==(t=e.expression)?void 0:t.unknowns.length)&&"Nothing"!==e.expression.unknowns[0]},onMenuSelect:()=>{var t;const n=e.expression,i=null==n?void 0:n.unknowns[0],r=null==(t=n.solve(i))?void 0:t.map((e=>{var t;return null!=(t=e.simplify().latex)?t:""}));r?e.insert(`${i}=${1===r.length?r[0]:"\\left\\lbrace"+(null==r?void 0:r.join(", "))+"\\right\\rbrace"}`,{insertionMode:"replaceAll",selectionMode:"item"}):e.model.announce("plonk")}},{type:"divider"},{label:()=>_("menu.cut"),onMenuSelect:()=>e.executeCommand("cutToClipboard"),visible:()=>!e.options.readOnly&&e.isSelectionEditable,keyboardShortcut:"meta+X"},{label:()=>_("menu.copy"),id:"copy",submenu:[{label:()=>_("menu.copy-as-latex"),id:"copy-latex",onMenuSelect:()=>Ys.copyToClipboard(e,"latex"),keyboardShortcut:"meta+C"},{label:()=>_("menu.copy-as-ascii-math"),id:"copy-ascii-math",onMenuSelect:()=>Ys.copyToClipboard(e,"ascii-math")},{label:()=>_("menu.copy-as-mathml"),id:"copy-math-ml",onMenuSelect:()=>Ys.copyToClipboard(e,"math-ml")}]},{label:()=>_("menu.paste"),id:"paste",onMenuSelect:()=>e.executeCommand("pasteFromClipboard"),visible:()=>e.hasEditableContent,keyboardShortcut:"meta+V"},{label:()=>_("menu.select-all"),id:"select-all",keyboardShortcut:"meta+A",onMenuSelect:()=>e.executeCommand("selectAll")}]}function Kh(e){var t;return!!(null==(t=e.model.parentEnvironment)?void 0:t.array)}function Uh(e,t){lc(e),e.flushInlineShortcutBuffer(),Eu(e.model,t),Cc(e)}function jh(e,t,n,i){return{label:()=>_h(`\\${n}{${Dh(e)}}`),tooltip:()=>{var e;return null!=(e=_(i))?e:i},visible:()=>function(e,t){const n=Ih(e);if(1!==n.length)return!1;const i=Al[t];return!!i&&!!i.test(n[0].value)}(e,t),checked:()=>{var n;return{some:"mixed",all:!0}[null!=(n=e.queryStyle({variant:t}))&&n]},onMenuSelect:()=>{e.applyStyle({variant:t},{operation:"toggle"}),e.adoptStyle="none"}}}function qh(e,t,n,i){return{label:()=>_h(`\\${n}{${Dh(e)}}`),tooltip:()=>{var e;return null!=(e=_(i))?e:i},visible:()=>function(e,t){return Dh(e).length>0}(e),checked:()=>{var n;return{some:"mixed",all:!0}[null!=(n=e.queryStyle({variantStyle:t}))&&n]},onMenuSelect:()=>{e.applyStyle({variantStyle:t},{operation:"toggle"}),e.adoptStyle="none"}}}function Hh(e,t){return e+gh(t)}function Vh(e){var t;let n;if("prompt"===e.parent.type)"body"===e.parentBranch&&(n="prompt");else if("body"===e.parentBranch)n=e.type&&null!=(t={enclose:"cross out",leftright:"delimiter",surd:"square root",root:"math field",mop:"operator",first:"first"}[e.type])?t:"parent";else if("genfrac"===e.parent.type){if("above"===e.parentBranch)return"numerator";if("below"===e.parentBranch)return"denominator"}else"surd"===e.parent.type?"above"===e.parentBranch&&(n="index"):"superscript"===e.parentBranch?n="superscript":"subscript"===e.parentBranch&&(n="subscript");return n||console.log("unknown relationship"),null!=n?n:"parent"}function Gh(e,t,n,i){let r="";if("plonk"===t)window.MathfieldElement.playSound("plonk"),e.flushInlineShortcutBuffer();else if("delete"===t)r=Hh("deleted: ",i);else if("focus"===t||t.includes("move"))r=function(e,t){if(Number.isNaN(t))return"";const n=e.at(t);if(!n)return"";if(n.treeDepth<=e.at(e.position).treeDepth)return"";let i="",r=n.parent;const a=e.at(e.position).parent;for(;r!==e.root&&r!==a;)i+=`out of ${Vh(r)};`,r=r.parent;return i}(e.model,n)+(e.model.selectionIsCollapsed?"":"selected: ")+function(e){if(!e.selectionIsCollapsed)return Hh("",e.getAtoms(e.selection));let t="";const n=e.at(e.position),i=Vh(n);n.isFirstSibling&&(t=(i?"start of "+i:"unknown")+": ");n.isLastSibling?n.isFirstSibling||(t+=i?"end of "+i:"unknown"):t+=Hh("",n);return t}(e.model);else if("replacement"===t)r=Hh("",e.model.at(e.model.position));else if("line"===t){const t=Hh("",e.model.root);e.keyboardDelegate.setAriaLabel(t)}else r=i?Hh(t+" ",i):t;if(r){const t=e.ariaLiveText.textContent.includes(" ")?" ":" ";e.ariaLiveText.textContent=r+t}}Dc({speak:(e,t,n)=>function(e,t,n){var i,r;n=null!=n?n:{withHighlighting:!1};const{model:a}=e;function s(e){let t=null;switch(e){case"all":default:t=a.root;break;case"selection":t=a.getAtoms(a.selection);break;case"left":t=a.getAtoms(a.offsetOf(a.at(a.position).leftSibling),a.position);break;case"right":t=a.getAtoms(a.position,a.offsetOf(a.at(a.position).rightSibling));break;case"group":t=a.getAtoms(a.getSiblingsRange(a.position));break;case"parent":{const{parent:e}=a.at(a.position);t=(null==e?void 0:e.parent)?e:a.root;break}}return t}function o(e){let t="";switch(e){case"all":console.log("Internal failure: speak all failed");break;case"selection":t="no selection";break;case"left":t="at start";break;case"right":t="at end";break;case"group":console.log("Internal failure: speak group failed");break;case"parent":t="no parent";break;default:console.log('unknown speak_ param value: "'+e+'"')}return t}const l=s(t);if(null===l)return null==(r=(i=window.MathfieldElement).speakHook)||r.call(i,o(t)),!1;(n.withHighlighting||"amazon"===window.MathfieldElement.speechEngine)&&(window.MathfieldElement.textToSpeechMarkup=window.sre&&"sre"===window.MathfieldElement.textToSpeechRules?"ssml_step":"ssml");const c=gh(l);m()&&n.withHighlighting?(pp().readAloudMathfield=e,Ac(e,{forHighlighting:!0}),window.MathfieldElement.readAloudHook&&window.MathfieldElement.readAloudHook(e.field,c)):window.MathfieldElement.speakHook&&window.MathfieldElement.speakHook(c);return!1}(e,t,n)},{target:"mathfield"});function Zh(e,t,n,i){const r=e.offsetOf(t);if(r<n||r>i)return!1;if(!t.hasChildren)return!0;const a=e.offsetOf(t.firstChild);if(a>=n&&a<=i){const r=e.offsetOf(t.lastChild);if(r>=n&&r<=i)return!0}return!1}function Wh(e,t,n){if(!(null==t?void 0:t.hasChildren))return!1;const[i,r]=n,a=e.offsetOf(t.firstChild),s=e.offsetOf(t.lastChild);return a>=i&&a<=r&&s>=a&&s<=r}function Yh(e,t,n,i){var r,a,s,o,l,c;const u=n.parent;if(u&&n instanceof Ho){const r=!i&&"forward"===t||"body"===i&&"backward"===t;let a=r?e.offsetOf(n.firstChild):e.offsetOf(n.lastChild);return r?"?"!==n.rightDelim&&"."!==n.rightDelim?(n.leftDelim=".",n.isDirty=!0):(u.addChildrenAfter(n.removeBranch("body"),n),u.removeChild(n),a--):"?"!==n.leftDelim&&"."!==n.leftDelim?(n.rightDelim=".",n.isDirty=!0):(u.addChildrenAfter(n.removeBranch("body"),n),u.removeChild(n),a--),e.position=a,!0}if(u&&"surd"===n.type){if("forward"===t&&!i||"backward"===t&&"body"===i){const t=n.leftSibling;n.hasChildren&&u.addChildrenAfter(n.removeBranch("body"),n),u.removeChild(n),e.position=e.offsetOf(t)}else"forward"===t&&"body"===i?e.position=e.offsetOf(n):i||"backward"!==t?"above"===i&&(n.hasEmptyBranch("above")&&n.removeBranch("above"),e.position="backward"===t?e.offsetOf(n.leftSibling):e.offsetOf(n.body[0])):n.hasChildren?e.position=e.offsetOf(n.lastChild):(e.position=Math.max(0,e.offsetOf(n)-1),u.removeChild(n));return!0}if(u&&("box"===n.type||"enclose"===n.type)){const r=i&&"backward"===t||!i&&"forward"===t?n.leftSibling:n.lastChild;return u.addChildrenAfter(n.removeBranch("body"),n),u.removeChild(n),e.position=e.offsetOf(r),!0}if("genfrac"===n.type||"overunder"===n.type){if(!i)return("overunder"!==n.type||!n.hasEmptyBranch("body"))&&(("genfrac"!==n.type||!n.hasEmptyBranch("below")||!n.hasEmptyBranch("above"))&&(e.position=e.offsetOf("forward"===t?n.firstChild:n.lastChild),!0));const r="numerator-denominator"===ap.fractionNavigationOrder?"above":"below",a="above"===r?"below":"above";if(u&&("forward"===t&&i===r||"backward"===t&&i===a)){const t=n.removeBranch(r),i=n.removeBranch(a);return u.addChildrenAfter([...t,...i],n),u.removeChild(n),e.position=e.offsetOf(t.length>0?t[t.length-1]:i[0]),!0}return e.position="backward"===t?e.offsetOf(n.leftSibling):e.offsetOf(n),!0}if(n.isExtensibleSymbol||"subsup"===n.type){if(!i&&"forward"===t)return!1;if(!i){if(n.subscript||n.superscript){const i="forward"===t?null!=(s=null==(r=n.superscript)?void 0:r[0])?s:null==(a=n.subscript)?void 0:a[0]:null!=(c=null==(o=n.subscript)?void 0:o[0].lastSibling)?c:null==(l=n.superscript)?void 0:l[0].lastSibling;return i&&(e.position=e.offsetOf(i)),!0}return!1}if(!n.hasChildren&&"subsup"===n.type){const i="forward"===t?e.offsetOf(n):Math.max(0,e.offsetOf(n)-1);return n.parent.removeChild(n),e.position=i,!0}if("superscript"===i)if("backward"===t){const t=e.offsetOf(n.firstChild)-1;console.assert(t>=0),e.position=t}else n.subscript?e.position=e.offsetOf(n.subscript[0]):e.position=e.offsetOf(n);else"subscript"===i&&("backward"===t&&n.superscript?e.position=e.offsetOf(n.superscript[0].lastSibling):e.position="backward"===t?e.offsetOf(n.firstChild)-1:e.offsetOf(n));if(i&&n.hasEmptyBranch(i)&&(n.removeBranch(i),"subsup"===n.type&&!n.subscript&&!n.superscript)){const i="forward"===t?e.offsetOf(n):Math.max(0,e.offsetOf(n)-1);n.parent.removeChild(n),e.position=i}return!0}if("genfrac"===(null==u?void 0:u.type)&&!i&&"first"!==n.type){let t=e.offsetOf(n.leftSibling);return u.removeChild(n),u.hasEmptyBranch("above")&&u.hasEmptyBranch("below")?(t=e.offsetOf(u.leftSibling),u.parent.removeChild(u),e.announce("delete",void 0,[u]),e.position=t,!0):(e.announce("delete",void 0,[n]),e.position=t,!0)}if("backward"===t&&("\\ln"===(null==u?void 0:u.command)||"\\log"===(null==u?void 0:u.command))&&"body"!==n.parentBranch){const t=e.offsetOf(u.leftSibling);return u.parent.removeChild(u),e.announce("delete",void 0,[u]),e.position=t,!0}return!1}function Xh(e,t,n){const i=e.getAtoms(t);if(i.length>0&&i[0].parent){let r=i[0].parent.firstChild;"first"===r.type&&(r=r.rightSibling);const a=i[i.length-1].parent.lastChild;let s=i[0];"first"===s.type&&(s=s.rightSibling);const o=i[i.length-1];if(s===r&&o===a){const n=i[0].parent;n.parent&&"prompt"!==n.type&&(t=[e.offsetOf(n.leftSibling),e.offsetOf(n)])}if(1===i.length&&"placeholder"===i[0].type&&"genfrac"===i[0].parent.type){const t=i[0].parent,r="below"===i[0].parentBranch?"above":"below",a=e.offsetOf(t.leftSibling);return e.deferNotifications({content:!0,selection:!0,type:n},(()=>{var n,i;const s=t.removeBranch(r);if(1!==s.length||"placeholder"!==s[0].type){const i=t.parent.addChildrenAfter(s,t);null==(n=t.parent)||n.removeChild(t),e.position=e.offsetOf(i)}else null==(i=t.parent)||i.removeChild(t),e.position=Math.max(0,a)}))}}return e.deferNotifications({content:!0,selection:!0,type:n},(()=>e.deleteAtoms(t)))}Dc({deleteAll:e=>e.contentWillChange({inputType:"deleteContent"})&&Xh(e,[0,-1],"deleteContent"),deleteForward:e=>function(e){return!!e.mathfield.isSelectionEditable&&!!e.contentWillChange({inputType:"deleteContentForward"})&&(e.selectionIsCollapsed?e.deferNotifications({content:!0,selection:!0,type:"deleteContentForward"},(()=>{var t,n;let i=e.at(e.position).rightSibling;if(i&&Yh(e,"forward",i))return;if(i){if(e.at(e.position).isLastSibling&&Yh(e,"forward",i.parent,i.parentBranch))return}else{if(i=e.at(e.position),i.isLastSibling&&Yh(e,"forward",i.parent,i.parentBranch))return;i=void 0}if(e.position===e.lastOffset||!i)return void e.announce("plonk");i.parent.removeChild(i);let r=null==(t=e.at(e.position))?void 0:t.rightSibling;for(;"subsup"===(null==r?void 0:r.type);)r.parent.removeChild(r),r=null==(n=e.at(e.position))?void 0:n.rightSibling;e.announce("delete",void 0,[i])})):Xh(e,Ns(e.selection),"deleteContentForward"))}(e),deleteBackward:e=>function(e){return!!e.mathfield.isSelectionEditable&&!!e.contentWillChange({inputType:"deleteContentBackward"})&&(e.selectionIsCollapsed?e.deferNotifications({content:!0,selection:!0,type:"deleteContentBackward"},(()=>{let t=e.at(e.position);if(!t||!Yh(e,"backward",t)){if(null==t?void 0:t.isFirstSibling){if(Yh(e,"backward",t.parent,t.parentBranch))return;t=null}t?(e.position=e.offsetOf(t.leftSibling),t.parent.removeChild(t),e.announce("delete",void 0,[t])):e.announce("plonk")}})):Xh(e,Ns(e.selection),"deleteContentBackward"))}(e),deleteNextWord:e=>e.contentWillChange({inputType:"deleteWordForward"})&&Xh(e,[e.anchor,Lu(e,e.position,"forward")],"deleteWordForward"),deletePreviousWord:e=>e.contentWillChange({inputType:"deleteWordBackward"})&&Xh(e,[e.anchor,Lu(e,e.position,"backward")],"deleteWordBackward"),deleteToGroupStart:e=>e.contentWillChange({inputType:"deleteSoftLineBackward"})&&Xh(e,[e.anchor,e.offsetOf(e.at(e.position).firstSibling)],"deleteSoftLineBackward"),deleteToGroupEnd:e=>e.contentWillChange({inputType:"deleteSoftLineForward"})&&Xh(e,[e.anchor,e.offsetOf(e.at(e.position).lastSibling)],"deleteSoftLineForward"),deleteToMathFieldStart:e=>e.contentWillChange({inputType:"deleteHardLineBackward"})&&Xh(e,[e.anchor,0],"deleteHardLineBackward"),deleteToMathFieldEnd:e=>e.contentWillChange({inputType:"deleteHardLineForward"})&&Xh(e,[e.anchor,-1],"deleteHardLineForward")},{target:"model",audioFeedback:"delete",canUndo:!0,changeContent:!0,changeSelection:!0});var Jh=`<svg xmlns="http://www.w3.org/2000/svg" style="width: 21px;" viewBox="0 0 576 512" role="img" aria-label="${_("tooltip.toggle virtual keyboard")}"><path d="M528 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h480c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm16 336c0 8.823-7.177 16-16 16H48c-8.823 0-16-7.177-16-16V112c0-8.823 7.177-16 16-16h480c8.823 0 16 7.177 16 16v288zM168 268v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-336 80v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm384 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zM120 188v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-96 152v-8c0-6.627-5.373-12-12-12H180c-6.627 0-12 5.373-12 12v8c0 6.627 5.373 12 12 12h216c6.627 0 12-5.373 12-12z"/></svg>`,Qh=`<svg xmlns="http://www.w3.org/2000/svg" style="height: 18px;" viewBox="0 0 448 512" role="img" aria-label="${_("tooltip.menu")}"><path d="M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg>`;function ep(e){if(e&&(e.classList.remove("ML__highlight"),e.children))for(const t of e.children)ep(t)}function tp(e,t){var n;e&&(t&&(null==(n=e.dataset)?void 0:n.atomId)!==t?(e.classList.remove("ML__highlight"),e.children&&e.children.length>0&&[...e.children].forEach((e=>{e instanceof HTMLElement&&tp(e,t)}))):(e.classList.add("ML__highlight"),e.children&&e.children.length>0&&[...e.children].forEach((e=>{e instanceof HTMLElement&&tp(e)}))))}m()||console.error('MathLive 0.98.5: this version of the MathLive library is for use in the browser. A subset of the API is available on the server side in the "mathlive-ssr" library. If using server side rendering (with React for example) you may want to do a dynamic import of the MathLive library inside a `useEffect()` call.');var np=new WeakMap,ip={letterShapeStyle:"mf.letterShapeStyle = ...",horizontalSpacingScale:'Removed. Use `"thinmuskip"`, `"medmuskip"`, and `"thickmuskip"` registers ',macros:"mf.macros = ...",registers:"mf.registers = ...",backgroundColorMap:"mf.backgroundColorMap = ...",colorMap:"mf.colorMap = ...",enablePopover:"mf.popoverPolicy = ...",mathModeSpace:"mf.mathModeSpace = ...",placeholderSymbol:"mf.placeholderSymbol = ...",readOnly:"mf.readOnly = ...",removeExtraneousParentheses:"mf.removeExtraneousParentheses = ...",scriptDepth:"mf.scriptDepth = ...",smartFence:"mf.smartFence = ...",smartMode:"mf.smartMode = ...",smartSuperscript:"mf.smartSuperscript = ...",inlineShortcutTimeout:"mf.inlineShortcutTimeout = ...",inlineShortcuts:"mf.inlineShortcuts = ...",keybindings:"mf.keybindings = ...",virtualKeyboardMode:"mf.mathVirtualKeyboardPolicy = ...",customVirtualKeyboardLayers:"mathVirtualKeyboard.layers = ...",customVirtualKeyboards:"mathVirtualKeyboard.layouts = ...",keypressSound:"mathVirtualKeyboard.keypressSound = ...",keypressVibration:"mathVirtualKeyboard.keypressVibration = ...",plonkSound:"mathVirtualKeyboard.plonkSound = ...",virtualKeyboardContainer:"mathVirtualKeyboard.container = ...",virtualKeyboardLayout:"mathVirtualKeyboard.alphabeticLayout = ...",virtualKeyboardTheme:"No longer supported",virtualKeyboardToggleGlyph:"No longer supported",virtualKeyboardToolbar:"mathVirtualKeyboard.editToolbar = ...",virtualKeyboards:"Use `mathVirtualKeyboard.layouts`",speechEngine:"`MathfieldElement.speechEngine`",speechEngineRate:"`MathfieldElement.speechEngineRate`",speechEngineVoice:"`MathfieldElement.speechEngineVoice`",textToSpeechMarkup:"`MathfieldElement.textToSpeechMarkup`",textToSpeechRules:"`MathfieldElement.textToSpeechRules`",textToSpeechRulesOptions:"`MathfieldElement.textToSpeechRulesOptions`",readAloudHook:"`MathfieldElement.readAloudHook`",speakHook:"`MathfieldElement.speakHook`",computeEngine:"`MathfieldElement.computeEngine`",fontsDirectory:"`MathfieldElement.fontsDirectory`",soundsDirectory:"`MathfieldElement.soundsDirectory`",createHTML:"`MathfieldElement.createHTML`",onExport:"`MathfieldElement.onExport`",onInlineShortcut:"`MathfieldElement.onInlineShortcut`",onScrollIntoView:"`MathfieldElement.onScrollIntoView`",locale:"MathfieldElement.locale = ...",strings:"MathfieldElement.strings = ...",decimalSeparator:"MathfieldElement.decimalSeparator = ...",fractionNavigationOrder:"MathfieldElement.fractionNavigationOrder = ..."},rp=class e extends HTMLElement{static get formAssociated(){return lp()}static get optionsAttributes(){return{"default-mode":"string","letter-shape-style":"string","min-font-scale":"number","popover-policy":"string","math-mode-space":"string","read-only":"boolean","remove-extraneous-parentheses":"on/off","smart-fence":"on/off","smart-mode":"on/off","smart-superscript":"on/off","inline-shortcut-timeout":"string","script-depth":"string",placeholder:"string","virtual-keyboard-target-origin":"string","math-virtual-keyboard-policy":"string"}}static get observedAttributes(){return[...Object.keys(this.optionsAttributes),"contenteditable","disabled","readonly","read-only"]}static get fontsDirectory(){return this._fontsDirectory}static set fontsDirectory(e){e!==this._fontsDirectory&&(this._fontsDirectory=e,async function(){kc="not-loaded",Sc()}())}get fontsDirectory(){throw new Error("Use MathfieldElement.fontsDirectory instead")}set fontsDirectory(e){throw new Error("Use MathfieldElement.fontsDirectory instead")}static get soundsDirectory(){return this._soundsDirectory}static set soundsDirectory(e){this._soundsDirectory=e,this.audioBuffers={}}get soundsDirectory(){throw new Error("Use MathfieldElement.soundsDirectory instead")}set soundsDirectory(e){throw new Error("Use MathfieldElement.soundsDirectory instead")}static get keypressSound(){return this._keypressSound}static set keypressSound(e){var t,n,i;this.audioBuffers={},null===e?this._keypressSound={spacebar:null,return:null,delete:null,default:null}:"string"==typeof e?this._keypressSound={spacebar:e,return:e,delete:e,default:e}:"object"==typeof e&&"default"in e&&(this._keypressSound={spacebar:null!=(t=e.spacebar)?t:e.default,return:null!=(n=e.return)?n:e.default,delete:null!=(i=e.delete)?i:e.default,default:e.default})}static get plonkSound(){return this._plonkSound}static set plonkSound(e){this.audioBuffers={},this._plonkSound=e}static get audioContext(){return this._audioContext||(this._audioContext=new AudioContext),this._audioContext}static get speechEngine(){return this._speechEngine}static set speechEngine(e){this._speechEngine=e}static get speechEngineRate(){return this._speechEngineRate}static set speechEngineRate(e){this._speechEngineRate=e}static get speechEngineVoice(){return this._speechEngineVoice}static set speechEngineVoice(e){this._speechEngineVoice=e}static get textToSpeechMarkup(){return this._textToSpeechMarkup}static set textToSpeechMarkup(e){this._textToSpeechMarkup=e}static get textToSpeechRules(){return this._textToSpeechRules}static set textToSpeechRules(e){this._textToSpeechRules=e}static get textToSpeechRulesOptions(){return this._textToSpeechRulesOptions}static set textToSpeechRulesOptions(e){this._textToSpeechRulesOptions=e}static get locale(){return y.locale}static set locale(e){"auto"===e&&(e=navigator.language.slice(0,5)),y.locale=e}get locale(){throw new Error("Use MathfieldElement.locale instead")}set locale(e){throw new Error("Use MathfieldElement.locale instead")}static get strings(){return y.strings}static set strings(e){y.merge(e)}get strings(){throw new Error("Use MathfieldElement.strings instead")}set strings(e){throw new Error("Use MathfieldElement.strings instead")}static get decimalSeparator(){return this._decimalSeparator}static set decimalSeparator(e){this._decimalSeparator=e,this._computeEngine&&(this._computeEngine.latexOptions.decimalMarker=","===this.decimalSeparator?"{,}":".")}get decimalSeparator(){throw new Error("Use MathfieldElement.decimalSeparator instead")}set decimalSeparator(e){throw new Error("Use MathfieldElement.decimalSeparator instead")}static get computeEngine(){var e,t;if(void 0===this._computeEngine){const t=null==(e=window[Symbol.for("io.cortexjs.compute-engine")])?void 0:e.ComputeEngine;if(!t)return null;this._computeEngine=new t,this._computeEngine&&","===this.decimalSeparator&&(this._computeEngine.latexOptions.decimalMarker="{,}")}return null!=(t=this._computeEngine)?t:null}static set computeEngine(e){this._computeEngine=e}get computeEngine(){throw new Error("Use MathfieldElement.computeEngine instead")}set computeEngine(e){throw new Error("Use MathfieldElement.computeEngine instead")}static get isFunction(){return"function"!=typeof this._isFunction?()=>!1:this._isFunction}static set isFunction(e){this._isFunction=e}static async loadSound(e){delete this.audioBuffers[e];let t="";switch(e){case"keypress":t=this._keypressSound.default;break;case"return":t=this._keypressSound.return;break;case"spacebar":t=this._keypressSound.spacebar;break;case"delete":t=this._keypressSound.delete;break;case"plonk":t=this.plonkSound}if("string"!=typeof t)return;t=t.trim();const n=this.soundsDirectory;if(null!=n&&"null"!==n&&"none"!==t&&"null"!==t)try{const i=await fetch(await xc(`${n}/${t}`)),r=await i.arrayBuffer(),a=await this.audioContext.decodeAudioData(r);this.audioBuffers[e]=a}catch(e){}}static async playSound(e){if("suspended"!==this.audioContext.state&&"interrupted"!==this.audioContext.state||await this.audioContext.resume(),this.audioBuffers[e]||await this.loadSound(e),!this.audioBuffers[e])return;const t=this.audioContext.createBufferSource();t.buffer=this.audioBuffers[e];const n=this.audioContext.createGain();n.gain.value=.5,t.connect(n).connect(this.audioContext.destination),t.start()}constructor(e){if(super(),e){const t=[];for(const n of Object.keys(e))if(ip[n])if(ip[n].startsWith("mf."))if(ip[n].startsWith(`mf.${n}`))t.push(`Option \`${n}\` cannot be used as a constructor option. Use ${ip[n]}`);else{const e=ip[n].match(/([a-zA-Z]+) =/);t.push(`Option \`${n}\` has been renamed \`${e[1]}\``)}else t.push(`Option \`${n}\` cannot be used as a constructor option. Use ${ip[n]}`);if(t.length>0){console.group("%cMathLive 0.98.5: %cInvalid Options","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn("Some of the options passed to `new MathfieldElement(...)` are invalid. \n See https://cortexjs.io/mathlive/changelog/ for details.");for(const e of t)console.warn(e);console.groupEnd()}}if(lp()&&(this._internals=this.attachInternals(),this._internals.role="math",this._internals.ariaLabel="math input field",this._internals.ariaMultiLine="false"),this.attachShadow({mode:"open",delegatesFocus:!0}),this.shadowRoot&&"adoptedStyleSheets"in this.shadowRoot){this.shadowRoot.adoptedStyleSheets=[ho("core"),ho("mathfield"),ho("mathfield-element"),ho("ui"),ho("menu")],this.shadowRoot.appendChild(document.createElement("span"));const e=document.createElement("slot");e.style.display="none",this.shadowRoot.appendChild(e)}else this.shadowRoot.innerHTML="<style>"+uo("core")+uo("mathfield")+uo("mathfield-element")+uo("ui")+uo("menu")+'</style><span></span><slot style="display:none"></slot>';e&&this._setOptions(e),this.shadowRoot.addEventListener("slotchange",(()=>{var e;const t=this.shadowRoot.querySelector("slot:not([name])");this.value=null!=(e=null==t?void 0:t.assignedNodes().map((e=>3===e.nodeType?e.textContent:"")).join("").trim())?e:""}))}showMenu(e){var t,n;return null!=(n=null==(t=this._mathfield)?void 0:t.showMenu(e))&&n}get mathVirtualKeyboard(){throw new Error("The `mathVirtualKeyboard` property is not available on the MathfieldElement. Use `window.mathVirtualKeyboard` instead.")}onPointerDown(){window.addEventListener("pointerup",(e=>{var t;e.target!==this||(null==(t=this._mathfield)?void 0:t.disabled)||this.dispatchEvent(new MouseEvent("click",{altKey:e.altKey,button:e.button,buttons:e.buttons,clientX:e.clientX,clientY:e.clientY,ctrlKey:e.ctrlKey,metaKey:e.metaKey,movementX:e.movementX,movementY:e.movementY,relatedTarget:e.relatedTarget,screenX:e.screenX,screenY:e.screenY,shiftKey:e.shiftKey}))}),{once:!0})}getPromptValue(e,t){var n,i;return null!=(i=null==(n=this._mathfield)?void 0:n.getPromptValue(e,t))?i:""}setPromptValue(e,t,n){var i;null==(i=this._mathfield)||i.setPromptValue(e,t,n)}getPromptRange(e){var t,n;return null!=(n=null==(t=this._mathfield)?void 0:t.getPromptRange(e))?n:null}getPrompts(e){var t,n;return null!=(n=null==(t=this._mathfield)?void 0:t.getPrompts(e))?n:[]}get form(){var e;return null==(e=this._internals)?void 0:e.form}get name(){var e;return null!=(e=this.getAttribute("name"))?e:""}get type(){return this.localName}get mode(){var e,t;return null!=(t=null==(e=this._mathfield)?void 0:e.model.mode)?t:"text"===this.defaultMode?"text":"math"}set mode(e){var t;null==(t=this._mathfield)||t.switchMode(e)}get expression(){if(this._mathfield)return window[Symbol.for("io.cortexjs.compute-engine")]?this._mathfield.expression:(console.error('MathLive 0.98.5: The CortexJS Compute Engine library is not available.\n \n Load the library, for example with:\n \n import "https://unpkg.com/@cortex-js/compute-engine?module"'),null)}set expression(t){var n,i;if(!this._mathfield)return;const r=null!=(i=null==(n=e.computeEngine)?void 0:n.box(t).latex)?i:null;null!==r&&this._mathfield.setValue(r),window[Symbol.for("io.cortexjs.compute-engine")]||console.error('MathLive 0.98.5: The CortexJS Compute Engine library is not available.\n \n Load the library, for example with:\n \n import "https://unpkg.com/@cortex-js/compute-engine?module"')}get errors(){var e,t;return null!=(t=null==(e=this._mathfield)?void 0:e.errors)?t:[]}_getOptions(e){return this._mathfield?du(this._mathfield.options,e):np.has(this)?u({},du(u(u({},hu()),uu(np.get(this).options)),e)):null}getOptions(e){return console.warn("%cMathLive 0.98.5: %cDeprecated Usage%c\n `mf.getOptions()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._mathfield?du(this._mathfield.options,e):np.has(this)?du(u(u({},hu()),uu(np.get(this).options)),e):null}reflectAttributes(){const t=hu(),n=this._getOptions();Object.keys(e.optionsAttributes).forEach((i=>{const r=sp(i);"on/off"===e.optionsAttributes[i]?t[r]!==n[r]?this.setAttribute(i,n[r]?"on":"off"):this.removeAttribute(i):t[r]!==n[r]&&("boolean"===e.optionsAttributes[i]?n[r]?this.setAttribute(i,""):this.removeAttribute(i):"string"!=typeof n[r]&&"number"!=typeof n[r]||this.setAttribute(i,n[r].toString()))}))}getOption(e){return console.warn("%cMathLive 0.98.5: %cDeprecated Usage%c\n `mf.getOption()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._getOptions([e])[e]}_getOption(e){return this._getOptions([e])[e]}_setOptions(e){if(this._mathfield)this._mathfield.setOptions(e);else if(np.has(this)){const t=u(u({},np.get(this).options),e);np.set(this,d(u({},np.get(this)),{selection:{ranges:t.readOnly?[[0,0]]:[[0,-1]]},options:t}))}else np.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:e,menuItems:void 0});this.reflectAttributes()}setOptions(e){console.group("%cMathLive 0.98.5: %cDeprecated Usage","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn(" `mf.setOptions()` is deprecated. Set the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.");for(const t of Object.keys(e))ip[t]&&console.warn(`\`mf.setOptions({${t}:...})\` -> ${ip[t]}`);console.groupEnd(),this._setOptions(e)}executeCommand(e){var t,n;return null!=(n=null==(t=this._mathfield)?void 0:t.executeCommand(e))&&n}getValue(e,t,n){var i,r;if(this._mathfield)return this._mathfield.model.getValue(e,t,n);if(np.has(this)){let a,s,o;if(Fs(e)?([a,s]=e.ranges[0],o=t):$s(e)?([a,s]=e,o=t):Bs(e)&&Bs(t)?(a=e,s=t,o=n):(a=0,s=-1,o=e),(void 0===o||"latex"===o)&&0===a&&-1===s)return null!=(r=null!=(i=np.get(this).value)?i:this.textContent)?r:""}return""}setValue(e,t){if(this._mathfield&&void 0!==e)return null!=t||(t={silenceNotifications:!0,mode:"math"}),void this._mathfield.setValue(e,t);if(np.has(this)){const t=np.get(this).options;return void np.set(this,{value:e,selection:{ranges:[[-1,-1]],direction:"forward"},options:t,menuItems:void 0})}const n=op(this);np.set(this,{value:e,selection:{ranges:[[-1,-1]],direction:"forward"},options:n,menuItems:void 0})}hasFocus(){var e,t;return null!=(t=null==(e=this._mathfield)?void 0:e.hasFocus())&&t}focus(){var e;null==(e=this._mathfield)||e.focus()}blur(){var e;null==(e=this._mathfield)||e.blur()}select(){var e;null==(e=this._mathfield)||e.select()}insert(e,t){var n,i;return null!=(i=null==(n=this._mathfield)?void 0:n.insert(e,t))&&i}applyStyle(e,t){var n;return null==(n=this._mathfield)?void 0:n.applyStyle(e,t)}queryStyle(e){var t,n;return null!=(n=null==(t=this._mathfield)?void 0:t.queryStyle(e))?n:"none"}get caretPoint(){var e,t;return null!=(t=null==(e=this._mathfield)?void 0:e.getCaretPoint())?t:null}set caretPoint(e){var t;e&&(null==(t=this._mathfield)||t.setCaretPoint(e.x,e.y))}setCaretPoint(e,t){var n,i;return null!=(i=null==(n=this._mathfield)?void 0:n.setCaretPoint(e,t))&&i}offsetFromPoint(e,t,n){return this._mathfield?pd(this._mathfield,e,t,n):-1}hitboxFromOffset(e){if(!this._mathfield)return null;const t=this._mathfield.model.at(e);if(!t)return null;const n=ro(this._mathfield,t);return n?new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top):null}resetUndo(){var e;null==(e=this._mathfield)||e.resetUndo()}canUndo(){return!!this._mathfield&&this._mathfield.canUndo()}canRedo(){return!!this._mathfield&&this._mathfield.canRedo()}handleEvent(e){var t,n,i,r;"closed"===Ql.state&&"closed"===(null==(n=null==(t=this._mathfield)?void 0:t.menu)?void 0:n.state)&&("pointerdown"===e.type&&this.onPointerDown(),"focus"===e.type&&(null==(i=this._mathfield)||i.focus()),"blur"===e.type&&(null==(r=this._mathfield)||r.blur()))}connectedCallback(){var t,n,i,r;const a=window.getComputedStyle(this),s=this.shadowRoot,o="none"!==a.userSelect;if(o)s.host.addEventListener("pointerdown",this,!0);else{s.querySelector("span").style.pointerEvents="none"}s.host.addEventListener("focus",this,!0),s.host.addEventListener("blur",this,!0),lp()||(this.hasAttribute("role")||this.setAttribute("role","math"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","math input field"),this.setAttribute("aria-multiline","false")),o&&!this.hasAttribute("contenteditable")&&this.setAttribute("contenteditable","true"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");const l=s.querySelector("slot:not([name])");if(l)try{this._style=l.assignedElements().filter((e=>"style"===e.tagName.toLowerCase())).map((e=>e.textContent)).join("")}catch(e){console.error(e)}if(this._style){const e=document.createElement("style");e.textContent=this._style,s.appendChild(e)}let c="";if(c=this.hasAttribute("value")?this.getAttribute("value"):null!=(t=null==l?void 0:l.assignedNodes().map((e=>3===e.nodeType?e.textContent:"")).join("").trim())?t:"",this._mathfield=new class{constructor(e,t){var n,i,r;this.focusBlurInProgress=!1,this.options=u(d(u({},hu()),{macros:ie(),registers:Es()}),uu(t)),this.eventController=new AbortController;const a=this.eventController.signal;t.eventSink&&(this.host=t.eventSink),this.element=e,e.mathfield=this,this.blurred=!0,this.keystrokeCaptionVisible=!1,this.suggestionIndex=0,this.inlineShortcutBuffer=[],this.inlineShortcutBufferFlushTimer=0,this.defaultStyle={},this.adoptStyle="left","inline-math"===this.options.defaultMode?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline"),this.dirty=!1;let s=null!=(i=null!=(n=t.value)?n:this.element.textContent)?i:"";s=s.trim();const o=pu(this.options),l=new Ds({type:"root",mode:o,body:Qo(s,{context:this.context})});this.model=new class{constructor(e,t,n){this.mathfield=e,this.mode=t,this.silenceNotifications=!1,this._selection={ranges:[[0,0]],direction:"none"},this._anchor=0,this._position=0,this.root=n}dispose(){this.mathfield=void 0}getState(){const e={ranges:[...this._selection.ranges]};return this.selection.direction&&"none"!==this.selection.direction&&(e.direction=this.selection.direction),{content:this.root.toJson(),selection:e,mode:this.mode}}setState(e,t){var n;const i=this.silenceNotifications;this.silenceNotifications=null==(n=null==t?void 0:t.silenceNotifications)||n;let r={};if("undo"===(null==t?void 0:t.type)&&(r={inputType:"historyUndo"}),"redo"===(null==t?void 0:t.type)&&(r={inputType:"historyRedo"}),this.contentWillChange(r)){const t=this.silenceNotifications;this.silenceNotifications=!0,this.mode=e.mode,this.root=Cl(e.content),this.selection=e.selection,this.silenceNotifications=t,this.contentDidChange(r)}this.silenceNotifications=i}get atoms(){return this.root.children}get selection(){return this._selection}set selection(e){this.setSelection(e)}setSelection(e,t){return!(!this.mathfield.contentEditable&&"none"===this.mathfield.userSelect)&&this.deferNotifications({selection:!0},(()=>{var n,i,r;const a=this.normalizeSelection(e,t);if(void 0===a)throw new TypeError("Invalid selection");if(1===a.ranges.length&&a.ranges[0][0]===a.ranges[0][1]){const e=a.ranges[0][0];return this.mathfield.dirty||(null==(n=this.at(e))?void 0:n.parentPrompt)||!this.mathfield.hasEditablePrompts?(this._anchor=e,this._position=e,void(this._selection=a)):(null==(i=this.at(e-1))?void 0:i.parentPrompt)?(this._anchor=this.normalizeOffset(e-1),this._position=this._anchor,void(this._selection=this.normalizeSelection(this._anchor))):(null==(r=this.at(e+1))?void 0:r.parentPrompt)?(this._anchor=this.normalizeOffset(e+1),this._position=this._anchor,void(this._selection=this.normalizeSelection(this._anchor))):(this._anchor=0,this._position=0,void(this._selection={ranges:[[0,0]]}))}const s=Ns(a);"backward"===a.direction?[this._position,this._anchor]=s:[this._anchor,this._position]=s;const o=this.at(s[0]+1),l=this.at(s[1]),c=Ds.commonAncestor(o,l);"array"===(null==c?void 0:c.type)&&o.parent===c&&l.parent,this._selection={ranges:[s],direction:a.direction},console.assert(this._position>=0&&this._position<=this.lastOffset)}))}setPositionHandlingPlaceholder(e){var t;const n=this.at(e);"placeholder"===(null==n?void 0:n.type)?this.setSelection(e-1,e):"placeholder"===(null==(t=null==n?void 0:n.rightSibling)?void 0:t.type)?this.setSelection(e,e+1):this.position=e,n instanceof ul&&n.isSuggestion&&(n.isSuggestion=!1),this.mathfield.stopCoalescingUndo()}get position(){return this._position}set position(e){this.setSelection(e,e)}get anchor(){return this._anchor}get selectionIsCollapsed(){return this._anchor===this._position}get selectionIsPlaceholder(){return 1===Math.abs(this._anchor-this._position)&&"placeholder"===this.at(Math.max(this._anchor,this._position)).type}collapseSelection(e="forward"){return this._anchor!==this._position&&(this.position="backward"===e?Math.min(this._anchor,this._position):Math.max(this._anchor,this._position),!0)}get lastOffset(){return this.atoms.length-1}at(e){return this.atoms[e]}offsetOf(e){return this.atoms.indexOf(e)}getSiblingsRange(e){const t=this.at(e),{parent:n}=t;if(!n)return[0,this.lastOffset];const i=t.parent.branch(t.parentBranch);return[this.offsetOf(i[0]),this.offsetOf(i[i.length-1])]}getBranchRange(e,t){const n=this.at(e).branch(t);return[this.offsetOf(n[0]),this.offsetOf(n[n.length-1])]}getAtoms(e,t,n){let i,r,a=null!=n?n:{};if(Fs(e)){if(a=null!=t?t:{},e.ranges.length>1)return e.ranges.reduce(((e,t)=>[...e,...this.getAtoms(t,a)]),[]);e=e.ranges[0]}if(Bs(e)){if(i=e,!Bs(t))return[];r=t}else[i,r]=e,a=null!=t?t:{};if(!Number.isFinite(i))return[];void 0===a.includeChildren&&(a.includeChildren=!1),i<0&&(i=this.lastOffset-i+1),r<0&&(r=this.lastOffset-r+1);const s=Math.min(i,r)+1,o=Math.max(i,r);if(!a.includeChildren&&1===s&&o===this.lastOffset)return[this.root];let l=[];for(let e=s;e<=o;e++){const t=this.atoms[e];Zh(this,t,s,o)&&l.push(t)}return a.includeChildren||(l=l.filter((e=>{let t=!1,{parent:n}=e;for(;n&&!t;)t=Zh(this,n,s,o),n=n.parent;return!t}))),l}getAllAtoms(e=0){const t=[],n=this.lastOffset;for(let i=e;i<=n;i++)t.push(this.atoms[i]);for(let n=0;n<e;n++)t.push(this.atoms[n]);return t}findAtom(e,t=0,n="forward"){let i;const r=this.lastOffset;if("forward"!==n){for(let n=t;n>=0;n--)if(i=this.atoms[n],e(i))return i;for(let n=r;n>t;n--)if(i=this.atoms[n],e(i))return i}else{for(let n=t;n<=r;n++)if(i=this.atoms[n],e(i))return i;for(let n=0;n<t;n++)if(i=this.atoms[n],e(i))return i}}extractAtoms(e){let t=this.getAtoms(e);if(1===t.length&&!t[0].parent){if("root"!==t[0].type)return t=this.root.cells.flat(),this.root=new Ds({type:"root",body:[]}),t;t=[...t[0].body],t.shift()}for(const e of t)e.parent.removeChild(e);return t}deleteAtoms(e){this.extractAtoms(e),this.position=e[0]}atomToString(e,t){const n=null!=t?t:"latex";if(n.startsWith("latex"))return Ds.serialize([e],{expandMacro:"latex-expanded"===n,skipStyles:"latex-unstyled"===n,skipPlaceholders:"latex-without-placeholders"===n,defaultMode:this.mathfield.options.defaultMode});if("math-ml"===n)return oh(e);if("spoken"===n)return gh(e);if("spoken-text"===n){const t=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="";const n=gh(e);return window.MathfieldElement.textToSpeechMarkup=t,n}if("spoken-ssml"===n||"spoken-ssml-with-highlighting"===n){const t=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="ssml";const n=gh(e);return window.MathfieldElement.textToSpeechMarkup=t,n}return"ascii-math"===n?yh(e):(console.error(`MathLive 0.98.5: Unexpected format "${n}`),"")}getValue(e,t,n){if(void 0===e)return this.atomToString(this.root,"latex");if("string"==typeof e&&"math-json"!==e)return this.atomToString(this.root,e);let i,r;if(Bs(e)&&Bs(t)?(i=[this.normalizeRange([e,t])],r=n):$s(e)?(i=[this.normalizeRange(e)],r=t):Fs(e)?(i=e.ranges,r=t):(i=[this.normalizeRange([0,-1])],r=e),null!=r||(r="latex"),"math-json"===r){if(!window.MathfieldElement.computeEngine)return window[Symbol.for("io.cortexjs.compute-engine")]||console.error('The CortexJS Compute Engine library is not available.\nLoad the library, for example with:\nimport "https://unpkg.com/@cortex-js/compute-engine?module"'),'["Error", "compute-engine-not-available"]';const e=this.getValue({ranges:i},"latex-unstyled");try{const t=window.MathfieldElement.computeEngine.parse(e);return JSON.stringify(t.json)}catch(e){return JSON.stringify(["Error",`'${e.toString()}'`])}}if(r.startsWith("latex")){const e={expandMacro:"latex-expanded"===r,skipStyles:"latex-unstyled"===r,skipPlaceholders:"latex-without-placeholders"===r,defaultMode:this.mathfield.options.defaultMode};return Xa(i.map((t=>Ds.serialize(this.getAtoms(t),e))))}return i.map((e=>this.getAtoms(e).map((e=>this.atomToString(e,r))).join(""))).join("")}extendSelectionTo(e,t){return!(!this.mathfield.contentEditable&&"none"===this.mathfield.userSelect)&&this.deferNotifications({selection:!0},(()=>{const n=this.normalizeRange([e,t]);let[i,r]=n,{parent:a}=this.at(r);if(a&&("genfrac"===a.type||"subsup"===a.type))for(;a!==this.root&&Wh(this,a,[i,r]);)r=this.offsetOf(a),a=a.parent;for(a=this.at(i).parent;a!==this.root&&Wh(this,a,[i,r]);)i=this.offsetOf(a.leftSibling),a=a.parent;if(a=this.at(r).parent,"genfrac"===(null==a?void 0:a.type))for(;a!==this.root&&Wh(this,a,[i,r]);)r=this.offsetOf(a),console.assert(r>=0),a=a.parent;this._position=this.normalizeOffset(t),this._selection={ranges:[[i,r]],direction:"none"}}))}announce(e,t,n=[]){var i,r;(null==(r=null==(i=this.mathfield.host)?void 0:i.dispatchEvent(new CustomEvent("announce",{detail:{command:e,previousPosition:t,atoms:n},cancelable:!0,bubbles:!0,composed:!0})))||r)&&Gh(this.mathfield,e,t,n)}deferNotifications(e,t){const n=this._selection,i=this._anchor,r=this._position,a=this.silenceNotifications;this.silenceNotifications=!0;const s=this.root.changeCounter;t();const o=this.root.changeCounter!==s,l=i!==this._anchor||r!==this._position||"different"===function(e,t){if(e.direction===t.direction){const n=e.ranges.length;if(t.ranges.length===n){let i=0;for(;i<n&&"equal"===Os(e.ranges[i],t.ranges[i]);)i++;return i===n?"equal":"different"}}return"different"}(this._selection,n);return this.silenceNotifications=a,e.content&&o&&this.contentDidChange({inputType:e.type}),e.selection&&l&&this.selectionDidChange(),o||l}normalizeOffset(e){return e>0?e=Math.min(e,this.lastOffset):e<0&&(e=this.lastOffset+e+1),e}normalizeRange(e){let[t,n]=e;return t=this.normalizeOffset(t),n=this.normalizeOffset(n),t<n?[t,n]:[n,t]}normalizeSelection(e,t){var n;let i;if(Bs(e)){const n=this.normalizeOffset(e);if(Bs(t)){const e=this.normalizeOffset(t);i=n<=e?{ranges:[[n,e]],direction:"none"}:{ranges:[[e,n]],direction:"backward"}}else i={ranges:[[n,n]],direction:"none"}}else if($s(e)){const t=this.normalizeOffset(e[0]),n=this.normalizeOffset(e[1]);i=t<=n?{ranges:[[t,n]],direction:"none"}:{ranges:[[n,t]],direction:"backward"}}else Fs(e)&&(i={ranges:e.ranges.map((e=>this.normalizeRange(e))),direction:null!=(n=e.direction)?n:"none"});return console.assert(void 0!==i),i}get parentEnvironment(){let e=this.at(this.position).parent;if(e){for(;e.parent&&"array"!==e.type;)e=e.parent;if("array"===e.type)return e}}get cell(){var e;let t=this.at(this.position);if(t){for(;t&&"array"!==(null==(e=t.parent)?void 0:e.type);)t=t.parent;if((null==t?void 0:t.parent)&&"array"===t.parent.type)return t.parentBranch}}contentWillChange(e={}){if(this.silenceNotifications||!this.mathfield)return!0;const t=this.silenceNotifications;this.silenceNotifications=!0;const n=this.mathfield.onContentWillChange(e);return this.silenceNotifications=t,n}contentDidChange(e){var t;if(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(bd(this.mathfield)),this.silenceNotifications||!this.mathfield.host||!this.mathfield)return;const n=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.host.dispatchEvent(new InputEvent("input",d(u({},e),{data:e.data?e.data:null!=(t=e.inputType)?t:"",bubbles:!0,composed:!0}))),this.silenceNotifications=n}selectionDidChange(){if(!this.mathfield)return;if(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(bd(this.mathfield)),this.silenceNotifications)return;const e=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.onSelectionDidChange(),this.silenceNotifications=e}}(this,o,l),this.undoManager=new Mu(this.model);const c=[];if(c.push("<span contenteditable=true aria-multiline=false part=keyboard-sink class=ML__keyboard-sink autocapitalize=off autocomplete=off autocorrect=off spellcheck=false inputmode=none tabindex=0></span>"),c.push('<span part=container class=ML__container aria-hidden=true style="visibility:hidden">'),c.push("<span part=content class=ML__content>"),c.push(Tc(this)),c.push("</span>"),window.mathVirtualKeyboard&&(c.push(`<div part=virtual-keyboard-toggle class=ML__virtual-keyboard-toggle role=button ${this.hasEditableContent?"":'style="display:none;"'} data-l10n-tooltip="tooltip.toggle virtual keyboard">`),c.push(Jh),c.push("</div>")),c.push('<div part=menu-toggle class=ML__menu-toggle role=button data-l10n-tooltip="tooltip.menu">'),c.push(Qh),c.push("</div>"),c.push("</span>"),c.push("<span class=ML__sr-only>"),c.push("<span role=status aria-live=assertive aria-atomic=true></span>"),c.push("</span>"),this.element.innerHTML=window.MathfieldElement.createHTML(c.join("")),!this.element.children)return void console.error("%cMathLive 0.98.5: Something went wrong and the mathfield could not be created.%c\nIf you are using Vue, this may be because you are using the runtime-only build of Vue. Make sure to include `runtimeCompiler: true` in your Vue configuration. There may a warning from Vue in the log above.","color:red;font-family:system-ui;font-size:1.2rem;font-weight:bold","color:inherit;font-family:system-ui;font-size:inherit;font-weight:inherit");this._l10Subscription=y.subscribe((()=>y.update(this.element))),y.update(this.element),this.field=this.element.querySelector("[part=content]"),this.field.addEventListener("click",(e=>e.stopImmediatePropagation()),{capture:!1,signal:a}),this.field.addEventListener("wheel",this,{passive:!1,signal:a}),"PointerEvent"in window?this.field.addEventListener("pointerdown",this,{signal:a}):this.field.addEventListener("mousedown",this,{signal:a}),null==(r=this.element.querySelector("[part=virtual-keyboard-toggle]"))||r.addEventListener("click",(()=>{window.mathVirtualKeyboard.visible?window.mathVirtualKeyboard.hide():(window.mathVirtualKeyboard.show({animate:!0}),window.mathVirtualKeyboard.update(bd(this)))}),{signal:a}),this._menu=new jd(zh(this),{host:this.host}),this.field.addEventListener("contextmenu",this,{signal:a});const h=this.element.querySelector("[part=menu-toggle]");var p;null==h||h.addEventListener("pointerdown",(e=>{if(e.currentTarget!==h)return;if("closed"!==this._menu.state)return;this.element.classList.add("tracking");const t=h.getBoundingClientRect();this._menu.modifiers=Wl(e),this._menu.show({target:h,location:{x:t.left,y:t.bottom},onDismiss:()=>this.element.classList.remove("tracking")}),e.preventDefault(),e.stopPropagation()}),{signal:a}),(this.model.atoms.length<=1||this.disabled||this.readOnly&&!this.hasEditableContent||"none"===this.userSelect)&&(h.style.display="none"),this.ariaLiveText=this.element.querySelector("[role=status]"),this.keyboardDelegate=function(e,t,n){let i=null,r=null,a=!1,s=!1,o=!1;const l=new AbortController,c=l.signal;return e.addEventListener("keydown",(t=>{a||"Process"===t.key||"CapsLock"===t.code||/(Control|Meta|Alt|Shift)(Left|Right)/.test(t.code)?i=null:(i=t,r=null,n.onKeystroke(t)?e.textContent="":i=null)}),{capture:!0,signal:c}),e.addEventListener("keypress",(e=>{a||(i&&r&&n.onKeystroke(i),r=e)}),{capture:!0,signal:c}),e.addEventListener("compositionstart",(t=>{e.textContent="",a=!0,n.onCompositionStart(t.data)}),{capture:!0,signal:c}),e.addEventListener("compositionupdate",(e=>{a&&n.onCompositionUpdate(e.data)}),{capture:!0,signal:c}),e.addEventListener("compositionend",(t=>{e.textContent="",a&&(a=!1,n.onCompositionEnd(t.data))}),{capture:!0,signal:c}),e.addEventListener("beforeinput",(e=>e.stopImmediatePropagation()),{signal:c}),e.addEventListener("input",(t=>{var i;if(!a&&(e.textContent="","insertCompositionText"!==t.inputType)){if("insertFromPaste"===t.inputType)return t.preventDefault(),void t.stopPropagation();n.onInput(null!=(i=t.data)?i:""),t.preventDefault(),t.stopPropagation()}}),{signal:c}),e.addEventListener("paste",(t=>{e.focus({preventScroll:!0}),e.textContent="",n.onPaste(t)||t.preventDefault(),t.stopImmediatePropagation()}),{signal:c}),e.addEventListener("cut",(e=>n.onCut(e)),{capture:!0,signal:c}),e.addEventListener("copy",(e=>n.onCopy(e)),{capture:!0,signal:c}),e.addEventListener("blur",(a=>{var l,c;if((null==(c=null==(l=a.relatedTarget)?void 0:l._mathfield)?void 0:c.element)===t)return e.focus({preventScroll:!0}),a.preventDefault(),void a.stopPropagation();const u=Ql.state;return"open"===u||"opening"===u||a.relatedTarget===a.target.getRootNode().host?(a.preventDefault(),void a.stopPropagation()):void(o||s||(o=!0,i=null,r=null,n.onBlur(),o=!1))}),{capture:!0,signal:c}),e.addEventListener("focus",(e=>{o||s||(s=!0,n.onFocus(),s=!1)}),{capture:!0,signal:c}),{dispose:()=>l.abort(),cancelComposition:()=>{a&&(e.blur(),requestAnimationFrame((()=>e.focus({preventScroll:!0}))))},blur:()=>{"function"==typeof e.blur&&e.blur()},focus:()=>{s||"function"!=typeof e.focus||e.focus({preventScroll:!0})},hasFocus:()=>Jl()===e,setAriaLabel:t=>e.setAttribute("aria-label",t),setValue:t=>{var n;e.textContent=t,e.style.left="-1000px",null==(n=window.getSelection())||n.selectAllChildren(e)},moveTo:(t,n)=>{e.style.top=`${n}px`,e.style.left=`${t}px`}}}(this.element.querySelector(".ML__keyboard-sink"),this.element,this),window.addEventListener("resize",this,{signal:a}),document.addEventListener("scroll",this,{signal:a}),this.resizeObserver=new ResizeObserver((()=>Cc(this))),this.resizeObserver.observe(this.field),window.mathVirtualKeyboard.addEventListener("virtual-keyboard-toggle",this,{signal:a}),Kl&&!y.locale.startsWith(Kl.locale)&&(p=y.locale,Kl=jl.find((e=>p.startsWith(e.locale)))),"ready"!==kc&&document.fonts.ready.then((()=>Mc(this))),e.querySelector("[part=container]").style.removeProperty("visibility"),this.undoManager.startRecording(),this.undoManager.snapshot("set-value")}get defaultStyle(){return this._defaultStyle}set defaultStyle(e){this._defaultStyle=e}get effectiveStyle(){if("none"===this.adoptStyle)return this.defaultStyle;const e=this.model.at(this.model.position),t="right"===this.adoptStyle?e.rightSibling:e;if(!t)return this.defaultStyle;if("group"===t.type){const e=t.branch("body");return!e||e.length<2?{}:"right"===this.adoptStyle?e[1].computedStyle:e[e.length-1].computedStyle}return t.computedStyle}connectToVirtualKeyboard(){this.connectedToVirtualKeyboard||(this.connectedToVirtualKeyboard=!0,window.addEventListener("message",this,{signal:this.eventController.signal}),window.mathVirtualKeyboard.connect(),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(bd(this)),Md(this))}disconnectFromVirtualKeyboard(){this.connectedToVirtualKeyboard&&(window.removeEventListener("message",this),window.mathVirtualKeyboard.disconnect(),this.connectedToVirtualKeyboard=!1,Ad())}showMenu(e){var t,n;const i=null!=(n=null!=(t=null==e?void 0:e.location)?t:eo(this.field))?n:void 0,r=null==e?void 0:e.modifiers,a=this.element.querySelector("[part=container]");return this._menu.show({target:a,location:i,modifiers:r})}get colorMap(){return e=>{var t,n,i;return null!=(i=null==(n=(t=this.options).colorMap)?void 0:n.call(t,e))?i:T(e)}}get backgroundColorMap(){return e=>{var t,n,i,r,a,s;return null!=(s=null!=(a=null==(n=(t=this.options).backgroundColorMap)?void 0:n.call(t,e))?a:null==(r=(i=this.options).colorMap)?void 0:r.call(i,e))?s:A(e)}}get smartFence(){var e;return null!=(e=this.options.smartFence)&&e}get readOnly(){var e;return null!=(e=this.options.readOnly)&&e}get disabled(){var e,t;return null!=(t=null==(e=this.host)?void 0:e.disabled)&&t}get contentEditable(){return!!this.host&&"false"!==this.host.getAttribute("contenteditable")}get userSelect(){if(!this.host)return"";const e=getComputedStyle(this.host);return e.getPropertyValue("user-select")||e.getPropertyValue("-webkit-user-select")}get hasEditableContent(){return!(this.disabled||!this.contentEditable)&&(!this.readOnly||this.hasEditablePrompts)}get hasEditablePrompts(){return this.readOnly&&!this.disabled&&this.contentEditable&&void 0!==this.model.findAtom((e=>"prompt"===e.type&&!e.locked))}get isSelectionEditable(){if(this.disabled||!this.contentEditable)return!1;if(!this.readOnly)return!0;const e=this.model.at(this.model.anchor),t=this.model.at(this.model.position),n=Ds.commonAncestor(e,t);return!("prompt"!==(null==n?void 0:n.type)&&!(null==n?void 0:n.parentPrompt))}get letterShapeStyle(){var e;return null!=(e=this.options.letterShapeStyle)?e:"tex"}get minFontScale(){return this.options.minFontScale}get selectionStyle(){if(this.model.selectionIsCollapsed)return this.effectiveStyle;const e=this.model.getAtoms(this.model.selection);if(0===e.length)return{};const t=u({},e[0].style);for(const n of e)for(const[e,i]of Object.entries(n.style))t[e]!==i&&delete t[e];return t}queryStyle(e){const t=nd(this,e);"verbatimColor"in t&&delete t.verbatimColor,"verbatimBackgroundColor"in t&&delete t.verbatimBackgroundColor;const n=Object.keys(t).length;if(0===n)return"all";if(n>1){for(const e of Object.keys(t)){const n=this.queryStyle({[e]:t[e]});if("none"===n)return"none";if("some"===n)return"some"}return"all"}const i=Object.keys(t)[0],r=t[i];if(this.model.selectionIsCollapsed)return this.effectiveStyle[i]===r?"all":"none";const a=this.model.getAtoms(this.model.selection,{includeChildren:!0});let s=a.length;if(0===s)return"none";let o=0;for(const e of a)"first"!==e.type?e.style[i]===r&&(o+=1):s-=1;return 0===o?"none":o===s?"all":"some"}get keybindings(){var e,t;if(this._keybindings)return this._keybindings;const[n,i]=function(e,t){const n=[],i=[];for(const r of e)try{const e=rc(r,t);if(!e)continue;const n=i.find((t=>t.key===e.key&&t.ifMode===e.ifMode));if(n)throw new Error(`Ambiguous key binding ${r.key} (${ac(r.command)}) matches ${n.key} (${ac(n.command)}) with the ${t.displayName} keyboard layout`);i.push(e)}catch(e){e instanceof Error&&n.push(e.message)}return[i,n]}(this.options.keybindings,null!=(e=Vl())?e:function(){switch(ql()){case"apple":return Nl;case"windows":return Bl;case"linux":return $l}return Nl}());return(null==(t=Vl())?void 0:t.score)>0&&(this._keybindings=n,i.length>0&&console.error("MathLive 0.98.5: Invalid keybindings for current keyboard layout",i)),n}get menu(){return this._menu}setOptions(e){var t;this.options=u(u({},this.options),uu(e)),this._keybindings=void 0,"inline-math"===this.options.defaultMode?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline");let n=this.options.defaultMode;"inline-math"===n&&(n="math"),(null==(t=this.model.root.firstChild)?void 0:t.mode)!==n&&(this.model.root.firstChild.mode=n),this.options.readOnly&&this.hasFocus()&&window.mathVirtualKeyboard.visible&&this.executeCommand("hideVirtualKeyboard");const i=Ds.serialize([this.model.root],{expandMacro:!1,defaultMode:this.options.defaultMode});("macros"in e||this.model.getValue()!==i)&&Ys.insert(this.model,i,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",silenceNotifications:!0,mode:"math"}),("value"in e||"macros"in e||"registers"in e||"colorMap"in e||"backgroundColorMap"in e||"letterShapeStyle"in e||"minFontScale"in e||"readOnly"in e||"placeholderSymbol"in e)&&Cc(this)}getOptions(e){return du(this.options,e)}getOption(e){return du(this.options,e)}async handleEvent(e){var t;if(Qs(this))if(Oc(e)){if(!so(e.origin,null!=(t=this.options.originValidator)?t:"none"))throw new DOMException(`Message from unknown origin (${e.origin}) cannot be handled`,"SecurityError");const{action:n}=e.data;if("execute-command"===n){const t=e.data.command;if("virtual-keyboard"===Rc(t))return;this.executeCommand(t)}else"update-state"===n||("focus"===n?this.focus({preventScroll:!0}):"blur"===n&&this.blur())}else switch(e.type){case"focus":this.onFocus();break;case"blur":this.onBlur();break;case"mousedown":"none"!==this.userSelect&&cd(this,e);break;case"pointerdown":"none"!==this.userSelect&&(cd(this,e),!1===e.shiftKey&&await Gd(e,this.element.querySelector("[part=container]"),this._menu)&&od.stop());break;case"contextmenu":"none"!==this.userSelect&&!1===e.shiftKey&&await Gd(e,this.element.querySelector("[part=container]"),this._menu)&&od.stop();break;case"virtual-keyboard-toggle":this.hasFocus()&&Md(this);break;case"resize":case"scroll":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame((()=>Qs(this)&&this.onGeometryChange()));break;case"wheel":this.onWheel(e);break;default:console.warn("Unexpected event type",e.type)}}dispose(){Qs(this)&&(y.unsubscribe(this._l10Subscription),this.keyboardDelegate.dispose(),this.keyboardDelegate=void 0,this.eventController.abort(),this.eventController=void 0,this.resizeObserver.disconnect(),window.mathVirtualKeyboard.removeEventListener("virtual-keyboard-toggle",this),this.disconnectFromVirtualKeyboard(),this.model.dispose(),delete this.element.mathfield,this.element=void 0,this.host=void 0,this.field=void 0,this.ariaLiveText=void 0,document.getElementById("mathlive-keystroke-caption-panel")&&(pc("mathlive-keystroke-caption-panel"),fo("core"),fo("keystroke-caption")),document.getElementById("mathlive-suggestion-popover")&&(pc("mathlive-suggestion-popover"),fo("suggestion-popover"),fo("core")),document.getElementById("mathlive-environment-popover")&&(pc("mathlive-environment-popover"),fo("environment-popover"),fo("core")))}flushInlineShortcutBuffer(e){if(null!=e||(e={defer:!1}),!e.defer)return this.inlineShortcutBuffer=[],clearTimeout(this.inlineShortcutBufferFlushTimer),void(this.inlineShortcutBufferFlushTimer=0);this.options.inlineShortcutTimeout>0&&(clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=setTimeout((()=>this.flushInlineShortcutBuffer()),this.options.inlineShortcutTimeout))}executeCommand(e){return"virtual-keyboard"===Rc(e)?(this.focus({preventScroll:!0}),window.mathVirtualKeyboard.executeCommand(e),requestAnimationFrame((()=>window.mathVirtualKeyboard.update(bd(this)))),!1):function(e,t){var n;if(!t)return!1;let i,r=[],a=!1,s=!1;f(t)?(i=t[0],r=t.slice(1)):i=t,i=i.replace(/-\w/g,(e=>e[1].toUpperCase()));const o=Lc[i],l=null==o?void 0:o.target;if("model"===l){if(!e.isSelectionEditable&&(null==o?void 0:o.changeContent))return e.model.announce("plonk"),!1;/^(delete|add)/.test(i)&&("deleteBackward"!==i&&e.flushInlineShortcutBuffer(),e.snapshot(i)),/^complete/.test(i)||lc(e),Lc[i].fn(e.model,...r),cc(e),s=!0,a=!0}else if("virtual-keyboard"===l)s=null!=(n=window.mathVirtualKeyboard.executeCommand(t))&&n,a=!0;else{if(!Lc[i])throw new Error(`Unknown command "${i}"`);if(!e.isSelectionEditable&&(null==o?void 0:o.changeContent))return e.model.announce("plonk"),!1;/^(undo|redo)/.test(i)&&e.flushInlineShortcutBuffer(),s=Lc[i].fn(e,...r),a=!0}return"virtual-keyboard"!==l&&(!e.model.selectionIsCollapsed||(null==o?void 0:o.changeSelection)&&"deleteBackward"!==t)&&(e.flushInlineShortcutBuffer(),(null==o?void 0:o.changeContent)||e.stopCoalescingUndo(),e.defaultStyle={}),s&&Cc(e),a}(this,e)}get errors(){return el(this.model.getValue(),{context:this.context})}getValue(e,t,n){return this.model.getValue(e,t,n)}setValue(e,t){var n;void 0===(t=null!=t?t:{mode:"math"}).insertionMode&&(t.insertionMode="replaceAll"),void 0!==t.format&&"auto"!==t.format||(t.format="latex"),void 0!==t.mode&&"auto"!==t.mode||(t.mode=null!=(n=function(e,t){const n=e.at(t);let i;if(n){i=n.mode;let e=n.parent;for(;!i&&e;)e&&(i=e.mode),e=e.parent}return i}(this.model,this.model.position))?n:"math");const i=this.undoManager.canUndo();Ys.insert(this.model,e,t)&&(Cc(this),i||this.undoManager.reset(),this.undoManager.snapshot("set-value"))}get expression(){const e=window.MathfieldElement.computeEngine;return e?e.box(e.parse(this.model.getValue("latex-unstyled"))):(console.error("MathLive 0.98.5: no compute engine available. Make sure the Compute Engine library is loaded."),null)}scrollIntoView(){var e;if(!this.element)return;if(this.host)if(this.options.onScrollIntoView)this.options.onScrollIntoView(this);else if(this.host.scrollIntoView({block:"nearest",inline:"nearest"}),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.container===window.document.body){const t=window.mathVirtualKeyboard.boundingRect,n=this.host.getBoundingClientRect();n.bottom>t.top&&(null==(e=window.document.scrollingElement)||e.scrollBy(0,n.bottom-t.top+8))}this.dirty&&Ac(this,{interactive:!0});const t=this.field.getBoundingClientRect();let n=null;if(this.model.selectionIsCollapsed)n=eo(this.field);else{const e=ao(this);if(e.length>0){let i=-1/0,r=-1/0;for(const t of e)t.right>i&&(i=t.right),t.top<r&&(r=t.top);n={x:i+t.left-this.field.scrollLeft,y:r+t.top-this.field.scrollTop,height:0}}}if(this.host&&n){const e=this.host.getBoundingClientRect(),t=n.y;let i=this.host.scrollTop;t<e.top?i=t-e.top+this.host.scrollTop:t>e.bottom&&(i=t-e.bottom+this.host.scrollTop+n.height),this.host.scroll({top:i,left:0})}if(n){const e=n.x-window.scrollX;let i=this.field.scrollLeft;e<t.left?i=e-t.left+this.field.scrollLeft-20:e>t.right&&(i=e-t.right+this.field.scrollLeft+20),this.field.scroll({top:this.field.scrollTop,left:i})}}insert(e,t){return!("string"!=typeof e||0===e.length&&("insertBefore"===(null==t?void 0:t.insertionMode)||"insertAfter"===(null==t?void 0:t.insertionMode))||0===e.length&&this.model.selectionIsCollapsed||(this.flushInlineShortcutBuffer(),(t=null!=t?t:{mode:"math"}).focus&&this.focus(),t.feedback&&(window.MathfieldElement.keypressVibration&&g()&&navigator.vibrate(3),window.MathfieldElement.playSound("keypress")),"\\\\"===e?ku(this.model):"&"===e?Su(this.model):this.model.selectionIsCollapsed?Ys.insert(this.model,e,u({style:this.model.at(this.model.position).computedStyle},t)):Ys.insert(this.model,e,t),this.snapshot(`insert-${this.model.at(this.model.position).type}`),Cc(this),t.scrollIntoView&&this.scrollIntoView(),0))}switchMode(e,t="",n=""){var i;if(this.model.mode===e||!this.hasEditableContent||!this.contentEditable||this.disabled)return;const r=this.model.mode;if(this.model.mode=e,!(null==(i=this.host)?void 0:i.dispatchEvent(new Event("mode-change",{bubbles:!0,composed:!0,cancelable:!0}))))return void(this.model.mode=r);const a=this.model.mode,{model:s}=this;s.deferNotifications({content:Boolean(n)||Boolean(t),selection:!0,type:"insertText"},(()=>{let i=!1;if(this.flushInlineShortcutBuffer(),this.stopCoalescingUndo(),t&&"latex"!==e){const n=Qo(t,{context:this.context,parseMode:e});s.collapseSelection("forward");const r=s.at(s.position);s.position=s.offsetOf(r.parent.addChildrenAfter(n,r)),i=!0}if(this.model.mode=e,"latex"===e){let e,n=s.selectionIsCollapsed;dc(this,"accept");let i=s.at(s.position);if(n)e="\\";else{const r=Ns(s.selection);e=this.model.getValue(r,"latex");const a=this.model.extractAtoms(r);1===a.length&&"placeholder"===a[0].type&&(e=t,n=!0),i=s.at(r[0])}const r=new dl(e);i.parent.addChildAfter(r,i),n?s.position=s.offsetOf(r.lastChild):s.setSelection(s.offsetOf(r.firstChild),s.offsetOf(r.lastChild))}else sc(s).forEach((e=>{e.isError=!1}));if(n){const e=Qo(n,{context:this.context,parseMode:a});s.collapseSelection("forward");const t=s.at(s.position);s.position=s.offsetOf(t.parent.addChildrenAfter(e,t)),i=!0}return Cc(this),this.undoManager.snapshot("latex"===e?"insert-latex":"insert"),i})),this.model.mode=e,window.mathVirtualKeyboard.update(bd(this))}hasFocus(){return!this.blurred}focus(e){var t;this.hasFocus()||(this.keyboardDelegate.focus(),this.connectToVirtualKeyboard(),this.onFocus(),this.model.announce("line")),null!=(t=null==e?void 0:e.preventScroll)&&t||this.scrollIntoView()}blur(){this.disconnectFromVirtualKeyboard(),this.hasFocus()&&this.keyboardDelegate.blur()}select(){this.model.selection={ranges:[[0,this.model.lastOffset]]},this.focus()}applyStyle(e,t={}){var n,i;const r={operation:"set",silenceNotifications:!1};$s(t)?r.range=t:("toggle"===t.operation&&(r.operation="toggle"),r.range=t.range,r.silenceNotifications=null!=(n=t.silenceNotifications)&&n);const a=nd(this,e),s=null!=(i=r.operation)?i:"set";if(void 0===r.range&&this.model.selectionIsCollapsed){if("set"===s)return void(this.defaultStyle=u(u({},this.defaultStyle),a));const e=u({},this.defaultStyle);for(const t of Object.keys(a))e[t]===a[t]?("color"===t&&delete e.verbatimColor,"backgroundColor"===t&&delete e.verbatimBackgroundColor,delete e[t]):e[t]=a[t];this.defaultStyle=e}else this.model.deferNotifications({content:!r.silenceNotifications,type:"insertText"},(()=>{if(void 0===r.range)for(const e of this.model.selection.ranges)mu(this.model,e,a,{operation:s});else mu(this.model,r.range,a,{operation:s})})),Cc(this)}toggleContextMenu(){var e;return!!this._menu.visible&&("open"===this._menu.state?(this._menu.hide(),!0):(this._menu.show({target:this.element.querySelector("[part=container]"),location:null!=(e=this.getCaretPoint())?e:void 0,onDismiss:()=>{var e;return null==(e=this.element)?void 0:e.focus()}}),!0))}getCaretPoint(){const e=eo(this.field);return e?{x:e.x,y:e.y}:null}setCaretPoint(e,t){const n=pd(this,e,t,{bias:0});if(n<0)return!1;const i=this.model.position;return this.model.position=n,this.model.announce("move",i),Cc(this),!0}getPrompt(e){const t=this.model.findAtom((t=>"prompt"===t.type&&t.placeholderId===e));return console.assert(void 0!==t,"MathLive 0.98.5: no prompts with matching ID found"),t}getPromptValue(e,t){const n=this.getPrompt(e);if(!n)return"";const i=this.model.offsetOf(n.firstChild),r=this.model.offsetOf(n.lastChild);return this.model.getValue(i,r,t)}getPrompts(e){return this.model.getAllAtoms().filter((t=>!("prompt"!==t.type||e&&(e.id&&t.placeholderId!==e.id||e.locked&&t.locked!==e.locked||"undefined"===e.correctness&&t.correctness||e.correctness&&t.correctness!==e.correctness)))).map((e=>e.placeholderId))}setPromptValue(e,t,n){if(void 0!==t){const i=this.getPrompt(e);if(!i)return void console.error(`MathLive 0.98.5: unknown prompt ${e}`);const r=this.model.getBranchRange(this.model.offsetOf(i),"body");this.model.setSelection(r),this.insert(t,d(u({},n),{insertionMode:"replaceSelection"}))}(null==n?void 0:n.silenceNotifications)&&(this.valueOnFocus=this.getValue()),Cc(this)}setPromptState(e,t,n){const i=this.getPrompt(e);i?("undefined"===t?i.correctness=void 0:"string"==typeof t&&(i.correctness=t),"boolean"==typeof n&&(i.locked=n,i.captureSelection=n),Cc(this)):console.error(`MathLive 0.98.5: unknown prompt ${e}`)}getPromptState(e){const t=this.getPrompt(e);return t?[t.correctness,t.locked]:(console.error(`MathLive 0.98.5: unknown prompt ${e}`),[void 0,!0])}getPromptRange(e){const t=this.getPrompt(e);return t?this.model.getBranchRange(this.model.offsetOf(t),"body"):(console.error(`MathLive 0.98.5: unknown prompt ${e}`),[0,0])}canUndo(){return this.undoManager.canUndo()}canRedo(){return this.undoManager.canRedo()}popUndoStack(){this.undoManager.pop()}snapshot(e){var t;this.undoManager.snapshot(e)&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(bd(this)),null==(t=this.host)||t.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"snapshot"}})))}stopCoalescingUndo(){this.undoManager.stopCoalescing(this.model.selection)}stopRecording(){this.undoManager.stopRecording()}startRecording(){this.undoManager.startRecording()}undo(){var e;this.undoManager.undo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(bd(this)),null==(e=this.host)||e.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}redo(){var e;this.undoManager.redo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(bd(this)),null==(e=this.host)||e.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}resetUndo(){var e;null==(e=this.undoManager)||e.reset()}onSelectionDidChange(){var e,t;const n=this.model;this.keyboardDelegate.setValue(n.getValue(this.model.selection,"latex-expanded"));{const t=n.at(n.position),i=null!=(e=t.mode)?e:pu(this.options);this.model.mode!==i&&("latex"===this.model.mode?(dc(this,"accept",{mode:i}),n.position=n.offsetOf(t)):this.switchMode(i))}null==(t=this.host)||t.dispatchEvent(new Event("selection-change",{bubbles:!0,composed:!0})),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(bd(this)),Md(this)}onContentWillChange(e){var t,n,i;return null==(i=null==(n=this.host)?void 0:n.dispatchEvent(new InputEvent("beforeinput",d(u({},e),{data:e.data?e.data:null!=(t=e.inputType)?t:"",cancelable:!0,bubbles:!0,composed:!0}))))||i}onFocus(){!this.focusBlurInProgress&&this.blurred&&(this.focusBlurInProgress=!0,this.blurred=!1,this.keyboardDelegate.focus(),this.stopCoalescingUndo(),Ac(this,{interactive:!0}),this.valueOnFocus=this.model.getValue(),this.hasEditablePrompts&&!this.model.at(this.model.anchor).parentPrompt&&this.executeCommand("moveToNextPlaceholder"),this.focusBlurInProgress=!1)}onBlur(){var e,t,n;if(this.focusBlurInProgress||this.blurred)return;this.focusBlurInProgress=!0,this.stopCoalescingUndo(),this.blurred=!0,this.ariaLiveText.textContent="",vc(this),this.model.getValue()!==this.valueOnFocus&&(null==(e=this.host)||e.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),this.disconnectFromVirtualKeyboard(),null==(t=this.host)||t.dispatchEvent(new Event("blur",{bubbles:!1,composed:!0})),null==(n=this.host)||n.dispatchEvent(new UIEvent("focusout",{bubbles:!0,composed:!0})),Cc(this),this.focusBlurInProgress=!1,Ad();const i=new AbortController,r=i.signal;document.addEventListener("visibilitychange",(()=>{"hidden"===document.visibilityState&&document.addEventListener("visibilitychange",(()=>{Qs(this)&&"visible"===document.visibilityState&&this.focus({preventScroll:!0})}),{once:!0,signal:r})}),{once:!0,signal:r}),setTimeout((()=>i.abort()),100)}onInput(e){Yu(this,e)}onKeystroke(e){return Wu(this,e)}onCompositionStart(e){this.model.deleteAtoms(Ns(this.model.selection));const t=eo(this.field);t&&requestAnimationFrame((()=>{Ac(this),this.keyboardDelegate.moveTo(t.x,t.y-t.height)}))}onCompositionUpdate(e){!function(e,t){const n=e.at(e.position);if("composition"===n.type)n.value=t;else{const{caret:i}=n;n.caret=void 0;const r=new Uo(t,{mode:n.mode});r.caret=i,n.parent.addChildAfter(r,n),e.position+=1}}(this.model,e),Cc(this)}onCompositionEnd(e){!function(e){const t=e.at(e.position);"composition"===t.type&&(t.parent.removeChild(t),e.position-=1)}(this.model),Yu(this,e,{simulateKeystroke:!0})}onCut(e){this.isSelectionEditable?this.model.contentWillChange({inputType:"deleteByCut"})&&(this.stopCoalescingUndo(),Ys.onCopy(this,e),Xh(this.model,Ns(this.model.selection),"deleteByCut"),this.snapshot("cut"),Cc(this)):this.model.announce("plonk")}onCopy(e){Ys.onCopy(this,e)}onPaste(e){let t=this.isSelectionEditable;return t&&(t=Ys.onPaste(this.model.at(this.model.position).mode,this,e.clipboardData)),t||this.model.announce("plonk"),e.preventDefault(),e.stopPropagation(),t}onGeometryChange(){this._menu.hide(),gc(this),Md(this)}onWheel(e){const t=5*e.deltaX;if(!Number.isFinite(t)||0===t)return;const n=this.field;t<0&&0===n.scrollLeft||t>0&&n.offsetWidth+n.scrollLeft>=n.scrollWidth||(n.scrollBy({top:0,left:t}),e.preventDefault(),e.stopPropagation())}getHTMLElement(e){let t=e;for(;!t.id&&t.hasChildren;)t=e.children[0];return this.field.querySelector(`[data-atom-id="${t.id}"]`)}get context(){var e,t;return{registers:null!=(e=this.options.registers)?e:{},smartFence:this.smartFence,letterShapeStyle:this.letterShapeStyle,minFontScale:this.minFontScale,placeholderSymbol:null!=(t=this.options.placeholderSymbol)?t:"▢",colorMap:e=>this.colorMap(e),backgroundColorMap:e=>this.backgroundColorMap(e),getMacro:e=>oe(e,this.options.macros),atomIdsSettings:{seed:"random",groupNumbers:!1}}}}(s.querySelector(":host > span"),d(u({},null!=(i=null==(n=np.get(this))?void 0:n.options)?i:op(this)),{eventSink:this,value:c})),!np.has(this)){this.upgradeProperty("disabled"),this.upgradeProperty("readonly");for(const t of Object.keys(e.optionsAttributes))this.upgradeProperty(sp(t))}if(null==(r=this._mathfield)?void 0:r.model){if(np.has(this)){const e=this._mathfield,t=np.get(this),n=t.menuItems;e.model.deferNotifications({content:!1,selection:!1},(()=>{const n=t.value;void 0!==n&&e.setValue(n),e.model.selection=t.selection,np.delete(this)})),n&&(this.menuItems=n)}window.queueMicrotask((()=>{this.isConnected&&this.dispatchEvent(new Event("mount",{cancelable:!1,bubbles:!0,composed:!0}))})),Sc()}else this._mathfield=null}disconnectedCallback(){var t,n;if(this.shadowRoot.host.removeEventListener("pointerdown",this,!0),!this._mathfield)return;window.queueMicrotask((()=>this.dispatchEvent(new Event("unmount",{cancelable:!1,bubbles:!0,composed:!0}))));const i=du(this._mathfield.options,Object.keys(e.optionsAttributes).map((e=>sp(e))));np.set(this,{value:this._mathfield.getValue(),selection:this._mathfield.model.selection,menuItems:null!=(n=null==(t=this._mathfield.menu)?void 0:t.menuItems)?n:void 0,options:i}),this._mathfield.dispose(),this._mathfield=null}upgradeProperty(e){if(this.hasOwnProperty(e)){const t=this[e];delete this[e],"readonly"!==e&&"read-only"!==e||(e="readOnly"),this[e]=t}}attributeChangedCallback(e,t,n){if(t===n)return;const i=null!==n;switch(e){case"contenteditable":Cc(this._mathfield);break;case"disabled":this.disabled=i;break;case"read-only":case"readonly":this.readOnly=i}}get readonly(){return this.hasAttribute("readonly")||this.hasAttribute("read-only")}set readonly(e){const t=Boolean(e);t?(this.setAttribute("readonly",""),lp()?this._internals.ariaReadOnly="true":this.setAttribute("aria-readonly","true"),this.setAttribute("aria-readonly","true")):(lp()?this._internals.ariaReadOnly="false":this.removeAttribute("aria-readonly"),this.removeAttribute("readonly"),this.removeAttribute("read-only")),this._setOptions({readOnly:t})}get disabled(){return this.hasAttribute("disabled")}set disabled(e){var t;const n=Boolean(e);n?this.setAttribute("disabled",""):this.removeAttribute("disabled"),lp()?this._internals.ariaDisabled=n?"true":"false":this.setAttribute("aria-disabled",n?"true":"false"),n&&(null==(t=this._mathfield)?void 0:t.hasFocus)&&window.mathVirtualKeyboard.visible&&this._mathfield.executeCommand("hideVirtualKeyboard")}get value(){return this.getValue()}set value(e){this.setValue(e)}get defaultMode(){return this._getOption("defaultMode")}set defaultMode(e){this._setOptions({defaultMode:e})}get macros(){return this._getOption("macros")}set macros(e){this._setOptions({macros:e})}get registers(){const e=this;return new Proxy({},{get:(t,n)=>{if("string"==typeof n)return e._getOption("registers")[n]},set(t,n,i){return"string"==typeof n&&(e._setOptions({registers:d(u({},e._getOption("registers")),{[n]:i})}),!0)}})}set registers(e){this._setOptions({registers:e})}get colorMap(){return this._getOption("colorMap")}set colorMap(e){this._setOptions({colorMap:e})}get backgroundColorMap(){return this._getOption("backgroundColorMap")}set backgroundColorMap(e){this._setOptions({backgroundColorMap:e})}get letterShapeStyle(){return this._getOption("letterShapeStyle")}set letterShapeStyle(e){this._setOptions({letterShapeStyle:e})}get minFontScale(){return this._getOption("minFontScale")}set minFontScale(e){this._setOptions({minFontScale:e})}get smartMode(){return this._getOption("smartMode")}set smartMode(e){this._setOptions({smartMode:e})}get smartFence(){return this._getOption("smartFence")}set smartFence(e){this._setOptions({smartFence:e})}get smartSuperscript(){return this._getOption("smartSuperscript")}set smartSuperscript(e){this._setOptions({smartSuperscript:e})}get scriptDepth(){return this._getOption("scriptDepth")}set scriptDepth(e){this._setOptions({scriptDepth:e})}get removeExtraneousParentheses(){return this._getOption("removeExtraneousParentheses")}set removeExtraneousParentheses(e){this._setOptions({removeExtraneousParentheses:e})}get mathModeSpace(){return this._getOption("mathModeSpace")}set mathModeSpace(e){this._setOptions({mathModeSpace:e})}get placeholderSymbol(){return this._getOption("placeholderSymbol")}set placeholderSymbol(e){this._setOptions({placeholderSymbol:e})}get popoverPolicy(){return this._getOption("popoverPolicy")}set popoverPolicy(e){this._setOptions({popoverPolicy:e})}get environmentPopoverPolicy(){return this._getOption("environmentPopoverPolicy")}set environmentPopoverPolicy(e){this._setOptions({environmentPopoverPolicy:e})}get menuItems(){var e,t,n;return this._mathfield?null!=(e=this._mathfield.menu._menuItems.map((e=>e.menuItem)))?e:[]:null!=(n=null==(t=np.get(this))?void 0:t.menuItems)?n:[]}set menuItems(e){var t;if(this._mathfield){const n=null==(t=this._mathfield.element)?void 0:t.querySelector("[part=menu-toggle]");n&&(n.style.display=0===e.length?"none":""),this._mathfield.menu.menuItems=e}np.has(this)?np.set(this,d(u({},np.get(this)),{menuItems:e})):np.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:op(this),menuItems:e})}get mathVirtualKeyboardPolicy(){return this._getOption("mathVirtualKeyboardPolicy")}set mathVirtualKeyboardPolicy(e){this._setOptions({mathVirtualKeyboardPolicy:e})}get inlineShortcuts(){return this._getOption("inlineShortcuts")}set inlineShortcuts(e){this._setOptions({inlineShortcuts:e})}get inlineShortcutTimeout(){return this._getOption("inlineShortcutTimeout")}set inlineShortcutTimeout(e){this._setOptions({inlineShortcutTimeout:e})}get keybindings(){return this._getOption("keybindings")}set keybindings(e){this._setOptions({keybindings:e})}get onInlineShortcut(){return this._getOption("onInlineShortcut")}set onInlineShortcut(e){this._setOptions({onInlineShortcut:e})}get onScrollIntoView(){return this._getOption("onScrollIntoView")}set onScrollIntoView(e){this._setOptions({onScrollIntoView:e})}get onExport(){return this._getOption("onExport")}set onExport(e){this._setOptions({onExport:e})}get readOnly(){return this._getOption("readOnly")}set readOnly(e){this._setOptions({readOnly:e})}get isSelectionEditable(){var e,t;return null!=(t=null==(e=this._mathfield)?void 0:e.isSelectionEditable)&&t}setPromptState(e,t,n){var i;null==(i=this._mathfield)||i.setPromptState(e,t,n)}getPromptState(e){var t,n;return null!=(n=null==(t=this._mathfield)?void 0:t.getPromptState(e))?n:[void 0,!0]}get virtualKeyboardTargetOrigin(){return this._getOption("virtualKeyboardTargetOrigin")}set virtualKeyboardTargetOrigin(e){this._setOptions({virtualKeyboardTargetOrigin:e})}get selection(){return this._mathfield?this._mathfield.model.selection:np.has(this)?np.get(this).selection:{ranges:[[0,0]],direction:"forward"}}set selection(e){if("number"==typeof e&&(e={ranges:[[e,e]]}),this._mathfield)return this._mathfield.model.selection=e,void Cc(this._mathfield);np.has(this)?np.set(this,d(u({},np.get(this)),{selection:e})):np.set(this,{value:void 0,selection:e,options:op(this),menuItems:void 0})}get selectionIsCollapsed(){const e=this.selection;return 1===e.ranges.length&&e.ranges[0][0]===e.ranges[0][1]}get position(){return this._mathfield?this._mathfield.model.position:np.has(this)?np.get(this).selection.ranges[0][0]:0}set position(e){this._mathfield&&(this._mathfield.model.position=e,Cc(this._mathfield)),np.has(this)?np.set(this,d(u({},np.get(this)),{selection:{ranges:[[e,e]]}})):np.set(this,{value:void 0,selection:{ranges:[[e,e]]},options:op(this),menuItems:void 0})}getOffsetDepth(e){var t,n;return this._mathfield?(null!=(n=null==(t=this._mathfield.model.at(e))?void 0:t.treeDepth)?n:2)-2:0}get lastOffset(){var e,t;return null!=(t=null==(e=this._mathfield)?void 0:e.model.lastOffset)?t:-1}};rp.version="0.98.5",rp._fontsDirectory="./fonts",rp._soundsDirectory="./sounds",rp.keypressVibration=!0,rp._keypressSound={spacebar:"keypress-spacebar.wav",return:"keypress-return.wav",delete:"keypress-delete.wav",default:"keypress-standard.wav"},rp._plonkSound="plonk.wav",rp.audioBuffers={},rp.createHTML=e=>e,rp._speechEngineRate="100%",rp._speechEngineVoice="Joanna",rp._textToSpeechMarkup="",rp._textToSpeechRules="mathlive",rp._textToSpeechRulesOptions={},rp.speakHook=function(e){var t,n;if(m())if(window.MathfieldElement.speechEngine&&"local"!==window.MathfieldElement.speechEngine)if("amazon"===window.MathfieldElement.speechEngine)if("AWS"in window){const i=new window.AWS.Polly({apiVersion:"2016-06-10"}),r={OutputFormat:"mp3",VoiceId:null!=(t=window.MathfieldElement.speechEngineVoice)?t:"Joanna",Engine:["Amy","Emma","Brian","Ivy","Joanna","Kendra","Kimberly","Salli","Joey","Justin","Matthew"].includes(null!=(n=window.MathfieldElement.speechEngineVoice)?n:"Joanna")?"neural":"standard",Text:e,TextType:"ssml"};i.synthesizeSpeech(r,((e,t)=>{if(e)console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${e}`);else if(null==t?void 0:t.AudioStream){const e=new Uint8Array(t.AudioStream),n=new Blob([e.buffer],{type:"audio/mpeg"}),i=URL.createObjectURL(n);new Audio(i).play().catch((e=>console.log(e)))}else console.log("polly.synthesizeSpeech():",t)}))}else console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");else"google"===window.MathfieldElement.speechEngine&&console.error("MathLive 0.98.5: The Google speech engine is not supported yet. Please come again.");else{const t=new SpeechSynthesisUtterance(e);window.speechSynthesis.speak(t)}else console.log("Speak:",e)},rp.readAloudHook=function(e,t){var n;if(!m())return;if("amazon"!==window.MathfieldElement.speechEngine)return console.error("MathLive 0.98.5: Use Amazon TTS Engine for synchronized highlighting"),void("function"==typeof window.MathfieldElement.speakHook&&window.MathfieldElement.speakHook(t));if(!window.AWS)return void console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");const i=new window.AWS.Polly({apiVersion:"2016-06-10"}),r={OutputFormat:"json",VoiceId:null!=(n=window.MathfieldElement.speechEngineVoice)?n:"Joanna",Engine:"standard",Text:t,TextType:"ssml",SpeechMarkTypes:["ssml"]};pp().readAloudElement=e,i.synthesizeSpeech(r,((e,n)=>{if(e)return void console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${e}`);if(!(null==n?void 0:n.AudioStream))return void console.log("polly.synthesizeSpeech():",n);const a=new TextDecoder("utf-8").decode(new Uint8Array(n.AudioStream));pp().readAloudMarks=a.split("\n").map((e=>e?JSON.parse(e):{})),pp().readAloudTokens=[];for(const e of pp().readAloudMarks)e.value&&pp().readAloudTokens.push(e.value);pp().readAloudCurrentMark="",r.OutputFormat="mp3",r.SpeechMarkTypes=[],i.synthesizeSpeech(r,((e,n)=>{if(e)return void console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech("${t}") error:${e}`);if(!(null==n?void 0:n.AudioStream))return;const i=new Uint8Array(n.AudioStream),r=new Blob([i.buffer],{type:"audio/mpeg"}),a=URL.createObjectURL(r),s=pp();s.readAloudAudio?s.readAloudAudio.pause():(s.readAloudAudio=new Audio,s.readAloudAudio.addEventListener("ended",(()=>{const e=s.readAloudMathfield;s.readAloudStatus="ended",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),e?(Ac(e),s.readAloudElement=null,s.readAloudMathfield=null,s.readAloudTokens=[],s.readAloudMarks=[],s.readAloudCurrentMark=""):ep(s.readAloudElement)})),s.readAloudAudio.addEventListener("timeupdate",(()=>{let e="";const t=1e3*s.readAloudAudio.currentTime+100;for(const n of s.readAloudMarks)n.time<t&&(e=n.value);s.readAloudCurrentMark!==e&&(s.readAloudCurrentToken=e,e&&e===s.readAloudFinalToken?s.readAloudAudio.pause():(s.readAloudCurrentMark=e,tp(s.readAloudElement,s.readAloudCurrentMark)))}))),s.readAloudAudio.src=a,s.readAloudStatus="playing",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),s.readAloudAudio.play()}))}))},rp._decimalSeparator=".",rp.fractionNavigationOrder="numerator-denominator",rp._isFunction=e=>{var t,n;const i=window.MathfieldElement.computeEngine;return null!=(n=null==(t=null==i?void 0:i.parse(e).domain)?void 0:t.isFunction)&&n};var ap=rp;function sp(e){return e.replace(/[^a-zA-Z\d]+(.)/g,((e,t)=>t.toUpperCase()))}function op(e){const t={readOnly:!1},n=ap.optionsAttributes;return Object.keys(n).forEach((i=>{if(e.hasAttribute(i)){const r=e.getAttribute(i);"placeholder"===i?t.contentPlaceholder=null!=r?r:"":"boolean"===n[i]?t[sp(i)]=!0:"on/off"===n[i]?t[sp(i)]="on"===r||"off"!==r&&void 0:"number"===n[i]?t[sp(i)]=Number.parseFloat(null!=r?r:"0"):t[sp(i)]=r}})),t}function lp(){return!(!("ElementInternals"in window)||!HTMLElement.prototype.attachInternals)&&"role"in window.ElementInternals.prototype}var cp,up,dp,hp=ap;if(m()&&!(null==(cp=window.customElements)?void 0:cp.get("math-field"))){null!=window[up=Symbol.for("io.cortexjs.mathlive")]||(window[up]={});window[Symbol.for("io.cortexjs.mathlive")].version="0.98.5",window.MathfieldElement=ap,null==(dp=window.customElements)||dp.define("math-field",ap)}function pp(){var e;return null!=globalThis[e=Symbol.for("io.cortexjs.mathlive")]||(globalThis[e]={}),globalThis[Symbol.for("io.cortexjs.mathlive")]}Dc({switchKeyboardLayer:function(e,t){const n=lu.singleton;return!!n&&(n.show(),Kc(),n.currentLayer=t,n.render(),n.focus(),!0)},toggleVirtualKeyboard:function(){const e=window.mathVirtualKeyboard;return e.visible?e.hide({animate:!0}):e.show({animate:!0}),!1},hideVirtualKeyboard:()=>(window.mathVirtualKeyboard.hide({animate:!0}),!1),showVirtualKeyboard:()=>(window.mathVirtualKeyboard.show({animate:!0}),!1)},{target:"virtual-keyboard"})}}]); |