diff --git a/apps/mobile/.gitignore b/apps/mobile/.gitignore index a21b48b9a..333c95067 100644 --- a/apps/mobile/.gitignore +++ b/apps/mobile/.gitignore @@ -34,8 +34,6 @@ build/ .gradle local.properties *.iml -web.bundle/ -web.bundle # node.js # node_modules/ diff --git a/apps/mobile/features.ts b/apps/mobile/features.ts index b6ad15003..d054cbb2a 100644 --- a/apps/mobile/features.ts +++ b/apps/mobile/features.ts @@ -3,7 +3,7 @@ import { FeatureType } from './src/components/sheets/new-feature'; export const features: FeatureType[] = [ { title: 'A brand new editor', - body: 'We have switched to a completely new editor for Notesnook. Why? Because we wanted something that was extensible and future proof so that we could build amazing features fast!' + body: 'We have switched to a completely new editor for Notesnook. Why? Because we wanted something that was extensible and future proof.' }, { title: 'Configurable toolbar', @@ -17,6 +17,10 @@ export const features: FeatureType[] = [ title: 'Task list', body: 'A new task list that keeps track of your progess and supports reordering items with drag & drop.' }, + { + title: 'Math support', + body: 'Inline and multi-line math support is here using KaTex.' + }, { title: 'Overhaul Settings UI', body: 'New Settings that are more organized and look miles better than before.' diff --git a/apps/mobile/tests.txt b/apps/mobile/tests.txt new file mode 100644 index 000000000..dc6d3c884 --- /dev/null +++ b/apps/mobile/tests.txt @@ -0,0 +1,11 @@ +1. Attach image from gallery +2. Attacah image from camera +3. Add a file +4. Logout +5. Login +6. Image download progress +7. Attachment download progress + +// Issues + +1. Attachment properties are not opening \ No newline at end of file diff --git a/apps/mobile/web.bundle/asset-manifest.json b/apps/mobile/web.bundle/asset-manifest.json new file mode 100644 index 000000000..1ffec42ef --- /dev/null +++ b/apps/mobile/web.bundle/asset-manifest.json @@ -0,0 +1,23 @@ +{ + "files": { + "static/js/0.5eeb08ce.chunk.js": "./static/js/0.5eeb08ce.chunk.js", + "main.css": "./static/css/main.f2465fba.chunk.css", + "main.js": "./static/js/main.f99b17c3.chunk.js", + "runtime-main.js": "./static/js/runtime-main.bd5c4477.js", + "static/css/3.c1694623.chunk.css": "./static/css/3.c1694623.chunk.css", + "static/js/3.d673b030.chunk.js": "./static/js/3.d673b030.chunk.js", + "static/js/4.932ef39d.chunk.js": "./static/js/4.932ef39d.chunk.js", + "static/js/5.ac8fa90a.chunk.js": "./static/js/5.ac8fa90a.chunk.js", + "index.html": "./index.html", + "static/js/3.d673b030.chunk.js.LICENSE.txt": "./static/js/3.d673b030.chunk.js.LICENSE.txt", + "static/media/katex.min.css": "./static/media/KaTeX_Typewriter-Regular.c5c02d76.ttf", + "static/media/fonts.css": "./static/media/hack-regular.fe74d490.woff2" + }, + "entrypoints": [ + "static/js/runtime-main.bd5c4477.js", + "static/css/3.c1694623.chunk.css", + "static/js/3.d673b030.chunk.js", + "static/css/main.f2465fba.chunk.css", + "static/js/main.f99b17c3.chunk.js" + ] +} \ No newline at end of file diff --git a/apps/mobile/web.bundle/favicon.ico b/apps/mobile/web.bundle/favicon.ico new file mode 100644 index 000000000..2994e3a2b Binary files /dev/null and b/apps/mobile/web.bundle/favicon.ico differ diff --git a/apps/mobile/web.bundle/fonts.css b/apps/mobile/web.bundle/fonts.css new file mode 100644 index 000000000..72cd4b88a --- /dev/null +++ b/apps/mobile/web.bundle/fonts.css @@ -0,0 +1,71 @@ +/* open-sans-regular - latin */ +@font-face { + font-family: 'Open Sans'; + font-display: swap; + font-style: normal; + font-weight: 400; + src: local('Open Sans'), url(./fonts/OpenSans-Regular.ttf) format('truetype'); +} + +/* open-sans-italic - latin */ +@font-face { + font-family: 'Open Sans'; + font-display: swap; + font-style: italic; + font-weight: 400; + src: local('Open Sans'), url(./fonts/OpenSans-Italic.ttf) format('truetype'); +} + +/* open-sans-600 - latin */ +@font-face { + font-family: 'Open Sans'; + font-display: swap; + font-style: normal; + font-weight: 500; + src: local('Open Sans'), url(./fonts/OpenSans-Medium.ttf) format('truetype'); +} + +/* open-sans-600italic - latin */ +@font-face { + font-family: 'Open Sans'; + font-display: swap; + font-style: italic; + font-weight: 500; + src: local('Open Sans'), url(./fonts/OpenSans-MediumItalic.ttf) format('truetype'); +} + +/* open-sans-600 - latin */ +@font-face { + font-family: 'Open Sans'; + font-display: swap; + font-style: normal; + font-weight: 600; + src: local('Open Sans'), url(./fonts/OpenSans-SemiBold.ttf) format('truetype'); +} + +/* open-sans-600italic - latin */ +@font-face { + font-family: 'Open Sans'; + font-display: swap; + font-style: italic; + font-weight: 600; + src: local('Open Sans'), url(./fonts/OpenSans-SemiBoldItalic.ttf) format('truetype'); +} + +/* open-sans-700 - latin */ +@font-face { + font-family: 'Open Sans'; + font-display: swap; + font-style: normal; + font-weight: 700; + src: local('Open Sans'), url(./fonts/OpenSans-Bold.ttf) format('truetype'); +} + +/* open-sans-700italic - latin */ +@font-face { + font-family: 'Open Sans'; + font-display: swap; + font-style: italic; + font-weight: 700; + src: local('Open Sans'), url(./fonts/OpenSans-BoldItalic.ttf) format('truetype'); +} diff --git a/apps/mobile/web.bundle/fonts/OpenSans-Bold.ttf b/apps/mobile/web.bundle/fonts/OpenSans-Bold.ttf new file mode 100644 index 000000000..b379424ec Binary files /dev/null and b/apps/mobile/web.bundle/fonts/OpenSans-Bold.ttf differ diff --git a/apps/mobile/web.bundle/fonts/OpenSans-BoldItalic.ttf b/apps/mobile/web.bundle/fonts/OpenSans-BoldItalic.ttf new file mode 100644 index 000000000..0b0764c38 Binary files /dev/null and b/apps/mobile/web.bundle/fonts/OpenSans-BoldItalic.ttf differ diff --git a/apps/mobile/web.bundle/fonts/OpenSans-Italic.ttf b/apps/mobile/web.bundle/fonts/OpenSans-Italic.ttf new file mode 100644 index 000000000..25def2ac3 Binary files /dev/null and b/apps/mobile/web.bundle/fonts/OpenSans-Italic.ttf differ diff --git a/apps/mobile/web.bundle/fonts/OpenSans-Medium.ttf b/apps/mobile/web.bundle/fonts/OpenSans-Medium.ttf new file mode 100644 index 000000000..d9d5d82bb Binary files /dev/null and b/apps/mobile/web.bundle/fonts/OpenSans-Medium.ttf differ diff --git a/apps/mobile/web.bundle/fonts/OpenSans-MediumItalic.ttf b/apps/mobile/web.bundle/fonts/OpenSans-MediumItalic.ttf new file mode 100644 index 000000000..17def2546 Binary files /dev/null and b/apps/mobile/web.bundle/fonts/OpenSans-MediumItalic.ttf differ diff --git a/apps/mobile/web.bundle/fonts/OpenSans-Regular.ttf b/apps/mobile/web.bundle/fonts/OpenSans-Regular.ttf new file mode 100644 index 000000000..472faab14 Binary files /dev/null and b/apps/mobile/web.bundle/fonts/OpenSans-Regular.ttf differ diff --git a/apps/mobile/web.bundle/fonts/OpenSans-SemiBold.ttf b/apps/mobile/web.bundle/fonts/OpenSans-SemiBold.ttf new file mode 100644 index 000000000..2f7861c60 Binary files /dev/null and b/apps/mobile/web.bundle/fonts/OpenSans-SemiBold.ttf differ diff --git a/apps/mobile/web.bundle/fonts/OpenSans-SemiBoldItalic.ttf b/apps/mobile/web.bundle/fonts/OpenSans-SemiBoldItalic.ttf new file mode 100644 index 000000000..dcad0fcfd Binary files /dev/null and b/apps/mobile/web.bundle/fonts/OpenSans-SemiBoldItalic.ttf differ diff --git a/apps/mobile/web.bundle/index.html b/apps/mobile/web.bundle/index.html new file mode 100644 index 000000000..582b548bc --- /dev/null +++ b/apps/mobile/web.bundle/index.html @@ -0,0 +1 @@ +
0&&(t="."===(t=e)?null:t),t};ot({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler:function(e,t){var r,n=e.parser,a=t[4],i=t[5],o=lt(t[0]),s="atom"===o.type&&"open"===o.family?on(o.text):null,l=lt(t[1]),h="atom"===l.type&&"close"===l.family?on(l.text):null,m=Gt(t[2],"size"),c=null;r=!!m.isBlank||(c=m.value).number>0;var u="auto",p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var d=Gt(p.body[0],"textord");u=an[Number(d.text)]}}else p=Gt(p,"textord"),u=an[Number(p.text)];return{type:"genfrac",mode:n.mode,numer:a,denom:i,continued:!1,hasBarLine:r,barSize:c,leftDelim:s,rightDelim:h,size:u}},htmlBuilder:rn,mathmlBuilder:nn}),ot({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler:function(e,t){var r=e.parser,n=(e.funcName,e.token);return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:Gt(t[0],"size").value,token:n}}}),ot({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:function(e,t){var r=e.parser,n=(e.funcName,t[0]),a=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}(Gt(t[1],"infix").size),i=t[2],o=a.number>0;return{type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:rn,mathmlBuilder:nn});var sn=function(e,t){var r,n,a=t.style;"supsub"===e.type?(r=e.sup?wt(e.sup,t.havingStyle(a.sup()),t):wt(e.sub,t.havingStyle(a.sub()),t),n=Gt(e.base,"horizBrace")):n=Gt(e,"horizBrace");var i,o=wt(n.base,t.havingBaseStyle(x.DISPLAY)),s=Vt(n,t);if(n.isOver?(i=Ke.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:s}]},t)).children[0].children[0].children[1].classes.push("svg-align"):(i=Ke.makeVList({positionType:"bottom",positionData:o.depth+.1+s.height,children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o}]},t)).children[0].children[0].children[0].classes.push("svg-align"),r){var l=Ke.makeSpan(["mord",n.isOver?"mover":"munder"],[i],t);i=n.isOver?Ke.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]},t):Ke.makeVList({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]},t)}return Ke.makeSpan(["mord",n.isOver?"mover":"munder"],[i],t)};ot({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler:function(e,t){var r=e.parser,n=e.funcName;return{type:"horizBrace",mode:r.mode,label:n,isOver:/^\\over/.test(n),base:t[0]}},htmlBuilder:sn,mathmlBuilder:function(e,t){var r=Ft(e.label);return new Tt.MathNode(e.isOver?"mover":"munder",[Rt(e.base,t),r])}}),ot({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:function(e,t){var r=e.parser,n=t[1],a=Gt(t[0],"url").url;return r.settings.isTrusted({command:"\\href",url:a})?{type:"href",mode:r.mode,href:a,body:ht(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:function(e,t){var r=ft(e.body,t,!1);return Ke.makeAnchor(e.href,[],r,t)},mathmlBuilder:function(e,t){var r=It(e.body,t);return r instanceof zt||(r=new zt("mrow",[r])),r.setAttribute("href",e.href),r}}),ot({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:function(e,t){var r=e.parser,n=Gt(t[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var a=[],i=0;i r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(v,"$1"+e.trim());case 58:return e.trim()+t.replace(v,"$1"+e.trim());default:if(0<1*n&&0 2),L=T||!!y&&/Mac/.test(y.platform),P=/Android \d/.test(w),R=!!b&&"webkitFontSmoothing"in b.documentElement.style,H=R?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,N=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},F=function(e){var t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},V=null,z=function(e,t,n){var r=V||(V=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},_=function(e,t,n,r){return n&&(I(e,t,n,r,-1)||I(e,t,n,r,1))},B=/^(img|br|input|textarea|hr)$/i;function I(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:$(e))){var i=e.parentNode;if(!i||1!=i.nodeType||W(e)||B.test(e.nodeName)||"false"==e.contentEditable)return!1;t=N(e)+(o<0?0:1),e=i}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?$(e):0}}}function $(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function q(e,t,n){for(var r=0==t,o=t==$(e);r||o;){if(e==n)return!0;var i=N(e);if(!(e=e.parentNode))return!1;r=r&&0==i,o=o&&i==$(e)}}function W(e){for(var t,n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var U=function(e){var t=e.isCollapsed;return t&&E&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function K(e,t){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function G(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function J(e,t){return"number"==typeof e?e:e[t]}function Z(e){var t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Y(e,t,n){for(var r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument,a=n||e.dom;a;a=F(a))if(1==a.nodeType){var s=a,l=s==i.body,u=l?G(i):Z(s),c=0,f=0;if(t.top =500)null===i||void 0===i||i();else{var n=30*h.current.offsetHeight/100;m.get()>=n?y():g.start({transition:Lh,y:0})}},dragConstraints:{top:0,bottom:0},dragMomentum:!1,dragElastic:!1,sx:{bg:"transparent",alignItems:"center",justifyContent:"center",p:2}},{children:Object(Oa.jsx)(ns.Box,{id:"pill",sx:{backgroundColor:"hover",width:60,height:8,borderRadius:100}})})),Object(Oa.jsx)(Rh,Object.assign({items:o,title:r,onClose:i},{children:d}))]}))})):null}function Rh(e){var t,n=e.title,r=e.items,o=e.onClose,i=e.children,a=function(e){var t=Object(Ca.useState)(e),n=Object(u.a)(t,2),r=n[0],o=n[1],i=Object(Ca.useState)(!1),a=Object(u.a)(i,2),s=a[0],l=a[1],c=Object(Ca.useRef)([e]);return{current:r,goBack:Object(Ca.useCallback)((function(){if(s){var e=c.current.pop();o(e),c.current.length<=1&&l(!1)}}),[s]),navigate:Object(Ca.useCallback)((function(e){console.log("NAVI",e),o((function(t){return t&&c.current.push(t),e})),l(!0)}),[]),canGoBack:s}}({title:n,items:r}),s=a.current,l=a.goBack,c=a.canGoBack,f=a.navigate;return Object(Oa.jsxs)(ns.Flex,Object.assign({sx:{flexDirection:"column"}},{children:[c||(null===s||void 0===s?void 0:s.title)?Object(Oa.jsxs)(ns.Flex,Object.assign({id:"header",sx:{alignItems:"center",mx:0,mb:1}},{children:[c&&Object(Oa.jsx)(as,Object.assign({variant:"icon",sx:{p:1,ml:1},onClick:l},{children:Object(Oa.jsx)(ds,{path:ps.arrowLeft,size:"big"})})),(null===s||void 0===s?void 0:s.title)&&Object(Oa.jsx)(is,Object.assign({variant:"title",sx:{ml:1,fontSize:"title"}},{children:null===s||void 0===s?void 0:s.title}))]})):null,i||(null===(t=null===s||void 0===s?void 0:s.items)||void 0===t?void 0:t.map((function(e){if(e.isHidden)return null;switch(e.type){case"separator":return Object(Oa.jsx)(bs,{},e.key);case"button":return Object(Oa.jsx)(ys,{item:e,onClick:function(t){e.menu?f(e.menu):e.onClick&&(null===o||void 0===o||o(),setTimeout((function(){var t;null===(t=e.onClick)||void 0===t||t.call(e)}),300))}},e.key);case"popup":return Object(Oa.jsx)(Sa.a.Fragment,{children:Object(Oa.jsx)(e.component,{onClick:o})},e.key)}})))]}))}var Hh={x:0,y:0,actualX:0,actualY:0};function Nh(e,t){var n=t||{},r=n.target,o=void 0===r?"mouse":r,i=n.isTargetAbsolute,a=void 0!==i&&i,s=n.location,l=void 0===s?void 0:s,u=n.yOffset,c=void 0===u?0:u,f=n.xOffset,d=void 0===f?0:f,p=n.align,h=void 0===p?"start":p,m=n.parent,v=void 0===m?document.body:m,g=n.yAnchor,y="mouse"===o?Hh:Fh(o,a),b=y.x,w=y.y,k=y.width,x=y.height,O=y.actualX,C=y.actualY,S=e.offsetWidth,j=e.offsetHeight,A=v.clientWidth,E=v.clientHeight,D={top:0,left:0};if(A-O0&&(u+=M,p-=M)}var z=[{type:"elem",elem:a,shift:p,marginRight:y,marginLeft:w},{type:"elem",elem:n,shift:-u,marginRight:y}];v=Ke.makeVList({positionType:"individualShift",children:z},t)}else if(a){p=Math.max(p,c.sub1,a.height-.8*c.xHeight);var A=[{type:"elem",elem:a,marginLeft:w,marginRight:y}];v=Ke.makeVList({positionType:"shift",positionData:p,children:A},t)}else{if(!n)throw new Error("supsub must have either sup or sub.");u=Math.max(u,i,n.depth+.25*c.xHeight),v=Ke.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:n,marginRight:y}]},t)}var T=yt(m,"right")||"mord";return Ke.makeSpan([T],[m,Ke.makeSpan(["msupsub"],[v])],t)},mathmlBuilder:function(e,t){var r,n=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(n=!0,r=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var a,i=[Rt(e.base,t)];if(e.sub&&i.push(Rt(e.sub,t)),e.sup&&i.push(Rt(e.sup,t)),n)a=r?"mover":"munder";else if(e.sub)if(e.sup){var o=e.base;a=o&&"op"===o.type&&o.limits&&t.style===x.DISPLAY||o&&"operatorname"===o.type&&o.alwaysHandleSupSub&&(t.style===x.DISPLAY||o.limits)?"munderover":"msubsup"}else{var s=e.base;a=s&&"op"===s.type&&s.limits&&(t.style===x.DISPLAY||s.alwaysHandleSupSub)||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(s.limits||t.style===x.DISPLAY)?"munder":"msub"}else{var l=e.base;a=l&&"op"===l.type&&l.limits&&(t.style===x.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===x.DISPLAY)?"mover":"msup"}return new Tt.MathNode(a,i)}}),st({type:"atom",htmlBuilder:function(e,t){return Ke.mathsym(e.text,e.mode,t,["m"+e.family])},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mo",[Bt(e.text,e.mode)]);if("bin"===e.family){var n=qt(e,t);"bold-italic"===n&&r.setAttribute("mathvariant",n)}else"punct"===e.family?r.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||r.setAttribute("stretchy","false");return r}});var wn={mi:"italic",mn:"normal",mtext:"normal"};st({type:"mathord",htmlBuilder:function(e,t){return Ke.makeOrd(e,t,"mathord")},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mi",[Bt(e.text,e.mode,t)]),n=qt(e,t)||"italic";return n!==wn[r.type]&&r.setAttribute("mathvariant",n),r}}),st({type:"textord",htmlBuilder:function(e,t){return Ke.makeOrd(e,t,"textord")},mathmlBuilder:function(e,t){var r,n=Bt(e.text,e.mode,t),a=qt(e,t)||"normal";return r="text"===e.mode?new Tt.MathNode("mtext",[n]):/[0-9]/.test(e.text)?new Tt.MathNode("mn",[n]):"\\prime"===e.text?new Tt.MathNode("mo",[n]):new Tt.MathNode("mi",[n]),a!==wn[r.type]&&r.setAttribute("mathvariant",a),r}});var kn={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Sn={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};st({type:"spacing",htmlBuilder:function(e,t){if(Sn.hasOwnProperty(e.text)){var r=Sn[e.text].className||"";if("text"===e.mode){var a=Ke.makeOrd(e,t,"textord");return a.classes.push(r),a}return Ke.makeSpan(["mspace",r],[Ke.mathsym(e.text,e.mode,t)],t)}if(kn.hasOwnProperty(e.text))return Ke.makeSpan(["mspace",kn[e.text]],[],t);throw new n('Unknown type of space "'+e.text+'"')},mathmlBuilder:function(e,t){if(!Sn.hasOwnProperty(e.text)){if(kn.hasOwnProperty(e.text))return new Tt.MathNode("mspace");throw new n('Unknown type of space "'+e.text+'"')}return new Tt.MathNode("mtext",[new Tt.TextNode("\xa0")])}});var Mn=function(){var e=new Tt.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};st({type:"tag",mathmlBuilder:function(e,t){var r=new Tt.MathNode("mtable",[new Tt.MathNode("mtr",[Mn(),new Tt.MathNode("mtd",[It(e.body,t)]),Mn(),new Tt.MathNode("mtd",[It(e.tag,t)])])]);return r.setAttribute("width","100%"),r}});var zn={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},An={"\\textbf":"textbf","\\textmd":"textmd"},Tn={"\\textit":"textit","\\textup":"textup"},Bn=function(e,t){var r=e.font;return r?zn[r]?t.withTextFontFamily(zn[r]):An[r]?t.withTextFontWeight(An[r]):t.withTextFontShape(Tn[r]):t};ot({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[0];return{type:"text",mode:r.mode,body:ht(a),font:n}},htmlBuilder:function(e,t){var r=Bn(e,t),n=ft(e.body,r,!0);return Ke.makeSpan(["mord","text"],n,r)},mathmlBuilder:function(e,t){var r=Bn(e,t);return It(e.body,r)}}),ot({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 r=wt(e.body,t),n=Ke.makeLineSpan("underline-line",t),a=t.fontMetrics().defaultRuleThickness,i=Ke.makeVList({positionType:"top",positionData:r.height,children:[{type:"kern",size:a},{type:"elem",elem:n},{type:"kern",size:3*a},{type:"elem",elem:r}]},t);return Ke.makeSpan(["mord","underline"],[i],t)},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mo",[new Tt.TextNode("\u203e")]);r.setAttribute("stretchy","true");var n=new Tt.MathNode("munder",[Rt(e.body,t),r]);return n.setAttribute("accentunder","true"),n}}),ot({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler:function(e,t){return{type:"vcenter",mode:e.parser.mode,body:t[0]}},htmlBuilder:function(e,t){var r=wt(e.body,t),n=t.fontMetrics().axisHeight,a=.5*(r.height-n-(r.depth+n));return Ke.makeVList({positionType:"shift",positionData:a,children:[{type:"elem",elem:r}]},t)},mathmlBuilder:function(e,t){return new Tt.MathNode("mpadded",[Rt(e.body,t)],["vcenter"])}}),ot({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler:function(e,t,r){throw new n("\\verb ended by end of line instead of matching delimiter")},htmlBuilder:function(e,t){for(var r=Cn(e),n=[],a=t.havingStyle(t.style.text()),i=0;ir.charCodeAt(0)&&(r=r.trim()),r=[r],0=n||c<=t?i.push(l):(uE?E-j:w,x&&("below"===l?D.top+=x:"top"===l&&(D.top=w-j)),k&&"mouse"!==o&&"center"===h&&S>0?D.left-=(S-k)/2:k&&"mouse"!==o&&"end"===h&&S>0&&(D.left-=S-k),j>E-D.top&&(e.style.maxHeight="".concat(E-20,"px")),g){var T=Fh(g,a);D.top=T.y-j}return D.top=a&&D.top<0?0:D.top,D.left=a&&D.left<0?0:D.left,D.top+="below"===l?c:-c,D.left+=d,D}function Fh(e,t){var n=e.getBoundingClientRect(),r={x:e.offsetLeft,y:e.offsetTop,width:n.width,height:n.height,actualY:n.y,actualX:n.x};return t&&(r.x=r.actualX,r.y=r.actualY),r}function Vh(e,t,n){var r=Object(Ca.useState)(-1),o=Object(u.a)(r,2),i=o[0],a=o[1],s=Object(Ca.useState)(!1),l=Object(u.a)(s,2),c=l[0],f=l[1],d=Object(Ca.useCallback)((function(t){var n=e[t];if(n){var r=document.getElementById(n.key);r&&r.scrollIntoView({behavior:"auto"})}}),[e]),p=Object(Ca.useCallback)((function(r){var o=function(t){return e[t]},i=function(t){var n,r;return e&&("separator"===(null===(n=e[t])||void 0===n?void 0:n.type)||(null===(r=o(t))||void 0===r?void 0:r.isDisabled))},s=function(t){return t