hypothesis 1.1663.0 → 1.1664.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/boot-template.js +1 -1
- package/build/boot.js +1 -1
- package/build/manifest.json +12 -12
- package/build/scripts/annotator.bundle.js +114 -113
- package/build/scripts/annotator.bundle.js.map +1 -1
- package/build/scripts/sidebar.bundle.js +305 -304
- package/build/scripts/sidebar.bundle.js.map +1 -1
- package/build/scripts/ui-playground.bundle.js +553 -551
- package/build/scripts/ui-playground.bundle.js.map +1 -1
- package/build/styles/annotator.css +19 -4
- package/build/styles/annotator.css.map +1 -1
- package/build/styles/sidebar.css +17 -18
- package/build/styles/sidebar.css.map +1 -1
- package/build/styles/ui-playground.css +17 -18
- package/build/styles/ui-playground.css.map +1 -1
- package/package.json +2 -2
|
@@ -97,46 +97,47 @@ subtree:!0,attributes:!0,attributeFilter:["disabled"],childList:!0}),()=>{c.remo
|
|
|
97
97
|
l.style.position="relative",l.style.zIndex="10",document.body.appendChild(l),new Promise((o=>{const c=e=>{H(null,l),l.remove(),o(e)};H(Qe(Or,{buttons:Qe(y,{children:[Qe(gr,{elementRef:i,"data-testid":"cancel-button",onClick:()=>c(!1),children:r},void 0,0,{fileName:Lr,lineNumber:66,columnNumber:13},this),Qe(gr,{variant:"primary",elementRef:a,"data-testid":"confirm-button",onClick:()=>c(!0),children:n},void 0,0,{fileName:Lr,lineNumber:73,columnNumber:13},this)]},void 0),initialFocus:s,title:e,onClose:()=>c(!1),children:t},void 0,0,{fileName:Lr,lineNumber:63,columnNumber:7},this),l)}))}var Pr="/home/runner/work/frontend-shared/frontend-shared/src/components/input/ToggleInput.tsx";function Dr({children:e,elementRef:t,containerRef:n,checked:r,icon:o,checkedIcon:i,disabled:a,onChange:s,id:l,type:c,containerClasses:u,...d}){const h=r?i:o;return Qe("label",{className:Xe("relative flex items-center gap-x-1.5",{"cursor-pointer":!a,"opacity-70":a},u),htmlFor:l,
|
|
98
98
|
"data-composite-component":"checkbox"===c?"Checkbox":"RadioButton",ref:n,children:[Qe("input",{...d,type:c,ref:t,className:Xe("peer","absolute w-em h-em","opacity-[.00001]",{"cursor-pointer":!a}),checked:r,disabled:a,id:l,onChange:s},void 0,0,{fileName:Pr,lineNumber:66,columnNumber:7},this),Qe(h,{className:Xe("peer-focus-visible:ring","w-em h-em")},void 0,0,{fileName:Pr,lineNumber:88,columnNumber:7},this),e]},void 0,0,{fileName:Pr,lineNumber:51,columnNumber:5},this)}var Hr="/home/runner/work/frontend-shared/frontend-shared/src/components/input/Checkbox.tsx";function Fr({checked:e,defaultChecked:t=!1,icon:n=It,checkedIcon:r=Ot,onChange:o,...i}){const a="boolean"==typeof e,[s,l]=oe(t);return Qe(Dr,{icon:n,checkedIcon:r,type:"checkbox",checked:a?e:s,onChange:function(e){null==o||o.call(this,e),a||l(e.target.checked)},...i},void 0,0,{fileName:Hr,lineNumber:65,columnNumber:5},this)}var jr="/home/runner/work/frontend-shared/frontend-shared/src/components/input/Input.tsx";function $r({classes:e,feedback:t}){
|
|
99
99
|
return Xe("focus-visible-ring ring-inset border rounded w-full p-2","bg-grey-0 focus:bg-white disabled:bg-grey-1","placeholder:text-grey-6 disabled:placeholder:text-grey-7","touch:text-at-least-16px",{"ring-2":!!t,"ring-red-error":"error"===t,"ring-yellow-notice":"warning"===t},br,e)}function Br({elementRef:e,type:t="text",classes:n,error:r,feedback:o,...i}){i.id||i["aria-label"]||console.warn("`Input` component should have either an `id` or an `aria-label` attribute");const a=Me(e);return r&&(o="error"),function(e,t){se((()=>{var n;null===(n=e.current)||void 0===n||n.setCustomValidity(null!=t?t:"")}),[t,e])}(a,r),Qe("input",{"data-component":"Input",...i,ref:a,type:t,className:$r({classes:n,feedback:o}),"aria-invalid":"error"===o},void 0,0,{fileName:jr,lineNumber:73,columnNumber:5},this)}const qr=F(null);var Ur="/home/runner/work/frontend-shared/frontend-shared/src/components/input/RadioGroup.tsx";function Gr({value:e,children:t,subtitle:n,disabled:r}){const o=de(qr)
|
|
100
|
-
;if(!o)throw new Error("RadioGroup.Radio can only be used as RadioGroup child");const{selected:i,disabled:a=r,onChange:s}=o,l=!a&&i===e;return Qe("div",{role:"radio","aria-checked":l,"aria-disabled":a,className:Xe("focus-visible-ring rounded-lg px-3 py-2 flex-1 group",{"bg-grey-3/
|
|
101
|
-
Gr.displayName="RadioGroup.Radio",Object.assign((function({direction:e="horizontal",children:t,selected:n,onChange:r,disabled:o,"aria-label":i,"aria-labelledby":a,name:s}){const l=le(null);return ke(l,{loop:!1,selector:'[role="radio"]:not([aria-disabled="true"])',focusElement:e=>{r(e.dataset.value),e.focus()}}),Qe(qr.Provider,{value:{selected:n,disabled:o,onChange:r},children:[Qe("div",{"aria-label":i,"aria-labelledby":a,ref:l,role:"radiogroup",className:Xe("w-full flex gap-1.5",{"flex-col":"vertical"===e}),children:t},void 0,0,{fileName:Ur,lineNumber:
|
|
102
|
-
;function Yr({anchorElementRef:e,children:t,open:n,onClose:r,align:o="left",
|
|
103
|
-
;const
|
|
104
|
-
"
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
"
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
"
|
|
114
|
-
"text-color-text
|
|
115
|
-
;
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
return
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
function
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
100
|
+
;if(!o)throw new Error("RadioGroup.Radio can only be used as RadioGroup child");const{selected:i,disabled:a=r,onChange:s}=o,l=!a&&i===e;return Qe("div",{role:"radio","aria-checked":l,"aria-disabled":a,className:Xe("focus-visible-ring rounded-lg px-3 py-2 flex-1 group",{"hover:bg-grey-3/25 aria-checked:bg-grey-3/50 cursor-pointer":!a,"opacity-70":a}),"data-value":e,onClick:a?void 0:()=>s(e),onKeyDown:a?void 0:t=>{["Enter"," "].includes(t.key)&&(t.preventDefault(),s(e))},tabIndex:-1,children:[Qe("div",{className:"flex items-center gap-x-1.5",children:[l?Qe(er,{},void 0,0,{fileName:Ur,lineNumber:67,columnNumber:23},this):Qe(Jn,{},void 0,0,{fileName:Ur,lineNumber:67,columnNumber:46},this),Qe("span",{className:Xe("flex items-center gap-x-1.5",{"text-grey-7 group-hover:text-grey-8 group-aria-checked:text-grey-8":!a}),children:t},void 0,0,{fileName:Ur,lineNumber:68,columnNumber:9},this)]},void 0,0,{fileName:Ur,lineNumber:66,columnNumber:7},this),n&&Qe("div",{className:Xe("pl-4 ml-1.5 mt-1 text-sm",{
|
|
101
|
+
"text-grey-6 group-hover:text-grey-7 group-aria-checked:text-grey-7":!a}),children:n},void 0,0,{fileName:Ur,lineNumber:78,columnNumber:9},this)]},void 0,0,{fileName:Ur,lineNumber:40,columnNumber:5},this)}Gr.displayName="RadioGroup.Radio",Object.assign((function({direction:e="horizontal",children:t,selected:n,onChange:r,disabled:o,"aria-label":i,"aria-labelledby":a,name:s}){const l=le(null);return ke(l,{loop:!1,selector:'[role="radio"]:not([aria-disabled="true"])',focusElement:e=>{r(e.dataset.value),e.focus()}}),Qe(qr.Provider,{value:{selected:n,disabled:o,onChange:r},children:[Qe("div",{"aria-label":i,"aria-labelledby":a,ref:l,role:"radiogroup",className:Xe("w-full flex gap-1.5",{"flex-col":"vertical"===e}),children:t},void 0,0,{fileName:Ur,lineNumber:140,columnNumber:7},this),s&&Qe("input",{type:"hidden","data-testid":"hidden-input",name:s,value:n,disabled:o},void 0,0,{fileName:Ur,lineNumber:152,columnNumber:9},this)]},void 0,0,{fileName:Ur,lineNumber:137,columnNumber:5},this)}),{Radio:Gr,
|
|
102
|
+
displayName:"RadioGroup"});var Vr="/home/runner/work/frontend-shared/frontend-shared/src/components/feedback/Popover.tsx";const Wr=3,Kr=8;function Yr({anchorElementRef:e,children:t,open:n,onClose:r,align:o="left",placement:i="below",arrow:a=!1,classes:s,variant:l="panel",onScroll:c,elementRef:u,asNativePopover:d=HTMLElement.prototype.hasOwnProperty("popover")}){const h=Me(u),m=function(e,t,{open:n,asNativePopover:r,alignToRight:o,placement:i,arrow:a}){const[s,l]=oe(i),c=ue((()=>{const n=e.current,s=t.current,c=e=>{Object.assign(n.style,e);const t=Object.keys(e);return()=>t.map((e=>n.style[e]=""))},u=window.innerHeight,{top:d,bottom:h,left:m,height:p,width:f}=s.getBoundingClientRect(),g=u-h,{height:v,width:b}=n.getBoundingClientRect(),y="above"===i&&(d>v||g<d)||"below"===i&&g<v&&d>g;l(y?"above":"below");const _=a?Wr+8:Wr;if(!r)return c(y?{bottom:"100%",marginBottom:`${_}px`}:{top:"100%",marginTop:`${_}px`});const{top:w,width:x}=document.body.getBoundingClientRect(),k=Math.abs(w),N=(o?m+f:x-m)-Kr;let S=m
|
|
103
|
+
;return b>N?S=o?Kr:S-(b-N):o&&b>f&&(S-=b-f),c({minWidth:`${f}px`,top:y?k+d-v-_+"px":`${k+d+p+_}px`,left:`${Math.max(Kr,S)}px`})}),[e,t,i,a,r,o]);return se((()=>{if(!n)return()=>{};const t=e.current;r&&t.togglePopover(!0);const o=c();if(!r)return o;const i=new we;i.add(document.body,"scroll",c,{capture:!0});const a=new ResizeObserver(c);return a.observe(t),()=>{r&&(null==t||t.togglePopover(!1)),o(),i.removeAll(),a.disconnect()}}),[c,r,n,e]),s}(h,e,{open:n,placement:i,arrow:a,alignToRight:"right"===o,asNativePopover:d});return function(e,t,n,r,o){ae((()=>{if(!o)return()=>{};const t=e.current,r=e=>{"open"===e.oldState&&"closed"===e.newState&&n()};return t.addEventListener("toggle",r),()=>t.removeEventListener("toggle",r)}),[o,n,e]);const i=r&&!o;Ne(e,(e=>{e.composedPath().includes(t.current)||n()}),{enabled:i}),Ae(["Escape"],n,{enabled:i})}(h,e,r,n,d),function({popoverRef:e,open:t}){se((()=>{const n=e.current,r=t?document.activeElement:null;return n&&r?()=>{const e=document.activeElement
|
|
104
|
+
;e&&!n.contains(e)&&e!==document.body||r.focus()}:()=>{}}),[e,t])}({open:n,popoverRef:h}),Qe("div",{className:Xe("absolute z-5","panel"===l&&["max-h-80 ","rounded border bg-white shadow hover:shadow-md focus-within:shadow-md",!a&&"overflow-y-auto overflow-x-hidden"],a&&"overflow-visible",d&&["max-w-[calc(100%-16px)]","p-0 m-0"],!d&&{hidden:!n,"right-0":"right"===o,"min-w-full":!0},s),ref:h,popover:d&&"auto",onScroll:c,"data-testid":"popover","data-component":"Popover",children:[n&&a&&Qe("div",{className:Xe("absolute z-10","fill-white text-grey-3",{"top-full":"above"===m,"bottom-full":"below"===m,"left-2":"left"===o,"right-2":"right"===o}),"data-testid":"arrow",children:"below"===m?Qe(Kn,{},void 0,0,{fileName:Vr,lineNumber:457,columnNumber:13},this):Qe(Vn,{},void 0,0,{fileName:Vr,lineNumber:459,columnNumber:13},this)},void 0,0,{fileName:Vr,lineNumber:447,columnNumber:9},this),n&&t]},void 0,0,{fileName:Vr,lineNumber:415,columnNumber:5},this)}const Xr=F(null)
|
|
105
|
+
;var Zr="/home/runner/work/frontend-shared/frontend-shared/src/components/input/Select.tsx";function Jr(e,t){return"function"==typeof e?e(t):e}function Qr({value:e,children:t,disabled:n=!1,classes:r,elementRef:o,title:i}){const a=le(null),s=le(null),l=Me(o),c=e=>e.target===a.current||e.target===s.current,u=de(Xr);if(!u)throw new Error("Select.Option can only be used as Select or MultiSelect child");const{selectValue:d,value:h,multiple:m}=u,p=ce((()=>!n&&(m?h.includes(e)||0===h.length&&void 0===e:h===e)),[h,n,m,e]),f=ue((()=>{const t={closeListbox:!0};d(m?void 0!==e?[e]:[]:e,t)}),[m,d,e]),g=ue((()=>{if(!m)return;const t={closeListbox:void 0===e};if(void 0===e)return void d([],t);const n=h.indexOf(e);if(-1===n)d([...h,e],t);else{const e=[...h];e.splice(n,1),d(e,t)}}),[h,m,d,e]);return Qe("li",{className:Xe("w-full ring-inset outline-none rounded-none select-none","px-1 mb-1 first:mt-1 whitespace-nowrap group",{"text-grey-4":n,"cursor-pointer":!n},r),onClick:e=>{n||c(e)||f()},onKeyDown:e=>{
|
|
106
|
+
n||(["Enter"," "].includes(e.key)&&!c(e)?(e.preventDefault(),f()):a.current&&"ArrowRight"===e.key&&(e.preventDefault(),a.current.focus()))},role:"option","aria-disabled":n,"aria-selected":p,tabIndex:p?0:-1,ref:l,title:i,children:Qe("div",{className:Xe("flex justify-between items-center","w-full rounded",{"hover:bg-grey-1 group-focus-visible:ring":!n,"bg-grey-1 hover:bg-grey-2":p}),children:[Qe("div",{className:Xe("py-2 pl-3",{truncate:"truncate"===u.listboxOverflow,"whitespace-normal":"wrap"===u.listboxOverflow}),children:Jr(t,{selected:p,disabled:n})},void 0,0,{fileName:Zr,lineNumber:203,columnNumber:9},this),!m&&Qe("div",{className:"px-3",children:Qe(Ct,{className:Xe("text-grey-6 scale-125",{"opacity-0":!p})},void 0,0,{fileName:Zr,lineNumber:213,columnNumber:13},this)},void 0,0,{fileName:Zr,lineNumber:212,columnNumber:11},this),m&&Qe(Fr,{containerClasses:Xe("self-stretch px-3","text-lg",{"text-grey-6":p,"text-grey-3 hover:text-grey-6":!p}),checked:p,checkedIcon:Ot,elementRef:a,containerRef:s,onChange:g,
|
|
107
|
+
onKeyDown:e=>{var t;"ArrowLeft"===e.key&&(e.preventDefault(),null===(t=l.current)||void 0===t||t.focus())}},void 0,0,{fileName:Zr,lineNumber:224,columnNumber:11},this)]},void 0,0,{fileName:Zr,lineNumber:193,columnNumber:7},this)},void 0,0,{fileName:Zr,lineNumber:146,columnNumber:5},this)}function eo({buttonContent:e,value:t,onChange:n,children:r,disabled:o,elementRef:i,buttonId:a,buttonClasses:s,popoverClasses:l,containerClasses:c,onPopoverScroll:u,alignListbox:d="left",multiple:h,listboxOverflow:m="truncate","aria-label":p,"aria-labelledby":f,listboxAsPopover:g}){const v=le(null),b=le(null),[y,_]=oe(!1),w=ue((()=>_(!1)),[_]),x=he(),k=Me(i),N=he(),S=ue(((e,t)=>{n(e),t.closeListbox&&w()}),[n,w]);return Se(v,w),ke(b,{horizontal:!1,loop:!1,autofocus:!0,containerVisible:y,selector:'[role="option"]:not([aria-disabled="true"])'}),Qe("div",{className:Xe("relative w-full border rounded",{"border-grey-5":y},br,c),ref:v,children:[Qe("button",{id:null!=a?a:N,
|
|
108
|
+
className:Xe("focus-visible-ring transition-colors whitespace-nowrap","w-full flex items-center justify-between gap-x-2","bg-grey-0 disabled:bg-grey-1 disabled:text-grey-6","text-left","rounded-[inherit]",s),type:"button",role:"combobox",disabled:o,"aria-expanded":y,"aria-haspopup":"listbox","aria-controls":x,"aria-label":p,"aria-labelledby":f,ref:k,onClick:()=>_((e=>!e)),onKeyDown:e=>{"ArrowDown"!==e.key||y||(e.preventDefault(),_(!0))},"data-testid":"select-toggle-button",children:[Qe("div",{className:"pl-2 py-2 truncate grow",children:e},void 0,0,{fileName:Zr,lineNumber:429,columnNumber:9},this),Qe("div",{className:"pr-2 py-2 text-grey-6",children:y?Qe(Hn,{},void 0,0,{fileName:Zr,lineNumber:431,columnNumber:26},this):Qe(jn,{},void 0,0,{fileName:Zr,lineNumber:431,columnNumber:49},this)},void 0,0,{fileName:Zr,lineNumber:430,columnNumber:9},this)]},void 0,0,{fileName:Zr,lineNumber:396,columnNumber:7},this),Qe(Xr.Provider,{value:{value:t,selectValue:S,multiple:h,listboxOverflow:m},children:Qe(Yr,{
|
|
109
|
+
anchorElementRef:v,open:y,onClose:w,asNativePopover:g,align:d,classes:l,onScroll:u,children:Qe("ul",{role:"listbox",id:x,ref:b,"aria-multiselectable":h,"aria-labelledby":null!=a?a:N,"aria-orientation":"vertical",children:r},void 0,0,{fileName:Zr,lineNumber:453,columnNumber:11},this)},void 0,0,{fileName:Zr,lineNumber:444,columnNumber:9},this)},void 0,0,{fileName:Zr,lineNumber:435,columnNumber:7},this)]},void 0,0,{fileName:Zr,lineNumber:387,columnNumber:5},this)}Qr.displayName="Select.Option";const to=Object.assign((function(e){return eo({...e,multiple:!1})}),{Option:Qr,displayName:"Select"});Object.assign((function(e){return eo({...e,multiple:!0})}),{Option:Qr,displayName:"MultiSelect"}),F({}),F(null);var no="/home/runner/work/frontend-shared/frontend-shared/src/components/feedback/Spinner.tsx";function ro({size:e="sm",color:t="text-light"}){return Qe(hr,{className:Xe({"text-color-text-light":"text-light"===t,"text-color-text":"text"===t,"text-color-text-inverted":"text-inverted"===t},{"w-em h-em":"sm"===e,
|
|
110
|
+
"w-2em h-2em":"md"===e,"w-4em h-4em":"lg"===e}),"data-component":"Spinner"},void 0,0,{fileName:no,lineNumber:18,columnNumber:5},this)}var oo="/home/runner/work/frontend-shared/frontend-shared/src/components/feedback/Callout.tsx";function io({children:e,classes:t,elementRef:n,icon:r,status:o="notice",size:i="md",variant:a="outlined",unstyled:s=!1,...l}){const c=!s,u=c&&"custom"!==a,d=c&&"custom"!==i;let h=r;if(!h)switch(o){case"success":h=Ct;break;case"error":h=yt;break;default:h=kt}const m=u&&d;return Qe("div",{"data-component":"Callout",...l,ref:n,className:Xe(c&&"flex items-center border",u&&{"rounded border":!0,"shadow hover:shadow-md cursor-pointer":"raised"===a,"border-yellow-notice":"notice"===o,"border-green-success":"success"===o,"border-red-error":"error"===o},u&&{"bg-yellow-notice":"notice"===o&&m,"bg-green-success":"success"===o&&m,"bg-red-error":"error"===o&&m,"bg-white":!m},t),children:[m&&Qe("div",{className:Xe({"p-2":"md"===i,"p-1.5":"sm"===i,"p-3":"lg"===i}),children:Qe(h,{
|
|
111
|
+
"data-testid":"callout-icon",className:Xe("text-white",{"w-[1.25em] h-[1.25em]":"md"===i,"w-[0.85em] h-[0.85em]":"sm"===i,"w-[1.5em] h-[1.5em]":"lg"===i})},void 0,0,{fileName:oo,lineNumber:95,columnNumber:11},this)},void 0,0,{fileName:oo,lineNumber:88,columnNumber:9},this),Qe("div",{className:Xe(d&&{"p-2":"md"===i,"py-1.5 px-2":"sm"===i,"p-3":"lg"===i},c&&"grow",u&&"bg-white rounded-r"),children:e},void 0,0,{fileName:oo,lineNumber:105,columnNumber:7},this)]},void 0,0,{fileName:oo,lineNumber:64,columnNumber:5},this)}var ao="/home/runner/work/frontend-shared/frontend-shared/src/components/feedback/ToastMessages.tsx";function so({message:e,onDismiss:t}){return Qe(io,{classes:Xe({"sr-only":e.visuallyHidden}),status:e.type,onClick:()=>t(e.id),variant:"raised",children:e.message},void 0,0,{fileName:ao,lineNumber:55,columnNumber:5},this)}const lo=({direction:e,onTransitionEnd:t,children:n,transitionClasses:r={}})=>{const o="out"===e,i=le(null),a=ce((()=>{
|
|
112
|
+
const{transitionIn:e="animate-fade-in",transitionOut:t="animate-fade-out"}=r;return{[e]:!o,[t]:o}}),[o,r]);return Qe("div",{"data-testid":"animation-container",onAnimationEnd:n=>{n.target===i.current&&(null==t||t(null!=e?e:"in"))},ref:i,className:Xe("relative w-full container",a),children:n},void 0,0,{fileName:ao,lineNumber:103,columnNumber:5},void 0)};function co({messages:e,onMessageDismiss:t,transitionClasses:n,setTimeout_:r=setTimeout}){const[o,i]=oe([]),a=le(new Map),s=ue((e=>i((t=>[...t,e]))),[]),l=ue((e=>{const t=r((()=>{s(e),a.current.delete(e)}),5e3);a.current.set(e,t)}),[s,r]),c=ue(((e,n)=>{var r;const o=null===(r=n.autoDismiss)||void 0===r||r;"in"===e&&o&&l(n.id),"out"===e&&(t(n.id),i((e=>e.filter((e=>e!==n.id)))))}),[l,t]);return se((()=>{const e=a.current;return()=>{e.forEach((e=>clearTimeout(e)))}}),[]),Qe("ul",{"aria-live":"polite","aria-relevant":"additions",className:"w-full space-y-2","data-component":"ToastMessages",children:e.map((e=>{const t=o.includes(e.id);return Qe("li",{className:Xe({
|
|
113
|
+
"mb-2":!e.visuallyHidden}),children:Qe(lo,{direction:t?"out":"in",onTransitionEnd:t=>c(t,e),transitionClasses:n,children:Qe(so,{message:e,onDismiss:s},void 0,0,{fileName:ao,lineNumber:206,columnNumber:15},this)},void 0,0,{fileName:ao,lineNumber:201,columnNumber:13},this)},e.id,0,{fileName:ao,lineNumber:189,columnNumber:11},this)}))},void 0,0,{fileName:ao,lineNumber:180,columnNumber:5},this)}var uo="/home/runner/work/frontend-shared/frontend-shared/src/components/navigation/Link.tsx";function ho({children:e,classes:t,elementRef:n,underline:r="none",unstyled:o=!1,variant:i="brand",...a}){const s=!o;return Qe("a",{"data-component":"Link",rel:"noopener noreferrer",...a,className:Xe(s&&{"focus-visible-ring rounded":!0,"no-underline hover:no-underline":"none"===r,"underline hover:underline":"always"===r,"no-underline hover:underline":"hover"===r},s&&"custom"!==i&&{"text-brand hover:text-brand-dark":"brand"===i,"text-color-text-light hover:text-brand":"text-light"===i,
|
|
114
|
+
"text-color-text hover:text-brand-dark":"text"===i},t),ref:n,children:e},void 0,0,{fileName:uo,lineNumber:37,columnNumber:5},this)}var mo="/home/runner/work/frontend-shared/frontend-shared/src/components/navigation/LinkButton.tsx";function po({children:e,classes:t,elementRef:n,inline:r=!1,underline:o="none",variant:i="brand",unstyled:a=!1,...s}){const l=!a;return Qe(gr,{"data-component":"LinkButton",...s,elementRef:n,classes:Xe(l&&{"focus-visible-ring transition-colors whitespace-nowrap rounded":!0,inline:r,"flex items-center":!r},l&&{"no-underline hover:no-underline":"none"===o,"underline enabled:hover:underline":"always"===o,"no-underline enabled:hover:underline":"hover"===o},l&&"custom"!==i&&{"aria-pressed:font-semibold aria-expanded:font-semibold":!0,"text-brand enabled:hover:text-brand-dark":"brand"===i,"text-color-text enabled:hover:text-brand-dark":"text"===i,"text-color-text-light enabled:hover:text-brand":"text-light"===i},t),unstyled:!0,children:e},void 0,0,{fileName:mo,lineNumber:40,columnNumber:5
|
|
115
|
+
},this)}var fo="/home/runner/work/frontend-shared/frontend-shared/src/components/navigation/Pagination.tsx";function go({children:e,invisible:t=!1,pressed:n=!1,onClick:r,title:o}){return Qe(gr,{classes:Xe("px-3.5 py-2.5 gap-x-1","font-semibold rounded","text-grey-7 enabled:hover:text-grey-9 enabled:hover:bg-grey-3","disabled:text-grey-5 aria-pressed:bg-grey-3 aria-expanded:bg-grey-3",t&&"invisible"),disabled:t,onClick:r,pressed:n,size:"custom",title:o,variant:"custom",children:e},void 0,0,{fileName:fo,lineNumber:24,columnNumber:5},this)}function vo({currentPage:e,onChangePage:t,totalPages:n}){const r=e<n,o=e>1,i=function(e,t,{boundaryCount:n=1,siblingCount:r=1}={}){if(t<=1)return[];const o=[],i=t-(e=Math.max(1,Math.min(e,t)));let a=null;if((n=Math.max(n,1))+(r=Math.max(r,0))<e-1){for(let e=1;e<=n;e++)o.push(e);a={index:o.length,count:e-r-n,value:e-r-1},o.push(null);for(let t=e-r;t<e;t++)o.push(t)}else for(let t=1;t<e;t++)o.push(t);o.push(e);let s=null;if(n+r<i){for(let t=e+1;t<=e+r;t++)o.push(t);s={
|
|
116
|
+
index:o.length,count:t-n+1-(e+r),value:e+r+1},o.push(null);for(let e=t-n+1;e<=t;e++)o.push(e)}else for(let n=e+1;n<=t;n++)o.push(n);const l=Math.min(2*n+2*r+3,t);for(;o.length<l&&(null!==(c=s)&&void 0!==c&&c.count||null!==(u=a)&&void 0!==u&&u.count);){var c,u;s&&s.count>0?(o.splice(s.index,0,s.value),++s.index,++s.value,--s.count):a&&(o.splice(a.index+1,0,a.value),--a.value,--a.count)}return o}(e,n),a=(e,n)=>{t(e),n.blur()};return Qe("div",{className:"flex items-center text-md select-none","data-testid":"pagination-navigation",children:[Qe("div",{className:"mr-2",children:Qe(go,{invisible:!o,title:"Go to previous page",onClick:t=>a(e-1,t.target),children:[Qe(ft,{},void 0,0,{fileName:fo,lineNumber:100,columnNumber:11},this),"prev"]},void 0,0,{fileName:fo,lineNumber:95,columnNumber:9},this)},void 0,0,{fileName:fo,lineNumber:94,columnNumber:7},this),Qe("ul",{className:Xe("hidden","md:flex md:items-center md:justify-center md:gap-x-2","md:grow"),children:i.map(((t,n)=>Qe("li",{children:null===t?Qe("div",{
|
|
117
|
+
className:"px-3 text-center","data-testid":"pagination-gap",children:"…"},void 0,0,{fileName:fo,lineNumber:130,columnNumber:15},this):Qe(go,{title:`Go to page ${t}`,pressed:t===e,onClick:e=>a(t,e.target),children:t.toString()},`page-${n}`,0,{fileName:fo,lineNumber:134,columnNumber:15},this)},n,0,{fileName:fo,lineNumber:122,columnNumber:11},this)))},void 0,0,{fileName:fo,lineNumber:104,columnNumber:7},this),Qe("div",{className:Xe("ml-2 flex justify-end","grow md:grow-0"),children:Qe(go,{invisible:!r,title:"Go to next page",onClick:t=>a(e+1,t.target),children:["next",Qe(vt,{},void 0,0,{fileName:fo,lineNumber:160,columnNumber:11},this)]},void 0,0,{fileName:fo,lineNumber:154,columnNumber:9},this)},void 0,0,{fileName:fo,lineNumber:146,columnNumber:7},this)]},void 0,0,{fileName:fo,lineNumber:90,columnNumber:5},this)}var bo="/home/runner/work/frontend-shared/frontend-shared/src/components/navigation/Tab.tsx"
|
|
118
|
+
;function yo({children:e,classes:t,elementRef:n,icon:r,textContent:o,selected:i=!1,size:a="md",variant:s="text",unstyled:l=!1,...c}){const u=!l,d=u&&"custom"!==a;return Qe(gr,{"data-component":"Tab",...c,classes:Xe(d&&"gap-x-1.5",u&&"custom"!==s&&{"px-4 py-2":"tab"===s&&d,"font-semibold text-grey-7 rounded-t-lg border border-transparent border-b-0":"tab"===s,"aria-selected:text-color-text aria-selected:bg-white":"tab"===s,"aria-selected:border aria-selected:border-grey-3 aria-selected:border-b-0":"tab"===s,"enabled:hover:text-color-text disabled:text-grey-7/50":"tab"===s,"enabled:hover:text-brand-dark":"text"===s,"aria-selected:font-bold":"text"===s},t),elementRef:n,"aria-selected":i,role:"tab",variant:"custom",size:"custom",unstyled:l,children:[r&&Qe(r,{className:Xe("p-[0.125em] w-em h-em")},void 0,0,{fileName:bo,lineNumber:79,columnNumber:9},this),Qe("span",{"data-content":o,"data-testid":"sizing-wrapper",className:Xe({"before:content-[attr(data-content)] before:font-bold":o,
|
|
119
|
+
"before:block before:invisible before:h-0 before:overflow-hidden":o}),children:e},void 0,0,{fileName:bo,lineNumber:87,columnNumber:7},this)]},void 0,0,{fileName:bo,lineNumber:50,columnNumber:5},this)}var _o="/home/runner/work/frontend-shared/frontend-shared/src/components/navigation/TabList.tsx";function wo({children:e,classes:t,elementRef:n,vertical:r=!1,...o}){const i=Me(n);return ke(i,{selector:"button",horizontal:!0,vertical:r}),Qe("div",{"data-component":"TabList",...o,ref:i,className:Xe("flex focus-visible-ring",{"flex-col":r},t),role:"tablist","aria-orientation":r?"vertical":"horizontal",children:e},void 0,0,{fileName:_o,lineNumber:45,columnNumber:5},this)}const xo=({children:e,direction:t="in",onTransitionEnd:n})=>{const r="in"===t,o=le(null),[i,a]=oe(r?"auto":0),[s,l]=oe(r);ae((()=>{if(r===(0!==i))return;const e=o.current;r?(e.style.display="",l(!0),a(e.scrollHeight)):(e.style.height=`${e.scrollHeight}px`,e.getBoundingClientRect(),a(0))}),[i,r]);const c=ue((e=>{
|
|
120
|
+
e.target===o.current&&"height"===e.propertyName&&(r?a("auto"):l(!1),null==n||n(t))}),[a,r,n,t]);return Qe("div",{ontransitionend:c,ref:o,style:{display:s?"":"none",height:i,overflow:"auto"===i?"visible":"hidden",transition:"height 0.15s ease-in"},children:e},void 0,0,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/transition/Slider.tsx",lineNumber:80,columnNumber:5},void 0)};function ko({services:e}){return Array.isArray(e)&&e[0]?e[0]:null}function No(e){const t=ko(e);return!!t?.authority&&t.authority!==e.authDomain}const So={accentColor:"color",appBackgroundColor:"backgroundColor",ctaBackgroundColor:"backgroundColor",ctaTextColor:"color",selectionFontFamily:"fontFamily",annotationFontFamily:"fontFamily"};function Ao(e,t){const n={};if(!t.branding)return n;const{branding:r}=t;return e.forEach((e=>{const t=So[e],o=r[e];t&&o&&(n[t]=o)})),n}const To=F({get(e){throw new Error(`Missing ServiceContext provider to provide "${e}" prop`)}});function Eo(e,t){function n(n){const r=de(To),o={}
|
|
121
|
+
;for(const e of t)e in n||(o[e]=r.get(e));const i={...o,...n};return Qe(e,{...i})}const r=e.displayName||e.name;return n.displayName=`withServices(${r})`,n}function Co(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Mo=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),Io=()=>Math.random().toString(36).substring(7).split("").join("."),zo={INIT:`@@redux/INIT${Io()}`,REPLACE:`@@redux/REPLACE${Io()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Io()}`};function Oo(e,t,n){if("function"!=typeof e)throw new Error(Co(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Co(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Co(1));return n(Oo)(e,t)}let r=e,o=t,i=new Map,a=i,s=0,l=!1;function c(){a===i&&(a=new Map,i.forEach(((e,t)=>{a.set(t,e)})))}
|
|
122
|
+
function u(){if(l)throw new Error(Co(3));return o}function d(e){if("function"!=typeof e)throw new Error(Co(4));if(l)throw new Error(Co(5));let t=!0;c();const n=s++;return a.set(n,e),function(){if(t){if(l)throw new Error(Co(6));t=!1,c(),a.delete(n),i=null}}}function h(e){if(!function(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}(e))throw new Error(Co(7));if(void 0===e.type)throw new Error(Co(8));if("string"!=typeof e.type)throw new Error(Co(17));if(l)throw new Error(Co(9));try{l=!0,o=r(o,e)}finally{l=!1}return(i=a).forEach((e=>{e()})),e}h({type:zo.INIT});return{dispatch:h,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(Co(10));r=e,h({type:zo.REPLACE})},[Mo]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(Co(11));function n(){const e=t;e.next&&e.next(u())}n();return{unsubscribe:e(n)}},
|
|
123
|
+
[Mo](){return this}}}}}function Lo(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}const r=Object.keys(n);let o;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:zo.INIT}))throw new Error(Co(12));if(void 0===n(void 0,{type:zo.PROBE_UNKNOWN_ACTION()}))throw new Error(Co(13))}))}(n)}catch(e){o=e}return function(e={},t){if(o)throw o;let i=!1;const a={};for(let o=0;o<r.length;o++){const s=r[o],l=n[s],c=e[s],u=l(c,t);if(void 0===u)throw t&&t.type,new Error(Co(14));a[s]=u,i=i||u!==c}return i=i||r.length!==Object.keys(e).length,i?a:e}}function Ro(e,t){return function(...n){return t(e.apply(this,n))}}var Po,Do=({dispatch:e,getState:t})=>n=>r=>"function"==typeof r?r(e,t,Po):n(r);function Ho(e){return(t={},n)=>{const r=e[n.type];if(!r)return t;const o=r(t,n);return{...t,...o}}}function Fo(e,t){const n={};for(const[r,o]of Object.entries(e))n[r]=(...e)=>o(t(),...e);return n}function jo(e,t){return Object.assign(e,t)}
|
|
124
|
+
function $o(e,t=[],n=[]){const r={};for(const n of e)r[n.namespace]=n.initialState(...t);const o={};for(const t of e)o[t.namespace]=Ho(t.reducers);const i=function(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error(Co(15))};const a={getState:o.getState,dispatch:(e,...t)=>i(e,...t)},s=e.map((e=>e(a)));return i=function(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}(...s)(o.dispatch),{...o,dispatch:i}}}(...[Do],...n);const a=Oo(Lo(o),r,i),s={};for(const t of e)jo(s,t.actionCreators);const l=function(e,t){if("function"==typeof e)return Ro(e,t);if("object"!=typeof e||null===e)throw new Error(Co(16));const n={};for(const r in e){const o=e[r];"function"==typeof o&&(n[r]=Ro(o,t))}return n}(s,a.dispatch);Object.assign(a,l);const c={};for(const t of e){const{namespace:e,selectors:n,rootSelectors:r}=t;if(jo(c,Fo(n,(()=>a.getState()[e]))),r){jo(c,Fo(r,a.getState))}}return Object.assign(a,c),a}function Bo(e,t,n){
|
|
125
|
+
if(n&&"type"in n)throw new Error("Payload cannot contain a `type` field");return{type:t,...n}}function qo(e,t){if(!(e instanceof Function)){const t=e;e=()=>t}return{initialState:e,...t}}function Uo(e){let t=0;return n=>r=>{if(!window.debug)return void n(r);++t;const o=r.type+" ("+t.toString()+")";console.group(o),console.log("Prev State:",e.getState()),console.log("Action:",r),n(r),console.log("Next State:",e.getState()),console.groupEnd()}}const Go={API_REQUEST_STARTED:e=>({...e,activeApiRequests:e.activeApiRequests+1}),API_REQUEST_FINISHED(e){if(0===e.activeApiRequests)throw new Error("API_REQUEST_FINISHED action when no requests were active");return{...e,activeApiRequests:e.activeApiRequests-1}},ANNOTATION_SAVE_STARTED(e,t){const n=[];t.annotation.$tag&&!e.activeAnnotationSaveRequests.includes(t.annotation.$tag)&&n.push(t.annotation.$tag);const r=e.activeAnnotationSaveRequests.concat(n);return{...e,activeAnnotationSaveRequests:r}},ANNOTATION_SAVE_FINISHED(e,t){
|
|
126
|
+
const n=e.activeAnnotationSaveRequests.filter((e=>e!==t.annotation.$tag));return{...e,activeAnnotationSaveRequests:n}},ANNOTATION_FETCH_STARTED:e=>({...e,activeAnnotationFetches:e.activeAnnotationFetches+1}),ANNOTATION_FETCH_FINISHED(e){if(0===e.activeAnnotationFetches)throw new Error("ANNOTATION_FETCH_FINISHED action when no annotation fetches were active");return{...e,hasFetchedAnnotations:!0,activeAnnotationFetches:e.activeAnnotationFetches-1}},SET_ANNOTATION_RESULT_COUNT:(e,t)=>({annotationResultCount:t.resultCount}),BEGIN_IMPORT:(e,t)=>({importsPending:e.importsPending+t.count,importsTotal:e.importsTotal+t.count}),COMPLETE_IMPORT(e,t){if(!e.importsPending)return e;const n=Math.max(e.importsPending-t.count,0);return{importsPending:n,importsTotal:n>0?e.importsTotal:0}}};const Vo=qo({activeAnnotationSaveRequests:[],activeApiRequests:0,activeAnnotationFetches:0,hasFetchedAnnotations:!1,annotationResultCount:null,importsPending:0,importsTotal:0},{reducers:Go,namespace:"activity",actionCreators:{
|
|
127
|
+
annotationFetchStarted:function(){return Bo(0,"ANNOTATION_FETCH_STARTED",void 0)},annotationFetchFinished:function(){return Bo(0,"ANNOTATION_FETCH_FINISHED",void 0)},annotationSaveStarted:function(e){return Bo(0,"ANNOTATION_SAVE_STARTED",{annotation:e})},annotationSaveFinished:function(e){return Bo(0,"ANNOTATION_SAVE_FINISHED",{annotation:e})},apiRequestStarted:function(){return Bo(0,"API_REQUEST_STARTED",void 0)},apiRequestFinished:function(){return Bo(0,"API_REQUEST_FINISHED",void 0)},beginImport:function(e){return Bo(0,"BEGIN_IMPORT",{count:e})},completeImport:function(e){return Bo(0,"COMPLETE_IMPORT",{count:e})},setAnnotationResultCount:function(e){return Bo(0,"SET_ANNOTATION_RESULT_COUNT",{resultCount:e})}},selectors:{hasFetchedAnnotations:function(e){return e.hasFetchedAnnotations},importsPending:function(e){return e.importsPending},importsTotal:function(e){return e.importsTotal},isLoading:function(e){return e.activeApiRequests>0||!e.hasFetchedAnnotations},isFetchingAnnotations:function(e){
|
|
128
|
+
return e.activeAnnotationFetches>0},isSavingAnnotation:function(e,t){return!!t.$tag&&e.activeAnnotationSaveRequests.includes(t.$tag)},annotationResultCount:function(e){return e.annotationResultCount}}});var Wo=Symbol("NOT_FOUND");var Ko=e=>Array.isArray(e)?e:[e];function Yo(e){const t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every((e=>"function"==typeof e))){const n=e.map((e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e)).join(", ");throw new TypeError(`${t}[${n}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}var Xo=(e,t)=>e===t;var Zo="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}},Jo=0,Qo=1;function ei(){return{s:Jo,v:void 0,o:null,p:null}}function ti(e,t={}){let n=ei();const{resultEqualityCheck:r}=t;let o,i=0;function a(){let t=n;const{length:a}=arguments;for(let e=0,n=a;e<n;e++){
|
|
129
|
+
const n=arguments[e];if("function"==typeof n||"object"==typeof n&&null!==n){let e=t.o;null===e&&(t.o=e=new WeakMap);const r=e.get(n);void 0===r?(t=ei(),e.set(n,t)):t=r}else{let e=t.p;null===e&&(t.p=e=new Map);const r=e.get(n);void 0===r?(t=ei(),e.set(n,t)):t=r}}const s=t;let l;if(t.s===Qo)l=t.v;else if(l=e.apply(null,arguments),i++,r){const e=o?.deref?.()??o;null!=e&&r(e,l)&&(l=e,0!==i&&i--);o="object"==typeof l&&null!==l||"function"==typeof l?new Zo(l):l}return s.s=Qo,s.v=l,l}return a.clearCache=()=>{n=ei(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function ni(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t,r=0,o=0,i={},a=e.pop();"object"==typeof a&&(i=a,a=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);const s={...n,...i
|
|
130
|
+
},{memoize:l,memoizeOptions:c=[],argsMemoize:u=ti,argsMemoizeOptions:d=[]}=s,h=Ko(c),m=Ko(d),p=Yo(e),f=l((function(){return r++,a.apply(null,arguments)}),...h),g=u((function(){o++;const e=function(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}(p,arguments);return t=f.apply(null,e),t}),...m);return Object.assign(g,{resultFunc:a,memoizedResultFunc:f,dependencies:p,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>t,recomputations:()=>r,resetRecomputations:()=>{r=0},memoize:l,argsMemoize:u})};return Object.assign(r,{withTypes:()=>r}),r}var ri=ni(ti),oi=Object.assign(((e,t=ri)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const n=Object.keys(e);return t(n.map((t=>e[t])),((...e)=>e.reduce(((e,t,r)=>(e[n[r]]=t,e)),{})))}),{withTypes:()=>oi})
|
|
131
|
+
;function ii(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ai(e){if(!e)return null;const t=e.match(/^acct:([^@]+)@(.+)/);return t?{username:t[1],provider:t[2]}:null}function si(e){const t=ai(e);return t?t.username:""}function li(e,t){const n=ai(e);return!!n&&n.provider!==t}function ci(e){return(e.references||[]).length>0}function ui(e){return!!e.id}function di(e){return!e.id}function hi(e){return!!(e.target&&e.target.length>0&&e.target[0].selector)}function mi(e){return hi(e)&&void 0===e.$orphan&&!e.$anchorTimeout}function pi(e){return!!e.hidden}function fi(e){return!(!("$highlight"in e)||!e.$highlight)||!di(e)&&!(vi(e)||ci(e)||e.hidden||e.text||e.tags&&e.tags.length)}function gi(e){return hi(e)&&!0===e.$orphan}function vi(e){return!hi(e)&&!ci(e)}function bi(e){return!(!hi(e)||gi(e))}function yi(e){return ci(e)?"Reply":fi(e)?"Highlight":vi(e)?"Page note":"Annotation"}function _i(e){const t=e.target[0];if(!t?.selector)return{};let n,r,o,i;for(const e of t.selector)switch(e.type){
|
|
132
|
+
case"TextPositionSelector":r=e.start;break;case"EPUBContentSelector":n=e.cfi;break;case"PageSelector":o=e.index;break;case"ShapeSelector":i=wi(e)}return{cfi:n,charOffset:r,pageIndex:o,top:i}}function wi(e){const t=e.view?.top??0;switch(e.shape.type){case"rect":return Math.abs(t-e.shape.top);case"point":return Math.abs(t-e.shape.y);default:return}}function xi(e){if(0===e.target.length)return null;const t=e.target[0];if(!t.selector)return null;const n=t.selector.find((e=>"TextQuoteSelector"===e.type));return n?n.exact:null}function ki(e){return e.target[0]?.description}function Ni(e){const t=e.target[0]?.selector?.find((e=>"ShapeSelector"===e.type));return t??null}function Si(e){const t=e.target[0]?.selector?.find((e=>"EPUBContentSelector"===e.type));return t?.cfi}function Ai(e){const t=e.target[0]?.selector?.find((e=>"PageSelector"===e.type));return t?.label}function Ti(e,t){return e.reduce(((e,n)=>t(n)?e+1:e),0)}function Ei(e){const t={};return e.forEach((e=>t[e]=!0)),t}function Ci(e){
|
|
133
|
+
return Object.keys(e).filter((t=>!0===e[t]))}function Mi(e){return Object.entries(e)}const Ii={CHANGE_ROUTE:(e,{name:t,params:n})=>({name:t,params:n})};const zi=qo({name:null,params:{}},{namespace:"route",reducers:Ii,actionCreators:{changeRoute:function(e,t={}){return Bo(0,"CHANGE_ROUTE",{name:e,params:t})}},selectors:{route:function(e){return e.name},routeParams:function(e){return e.params}}}),Oi={features:{},preferences:{},userid:null};const Li={UPDATE_PROFILE:(e,t)=>({profile:{...t.profile}})};const Ri=ri((e=>e.profile),(e=>e.features),((e,t)=>{const n={...e.features};for(const e of t)n[e]=!0;return n}));const Pi=qo((function(e){return{defaultAuthority:e?.authDomain??"",features:e.features??[],profile:Oi}}),{namespace:"session",reducers:Li,actionCreators:{updateProfile:function(e){return Bo(0,"UPDATE_PROFILE",{profile:e})}},selectors:{defaultAuthority:function(e){return e.defaultAuthority},features:Ri,hasFetchedProfile:function(e){return e.profile!==Oi},isFeatureEnabled:function(e,t){
|
|
134
|
+
return Boolean(Ri(e)[t])},isLoggedIn:function(e){return null!==e.profile.userid},profile:function(e){return e.profile}}});function Di(e,t){return e.find((e=>e.id===t))}function Hi(e,t){return e.find((e=>e.$tag===t))}function Fi(e,t,n){let r=e.$orphan;e.id||(r=!1);let o="other-content";return e.user===n&&(o=fi(e)?"user-highlights":"user-annotations"),Object.assign({},e,{$anchorTimeout:!1,$cluster:o,$tag:e.$tag||t,$orphan:r})}const ji={ADD_ANNOTATIONS(e,t){const n=new Set,r=new Set,o=[],i=[],a=[];let s=e.nextTag;for(const i of t.annotations){let l;i.id&&(l=Di(e.annotations,i.id)),!l&&i.$tag&&(l=Hi(e.annotations,i.$tag)),l?(a.push(Object.assign({},l,i)),i.id&&n.add(i.id),l.$tag&&r.add(l.$tag)):(o.push(Fi(i,"t"+s,t.currentUserId)),++s)}for(const t of e.annotations)n.has(t.id)||r.has(t.$tag)||i.push(t);return{annotations:o.concat(a).concat(i),nextTag:s}},CLEAR_ANNOTATIONS:()=>({annotations:[],highlighted:{},hovered:{}}),HOVER_ANNOTATIONS:(e,t)=>({hovered:Ei(t.tags)}),HIDE_ANNOTATION:(e,t)=>({
|
|
135
|
+
annotations:e.annotations.map((e=>e.id!==t.id?e:{...e,hidden:!0}))}),HIGHLIGHT_ANNOTATIONS:(e,t)=>({highlighted:t.highlighted}),REMOVE_ANNOTATIONS:(e,t)=>({annotations:[...t.remainingAnnotations]}),UNHIDE_ANNOTATION:(e,t)=>({annotations:e.annotations.map((e=>e.id!==t.id?e:Object.assign({},e,{hidden:!1})))}),UPDATE_ANCHOR_STATUS:(e,t)=>({annotations:e.annotations.map((e=>{if(!ii(t.statusUpdates,e.$tag))return e;const n=t.statusUpdates[e.$tag];return"timeout"===n?Object.assign({},e,{$anchorTimeout:!0}):Object.assign({},e,{$orphan:"orphan"===n})}))}),UPDATE_FLAG_STATUS:(e,t)=>({annotations:e.annotations.map((e=>{if(e.id&&e.id===t.id){if(e.flagged===t.isFlagged)return e;const n=Object.assign({},e,{flagged:t.isFlagged});if(n.moderation){const e=t.isFlagged?1:-1;n.moderation={...n.moderation,flagCount:n.moderation.flagCount+e}}return n}return e}))})};function $i(e){return(t,n)=>{const r=function(e,t){const n=new Set,r=new Set;for(const e of t)e.id&&n.add(e.id),e.$tag&&r.add(e.$tag)
|
|
136
|
+
;return e.filter((e=>!(e.id&&n.has(e.id)||e.$tag&&r.has(e.$tag))))}(n().annotations.annotations,e);t(Bo(0,"REMOVE_ANNOTATIONS",{annotationsToRemove:e,remainingAnnotations:r}))}}function Bi(e){return Bo(0,"UPDATE_ANCHOR_STATUS",{statusUpdates:e})}const qi=ri((e=>e.annotations),(e=>Ti(e,bi)));const Ui=ri((e=>e.hovered),(e=>Ci(e))),Gi=ri((e=>e.highlighted),(e=>Ci(e)));const Vi=ri((e=>e.annotations),(e=>e.some(mi))),Wi=ri((e=>e.annotations),(e=>e.filter((e=>di(e)&&!fi(e))))),Ki=ri((e=>e.annotations),(e=>e.filter((e=>di(e)&&fi(e))))),Yi=ri((e=>e.annotations),(e=>Ti(e,vi))),Xi=ri((e=>e.annotations),(e=>Ti(e,gi))),Zi=ri((e=>e.annotations),(e=>e.filter((e=>ui(e))))),Ji=ri((e=>e.annotations),(e=>{const t=new Map;return e.forEach((e=>{const{user:n}=e;if(t.has(n))return;const r=si(n),o=e.user_info?.display_name??null;t.set(n,{userid:n,username:r,displayName:o})})),[...t.values()].sort(((e,t)=>{const n=e.username,r=t.username;return n.localeCompare(r,void 0,{sensitivity:"base"})}))})),Qi=ri((e=>e.annotations),(e=>{
|
|
137
|
+
const t=e.flatMap((e=>e.mentions??[])),n=new Set;return t.filter((({userid:e})=>{const t=n.has(e);return n.add(e),!t})).map((({display_name:e,...t})=>({displayName:e,...t})))})),ea=qo({annotations:[],highlighted:{},hovered:{},nextTag:1},{namespace:"annotations",reducers:ji,actionCreators:{addAnnotations:function(e){return function(t,n){const r=e.filter((e=>!e.id||!Di(n().annotations.annotations,e.id))),o=Pi.selectors.profile(n().session);if(t(Bo(0,"ADD_ANNOTATIONS",{annotations:e,currentAnnotationCount:n().annotations.annotations.length,currentUserId:o.userid})),"sidebar"!==zi.selectors.route(n().route))return;const i=r.filter(mi).map((e=>e.id));i.length>0&&setTimeout((()=>{const e=n().annotations.annotations,r=i.map((t=>t?Di(e,t):null)).filter((e=>e&&mi(e))).reduce(((e,t)=>(e[t.$tag]="timeout",e)),{});t(Bi(r))}),500)}},clearAnnotations:function(){return Bo(0,"CLEAR_ANNOTATIONS",void 0)},hoverAnnotations:function(e){return Bo(0,"HOVER_ANNOTATIONS",{tags:e})},hideAnnotation:function(e){
|
|
138
|
+
return Bo(0,"HIDE_ANNOTATION",{id:e})},highlightAnnotations:function(e){return Bo(0,"HIGHLIGHT_ANNOTATIONS",{highlighted:Ei(e)})},removeAnnotations:$i,unhideAnnotation:function(e){return Bo(0,"UNHIDE_ANNOTATION",{id:e})},updateAnchorStatus:Bi,updateFlagStatus:function(e,t){return Bo(0,"UPDATE_FLAG_STATUS",{id:e,isFlagged:t})}},selectors:{allAnnotations:function(e){return e.annotations},annotationCount:qi,annotationExists:function(e,t){return e.annotations.some((e=>e.id===t))},findAnnotationByID:function(e,t){return Di(e.annotations,t)},findIDsForTags:function(e,t){const n=[];for(const r of t){const t=Hi(e.annotations,r);t&&t.id&&n.push(t.id)}return n},hoveredAnnotations:Ui,highlightedAnnotations:Gi,isAnnotationHighlighted:function(e,t){return!!t?.id&&!0===e.highlighted[t.id]},isAnnotationHovered:function(e,t){return!0===e.hovered[t]},isWaitingToAnchorAnnotations:Vi,newAnnotations:Wi,newHighlights:Ki,noteCount:Yi,orphanCount:Xi,savedAnnotations:Zi,usersWhoAnnotated:Ji,usersWhoWereMentioned:Qi}}),ta={
|
|
139
|
+
SET_DEFAULT:(e,t)=>({[t.defaultKey]:t.value})};const na=qo({annotationPrivacy:null,focusedGroup:null},{namespace:"defaults",reducers:ta,actionCreators:{setDefault:function(e,t){return Bo(0,"SET_DEFAULT",{defaultKey:e,value:t})}},selectors:{getDefault:function(e,t){return e[t]},getDefaults:function(e){return e}}});const ra={UPDATE_DIRECT_LINKED_GROUP_FETCH_FAILED:(e,t)=>({directLinkedGroupFetchFailed:t.directLinkedGroupFetchFailed}),UPDATE_DIRECT_LINKED_GROUP_ID:(e,t)=>({directLinkedGroupId:t.directLinkedGroupId}),UPDATE_DIRECT_LINKED_ANNOTATION_ID:(e,t)=>({directLinkedAnnotationId:t.directLinkedAnnotationId}),CLEAR_DIRECT_LINKED_IDS:()=>({directLinkedAnnotationId:null,directLinkedGroupId:null}),CLEAR_SELECTION:()=>({directLinkedAnnotationId:null,directLinkedGroupId:null,directLinkedGroupFetchFailed:!1})};const oa=qo((function(e){return{directLinkedGroupId:e.group||null,directLinkedAnnotationId:e.annotations||null,directLinkedGroupFetchFailed:!1}}),{namespace:"directLinked",reducers:ra,actionCreators:{
|
|
140
|
+
setDirectLinkedGroupFetchFailed:function(){return Bo(0,"UPDATE_DIRECT_LINKED_GROUP_FETCH_FAILED",{directLinkedGroupFetchFailed:!0})},setDirectLinkedGroupId:function(e){return Bo(0,"UPDATE_DIRECT_LINKED_GROUP_ID",{directLinkedGroupId:e})},setDirectLinkedAnnotationId:function(e){return Bo(0,"UPDATE_DIRECT_LINKED_ANNOTATION_ID",{directLinkedAnnotationId:e})},clearDirectLinkedGroupFetchFailed:function(){return Bo(0,"UPDATE_DIRECT_LINKED_GROUP_FETCH_FAILED",{directLinkedGroupFetchFailed:!1})},clearDirectLinkedIds:function(){return Bo(0,"CLEAR_DIRECT_LINKED_IDS",void 0)}},selectors:{directLinkedAnnotationId:function(e){return e.directLinkedAnnotationId},directLinkedGroupFetchFailed:function(e){return e.directLinkedGroupFetchFailed},directLinkedGroupId:function(e){return e.directLinkedGroupId}}});class ia{constructor(e,t){this.annotation={id:e.id,$tag:e.$tag},this.isPrivate=t.isPrivate,this.tags=t.tags,this.text=t.text,this.description=t.description}match(e){
|
|
140
141
|
return this.annotation.$tag&&e.$tag===this.annotation.$tag||this.annotation.id&&e.id===this.annotation.id}isEmpty(){return!this.text&&0===this.tags.length&&!this.description}}const aa={DISCARD_ALL_DRAFTS:()=>({drafts:[]}),REMOVE_DRAFT:(e,t)=>({drafts:e.drafts.filter((e=>!e.match(t.annotation)))}),UPDATE_DRAFT(e,t){const n=e.drafts.filter((e=>!e.match(t.draft.annotation)));return n.push(t.draft),{drafts:n}}};function sa(e){return Bo(0,"REMOVE_DRAFT",{annotation:e})}function la(e,t){const n=e.drafts;for(let e=0;e<n.length;e++){const r=n[e];if(r.match(t))return r}return null}function ca(e,t){const n=la(e,t);return n?n.isEmpty()?null:n:null}const ua=ri((e=>e.drafts),(e=>e.filter((e=>!e.annotation.id)).map((e=>e.annotation)))),da=qo({drafts:[]},{namespace:"drafts",reducers:aa,actionCreators:{createDraft:function(e,t){return Bo(0,"UPDATE_DRAFT",{draft:new ia(e,t)})},deleteNewAndEmptyDrafts:function(){return(e,t)=>{
|
|
141
142
|
const n=t().drafts.drafts.filter((e=>!e.annotation.id&&!ca(t().drafts,e.annotation))).map((t=>(e(sa(t.annotation)),t.annotation)));e($i(n))}},discardAllDrafts:function(){return Bo(0,"DISCARD_ALL_DRAFTS",void 0)},removeDraft:sa},selectors:{countDrafts:function(e){return e.drafts.length},getDraft:la,getDraftIfNotEmpty:ca,unsavedAnnotations:ua}});function ha(e){const t={},n=e.user,r=n?.username||n?.userid||"";return n&&r&&(t.user={value:r,display:n.displayName||r}),e.pages&&(t.page={value:e.pages,display:e.pages}),e.cfi&&(t.cfi={value:e.cfi.range,display:e.cfi.label}),t}const ma={CHANGE_FOCUS_MODE_USER(e,t){const n={...e.focusFilters},{user:r}=ha({user:t.user}),o=new Set(e.focusActive);return void 0!==r?(o.add("user"),n.user=r):(o.delete("user"),delete n.user),{focusActive:o,focusFilters:n}},SET_FILTER(e,t){const n={...e.filters,[t.filterName]:t.filterOption};return""===t.filterOption?.value&&delete n[t.filterName],{filters:n}},SET_FILTER_QUERY:(e,t)=>({query:t.query}),SET_FOCUS_MODE(e,t){
|
|
142
143
|
let n=new Set(e.focusActive);if(void 0!==t.key){t.active??!n.has(t.key)?n.add(t.key):n.delete(t.key)}else{n=t.active??0===n.size?new Set(Object.keys(e.focusFilters)):new Set}return{focusActive:n}}};const pa=ri((e=>e.focusActive),(e=>e.focusFilters),((e,t)=>({active:e.size>0,configured:Object.values(t??{}).some((e=>void 0!==e)),displayName:t?.user?.display??"",contentRange:t?.cfi?.display,pageRange:t?.page?.display}))),fa=ri((e=>e.filters),(e=>e.focusActive),(e=>e.focusFilters),((e,t,n)=>{const r={};for(const e of t){const t=n[e];t&&(r[e]=t)}return Object.assign(r,e),r}));const ga=ri((e=>fa(e)),(e=>{const t={};for(const[n,r]of Object.entries(e))r&&(t[n]=r.value);return t}));const va=qo((function(e){const t=ha(e.focus||{});return{filters:{},focusActive:new Set(Object.keys(t)),focusFilters:t,query:e.query||null}}),{namespace:"filters",reducers:ma,actionCreators:{changeFocusModeUser:function(e){return Bo(0,"CHANGE_FOCUS_MODE_USER",{user:e})},setFilter:function(e,t){return(n,r)=>{
|
|
@@ -158,47 +159,47 @@ return this.name===e&&this.args.every(((e,n)=>t[n]===e))}}function us(e){return
|
|
|
158
159
|
children:o?"group"===e?"The current URL links to a group, but that group cannot be found,\n or you do not have permission to view the annotations in that group.":"The current URL links to an annotation, but that annotation\n cannot be found, or you do not have permission to view it.":`The ${e} associated with the current URL is unavailable.\n You may need to log in to see it.`}),Qe("div",{className:"flex justify-end space-x-2",children:[n&&Qe(gr,{variant:o?"primary":void 0,onClick:()=>r.clearSelection(),children:"Show all annotations"}),!o&&Qe(gr,{variant:"primary",onClick:t,children:"Log in"})]})]})})}var ms,ps;us.$inject=["settings"];var fs=function(){if(ps)return ms;ps=1;var e=NaN,t="[object Symbol]",n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt,s="object"==typeof Ue&&Ue&&Ue.Object===Object&&Ue,l="object"==typeof self&&self&&self.Object===Object&&self,c=s||l||Function("return this")(),u=Object.prototype.toString,d=Math.max,h=Math.min,m=function(){
|
|
159
160
|
return c.Date.now()};function p(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function f(s){if("number"==typeof s)return s;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&u.call(e)==t}(s))return e;if(p(s)){var l="function"==typeof s.valueOf?s.valueOf():s;s=p(l)?l+"":l}if("string"!=typeof s)return 0===s?s:+s;s=s.replace(n,"");var c=o.test(s);return c||i.test(s)?a(s.slice(2),c?2:8):r.test(s)?e:+s}return ms=function(e,t,n){var r,o,i,a,s,l,c=0,u=!1,g=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function b(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function y(e){var n=e-l;return void 0===l||n>=t||n<0||g&&e-c>=i}function _(){var e=m();if(y(e))return w(e);s=setTimeout(_,function(e){var n=t-(e-l);return g?h(n,i-(e-c)):n}(e))}function w(e){return s=void 0,v&&r?b(e):(r=o=void 0,a)}function x(){var e=m(),n=y(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(_,t),u?b(e):a}(l)
|
|
160
161
|
;if(g)return s=setTimeout(_,t),b(l)}return void 0===s&&(s=setTimeout(_,t)),a}return t=f(t)||0,p(n)&&(u=!!n.leading,i=(g="maxWait"in n)?d(f(n.maxWait)||0,t):i,v="trailing"in n?!!n.trailing:v),x.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=o=s=void 0},x.flush=function(){return void 0===s?a:w(m())},x},ms}(),gs=Ge(fs);const vs={defaultHeight:200,marginAbove:800,marginBelow:800};function bs(e){const t=window.getComputedStyle(e);return e.getBoundingClientRect().height+(parseFloat(t.marginTop)+parseFloat(t.marginBottom))}function ys(e,t){const n=e.visible===t;return e.children.reduce(((e,n)=>e+ys(n,t)),n?1:0)}function _s(e){return ys(e,!1)}function ws(e){return ys(e,!0)}function xs(e){const t=e.filter((e=>!!e.annotation)).map((e=>e.annotation));if(t.length)return t;const n=[];if(e.forEach((e=>{e.children&&n.push(...e.children)})),n.length)return xs(n);throw new Error("Thread contains no annotations")}function ks(e,t,n){const r=li(e.user,t)
|
|
161
|
-
;return(n||r)&&e.user_info?.display_name?e.user_info.display_name:si(e.user)}function Ns(e){return/^http(s?):/i.test(e)}function Ss(e){return{read:[e],update:[e],delete:[e]}}function As(e,t){return Object.assign(Ss(e),{read:["group:"+t]})}function Ts(e,t,n){return"private"===function(e){switch(e){case"private":case"shared":return e;default:return"shared"}}(n)&&e?Ss(e):As(e,t)}function Es(e){return e.read.some((e=>e.startsWith("group:")))}function Cs(e){return!Es(e)}const Ms=(e=window.navigator.userAgent)=>e.indexOf("Mac OS")>=0,Is=(e=window.navigator,t="ontouchend"in document)=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(e.platform)||e.userAgent.includes("Mac")&&t;async function zs(e,t=navigator){await t.clipboard.writeText(e)}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
},this),t.
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
;const
|
|
178
|
-
const t=
|
|
179
|
-
const
|
|
180
|
-
;var
|
|
181
|
-
;const{implementation:k,createNodeIterator:N,createDocumentFragment:S,getElementsByTagName:A}=r,{importNode:T}=o;let E={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof
|
|
182
|
-
})),q=null,U=null,G=!0,V=!0,W=!1,K=!0,Y=!1,X=!0,Z=!1,J=!1,Q=!1,ee=!1,te=!1,ne=!1,re=!0,oe=!1,ie=!0,ae=!1,se={},le=null;const ce=
|
|
183
|
-
return e instanceof RegExp||e instanceof Function},Me=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Te||Te!==e){if(e&&"object"==typeof e||(e={}),e=
|
|
184
|
-
te=e.RETURN_DOM_FRAGMENT||!1,ne=e.RETURN_TRUSTED_TYPE||!1,Q=e.FORCE_BODY||!1,re=!1!==e.SANITIZE_DOM,oe=e.SANITIZE_NAMED_PROPS||!1,ie=!1!==e.KEEP_CONTENT,ae=e.IN_PLACE||!1,D=e.ALLOWED_URI_REGEXP||
|
|
185
|
-
e.ADD_TAGS&&(H===F&&(H=
|
|
186
|
-
return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(p,i)),null!==w&&"string"==typeof x&&(x=w.createHTML(""));
|
|
187
|
-
;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ve===ge?A.call(t,Z?"html":"body")[0]:Z?t.documentElement:i},Pe=function(e){return N.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},De=function(e){return e instanceof h&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},He=function(e){return"function"==typeof l&&e instanceof l};function Fe(e,t,r){
|
|
188
|
-
!0;if(e.nodeType===
|
|
189
|
-
;return!!ye[e.namespaceURI]&&(e.namespaceURI===fe?t.namespaceURI===ge?"svg"===n:t.namespaceURI===pe?"svg"===n&&("annotation-xml"===r||we[r]):Boolean(Ie[n]):e.namespaceURI===pe?t.namespaceURI===ge?"math"===n:t.namespaceURI===fe?"math"===n&&xe[r]:Boolean(ze[n]):e.namespaceURI===ge?!(t.namespaceURI===fe&&!xe[r])&&!(t.namespaceURI===pe&&!we[r])&&!ze[n]&&(ke[n]||!Ie[n]):!("application/xhtml+xml"!==Ne||!ye[e.namespaceURI]))}(e)?(Oe(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!
|
|
190
|
-
if(!(Be(e)&&(B.tagNameCheck instanceof RegExp&&
|
|
191
|
-
r.forceKeepAttr=void 0,Fe(E.uponSanitizeAttribute,e,r),d=r.attrValue,!oe||"id"!==c&&"name"!==c||(Le(a,e),d="user-content-"+d),X&&
|
|
192
|
-
let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,s=null,c=null;if(be=!e,be&&(e="\x3c!--\x3e"),"string"!=typeof e&&!He(e)){if("function"!=typeof e.toString)throw
|
|
193
|
-
;return(j.shadowroot||j.shadowrootmode)&&(c=T.call(o,c,!0)),c}let d=Z?r.outerHTML:r.innerHTML;return Z&&H["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&
|
|
194
|
-
uponSanitizeShadowNode:[]}},n}();var
|
|
195
|
-
;if(i&&i.start<=i.end){var a=i.lexer.input;n=i.start,r=i.end,n===a.length?o+=" at end of input: ":o+=" at position "+(n+1)+": ";var s=a.slice(n,r).replace(/[^]/g,"$&̲");o+=(n>15?"…"+a.slice(n-15,n):a.slice(0,n))+s+(r+15<a.length?a.slice(r,r+15)+"…":a.slice(r))}var l=new Error(o);return l.name="ParseError",l.__proto__=
|
|
196
|
-
var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?":"!==t[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?t[1].toLowerCase():null:"_relative"}},
|
|
162
|
+
;return(n||r)&&e.user_info?.display_name?e.user_info.display_name:si(e.user)}function Ns(e){return/^http(s?):/i.test(e)}function Ss(e){return{read:[e],update:[e],delete:[e]}}function As(e,t){return Object.assign(Ss(e),{read:["group:"+t]})}function Ts(e,t,n){return"private"===function(e){switch(e){case"private":case"shared":return e;default:return"shared"}}(n)&&e?Ss(e):As(e,t)}function Es(e){return e.read.some((e=>e.startsWith("group:")))}function Cs(e){return!Es(e)}const Ms=(e=window.navigator.userAgent)=>e.indexOf("Mac OS")>=0,Is=(e=window.navigator,t="ontouchend"in document)=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(e.platform)||e.userAgent.includes("Mac")&&t;async function zs(e,t=navigator){await t.clipboard.writeText(e)}var Os=Eo((function({annotation:e,toastMessenger:t,shareUri:n}){const r=ds().getGroup(e.group),o=Cs(e.permissions),i=Ns(e.uri),a=le(null),s=le(null),[l,c]=oe(!1),u=le(l);if(ae((()=>{u.current!==l&&(u.current=l,l&&!Is()&&(a.current?.focus(),
|
|
163
|
+
a.current?.select()))}),[l]),!r)return null;const d="private"===r.type?Qe("span",{children:["Only members of the group ",Qe("em",{children:r.name})," may view this annotation."]}):Qe("span",{children:"Anyone using this link may view this annotation."}),h=o?Qe("span",{children:"Only you may view this annotation."}):d;return Qe("div",{className:"relative",ref:s,children:[Qe(wr,{icon:lr,title:"Share",onClick:()=>c(!l),expanded:l}),Qe(Yr,{open:l,onClose:()=>c(!1),anchorElementRef:s,align:"right",placement:"above",arrow:!0,classes:Xe({"w-max":!HTMLElement.prototype.hasOwnProperty("popover")}),children:Qe("div",{className:"p-2 flex flex-col gap-y-2",children:[Qe("h2",{className:"text-brand text-md font-medium",children:"Share this annotation"}),Qe("div",{className:"flex w-full text-base",children:Qe(yr,{children:[Qe(Br,{"aria-label":"Use this URL to share this annotation",type:"text",value:n,readOnly:!0,elementRef:a}),Qe(wr,{icon:Dt,title:"Copy share link to clipboard",onClick:async()=>{try{await zs(n),
|
|
164
|
+
t.success("Copied share link to clipboard")}catch{t.error("Unable to copy link")}},variant:"dark"})]})}),Qe("div",{className:"text-base font-normal","data-testid":"share-details",children:Qe(y,i?{children:h}:{children:"This annotation cannot be shared in its original context because it was made on a document that is not available on the web. This link shares the annotation by itself."})})]})})]})}),["toastMessenger"]);var Ls=Eo((function({annotation:e,annotationsService:t,onReply:n,settings:r,toastMessenger:o}){const i=ds(),a=i.profile(),s=i.isLoggedIn(),l=t=>function(e,t,n){return-1!==e[t].indexOf(n||"")}(e.permissions,t,a.userid),c=l("delete"),u=l("update"),d=function(e){const t=ko(e);return!1!==t?.allowFlagging}(r)&&!!a.userid&&a.userid!==e.user,h=function(e){const t=ko(e);return!1!==t?.enableShareLinks}(r)&&function(e){return Ns(e.uri)?e.links?.incontext??e.links?.html??null:e.links?.html??null}(e);return Qe("div",{className:"flex text-[16px]","data-testid":"annotation-action-bar",children:[u&&Qe(wr,{
|
|
165
|
+
icon:$t,title:"Edit",onClick:()=>{i.createDraft(e,{tags:e.tags,text:e.text,isPrivate:Cs(e.permissions),description:e.target[0]?.description})}}),c&&Qe(wr,{icon:pr,title:"Delete",onClick:async()=>{const n=yi(e);if(await Rr({title:`Delete ${n.toLowerCase()}?`,message:`Are you sure you want to delete this ${n.toLowerCase()}?`,confirmAction:"Delete"}))try{await t.delete(e),o.success(`${n} deleted`,{visuallyHidden:!0})}catch(e){o.error(e.message)}}}),Qe(wr,{icon:nr,title:"Reply",onClick:()=>{s?n():i.openSidebarPanel("loginPrompt")}}),h&&Qe(Os,{annotation:e,shareUri:h}),d&&!e.flagged&&Qe(wr,{icon:rn,title:"Report this annotation to moderators",onClick:()=>{t.flag(e).catch((()=>o.error("Flagging annotation failed")))}}),d&&e.flagged&&Qe(wr,{pressed:!0,icon:an,title:"Annotation has been reported to the moderators"})]})}),["annotationsService","settings","toastMessenger"]);function Rs(e){var t,n=e.uri;try{t=new URL(n).hostname}catch(e){t=""}"localhost"===t&&(t="");var r=t
|
|
166
|
+
;return e.document&&e.document.title&&(r=e.document.title[0]),{uri:n,domain:t,title:r}}function Ps(e){var t=e.uri;return t&&0!==t.indexOf("http://")&&0!==t.indexOf("https://")&&(t=null),e.links&&e.links.incontext&&(t=e.links.incontext),t}function Ds(e){var t=Rs(e),n="";if(t.uri&&0===t.uri.indexOf("file://")&&t.title){var r=t.uri.split("/"),o=r[r.length-1];o&&(n=o)}else t.domain&&t.domain!==t.title&&(n=t.domain);return n}function Hs(e){var t=Rs(e).title;return t.length>30&&(t=t.slice(0,30)+"…"),t}var Fs="/home/runner/work/annotation-ui/annotation-ui/src/components/AnnotationDocumentInfo.tsx";function js(e){var t,n=e.annotation,r=function(e){return{domain:Ds(e),titleText:Hs(e),titleLink:Ps(e)}}(n),o=r.domain,i=r.titleText,a=r.titleLink,s=((null===(t=n.links)||void 0===t?void 0:t.html)||"")&&a?a:"";return Qe("div",{className:"flex gap-x-1",children:[Qe("div",{className:"text-color-text-light",children:['on "',s?Qe(ho,{href:s,target:"_blank",underline:"none",children:i},void 0,0,{fileName:Fs,lineNumber:36,
|
|
167
|
+
columnNumber:11},this):Qe("span",{children:i},void 0,0,{fileName:Fs,lineNumber:40,columnNumber:11},this),'"']},void 0,0,{fileName:Fs,lineNumber:33,columnNumber:7},this),o&&Qe("span",{className:"text-color-text-light",children:["(",o,")"]},void 0,0,{fileName:Fs,lineNumber:44,columnNumber:18},this)]},void 0,0,{fileName:Fs,lineNumber:32,columnNumber:5},this)}var $s="/home/runner/work/annotation-ui/annotation-ui/src/components/AnnotationGroupInfo.tsx";function Bs(e){var t=e.group,n=null==t?void 0:t.links.html;return Qe(y,{children:t&&n&&Qe(ho,{classes:Xe("text-color-text-light hover:text-color-text-light"),href:t.links.html,target:"_blank",underline:"hover",variant:"custom",children:Qe("div",{className:"flex items-baseline gap-x-1",children:["open"===t.type?Qe(ln,{className:"w-2.5 h-2.5"},void 0,0,{fileName:$s,lineNumber:37,columnNumber:15},this):Qe(hn,{className:"w-2.5 h-2.5"},void 0,0,{fileName:$s,lineNumber:39,columnNumber:15},this),Qe("span",{children:t.name},void 0,0,{fileName:$s,lineNumber:41,
|
|
168
|
+
columnNumber:13},this)]},void 0,0,{fileName:$s,lineNumber:35,columnNumber:11},this)},void 0,0,{fileName:$s,lineNumber:24,columnNumber:9},this)},void 0)}var qs="/home/runner/work/annotation-ui/annotation-ui/src/components/AnnotationTimestamps.tsx";function Us(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Gs(e,t);var n={}.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)?Gs(e,t):void 0}}(e,t)||function(){
|
|
169
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Vs(e){var t=e.annotationCreated,n=e.annotationUpdated,r=e.annotationURL,o=e.withEditedTimestamp,i=Us(oe((function(){return new Date})),2),a=i[0],s=i[1],l=ce((function(){return new Date(t)}),[t]),c=ce((function(){return o&&new Date(n)}),[n,o]),u=ce((function(){return{absolute:qe(l,{includeWeekday:!0}),relative:Be(l,a)}}),[l,a]),d=ce((function(){return c?{absolute:qe(c,{includeWeekday:!0}),relative:Be(c,a)}:{}}),[c,a]);ae((function(){return $e(c?n:t,(function(){return s(new Date)}))}),[t,n,l,c,a]);var h=d&&d.relative!==u.relative?"edited ".concat(d.relative):"edited";return Qe("div",{children:[o&&Qe("span",{className:"text-color-text-light text-xs italic","data-testid":"timestamp-edited",title:d.absolute,children:["(",h,")"," "]},void 0,0,{
|
|
170
|
+
fileName:qs,lineNumber:79,columnNumber:9},this),r?Qe(ho,{classes:"text-color-text-light hover:text-color-text-light",target:"_blank",title:u.absolute,href:r,underline:"hover",variant:"custom",children:u.relative},void 0,0,{fileName:qs,lineNumber:88,columnNumber:9},this):Qe("span",{className:"color-text-color-light","data-testid":"timestamp-created",title:u.absolute,children:u.relative},void 0,0,{fileName:qs,lineNumber:101,columnNumber:9},this)]},void 0,0,{fileName:qs,lineNumber:77,columnNumber:5},this)}var Ws="/home/runner/work/annotation-ui/annotation-ui/src/components/AnnotationUser.tsx";function Ks(e){var t=e.authorLink,n=Qe("h3",{className:"text-color-text font-bold",children:e.displayName},void 0,0,{fileName:Ws,lineNumber:16,columnNumber:16},this);return t?Qe(ho,{href:t,target:"_blank",underline:"none",variant:"custom",children:n},void 0,0,{fileName:Ws,lineNumber:20,columnNumber:7},this):Qe("div",{children:n},void 0,0,{fileName:Ws,lineNumber:26,columnNumber:10},this)}
|
|
171
|
+
var Ys="/home/runner/work/annotation-ui/annotation-ui/src/components/MentionPopoverContent.tsx";function Xs(e){var t=e.content,n="username"===e.mentionMode;return Qe(y,{children:[Qe("div",{className:"px-3 py-2",children:"string"==typeof t?Qe("div",{"data-testid":"user-not-found",children:["No user with username ",Qe("span",{className:"font-bold",children:t},void 0,0,{fileName:Ys,lineNumber:29,columnNumber:35},this)," ","exists"]},void 0,0,{fileName:Ys,lineNumber:28,columnNumber:11},this):Qe("div",{className:"flex flex-col gap-y-4",children:[Qe("div",{className:"flex flex-col gap-y-1.5",children:[n&&Qe("div",{"data-testid":"username",className:"text-md font-bold",children:["@",t.username]},void 0,0,{fileName:Ys,lineNumber:36,columnNumber:17},this),t.display_name&&Qe("div",{"data-testid":"display-name",className:Xe({"text-color-text-light":n,"text-md font-bold":!n}),children:t.display_name},void 0,0,{fileName:Ys,lineNumber:41,columnNumber:17},this)]},void 0,0,{fileName:Ys,lineNumber:34,columnNumber:13
|
|
172
|
+
},this),t.description&&Qe("div",{"data-testid":"description",className:"line-clamp-2",children:t.description},void 0,0,{fileName:Ys,lineNumber:53,columnNumber:15},this),t.joined&&Qe("div",{"data-testid":"joined",className:"text-color-text-light",children:["Joined"," ",Qe("b",{children:qe(t.joined,{includeTime:!1})},void 0,0,{fileName:Ys,lineNumber:60,columnNumber:17},this)]},void 0,0,{fileName:Ys,lineNumber:58,columnNumber:15},this)]},void 0,0,{fileName:Ys,lineNumber:33,columnNumber:11},this)},void 0,0,{fileName:Ys,lineNumber:26,columnNumber:7},this),Qe("div",{className:"px-3 py-2 border-t",children:Qe(ho,{variant:"text-light",classes:"flex gap-x-1 items-center",target:"_blank",href:n?"https://web.hypothes.is/help/mentions-for-the-hypothesis-web-app/":"https://web.hypothes.is/help/mentions-for-the-hypothesis-lms-app/","data-testid":"kb-article-link",children:[Qe(xn,{className:"w-3 h-3"},void 0,0,{fileName:Ys,lineNumber:78,columnNumber:11},this)," Learn more about @mentions"]},void 0,0,{fileName:Ys,
|
|
173
|
+
lineNumber:67,columnNumber:9},this)},void 0,0,{fileName:Ys,lineNumber:66,columnNumber:7},this)]},void 0)}function Zs(e){return Zs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zs(e)}var Js=["children","classes"],Qs="/home/runner/work/annotation-ui/annotation-ui/src/components/StyledText.tsx";function el(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?el(Object(n),!0).forEach((function(t){nl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):el(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}
|
|
174
|
+
return e}function nl(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Zs(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=Zs(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Zs(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rl(e){var t=e.children,n=e.classes,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Js);return Qe("div",tl(tl({dir:"auto",lang:"",className:Xe("StyledText",n)},r),{},{children:t}),void 0,0,{fileName:Qs,lineNumber:28,columnNumber:5},this)}function ol(e){
|
|
175
|
+
return function(e){if(Array.isArray(e))return al(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||il(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function il(e,t){if(e){if("string"==typeof e)return al(e,t);var n={}.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)?al(e,t):void 0}}function al(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function sl(e,t,n){var r,o=e.querySelectorAll("[data-hyp-mention]"),i=new Map,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=il(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{
|
|
176
|
+
done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(o);try{var s=function(){var e=r.value,o=e.dataset.userid,a=o?t.find((function(e){return e.userid===o})):void 0;i.set.apply(i,ol(function(e,t,n){var r,o=null!==(r=e.textContent)&&void 0!==r?r:"",i=null!=t?t:o;if(e.hasAttribute("data-hyp-mention-type"))return[e,i];var a,s,l=t&&t.link?"link":t?"no-link":"invalid",c=document.createElement("link"===l?"a":"span");return c.setAttribute("data-hyp-mention",""),c.setAttribute("data-hyp-mention-type",l),c.textContent=t?"username"===n?"@".concat(t.username):t.display_name?"@".concat(t.display_name):o:o,
|
|
177
|
+
"link"===l&&(c.setAttribute("href",null!==(a=null==t?void 0:t.link)&&void 0!==a?a:""),c.setAttribute("target","_blank")),"invalid"!==l&&c.setAttribute("data-userid",null!==(s=e.dataset.userid)&&void 0!==s?s:""),e.replaceWith(c),[c,i]}(e,a,n)))};for(a.s();!(r=a.n()).done;)s()}catch(e){a.e(e)}finally{a.f()}return i}const{entries:ll,setPrototypeOf:cl,isFrozen:ul,getPrototypeOf:dl,getOwnPropertyDescriptor:hl}=Object;let{freeze:ml,seal:pl,create:fl}=Object,{apply:gl,construct:vl}="undefined"!=typeof Reflect&&Reflect;ml||(ml=function(e){return e}),pl||(pl=function(e){return e}),gl||(gl=function(e,t,n){return e.apply(t,n)}),vl||(vl=function(e,t){return new e(...t)})
|
|
178
|
+
;const bl=Ol(Array.prototype.forEach),yl=Ol(Array.prototype.lastIndexOf),_l=Ol(Array.prototype.pop),wl=Ol(Array.prototype.push),xl=Ol(Array.prototype.splice),kl=Ol(String.prototype.toLowerCase),Nl=Ol(String.prototype.toString),Sl=Ol(String.prototype.match),Al=Ol(String.prototype.replace),Tl=Ol(String.prototype.indexOf),El=Ol(String.prototype.trim),Cl=Ol(Object.prototype.hasOwnProperty),Ml=Ol(RegExp.prototype.test),Il=(zl=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return vl(zl,t)});var zl;function Ol(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return gl(e,t,r)}}function Ll(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:kl;cl&&cl(e,null);let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){const e=n(o);e!==o&&(ul(t)||(t[r]=e),o=e)}e[o]=!0}return e}function Rl(e){for(let t=0;t<e.length;t++){Cl(e,t)||(e[t]=null)}return e}function Pl(e){
|
|
179
|
+
const t=fl(null);for(const[n,r]of ll(e)){Cl(e,n)&&(Array.isArray(r)?t[n]=Rl(r):r&&"object"==typeof r&&r.constructor===Object?t[n]=Pl(r):t[n]=r)}return t}function Dl(e,t){for(;null!==e;){const n=hl(e,t);if(n){if(n.get)return Ol(n.get);if("function"==typeof n.value)return Ol(n.value)}e=dl(e)}return function(){return null}}
|
|
180
|
+
const Hl=ml(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Fl=ml(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),jl=ml(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),$l=ml(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Bl=ml(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ql=ml(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ul=ml(["#text"]),Gl=ml(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Vl=ml(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Wl=ml(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Kl=ml(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Yl=pl(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Xl=pl(/<%[\w\W]*|[\w\W]*%>/gm),Zl=pl(/\$\{[\w\W]*/gm),Jl=pl(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ql=pl(/^aria-[\-\w]+$/),ec=pl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),tc=pl(/^(?:\w+script|data):/i),nc=pl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),rc=pl(/^html$/i),oc=pl(/^[a-z][.\w]*(-[.\w]+)+$/i)
|
|
181
|
+
;var ic=Object.freeze({__proto__:null,ARIA_ATTR:Ql,ATTR_WHITESPACE:nc,CUSTOM_ELEMENT:oc,DATA_ATTR:Jl,DOCTYPE_NAME:rc,ERB_EXPR:Xl,IS_ALLOWED_URI:ec,IS_SCRIPT_OR_DATA:tc,MUSTACHE_EXPR:Yl,TMPLIT_EXPR:Zl});const ac=1,sc=3,lc=7,cc=8,uc=9,dc=function(){return"undefined"==typeof window?null:window};var hc,mc,pc=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:dc();const n=t=>e(t);if(n.version="3.2.6",n.removed=[],!t||!t.document||t.document.nodeType!==uc||!t.Element)return n.isSupported=!1,n;let{document:r}=t;const o=r,i=o.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:c,NodeFilter:u,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:m,trustedTypes:p}=t,f=c.prototype,g=Dl(f,"cloneNode"),v=Dl(f,"remove"),b=Dl(f,"nextSibling"),y=Dl(f,"childNodes"),_=Dl(f,"parentNode");if("function"==typeof s){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let w,x=""
|
|
182
|
+
;const{implementation:k,createNodeIterator:N,createDocumentFragment:S,getElementsByTagName:A}=r,{importNode:T}=o;let E={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof ll&&"function"==typeof _&&k&&void 0!==k.createHTMLDocument;const{MUSTACHE_EXPR:C,ERB_EXPR:M,TMPLIT_EXPR:I,DATA_ATTR:z,ARIA_ATTR:O,IS_SCRIPT_OR_DATA:L,ATTR_WHITESPACE:R,CUSTOM_ELEMENT:P}=ic;let{IS_ALLOWED_URI:D}=ic,H=null;const F=Ll({},[...Hl,...Fl,...jl,...Bl,...Ul]);let j=null;const $=Ll({},[...Gl,...Vl,...Wl,...Kl]);let B=Object.seal(fl(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}
|
|
183
|
+
})),q=null,U=null,G=!0,V=!0,W=!1,K=!0,Y=!1,X=!0,Z=!1,J=!1,Q=!1,ee=!1,te=!1,ne=!1,re=!0,oe=!1,ie=!0,ae=!1,se={},le=null;const ce=Ll({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ue=null;const de=Ll({},["audio","video","img","source","image","track"]);let he=null;const me=Ll({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pe="http://www.w3.org/1998/Math/MathML",fe="http://www.w3.org/2000/svg",ge="http://www.w3.org/1999/xhtml";let ve=ge,be=!1,ye=null;const _e=Ll({},[pe,fe,ge],Nl);let we=Ll({},["mi","mo","mn","ms","mtext"]),xe=Ll({},["annotation-xml"]);const ke=Ll({},["title","style","font","a","script"]);let Ne=null;const Se=["application/xhtml+xml","text/html"];let Ae=null,Te=null;const Ee=r.createElement("form"),Ce=function(e){
|
|
184
|
+
return e instanceof RegExp||e instanceof Function},Me=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Te||Te!==e){if(e&&"object"==typeof e||(e={}),e=Pl(e),Ne=-1===Se.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ae="application/xhtml+xml"===Ne?Nl:kl,H=Cl(e,"ALLOWED_TAGS")?Ll({},e.ALLOWED_TAGS,Ae):F,j=Cl(e,"ALLOWED_ATTR")?Ll({},e.ALLOWED_ATTR,Ae):$,ye=Cl(e,"ALLOWED_NAMESPACES")?Ll({},e.ALLOWED_NAMESPACES,Nl):_e,he=Cl(e,"ADD_URI_SAFE_ATTR")?Ll(Pl(me),e.ADD_URI_SAFE_ATTR,Ae):me,ue=Cl(e,"ADD_DATA_URI_TAGS")?Ll(Pl(de),e.ADD_DATA_URI_TAGS,Ae):de,le=Cl(e,"FORBID_CONTENTS")?Ll({},e.FORBID_CONTENTS,Ae):ce,q=Cl(e,"FORBID_TAGS")?Ll({},e.FORBID_TAGS,Ae):Pl({}),U=Cl(e,"FORBID_ATTR")?Ll({},e.FORBID_ATTR,Ae):Pl({}),se=!!Cl(e,"USE_PROFILES")&&e.USE_PROFILES,G=!1!==e.ALLOW_ARIA_ATTR,V=!1!==e.ALLOW_DATA_ATTR,W=e.ALLOW_UNKNOWN_PROTOCOLS||!1,K=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Y=e.SAFE_FOR_TEMPLATES||!1,X=!1!==e.SAFE_FOR_XML,Z=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,
|
|
185
|
+
te=e.RETURN_DOM_FRAGMENT||!1,ne=e.RETURN_TRUSTED_TYPE||!1,Q=e.FORCE_BODY||!1,re=!1!==e.SANITIZE_DOM,oe=e.SANITIZE_NAMED_PROPS||!1,ie=!1!==e.KEEP_CONTENT,ae=e.IN_PLACE||!1,D=e.ALLOWED_URI_REGEXP||ec,ve=e.NAMESPACE||ge,we=e.MATHML_TEXT_INTEGRATION_POINTS||we,xe=e.HTML_INTEGRATION_POINTS||xe,B=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ce(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(B.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ce(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(B.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(B.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(V=!1),te&&(ee=!0),se&&(H=Ll({},Ul),j=[],!0===se.html&&(Ll(H,Hl),Ll(j,Gl)),!0===se.svg&&(Ll(H,Fl),Ll(j,Vl),Ll(j,Kl)),!0===se.svgFilters&&(Ll(H,jl),Ll(j,Vl),Ll(j,Kl)),!0===se.mathMl&&(Ll(H,Bl),Ll(j,Wl),Ll(j,Kl))),
|
|
186
|
+
e.ADD_TAGS&&(H===F&&(H=Pl(H)),Ll(H,e.ADD_TAGS,Ae)),e.ADD_ATTR&&(j===$&&(j=Pl(j)),Ll(j,e.ADD_ATTR,Ae)),e.ADD_URI_SAFE_ATTR&&Ll(he,e.ADD_URI_SAFE_ATTR,Ae),e.FORBID_CONTENTS&&(le===ce&&(le=Pl(le)),Ll(le,e.FORBID_CONTENTS,Ae)),ie&&(H["#text"]=!0),Z&&Ll(H,["html","head","body"]),H.table&&(Ll(H,["tbody"]),delete q.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Il('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Il('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=e.TRUSTED_TYPES_POLICY,x=w.createHTML("")}else void 0===w&&(w=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){
|
|
187
|
+
return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(p,i)),null!==w&&"string"==typeof x&&(x=w.createHTML(""));ml&&ml(e),Te=e}},Ie=Ll({},[...Fl,...jl,...$l]),ze=Ll({},[...Bl,...ql]),Oe=function(e){wl(n.removed,{element:e});try{_(e).removeChild(e)}catch(t){v(e)}},Le=function(e,t){try{wl(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){wl(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ee||te)try{Oe(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Re=function(e){let t=null,n=null;if(Q)e="<remove></remove>"+e;else{const t=Sl(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Ne&&ve===ge&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=w?w.createHTML(e):e;if(ve===ge)try{t=(new m).parseFromString(o,Ne)}catch(e){}if(!t||!t.documentElement){t=k.createDocument(ve,"template",null);try{t.documentElement.innerHTML=be?x:o}catch(e){}}const i=t.body||t.documentElement
|
|
188
|
+
;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ve===ge?A.call(t,Z?"html":"body")[0]:Z?t.documentElement:i},Pe=function(e){return N.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},De=function(e){return e instanceof h&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},He=function(e){return"function"==typeof l&&e instanceof l};function Fe(e,t,r){bl(e,(e=>{e.call(n,t,r,Te)}))}const je=function(e){let t=null;if(Fe(E.beforeSanitizeElements,e,null),De(e))return Oe(e),!0;const r=Ae(e.nodeName);if(Fe(E.uponSanitizeElement,e,{tagName:r,allowedTags:H}),X&&e.hasChildNodes()&&!He(e.firstElementChild)&&Ml(/<[/\w!]/g,e.innerHTML)&&Ml(/<[/\w!]/g,e.textContent))return Oe(e),
|
|
189
|
+
!0;if(e.nodeType===lc)return Oe(e),!0;if(X&&e.nodeType===cc&&Ml(/<[/\w]/g,e.data))return Oe(e),!0;if(!H[r]||q[r]){if(!q[r]&&Be(r)){if(B.tagNameCheck instanceof RegExp&&Ml(B.tagNameCheck,r))return!1;if(B.tagNameCheck instanceof Function&&B.tagNameCheck(r))return!1}if(ie&&!le[r]){const t=_(e)||e.parentNode,n=y(e)||e.childNodes;if(n&&t){for(let r=n.length-1;r>=0;--r){const o=g(n[r],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,b(e))}}}return Oe(e),!0}return e instanceof c&&!function(e){let t=_(e);t&&t.tagName||(t={namespaceURI:ve,tagName:"template"});const n=kl(e.tagName),r=kl(t.tagName)
|
|
190
|
+
;return!!ye[e.namespaceURI]&&(e.namespaceURI===fe?t.namespaceURI===ge?"svg"===n:t.namespaceURI===pe?"svg"===n&&("annotation-xml"===r||we[r]):Boolean(Ie[n]):e.namespaceURI===pe?t.namespaceURI===ge?"math"===n:t.namespaceURI===fe?"math"===n&&xe[r]:Boolean(ze[n]):e.namespaceURI===ge?!(t.namespaceURI===fe&&!xe[r])&&!(t.namespaceURI===pe&&!we[r])&&!ze[n]&&(ke[n]||!Ie[n]):!("application/xhtml+xml"!==Ne||!ye[e.namespaceURI]))}(e)?(Oe(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!Ml(/<\/no(script|embed|frames)/i,e.innerHTML)?(Y&&e.nodeType===sc&&(t=e.textContent,bl([C,M,I],(e=>{t=Al(t,e," ")})),e.textContent!==t&&(wl(n.removed,{element:e.cloneNode()}),e.textContent=t)),Fe(E.afterSanitizeElements,e,null),!1):(Oe(e),!0)},$e=function(e,t,n){if(re&&("id"===t||"name"===t)&&(n in r||n in Ee))return!1;if(V&&!U[t]&&Ml(z,t));else if(G&&Ml(O,t));else if(!j[t]||U[t]){
|
|
191
|
+
if(!(Be(e)&&(B.tagNameCheck instanceof RegExp&&Ml(B.tagNameCheck,e)||B.tagNameCheck instanceof Function&&B.tagNameCheck(e))&&(B.attributeNameCheck instanceof RegExp&&Ml(B.attributeNameCheck,t)||B.attributeNameCheck instanceof Function&&B.attributeNameCheck(t))||"is"===t&&B.allowCustomizedBuiltInElements&&(B.tagNameCheck instanceof RegExp&&Ml(B.tagNameCheck,n)||B.tagNameCheck instanceof Function&&B.tagNameCheck(n))))return!1}else if(he[t]);else if(Ml(D,Al(n,R,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Tl(n,"data:")||!ue[e]){if(W&&!Ml(L,Al(n,R,"")));else if(n)return!1}else;return!0},Be=function(e){return"annotation-xml"!==e&&Sl(e,P)},qe=function(e){Fe(E.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||De(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j,forceKeepAttr:void 0};let o=t.length;for(;o--;){const i=t[o],{name:a,namespaceURI:s,value:l}=i,c=Ae(a),u=l;let d="value"===a?u:El(u);if(r.attrName=c,r.attrValue=d,r.keepAttr=!0,
|
|
192
|
+
r.forceKeepAttr=void 0,Fe(E.uponSanitizeAttribute,e,r),d=r.attrValue,!oe||"id"!==c&&"name"!==c||(Le(a,e),d="user-content-"+d),X&&Ml(/((--!?|])>)|<\/(style|title)/i,d)){Le(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Le(a,e);continue}if(!K&&Ml(/\/>/i,d)){Le(a,e);continue}Y&&bl([C,M,I],(e=>{d=Al(d,e," ")}));const h=Ae(e.nodeName);if($e(h,c,d)){if(w&&"object"==typeof p&&"function"==typeof p.getAttributeType)if(s);else switch(p.getAttributeType(h,c)){case"TrustedHTML":d=w.createHTML(d);break;case"TrustedScriptURL":d=w.createScriptURL(d)}if(d!==u)try{s?e.setAttributeNS(s,a,d):e.setAttribute(a,d),De(e)?Oe(e):_l(n.removed)}catch(t){Le(a,e)}}else Le(a,e)}Fe(E.afterSanitizeAttributes,e,null)},Ue=function e(t){let n=null;const r=Pe(t);for(Fe(E.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)Fe(E.uponSanitizeShadowNode,n,null),je(n),qe(n),n.content instanceof a&&e(n.content);Fe(E.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){
|
|
193
|
+
let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,s=null,c=null;if(be=!e,be&&(e="\x3c!--\x3e"),"string"!=typeof e&&!He(e)){if("function"!=typeof e.toString)throw Il("toString is not a function");if("string"!=typeof(e=e.toString()))throw Il("dirty is not a string, aborting")}if(!n.isSupported)return e;if(J||Me(t),n.removed=[],"string"==typeof e&&(ae=!1),ae){if(e.nodeName){const t=Ae(e.nodeName);if(!H[t]||q[t])throw Il("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)r=Re("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),i.nodeType===ac&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!ee&&!Y&&!Z&&-1===e.indexOf("<"))return w&&ne?w.createHTML(e):e;if(r=Re(e),!r)return ee?null:ne?x:""}r&&Q&&Oe(r.firstChild);const u=Pe(ae?e:r);for(;s=u.nextNode();)je(s),qe(s),s.content instanceof a&&Ue(s.content);if(ae)return e;if(ee){if(te)for(c=S.call(r.ownerDocument);r.firstChild;)c.appendChild(r.firstChild);else c=r
|
|
194
|
+
;return(j.shadowroot||j.shadowrootmode)&&(c=T.call(o,c,!0)),c}let d=Z?r.outerHTML:r.innerHTML;return Z&&H["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&Ml(rc,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),Y&&bl([C,M,I],(e=>{d=Al(d,e," ")})),w&&ne?w.createHTML(d):d},n.setConfig=function(){Me(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),J=!0},n.clearConfig=function(){Te=null,J=!1},n.isValidAttribute=function(e,t,n){Te||Me({});const r=Ae(e),o=Ae(t);return $e(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&wl(E[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=yl(E[e],t);return-1===n?void 0:xl(E[e],n,1)[0]}return _l(E[e])},n.removeHooks=function(e){E[e]=[]},n.removeAllHooks=function(){E={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],
|
|
195
|
+
uponSanitizeShadowNode:[]}},n}();var fc=function(){if(mc)return hc;mc=1;var e=/["'&<>]/;return hc=function(t){var n,r=""+t,o=e.exec(r);if(!o)return r;var i="",a=0,s=0;for(a=o.index;a<r.length;a++){switch(r.charCodeAt(a)){case 34:n=""";break;case 38:n="&";break;case 39:n="'";break;case 60:n="<";break;case 62:n=">";break;default:continue}s!==a&&(i+=r.substring(s,a)),s=a+1,i+=n}return s!==a?i+r.substring(s,a):i},hc}(),gc=Ge(fc);class vc{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new vc(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class bc{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new bc(t,vc.range(this,e))}}class yc{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n,r,o="KaTeX parse error: "+e,i=t&&t.loc
|
|
196
|
+
;if(i&&i.start<=i.end){var a=i.lexer.input;n=i.start,r=i.end,n===a.length?o+=" at end of input: ":o+=" at position "+(n+1)+": ";var s=a.slice(n,r).replace(/[^]/g,"$&̲");o+=(n>15?"…"+a.slice(n-15,n):a.slice(0,n))+s+(r+15<a.length?a.slice(r,r+15)+"…":a.slice(r))}var l=new Error(o);return l.name="ParseError",l.__proto__=yc.prototype,l.position=n,null!=n&&null!=r&&(l.length=r-n),l.rawMessage=e,l}}yc.prototype.__proto__=Error.prototype;var _c=/([A-Z])/g,wc={"&":"&",">":">","<":"<",'"':""","'":"'"},xc=/[&><"']/g;var kc=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},Nc={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(xc,(e=>wc[e]))},hyphenate:function(e){return e.replace(_c,"-$1").toLowerCase()},getBaseElem:kc,isCharacterBox:function(e){var t=kc(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},protocolFromUrl:function(e){
|
|
197
|
+
var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?":"!==t[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?t[1].toLowerCase():null:"_relative"}},Sc={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",
|
|
197
198
|
cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],
|
|
198
|
-
description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function
|
|
199
|
-
;var t=e.type,n=Array.isArray(t)?t[0]:t;if("string"!=typeof n)return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class
|
|
200
|
-
;"warn"===r?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,n){var r=this.strict;if("function"==typeof r)try{r=r(e,t,n)}catch(e){r="error"}return!(!r||"ignore"===r)&&(!0===r||"error"===r||("warn"===r?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),!1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]"),!1)))}isTrusted(e){if(e.url&&!e.protocol){var t=
|
|
201
|
-
return
|
|
199
|
+
description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function Ac(e){if(e.default)return e.default
|
|
200
|
+
;var t=e.type,n=Array.isArray(t)?t[0]:t;if("string"!=typeof n)return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class Tc{constructor(e){for(var t in this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{},Sc)if(Sc.hasOwnProperty(t)){var n=Sc[t];this[t]=void 0!==e[t]?n.processor?n.processor(e[t]):e[t]:Ac(n)}}reportNonstrict(e,t,n){var r=this.strict;if("function"==typeof r&&(r=r(e,t,n)),r&&"ignore"!==r){if(!0===r||"error"===r)throw new yc("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n)
|
|
201
|
+
;"warn"===r?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,n){var r=this.strict;if("function"==typeof r)try{r=r(e,t,n)}catch(e){r="error"}return!(!r||"ignore"===r)&&(!0===r||"error"===r||("warn"===r?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),!1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]"),!1)))}isTrusted(e){if(e.url&&!e.protocol){var t=Nc.protocolFromUrl(e.url);if(null==t)return!1;e.protocol=t}var n="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(n)}}class Ec{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Cc[Mc[this.id]]}sub(){
|
|
202
|
+
return Cc[Ic[this.id]]}fracNum(){return Cc[zc[this.id]]}fracDen(){return Cc[Oc[this.id]]}cramp(){return Cc[Lc[this.id]]}text(){return Cc[Rc[this.id]]}isTight(){return this.size>=2}}var Cc=[new Ec(0,0,!1),new Ec(1,0,!0),new Ec(2,1,!1),new Ec(3,1,!0),new Ec(4,2,!1),new Ec(5,2,!0),new Ec(6,3,!1),new Ec(7,3,!0)],Mc=[4,5,4,5,6,7,6,7],Ic=[5,5,5,5,7,7,7,7],zc=[2,3,4,5,6,7,6,7],Oc=[3,3,5,5,7,7,7,7],Lc=[1,1,3,3,5,5,7,7],Rc=[0,1,2,3,2,3,2,3],Pc={DISPLAY:Cc[0],TEXT:Cc[2],SCRIPT:Cc[4],SCRIPTSCRIPT:Cc[6]},Dc=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];var Hc=[];function Fc(e){for(var t=0;t<Hc.length;t+=2)if(e>=Hc[t]&&e<=Hc[t+1])return!0;return!1}Dc.forEach((e=>e.blocks.forEach((e=>Hc.push(...e)))));var jc=80,$c={
|
|
202
203
|
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",
|
|
203
204
|
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",
|
|
204
205
|
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",
|
|
@@ -218,7 +219,7 @@ widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,
|
|
|
218
219
|
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",
|
|
219
220
|
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",
|
|
220
221
|
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",
|
|
221
|
-
shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};class
|
|
222
|
+
shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};class Bc{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return Nc.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map((e=>e.toText())).join("")}}var qc={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],
|
|
222
223
|
67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],
|
|
223
224
|
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],
|
|
224
225
|
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],
|
|
@@ -275,194 +276,194 @@ shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,
|
|
|
275
276
|
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],
|
|
276
277
|
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],
|
|
277
278
|
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],
|
|
278
|
-
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]}},
|
|
279
|
-
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]},
|
|
280
|
-
"а":"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
|
|
281
|
-
this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||
|
|
282
|
-
textSize:e,sizeMultiplier:
|
|
283
|
-
cssEmPerMu:
|
|
284
|
-
this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var r=t.getColor();r&&(this.style.color=r)}},
|
|
285
|
-
;return t+="</"+e+">"};class
|
|
286
|
-
this.style=n}hasClass(e){return
|
|
287
|
-
}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=
|
|
288
|
-
this.attributes=t||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+
|
|
289
|
-
constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+
|
|
290
|
-
wu
|
|
291
|
-
wu
|
|
292
|
-
wu
|
|
293
|
-
wu
|
|
294
|
-
wu
|
|
295
|
-
wu
|
|
296
|
-
wu
|
|
297
|
-
wu
|
|
298
|
-
wu
|
|
299
|
-
wu
|
|
300
|
-
wu
|
|
301
|
-
wu
|
|
302
|
-
wu
|
|
303
|
-
wu
|
|
304
|
-
wu
|
|
305
|
-
wu
|
|
306
|
-
wu
|
|
307
|
-
|
|
308
|
-
var
|
|
309
|
-
|
|
310
|
-
var
|
|
311
|
-
return
|
|
312
|
-
i.maxFontSize>r&&(r=i.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},
|
|
313
|
-
fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},
|
|
314
|
-
for(var{children:n,depth:r}=function(e){if("individualShift"===e.positionType){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,o=r,i=1;i<t.length;i++){var a=-t[i].shift-o-t[i].elem.depth,s=a-(t[i-1].elem.height+t[i-1].elem.depth);o+=a,n.push({type:"kern",size:s}),n.push(t[i])}return{children:n,depth:r}}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),o=0,i=0;i<n.length;i++){var a=n[i];if("elem"===a.type){var s=a.elem;o=Math.max(o,s.maxFontSize,s.height)}}o+=2;var l=
|
|
315
|
-
;for(var c=[],u=r,d=r,h=r,m=0;m<n.length;m++){var p=n[m];if("kern"===p.type)h+=p.size;else{var f=p.elem,g=p.wrapperClasses||[],v=p.wrapperStyle||{},b=
|
|
316
|
-
if(120782<=n&&n<=120831){var i=Math.floor((n-120782)/10);return[
|
|
317
|
-
;return
|
|
318
|
-
mop:
|
|
319
|
-
throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var
|
|
320
|
-
;"mbin"===n&&
|
|
321
|
-
;return
|
|
322
|
-
n?((i=
|
|
323
|
-
for(var r=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof
|
|
324
|
-
this.character=e>=.05555&&e<=.05556?" ":e>=.1666&&e<=.1667?" ":e>=.2222&&e<=.2223?" ":e>=.2777&&e<=.2778?" ":e>=-.05556&&e<=-.05555?" ":e>=-.1667&&e<=-.1666?" ":e>=-.2223&&e<=-.2222?" ":e>=-.2778&&e<=-.2777?" ":null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",
|
|
325
|
-
;if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";var n=t.font;if(!n||"mathnormal"===n)return null;var r=e.mode;if("mathit"===n)return"italic";if("boldsymbol"===n)return"textord"===e.type?"bold":"bold-italic";if("mathbf"===n)return"bold";if("mathbb"===n)return"double-struck";if("mathsfit"===n)return"sans-serif-italic";if("mathfrak"===n)return"fraktur";if("mathscr"===n||"mathcal"===n)return"script";if("mathsf"===n)return"sans-serif";if("mathtt"===n)return"monospace";var o=e.text;return
|
|
326
|
-
var t=e.children[0];return t instanceof
|
|
327
|
-
;l instanceof
|
|
328
|
-
;return
|
|
329
|
-
"\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},
|
|
279
|
+
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]}},Uc={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],
|
|
280
|
+
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]},Gc={"Å":"A","Ð":"D","Þ":"o","å":"a","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R",
|
|
281
|
+
"а":"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 Vc(e,t,n){if(!qc[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),o=qc[t][r];if(!o&&e[0]in Gc&&(r=Gc[e[0]].charCodeAt(0),o=qc[t][r]),o||"text"!==n||Fc(r)&&(o=qc[t][77]),o)return{depth:o[0],height:o[1],italic:o[2],skew:o[3],width:o[4]}}var Wc={};var Kc=[[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]],Yc=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Xc=function(e,t){return t.size<2?e:Kc[e-1][t.size-1]};class Zc{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,
|
|
282
|
+
this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||Zc.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=Yc[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return new Zc(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Xc(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,
|
|
283
|
+
textSize:e,sizeMultiplier:Yc[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=Xc(Zc.BASESIZE,e);return this.size===t&&this.textSize===Zc.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Zc.BASESIZE?["sizing","reset-size"+this.size,"size"+Zc.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!Wc[t=e>=5?0:e>=3?1:2]){var n=Wc[t]={
|
|
284
|
+
cssEmPerMu:Uc.quad[t]/18};for(var r in Uc)Uc.hasOwnProperty(r)&&(n[r]=Uc[r][t])}return Wc[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Zc.BASESIZE=6;var Jc={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},Qc={ex:!0,em:!0,mu:!0},eu=function(e){return"string"!=typeof e&&(e=e.unit),e in Jc||e in Qc||"ex"===e},tu=function(e,t){var n;if(e.unit in Jc)n=Jc[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)n=t.fontMetrics().cssEmPerMu;else{var r;if(r=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)n=r.fontMetrics().xHeight;else{if("em"!==e.unit)throw new yc("Invalid unit: '"+e.unit+"'");n=r.fontMetrics().quad}r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},nu=function(e){return+e.toFixed(4)+"em"},ru=function(e){return e.filter((e=>e)).join(" ")},ou=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,
|
|
285
|
+
this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var r=t.getColor();r&&(this.style.color=r)}},iu=function(e){var t=document.createElement(e);for(var n in t.className=ru(this.classes),this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var r in this.attributes)this.attributes.hasOwnProperty(r)&&t.setAttribute(r,this.attributes[r]);for(var o=0;o<this.children.length;o++)t.appendChild(this.children[o].toNode());return t},au=/[\s"'>/=\x00-\x1f]/,su=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+Nc.escape(ru(this.classes))+'"');var n="";for(var r in this.style)this.style.hasOwnProperty(r)&&(n+=Nc.hyphenate(r)+":"+this.style[r]+";");for(var o in n&&(t+=' style="'+Nc.escape(n)+'"'),this.attributes)if(this.attributes.hasOwnProperty(o)){if(au.test(o))throw new yc("Invalid attribute name '"+o+"'");t+=" "+o+'="'+Nc.escape(this.attributes[o])+'"'}t+=">";for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup()
|
|
286
|
+
;return t+="</"+e+">"};class lu{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,ou.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return Nc.contains(this.classes,e)}toNode(){return iu.call(this,"span")}toMarkup(){return su.call(this,"span")}}class cu{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,ou.call(this,t,r),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return Nc.contains(this.classes,e)}toNode(){return iu.call(this,"a")}toMarkup(){return su.call(this,"a")}}class uu{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],
|
|
287
|
+
this.style=n}hasClass(e){return Nc.contains(this.classes,e)}toNode(){var e=document.createElement("img");for(var t in e.src=this.src,e.alt=this.alt,e.className="mord",this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e='<img src="'+Nc.escape(this.src)+'" alt="'+Nc.escape(this.alt)+'"',t="";for(var n in this.style)this.style.hasOwnProperty(n)&&(t+=Nc.hyphenate(n)+":"+this.style[n]+";");return t&&(e+=' style="'+Nc.escape(t)+'"'),e+="'/>"}}var du={"î":"ı̂","ï":"ı̈","í":"ı́","ì":"ı̀"};class hu{constructor(e,t,n,r,o,i,a,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=o||0,this.width=i||0,this.classes=a||[],this.style=s||{},this.maxFontSize=0;var l=function(e){for(var t=0;t<Dc.length;t++)for(var n=Dc[t],r=0;r<n.blocks.length;r++){var o=n.blocks[r];if(e>=o[0]&&e<=o[1])return n.name
|
|
288
|
+
}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=du[this.text])}hasClass(e){return Nc.contains(this.classes,e)}toNode(){var e=document.createTextNode(this.text),t=null;for(var n in this.italic>0&&((t=document.createElement("span")).style.marginRight=nu(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=ru(this.classes)),this.style)this.style.hasOwnProperty(n)&&((t=t||document.createElement("span")).style[n]=this.style[n]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=Nc.escape(ru(this.classes)),t+='"');var n="";for(var r in this.italic>0&&(n+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(r)&&(n+=Nc.hyphenate(r)+":"+this.style[r]+";");n&&(e=!0,t+=' style="'+Nc.escape(n)+'"');var o=Nc.escape(this.text);return e?(t+=">",t+=o,t+="</span>"):o}}class mu{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],
|
|
289
|
+
this.attributes=t||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+Nc.escape(this.attributes[t])+'"');e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</svg>"}}class pu{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","path");return this.alternate?e.setAttribute("d",this.alternate):e.setAttribute("d",$c[this.pathName]),e}toMarkup(){return this.alternate?'<path d="'+Nc.escape(this.alternate)+'"/>':'<path d="'+Nc.escape($c[this.pathName])+'"/>'}}class fu{
|
|
290
|
+
constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+Nc.escape(this.attributes[t])+'"');return e+="/>"}}function gu(e){if(e instanceof hu)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}var vu={bin:1,close:1,inner:1,open:1,punct:1,rel:1},bu={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},yu={math:{},text:{}};function _u(e,t,n,r,o,i){yu[e][o]={font:t,group:n,replace:r},i&&r&&(yu[e][r]=yu[e][o])}var wu="math",xu="text",ku="main",Nu="ams",Su="accent-token",Au="bin",Tu="close",Eu="inner",Cu="mathord",Mu="op-token",Iu="open",zu="punct",Ou="rel",Lu="spacing",Ru="textord";_u(wu,ku,Ou,"≡","\\equiv",!0),_u(wu,ku,Ou,"≺","\\prec",!0),
|
|
291
|
+
_u(wu,ku,Ou,"≻","\\succ",!0),_u(wu,ku,Ou,"∼","\\sim",!0),_u(wu,ku,Ou,"⊥","\\perp"),_u(wu,ku,Ou,"⪯","\\preceq",!0),_u(wu,ku,Ou,"⪰","\\succeq",!0),_u(wu,ku,Ou,"≃","\\simeq",!0),_u(wu,ku,Ou,"∣","\\mid",!0),_u(wu,ku,Ou,"≪","\\ll",!0),_u(wu,ku,Ou,"≫","\\gg",!0),_u(wu,ku,Ou,"≍","\\asymp",!0),_u(wu,ku,Ou,"∥","\\parallel"),_u(wu,ku,Ou,"⋈","\\bowtie",!0),_u(wu,ku,Ou,"⌣","\\smile",!0),_u(wu,ku,Ou,"⊑","\\sqsubseteq",!0),_u(wu,ku,Ou,"⊒","\\sqsupseteq",!0),_u(wu,ku,Ou,"≐","\\doteq",!0),_u(wu,ku,Ou,"⌢","\\frown",!0),_u(wu,ku,Ou,"∋","\\ni",!0),_u(wu,ku,Ou,"∝","\\propto",!0),_u(wu,ku,Ou,"⊢","\\vdash",!0),_u(wu,ku,Ou,"⊣","\\dashv",!0),_u(wu,ku,Ou,"∋","\\owns"),_u(wu,ku,zu,".","\\ldotp"),_u(wu,ku,zu,"⋅","\\cdotp"),_u(wu,ku,Ru,"#","\\#"),_u(xu,ku,Ru,"#","\\#"),_u(wu,ku,Ru,"&","\\&"),_u(xu,ku,Ru,"&","\\&"),_u(wu,ku,Ru,"ℵ","\\aleph",!0),_u(wu,ku,Ru,"∀","\\forall",!0),_u(wu,ku,Ru,"ℏ","\\hbar",!0),_u(wu,ku,Ru,"∃","\\exists",!0),_u(wu,ku,Ru,"∇","\\nabla",!0),_u(wu,ku,Ru,"♭","\\flat",!0),_u(wu,ku,Ru,"ℓ","\\ell",!0),
|
|
292
|
+
_u(wu,ku,Ru,"♮","\\natural",!0),_u(wu,ku,Ru,"♣","\\clubsuit",!0),_u(wu,ku,Ru,"℘","\\wp",!0),_u(wu,ku,Ru,"♯","\\sharp",!0),_u(wu,ku,Ru,"♢","\\diamondsuit",!0),_u(wu,ku,Ru,"ℜ","\\Re",!0),_u(wu,ku,Ru,"♡","\\heartsuit",!0),_u(wu,ku,Ru,"ℑ","\\Im",!0),_u(wu,ku,Ru,"♠","\\spadesuit",!0),_u(wu,ku,Ru,"§","\\S",!0),_u(xu,ku,Ru,"§","\\S"),_u(wu,ku,Ru,"¶","\\P",!0),_u(xu,ku,Ru,"¶","\\P"),_u(wu,ku,Ru,"†","\\dag"),_u(xu,ku,Ru,"†","\\dag"),_u(xu,ku,Ru,"†","\\textdagger"),_u(wu,ku,Ru,"‡","\\ddag"),_u(xu,ku,Ru,"‡","\\ddag"),_u(xu,ku,Ru,"‡","\\textdaggerdbl"),_u(wu,ku,Tu,"⎱","\\rmoustache",!0),_u(wu,ku,Iu,"⎰","\\lmoustache",!0),_u(wu,ku,Tu,"⟯","\\rgroup",!0),_u(wu,ku,Iu,"⟮","\\lgroup",!0),_u(wu,ku,Au,"∓","\\mp",!0),_u(wu,ku,Au,"⊖","\\ominus",!0),_u(wu,ku,Au,"⊎","\\uplus",!0),_u(wu,ku,Au,"⊓","\\sqcap",!0),_u(wu,ku,Au,"∗","\\ast"),_u(wu,ku,Au,"⊔","\\sqcup",!0),_u(wu,ku,Au,"◯","\\bigcirc",!0),_u(wu,ku,Au,"∙","\\bullet",!0),_u(wu,ku,Au,"‡","\\ddagger"),_u(wu,ku,Au,"≀","\\wr",!0),_u(wu,ku,Au,"⨿","\\amalg"),_u(wu,ku,Au,"&","\\And"),
|
|
293
|
+
_u(wu,ku,Ou,"⟵","\\longleftarrow",!0),_u(wu,ku,Ou,"⇐","\\Leftarrow",!0),_u(wu,ku,Ou,"⟸","\\Longleftarrow",!0),_u(wu,ku,Ou,"⟶","\\longrightarrow",!0),_u(wu,ku,Ou,"⇒","\\Rightarrow",!0),_u(wu,ku,Ou,"⟹","\\Longrightarrow",!0),_u(wu,ku,Ou,"↔","\\leftrightarrow",!0),_u(wu,ku,Ou,"⟷","\\longleftrightarrow",!0),_u(wu,ku,Ou,"⇔","\\Leftrightarrow",!0),_u(wu,ku,Ou,"⟺","\\Longleftrightarrow",!0),_u(wu,ku,Ou,"↦","\\mapsto",!0),_u(wu,ku,Ou,"⟼","\\longmapsto",!0),_u(wu,ku,Ou,"↗","\\nearrow",!0),_u(wu,ku,Ou,"↩","\\hookleftarrow",!0),_u(wu,ku,Ou,"↪","\\hookrightarrow",!0),_u(wu,ku,Ou,"↘","\\searrow",!0),_u(wu,ku,Ou,"↼","\\leftharpoonup",!0),_u(wu,ku,Ou,"⇀","\\rightharpoonup",!0),_u(wu,ku,Ou,"↙","\\swarrow",!0),_u(wu,ku,Ou,"↽","\\leftharpoondown",!0),_u(wu,ku,Ou,"⇁","\\rightharpoondown",!0),_u(wu,ku,Ou,"↖","\\nwarrow",!0),_u(wu,ku,Ou,"⇌","\\rightleftharpoons",!0),_u(wu,Nu,Ou,"≮","\\nless",!0),_u(wu,Nu,Ou,"","\\@nleqslant"),_u(wu,Nu,Ou,"","\\@nleqq"),_u(wu,Nu,Ou,"⪇","\\lneq",!0),_u(wu,Nu,Ou,"≨","\\lneqq",!0),
|
|
294
|
+
_u(wu,Nu,Ou,"","\\@lvertneqq"),_u(wu,Nu,Ou,"⋦","\\lnsim",!0),_u(wu,Nu,Ou,"⪉","\\lnapprox",!0),_u(wu,Nu,Ou,"⊀","\\nprec",!0),_u(wu,Nu,Ou,"⋠","\\npreceq",!0),_u(wu,Nu,Ou,"⋨","\\precnsim",!0),_u(wu,Nu,Ou,"⪹","\\precnapprox",!0),_u(wu,Nu,Ou,"≁","\\nsim",!0),_u(wu,Nu,Ou,"","\\@nshortmid"),_u(wu,Nu,Ou,"∤","\\nmid",!0),_u(wu,Nu,Ou,"⊬","\\nvdash",!0),_u(wu,Nu,Ou,"⊭","\\nvDash",!0),_u(wu,Nu,Ou,"⋪","\\ntriangleleft"),_u(wu,Nu,Ou,"⋬","\\ntrianglelefteq",!0),_u(wu,Nu,Ou,"⊊","\\subsetneq",!0),_u(wu,Nu,Ou,"","\\@varsubsetneq"),_u(wu,Nu,Ou,"⫋","\\subsetneqq",!0),_u(wu,Nu,Ou,"","\\@varsubsetneqq"),_u(wu,Nu,Ou,"≯","\\ngtr",!0),_u(wu,Nu,Ou,"","\\@ngeqslant"),_u(wu,Nu,Ou,"","\\@ngeqq"),_u(wu,Nu,Ou,"⪈","\\gneq",!0),_u(wu,Nu,Ou,"≩","\\gneqq",!0),_u(wu,Nu,Ou,"","\\@gvertneqq"),_u(wu,Nu,Ou,"⋧","\\gnsim",!0),_u(wu,Nu,Ou,"⪊","\\gnapprox",!0),_u(wu,Nu,Ou,"⊁","\\nsucc",!0),_u(wu,Nu,Ou,"⋡","\\nsucceq",!0),_u(wu,Nu,Ou,"⋩","\\succnsim",!0),_u(wu,Nu,Ou,"⪺","\\succnapprox",!0),_u(wu,Nu,Ou,"≆","\\ncong",!0),
|
|
295
|
+
_u(wu,Nu,Ou,"","\\@nshortparallel"),_u(wu,Nu,Ou,"∦","\\nparallel",!0),_u(wu,Nu,Ou,"⊯","\\nVDash",!0),_u(wu,Nu,Ou,"⋫","\\ntriangleright"),_u(wu,Nu,Ou,"⋭","\\ntrianglerighteq",!0),_u(wu,Nu,Ou,"","\\@nsupseteqq"),_u(wu,Nu,Ou,"⊋","\\supsetneq",!0),_u(wu,Nu,Ou,"","\\@varsupsetneq"),_u(wu,Nu,Ou,"⫌","\\supsetneqq",!0),_u(wu,Nu,Ou,"","\\@varsupsetneqq"),_u(wu,Nu,Ou,"⊮","\\nVdash",!0),_u(wu,Nu,Ou,"⪵","\\precneqq",!0),_u(wu,Nu,Ou,"⪶","\\succneqq",!0),_u(wu,Nu,Ou,"","\\@nsubseteqq"),_u(wu,Nu,Au,"⊴","\\unlhd"),_u(wu,Nu,Au,"⊵","\\unrhd"),_u(wu,Nu,Ou,"↚","\\nleftarrow",!0),_u(wu,Nu,Ou,"↛","\\nrightarrow",!0),_u(wu,Nu,Ou,"⇍","\\nLeftarrow",!0),_u(wu,Nu,Ou,"⇏","\\nRightarrow",!0),_u(wu,Nu,Ou,"↮","\\nleftrightarrow",!0),_u(wu,Nu,Ou,"⇎","\\nLeftrightarrow",!0),_u(wu,Nu,Ou,"△","\\vartriangle"),_u(wu,Nu,Ru,"ℏ","\\hslash"),_u(wu,Nu,Ru,"▽","\\triangledown"),_u(wu,Nu,Ru,"◊","\\lozenge"),_u(wu,Nu,Ru,"Ⓢ","\\circledS"),_u(wu,Nu,Ru,"®","\\circledR"),_u(xu,Nu,Ru,"®","\\circledR"),_u(wu,Nu,Ru,"∡","\\measuredangle",!0),
|
|
296
|
+
_u(wu,Nu,Ru,"∄","\\nexists"),_u(wu,Nu,Ru,"℧","\\mho"),_u(wu,Nu,Ru,"Ⅎ","\\Finv",!0),_u(wu,Nu,Ru,"⅁","\\Game",!0),_u(wu,Nu,Ru,"‵","\\backprime"),_u(wu,Nu,Ru,"▲","\\blacktriangle"),_u(wu,Nu,Ru,"▼","\\blacktriangledown"),_u(wu,Nu,Ru,"■","\\blacksquare"),_u(wu,Nu,Ru,"⧫","\\blacklozenge"),_u(wu,Nu,Ru,"★","\\bigstar"),_u(wu,Nu,Ru,"∢","\\sphericalangle",!0),_u(wu,Nu,Ru,"∁","\\complement",!0),_u(wu,Nu,Ru,"ð","\\eth",!0),_u(xu,ku,Ru,"ð","ð"),_u(wu,Nu,Ru,"╱","\\diagup"),_u(wu,Nu,Ru,"╲","\\diagdown"),_u(wu,Nu,Ru,"□","\\square"),_u(wu,Nu,Ru,"□","\\Box"),_u(wu,Nu,Ru,"◊","\\Diamond"),_u(wu,Nu,Ru,"¥","\\yen",!0),_u(xu,Nu,Ru,"¥","\\yen",!0),_u(wu,Nu,Ru,"✓","\\checkmark",!0),_u(xu,Nu,Ru,"✓","\\checkmark"),_u(wu,Nu,Ru,"ℶ","\\beth",!0),_u(wu,Nu,Ru,"ℸ","\\daleth",!0),_u(wu,Nu,Ru,"ℷ","\\gimel",!0),_u(wu,Nu,Ru,"ϝ","\\digamma",!0),_u(wu,Nu,Ru,"ϰ","\\varkappa"),_u(wu,Nu,Iu,"┌","\\@ulcorner",!0),_u(wu,Nu,Tu,"┐","\\@urcorner",!0),_u(wu,Nu,Iu,"└","\\@llcorner",!0),_u(wu,Nu,Tu,"┘","\\@lrcorner",!0),_u(wu,Nu,Ou,"≦","\\leqq",!0),
|
|
297
|
+
_u(wu,Nu,Ou,"⩽","\\leqslant",!0),_u(wu,Nu,Ou,"⪕","\\eqslantless",!0),_u(wu,Nu,Ou,"≲","\\lesssim",!0),_u(wu,Nu,Ou,"⪅","\\lessapprox",!0),_u(wu,Nu,Ou,"≊","\\approxeq",!0),_u(wu,Nu,Au,"⋖","\\lessdot"),_u(wu,Nu,Ou,"⋘","\\lll",!0),_u(wu,Nu,Ou,"≶","\\lessgtr",!0),_u(wu,Nu,Ou,"⋚","\\lesseqgtr",!0),_u(wu,Nu,Ou,"⪋","\\lesseqqgtr",!0),_u(wu,Nu,Ou,"≑","\\doteqdot"),_u(wu,Nu,Ou,"≓","\\risingdotseq",!0),_u(wu,Nu,Ou,"≒","\\fallingdotseq",!0),_u(wu,Nu,Ou,"∽","\\backsim",!0),_u(wu,Nu,Ou,"⋍","\\backsimeq",!0),_u(wu,Nu,Ou,"⫅","\\subseteqq",!0),_u(wu,Nu,Ou,"⋐","\\Subset",!0),_u(wu,Nu,Ou,"⊏","\\sqsubset",!0),_u(wu,Nu,Ou,"≼","\\preccurlyeq",!0),_u(wu,Nu,Ou,"⋞","\\curlyeqprec",!0),_u(wu,Nu,Ou,"≾","\\precsim",!0),_u(wu,Nu,Ou,"⪷","\\precapprox",!0),_u(wu,Nu,Ou,"⊲","\\vartriangleleft"),_u(wu,Nu,Ou,"⊴","\\trianglelefteq"),_u(wu,Nu,Ou,"⊨","\\vDash",!0),_u(wu,Nu,Ou,"⊪","\\Vvdash",!0),_u(wu,Nu,Ou,"⌣","\\smallsmile"),_u(wu,Nu,Ou,"⌢","\\smallfrown"),_u(wu,Nu,Ou,"≏","\\bumpeq",!0),_u(wu,Nu,Ou,"≎","\\Bumpeq",!0),_u(wu,Nu,Ou,"≧","\\geqq",!0),
|
|
298
|
+
_u(wu,Nu,Ou,"⩾","\\geqslant",!0),_u(wu,Nu,Ou,"⪖","\\eqslantgtr",!0),_u(wu,Nu,Ou,"≳","\\gtrsim",!0),_u(wu,Nu,Ou,"⪆","\\gtrapprox",!0),_u(wu,Nu,Au,"⋗","\\gtrdot"),_u(wu,Nu,Ou,"⋙","\\ggg",!0),_u(wu,Nu,Ou,"≷","\\gtrless",!0),_u(wu,Nu,Ou,"⋛","\\gtreqless",!0),_u(wu,Nu,Ou,"⪌","\\gtreqqless",!0),_u(wu,Nu,Ou,"≖","\\eqcirc",!0),_u(wu,Nu,Ou,"≗","\\circeq",!0),_u(wu,Nu,Ou,"≜","\\triangleq",!0),_u(wu,Nu,Ou,"∼","\\thicksim"),_u(wu,Nu,Ou,"≈","\\thickapprox"),_u(wu,Nu,Ou,"⫆","\\supseteqq",!0),_u(wu,Nu,Ou,"⋑","\\Supset",!0),_u(wu,Nu,Ou,"⊐","\\sqsupset",!0),_u(wu,Nu,Ou,"≽","\\succcurlyeq",!0),_u(wu,Nu,Ou,"⋟","\\curlyeqsucc",!0),_u(wu,Nu,Ou,"≿","\\succsim",!0),_u(wu,Nu,Ou,"⪸","\\succapprox",!0),_u(wu,Nu,Ou,"⊳","\\vartriangleright"),_u(wu,Nu,Ou,"⊵","\\trianglerighteq"),_u(wu,Nu,Ou,"⊩","\\Vdash",!0),_u(wu,Nu,Ou,"∣","\\shortmid"),_u(wu,Nu,Ou,"∥","\\shortparallel"),_u(wu,Nu,Ou,"≬","\\between",!0),_u(wu,Nu,Ou,"⋔","\\pitchfork",!0),_u(wu,Nu,Ou,"∝","\\varpropto"),_u(wu,Nu,Ou,"◀","\\blacktriangleleft"),
|
|
299
|
+
_u(wu,Nu,Ou,"∴","\\therefore",!0),_u(wu,Nu,Ou,"∍","\\backepsilon"),_u(wu,Nu,Ou,"▶","\\blacktriangleright"),_u(wu,Nu,Ou,"∵","\\because",!0),_u(wu,Nu,Ou,"⋘","\\llless"),_u(wu,Nu,Ou,"⋙","\\gggtr"),_u(wu,Nu,Au,"⊲","\\lhd"),_u(wu,Nu,Au,"⊳","\\rhd"),_u(wu,Nu,Ou,"≂","\\eqsim",!0),_u(wu,ku,Ou,"⋈","\\Join"),_u(wu,Nu,Ou,"≑","\\Doteq",!0),_u(wu,Nu,Au,"∔","\\dotplus",!0),_u(wu,Nu,Au,"∖","\\smallsetminus"),_u(wu,Nu,Au,"⋒","\\Cap",!0),_u(wu,Nu,Au,"⋓","\\Cup",!0),_u(wu,Nu,Au,"⩞","\\doublebarwedge",!0),_u(wu,Nu,Au,"⊟","\\boxminus",!0),_u(wu,Nu,Au,"⊞","\\boxplus",!0),_u(wu,Nu,Au,"⋇","\\divideontimes",!0),_u(wu,Nu,Au,"⋉","\\ltimes",!0),_u(wu,Nu,Au,"⋊","\\rtimes",!0),_u(wu,Nu,Au,"⋋","\\leftthreetimes",!0),_u(wu,Nu,Au,"⋌","\\rightthreetimes",!0),_u(wu,Nu,Au,"⋏","\\curlywedge",!0),_u(wu,Nu,Au,"⋎","\\curlyvee",!0),_u(wu,Nu,Au,"⊝","\\circleddash",!0),_u(wu,Nu,Au,"⊛","\\circledast",!0),_u(wu,Nu,Au,"⋅","\\centerdot"),_u(wu,Nu,Au,"⊺","\\intercal",!0),_u(wu,Nu,Au,"⋒","\\doublecap"),_u(wu,Nu,Au,"⋓","\\doublecup"),
|
|
300
|
+
_u(wu,Nu,Au,"⊠","\\boxtimes",!0),_u(wu,Nu,Ou,"⇢","\\dashrightarrow",!0),_u(wu,Nu,Ou,"⇠","\\dashleftarrow",!0),_u(wu,Nu,Ou,"⇇","\\leftleftarrows",!0),_u(wu,Nu,Ou,"⇆","\\leftrightarrows",!0),_u(wu,Nu,Ou,"⇚","\\Lleftarrow",!0),_u(wu,Nu,Ou,"↞","\\twoheadleftarrow",!0),_u(wu,Nu,Ou,"↢","\\leftarrowtail",!0),_u(wu,Nu,Ou,"↫","\\looparrowleft",!0),_u(wu,Nu,Ou,"⇋","\\leftrightharpoons",!0),_u(wu,Nu,Ou,"↶","\\curvearrowleft",!0),_u(wu,Nu,Ou,"↺","\\circlearrowleft",!0),_u(wu,Nu,Ou,"↰","\\Lsh",!0),_u(wu,Nu,Ou,"⇈","\\upuparrows",!0),_u(wu,Nu,Ou,"↿","\\upharpoonleft",!0),_u(wu,Nu,Ou,"⇃","\\downharpoonleft",!0),_u(wu,ku,Ou,"⊶","\\origof",!0),_u(wu,ku,Ou,"⊷","\\imageof",!0),_u(wu,Nu,Ou,"⊸","\\multimap",!0),_u(wu,Nu,Ou,"↭","\\leftrightsquigarrow",!0),_u(wu,Nu,Ou,"⇉","\\rightrightarrows",!0),_u(wu,Nu,Ou,"⇄","\\rightleftarrows",!0),_u(wu,Nu,Ou,"↠","\\twoheadrightarrow",!0),_u(wu,Nu,Ou,"↣","\\rightarrowtail",!0),_u(wu,Nu,Ou,"↬","\\looparrowright",!0),_u(wu,Nu,Ou,"↷","\\curvearrowright",!0),
|
|
301
|
+
_u(wu,Nu,Ou,"↻","\\circlearrowright",!0),_u(wu,Nu,Ou,"↱","\\Rsh",!0),_u(wu,Nu,Ou,"⇊","\\downdownarrows",!0),_u(wu,Nu,Ou,"↾","\\upharpoonright",!0),_u(wu,Nu,Ou,"⇂","\\downharpoonright",!0),_u(wu,Nu,Ou,"⇝","\\rightsquigarrow",!0),_u(wu,Nu,Ou,"⇝","\\leadsto"),_u(wu,Nu,Ou,"⇛","\\Rrightarrow",!0),_u(wu,Nu,Ou,"↾","\\restriction"),_u(wu,ku,Ru,"‘","`"),_u(wu,ku,Ru,"$","\\$"),_u(xu,ku,Ru,"$","\\$"),_u(xu,ku,Ru,"$","\\textdollar"),_u(wu,ku,Ru,"%","\\%"),_u(xu,ku,Ru,"%","\\%"),_u(wu,ku,Ru,"_","\\_"),_u(xu,ku,Ru,"_","\\_"),_u(xu,ku,Ru,"_","\\textunderscore"),_u(wu,ku,Ru,"∠","\\angle",!0),_u(wu,ku,Ru,"∞","\\infty",!0),_u(wu,ku,Ru,"′","\\prime"),_u(wu,ku,Ru,"△","\\triangle"),_u(wu,ku,Ru,"Γ","\\Gamma",!0),_u(wu,ku,Ru,"Δ","\\Delta",!0),_u(wu,ku,Ru,"Θ","\\Theta",!0),_u(wu,ku,Ru,"Λ","\\Lambda",!0),_u(wu,ku,Ru,"Ξ","\\Xi",!0),_u(wu,ku,Ru,"Π","\\Pi",!0),_u(wu,ku,Ru,"Σ","\\Sigma",!0),_u(wu,ku,Ru,"Υ","\\Upsilon",!0),_u(wu,ku,Ru,"Φ","\\Phi",!0),_u(wu,ku,Ru,"Ψ","\\Psi",!0),_u(wu,ku,Ru,"Ω","\\Omega",!0),_u(wu,ku,Ru,"A","Α"),
|
|
302
|
+
_u(wu,ku,Ru,"B","Β"),_u(wu,ku,Ru,"E","Ε"),_u(wu,ku,Ru,"Z","Ζ"),_u(wu,ku,Ru,"H","Η"),_u(wu,ku,Ru,"I","Ι"),_u(wu,ku,Ru,"K","Κ"),_u(wu,ku,Ru,"M","Μ"),_u(wu,ku,Ru,"N","Ν"),_u(wu,ku,Ru,"O","Ο"),_u(wu,ku,Ru,"P","Ρ"),_u(wu,ku,Ru,"T","Τ"),_u(wu,ku,Ru,"X","Χ"),_u(wu,ku,Ru,"¬","\\neg",!0),_u(wu,ku,Ru,"¬","\\lnot"),_u(wu,ku,Ru,"⊤","\\top"),_u(wu,ku,Ru,"⊥","\\bot"),_u(wu,ku,Ru,"∅","\\emptyset"),_u(wu,Nu,Ru,"∅","\\varnothing"),_u(wu,ku,Cu,"α","\\alpha",!0),_u(wu,ku,Cu,"β","\\beta",!0),_u(wu,ku,Cu,"γ","\\gamma",!0),_u(wu,ku,Cu,"δ","\\delta",!0),_u(wu,ku,Cu,"ϵ","\\epsilon",!0),_u(wu,ku,Cu,"ζ","\\zeta",!0),_u(wu,ku,Cu,"η","\\eta",!0),_u(wu,ku,Cu,"θ","\\theta",!0),_u(wu,ku,Cu,"ι","\\iota",!0),_u(wu,ku,Cu,"κ","\\kappa",!0),_u(wu,ku,Cu,"λ","\\lambda",!0),_u(wu,ku,Cu,"μ","\\mu",!0),_u(wu,ku,Cu,"ν","\\nu",!0),_u(wu,ku,Cu,"ξ","\\xi",!0),_u(wu,ku,Cu,"ο","\\omicron",!0),_u(wu,ku,Cu,"π","\\pi",!0),_u(wu,ku,Cu,"ρ","\\rho",!0),_u(wu,ku,Cu,"σ","\\sigma",!0),_u(wu,ku,Cu,"τ","\\tau",!0),_u(wu,ku,Cu,"υ","\\upsilon",!0),
|
|
303
|
+
_u(wu,ku,Cu,"ϕ","\\phi",!0),_u(wu,ku,Cu,"χ","\\chi",!0),_u(wu,ku,Cu,"ψ","\\psi",!0),_u(wu,ku,Cu,"ω","\\omega",!0),_u(wu,ku,Cu,"ε","\\varepsilon",!0),_u(wu,ku,Cu,"ϑ","\\vartheta",!0),_u(wu,ku,Cu,"ϖ","\\varpi",!0),_u(wu,ku,Cu,"ϱ","\\varrho",!0),_u(wu,ku,Cu,"ς","\\varsigma",!0),_u(wu,ku,Cu,"φ","\\varphi",!0),_u(wu,ku,Au,"∗","*",!0),_u(wu,ku,Au,"+","+"),_u(wu,ku,Au,"−","-",!0),_u(wu,ku,Au,"⋅","\\cdot",!0),_u(wu,ku,Au,"∘","\\circ",!0),_u(wu,ku,Au,"÷","\\div",!0),_u(wu,ku,Au,"±","\\pm",!0),_u(wu,ku,Au,"×","\\times",!0),_u(wu,ku,Au,"∩","\\cap",!0),_u(wu,ku,Au,"∪","\\cup",!0),_u(wu,ku,Au,"∖","\\setminus",!0),_u(wu,ku,Au,"∧","\\land"),_u(wu,ku,Au,"∨","\\lor"),_u(wu,ku,Au,"∧","\\wedge",!0),_u(wu,ku,Au,"∨","\\vee",!0),_u(wu,ku,Ru,"√","\\surd"),_u(wu,ku,Iu,"⟨","\\langle",!0),_u(wu,ku,Iu,"∣","\\lvert"),_u(wu,ku,Iu,"∥","\\lVert"),_u(wu,ku,Tu,"?","?"),_u(wu,ku,Tu,"!","!"),_u(wu,ku,Tu,"⟩","\\rangle",!0),_u(wu,ku,Tu,"∣","\\rvert"),_u(wu,ku,Tu,"∥","\\rVert"),_u(wu,ku,Ou,"=","="),_u(wu,ku,Ou,":",":"),
|
|
304
|
+
_u(wu,ku,Ou,"≈","\\approx",!0),_u(wu,ku,Ou,"≅","\\cong",!0),_u(wu,ku,Ou,"≥","\\ge"),_u(wu,ku,Ou,"≥","\\geq",!0),_u(wu,ku,Ou,"←","\\gets"),_u(wu,ku,Ou,">","\\gt",!0),_u(wu,ku,Ou,"∈","\\in",!0),_u(wu,ku,Ou,"","\\@not"),_u(wu,ku,Ou,"⊂","\\subset",!0),_u(wu,ku,Ou,"⊃","\\supset",!0),_u(wu,ku,Ou,"⊆","\\subseteq",!0),_u(wu,ku,Ou,"⊇","\\supseteq",!0),_u(wu,Nu,Ou,"⊈","\\nsubseteq",!0),_u(wu,Nu,Ou,"⊉","\\nsupseteq",!0),_u(wu,ku,Ou,"⊨","\\models"),_u(wu,ku,Ou,"←","\\leftarrow",!0),_u(wu,ku,Ou,"≤","\\le"),_u(wu,ku,Ou,"≤","\\leq",!0),_u(wu,ku,Ou,"<","\\lt",!0),_u(wu,ku,Ou,"→","\\rightarrow",!0),_u(wu,ku,Ou,"→","\\to"),_u(wu,Nu,Ou,"≱","\\ngeq",!0),_u(wu,Nu,Ou,"≰","\\nleq",!0),_u(wu,ku,Lu," ","\\ "),_u(wu,ku,Lu," ","\\space"),_u(wu,ku,Lu," ","\\nobreakspace"),_u(xu,ku,Lu," ","\\ "),_u(xu,ku,Lu," "," "),_u(xu,ku,Lu," ","\\space"),_u(xu,ku,Lu," ","\\nobreakspace"),_u(wu,ku,Lu,null,"\\nobreak"),_u(wu,ku,Lu,null,"\\allowbreak"),_u(wu,ku,zu,",",","),_u(wu,ku,zu,";",";"),_u(wu,Nu,Au,"⊼","\\barwedge",!0),
|
|
305
|
+
_u(wu,Nu,Au,"⊻","\\veebar",!0),_u(wu,ku,Au,"⊙","\\odot",!0),_u(wu,ku,Au,"⊕","\\oplus",!0),_u(wu,ku,Au,"⊗","\\otimes",!0),_u(wu,ku,Ru,"∂","\\partial",!0),_u(wu,ku,Au,"⊘","\\oslash",!0),_u(wu,Nu,Au,"⊚","\\circledcirc",!0),_u(wu,Nu,Au,"⊡","\\boxdot",!0),_u(wu,ku,Au,"△","\\bigtriangleup"),_u(wu,ku,Au,"▽","\\bigtriangledown"),_u(wu,ku,Au,"†","\\dagger"),_u(wu,ku,Au,"⋄","\\diamond"),_u(wu,ku,Au,"⋆","\\star"),_u(wu,ku,Au,"◃","\\triangleleft"),_u(wu,ku,Au,"▹","\\triangleright"),_u(wu,ku,Iu,"{","\\{"),_u(xu,ku,Ru,"{","\\{"),_u(xu,ku,Ru,"{","\\textbraceleft"),_u(wu,ku,Tu,"}","\\}"),_u(xu,ku,Ru,"}","\\}"),_u(xu,ku,Ru,"}","\\textbraceright"),_u(wu,ku,Iu,"{","\\lbrace"),_u(wu,ku,Tu,"}","\\rbrace"),_u(wu,ku,Iu,"[","\\lbrack",!0),_u(xu,ku,Ru,"[","\\lbrack",!0),_u(wu,ku,Tu,"]","\\rbrack",!0),_u(xu,ku,Ru,"]","\\rbrack",!0),_u(wu,ku,Iu,"(","\\lparen",!0),_u(wu,ku,Tu,")","\\rparen",!0),_u(xu,ku,Ru,"<","\\textless",!0),_u(xu,ku,Ru,">","\\textgreater",!0),_u(wu,ku,Iu,"⌊","\\lfloor",!0),_u(wu,ku,Tu,"⌋","\\rfloor",!0),
|
|
306
|
+
_u(wu,ku,Iu,"⌈","\\lceil",!0),_u(wu,ku,Tu,"⌉","\\rceil",!0),_u(wu,ku,Ru,"\\","\\backslash"),_u(wu,ku,Ru,"∣","|"),_u(wu,ku,Ru,"∣","\\vert"),_u(xu,ku,Ru,"|","\\textbar",!0),_u(wu,ku,Ru,"∥","\\|"),_u(wu,ku,Ru,"∥","\\Vert"),_u(xu,ku,Ru,"∥","\\textbardbl"),_u(xu,ku,Ru,"~","\\textasciitilde"),_u(xu,ku,Ru,"\\","\\textbackslash"),_u(xu,ku,Ru,"^","\\textasciicircum"),_u(wu,ku,Ou,"↑","\\uparrow",!0),_u(wu,ku,Ou,"⇑","\\Uparrow",!0),_u(wu,ku,Ou,"↓","\\downarrow",!0),_u(wu,ku,Ou,"⇓","\\Downarrow",!0),_u(wu,ku,Ou,"↕","\\updownarrow",!0),_u(wu,ku,Ou,"⇕","\\Updownarrow",!0),_u(wu,ku,Mu,"∐","\\coprod"),_u(wu,ku,Mu,"⋁","\\bigvee"),_u(wu,ku,Mu,"⋀","\\bigwedge"),_u(wu,ku,Mu,"⨄","\\biguplus"),_u(wu,ku,Mu,"⋂","\\bigcap"),_u(wu,ku,Mu,"⋃","\\bigcup"),_u(wu,ku,Mu,"∫","\\int"),_u(wu,ku,Mu,"∫","\\intop"),_u(wu,ku,Mu,"∬","\\iint"),_u(wu,ku,Mu,"∭","\\iiint"),_u(wu,ku,Mu,"∏","\\prod"),_u(wu,ku,Mu,"∑","\\sum"),_u(wu,ku,Mu,"⨂","\\bigotimes"),_u(wu,ku,Mu,"⨁","\\bigoplus"),_u(wu,ku,Mu,"⨀","\\bigodot"),_u(wu,ku,Mu,"∮","\\oint"),
|
|
307
|
+
_u(wu,ku,Mu,"∯","\\oiint"),_u(wu,ku,Mu,"∰","\\oiiint"),_u(wu,ku,Mu,"⨆","\\bigsqcup"),_u(wu,ku,Mu,"∫","\\smallint"),_u(xu,ku,Eu,"…","\\textellipsis"),_u(wu,ku,Eu,"…","\\mathellipsis"),_u(xu,ku,Eu,"…","\\ldots",!0),_u(wu,ku,Eu,"…","\\ldots",!0),_u(wu,ku,Eu,"⋯","\\@cdots",!0),_u(wu,ku,Eu,"⋱","\\ddots",!0),_u(wu,ku,Ru,"⋮","\\varvdots"),_u(xu,ku,Ru,"⋮","\\varvdots"),_u(wu,ku,Su,"ˊ","\\acute"),_u(wu,ku,Su,"ˋ","\\grave"),_u(wu,ku,Su,"¨","\\ddot"),_u(wu,ku,Su,"~","\\tilde"),_u(wu,ku,Su,"ˉ","\\bar"),_u(wu,ku,Su,"˘","\\breve"),_u(wu,ku,Su,"ˇ","\\check"),_u(wu,ku,Su,"^","\\hat"),_u(wu,ku,Su,"⃗","\\vec"),_u(wu,ku,Su,"˙","\\dot"),_u(wu,ku,Su,"˚","\\mathring"),_u(wu,ku,Cu,"","\\@imath"),_u(wu,ku,Cu,"","\\@jmath"),_u(wu,ku,Ru,"ı","ı"),_u(wu,ku,Ru,"ȷ","ȷ"),_u(xu,ku,Ru,"ı","\\i",!0),_u(xu,ku,Ru,"ȷ","\\j",!0),_u(xu,ku,Ru,"ß","\\ss",!0),_u(xu,ku,Ru,"æ","\\ae",!0),_u(xu,ku,Ru,"œ","\\oe",!0),_u(xu,ku,Ru,"ø","\\o",!0),_u(xu,ku,Ru,"Æ","\\AE",!0),_u(xu,ku,Ru,"Œ","\\OE",!0),_u(xu,ku,Ru,"Ø","\\O",!0),_u(xu,ku,Su,"ˊ","\\'"),
|
|
308
|
+
_u(xu,ku,Su,"ˋ","\\`"),_u(xu,ku,Su,"ˆ","\\^"),_u(xu,ku,Su,"˜","\\~"),_u(xu,ku,Su,"ˉ","\\="),_u(xu,ku,Su,"˘","\\u"),_u(xu,ku,Su,"˙","\\."),_u(xu,ku,Su,"¸","\\c"),_u(xu,ku,Su,"˚","\\r"),_u(xu,ku,Su,"ˇ","\\v"),_u(xu,ku,Su,"¨",'\\"'),_u(xu,ku,Su,"˝","\\H"),_u(xu,ku,Su,"◯","\\textcircled");var Pu={"--":!0,"---":!0,"``":!0,"''":!0};_u(xu,ku,Ru,"–","--",!0),_u(xu,ku,Ru,"–","\\textendash"),_u(xu,ku,Ru,"—","---",!0),_u(xu,ku,Ru,"—","\\textemdash"),_u(xu,ku,Ru,"‘","`",!0),_u(xu,ku,Ru,"‘","\\textquoteleft"),_u(xu,ku,Ru,"’","'",!0),_u(xu,ku,Ru,"’","\\textquoteright"),_u(xu,ku,Ru,"“","``",!0),_u(xu,ku,Ru,"“","\\textquotedblleft"),_u(xu,ku,Ru,"”","''",!0),_u(xu,ku,Ru,"”","\\textquotedblright"),_u(wu,ku,Ru,"°","\\degree",!0),_u(xu,ku,Ru,"°","\\degree"),_u(xu,ku,Ru,"°","\\textdegree",!0),_u(wu,ku,Ru,"£","\\pounds"),_u(wu,ku,Ru,"£","\\mathsterling",!0),_u(xu,ku,Ru,"£","\\pounds"),_u(xu,ku,Ru,"£","\\textsterling",!0),_u(wu,Nu,Ru,"✠","\\maltese"),_u(xu,Nu,Ru,"✠","\\maltese");for(var Du='0123456789/@."',Hu=0;Hu<14;Hu++){
|
|
309
|
+
var Fu=Du.charAt(Hu);_u(wu,ku,Ru,Fu,Fu)}for(var ju='0123456789!@*()-=+";:?/.,',$u=0;$u<25;$u++){var Bu=ju.charAt($u);_u(xu,ku,Ru,Bu,Bu)}for(var qu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Uu=0;Uu<52;Uu++){var Gu=qu.charAt(Uu);_u(wu,ku,Cu,Gu,Gu),_u(xu,ku,Ru,Gu,Gu)}_u(wu,Nu,Ru,"C","ℂ"),_u(xu,Nu,Ru,"C","ℂ"),_u(wu,Nu,Ru,"H","ℍ"),_u(xu,Nu,Ru,"H","ℍ"),_u(wu,Nu,Ru,"N","ℕ"),_u(xu,Nu,Ru,"N","ℕ"),_u(wu,Nu,Ru,"P","ℙ"),_u(xu,Nu,Ru,"P","ℙ"),_u(wu,Nu,Ru,"Q","ℚ"),_u(xu,Nu,Ru,"Q","ℚ"),_u(wu,Nu,Ru,"R","ℝ"),_u(xu,Nu,Ru,"R","ℝ"),_u(wu,Nu,Ru,"Z","ℤ"),_u(xu,Nu,Ru,"Z","ℤ"),_u(wu,ku,Cu,"h","ℎ"),_u(xu,ku,Cu,"h","ℎ");for(var Vu="",Wu=0;Wu<52;Wu++){var Ku=qu.charAt(Wu);_u(wu,ku,Cu,Ku,Vu=String.fromCharCode(55349,56320+Wu)),_u(xu,ku,Ru,Ku,Vu),_u(wu,ku,Cu,Ku,Vu=String.fromCharCode(55349,56372+Wu)),_u(xu,ku,Ru,Ku,Vu),_u(wu,ku,Cu,Ku,Vu=String.fromCharCode(55349,56424+Wu)),_u(xu,ku,Ru,Ku,Vu),_u(wu,ku,Cu,Ku,Vu=String.fromCharCode(55349,56580+Wu)),_u(xu,ku,Ru,Ku,Vu),_u(wu,ku,Cu,Ku,Vu=String.fromCharCode(55349,56684+Wu)),
|
|
310
|
+
_u(xu,ku,Ru,Ku,Vu),_u(wu,ku,Cu,Ku,Vu=String.fromCharCode(55349,56736+Wu)),_u(xu,ku,Ru,Ku,Vu),_u(wu,ku,Cu,Ku,Vu=String.fromCharCode(55349,56788+Wu)),_u(xu,ku,Ru,Ku,Vu),_u(wu,ku,Cu,Ku,Vu=String.fromCharCode(55349,56840+Wu)),_u(xu,ku,Ru,Ku,Vu),_u(wu,ku,Cu,Ku,Vu=String.fromCharCode(55349,56944+Wu)),_u(xu,ku,Ru,Ku,Vu),Wu<26&&(_u(wu,ku,Cu,Ku,Vu=String.fromCharCode(55349,56632+Wu)),_u(xu,ku,Ru,Ku,Vu),_u(wu,ku,Cu,Ku,Vu=String.fromCharCode(55349,56476+Wu)),_u(xu,ku,Ru,Ku,Vu))}_u(wu,ku,Cu,"k",Vu=String.fromCharCode(55349,56668)),_u(xu,ku,Ru,"k",Vu);for(var Yu=0;Yu<10;Yu++){var Xu=Yu.toString();_u(wu,ku,Cu,Xu,Vu=String.fromCharCode(55349,57294+Yu)),_u(xu,ku,Ru,Xu,Vu),_u(wu,ku,Cu,Xu,Vu=String.fromCharCode(55349,57314+Yu)),_u(xu,ku,Ru,Xu,Vu),_u(wu,ku,Cu,Xu,Vu=String.fromCharCode(55349,57324+Yu)),_u(xu,ku,Ru,Xu,Vu),_u(wu,ku,Cu,Xu,Vu=String.fromCharCode(55349,57334+Yu)),_u(xu,ku,Ru,Xu,Vu)}for(var Zu="ÐÞþ",Ju=0;Ju<3;Ju++){var Qu=Zu.charAt(Ju);_u(wu,ku,Cu,Qu,Qu),_u(xu,ku,Ru,Qu,Qu)}
|
|
311
|
+
var ed=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-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"]],td=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],nd=function(e,t,n){
|
|
312
|
+
return yu[n][e]&&yu[n][e].replace&&(e=yu[n][e].replace),{value:e,metrics:Vc(e,t,n)}},rd=function(e,t,n,r,o){var i,a=nd(e,t,n),s=a.metrics;if(e=a.value,s){var l=s.italic;("text"===n||r&&"mathit"===r.font)&&(l=0),i=new hu(e,s.height,s.depth,l,s.skew,s.width,o)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"' and mode '"+n+"'"),i=new hu(e,0,0,0,0,0,o);if(r){i.maxFontSize=r.sizeMultiplier,r.style.isTight()&&i.classes.push("mtight");var c=r.getColor();c&&(i.style.color=c)}return i},od=(e,t)=>{if(ru(e.classes)!==ru(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(1===e.classes.length){var n=e.classes[0];if("mbin"===n||"mord"===n)return!1}for(var r in e.style)if(e.style.hasOwnProperty(r)&&e.style[r]!==t.style[r])return!1;for(var o in t.style)if(t.style.hasOwnProperty(o)&&e.style[o]!==t.style[o])return!1;return!0},id=function(e){for(var t=0,n=0,r=0,o=0;o<e.children.length;o++){var i=e.children[o];i.height>t&&(t=i.height),i.depth>n&&(n=i.depth),
|
|
313
|
+
i.maxFontSize>r&&(r=i.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},ad=function(e,t,n,r){var o=new lu(e,t,n,r);return id(o),o},sd=(e,t,n,r)=>new lu(e,t,n,r),ld=function(e){var t=new Bc(e);return id(t),t},cd=function(e,t,n){var r="";switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return r+"-"+("textbf"===t&&"textit"===n?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular")},ud={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",
|
|
314
|
+
fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},dd={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},hd={fontMap:ud,makeSymbol:rd,mathsym:function(e,t,n,r){return void 0===r&&(r=[]),"boldsymbol"===n.font&&nd(e,"Main-Bold",t).metrics?rd(e,"Main-Bold",t,n,r.concat(["mathbf"])):"\\"===e||"main"===yu[t][e].font?rd(e,"Main-Regular",t,n,r):rd(e,"AMS-Regular",t,n,r.concat(["amsrm"]))},makeSpan:ad,makeSvgSpan:sd,makeLineSpan:function(e,t,n){var r=ad([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=nu(r.height),r.maxFontSize=1,r},makeAnchor:function(e,t,n,r){var o=new cu(e,t,n,r);return id(o),o},makeFragment:ld,wrapFragment:function(e,t){return e instanceof Bc?ad([],[e],t):e},makeVList:function(e,t){
|
|
315
|
+
for(var{children:n,depth:r}=function(e){if("individualShift"===e.positionType){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,o=r,i=1;i<t.length;i++){var a=-t[i].shift-o-t[i].elem.depth,s=a-(t[i-1].elem.height+t[i-1].elem.depth);o+=a,n.push({type:"kern",size:s}),n.push(t[i])}return{children:n,depth:r}}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),o=0,i=0;i<n.length;i++){var a=n[i];if("elem"===a.type){var s=a.elem;o=Math.max(o,s.maxFontSize,s.height)}}o+=2;var l=ad(["pstrut"],[]);l.style.height=nu(o)
|
|
316
|
+
;for(var c=[],u=r,d=r,h=r,m=0;m<n.length;m++){var p=n[m];if("kern"===p.type)h+=p.size;else{var f=p.elem,g=p.wrapperClasses||[],v=p.wrapperStyle||{},b=ad(g,[l,f],void 0,v);b.style.top=nu(-o-h-f.depth),p.marginLeft&&(b.style.marginLeft=p.marginLeft),p.marginRight&&(b.style.marginRight=p.marginRight),c.push(b),h+=f.height+f.depth}u=Math.min(u,h),d=Math.max(d,h)}var y,_=ad(["vlist"],c);if(_.style.height=nu(d),u<0){var w=ad([],[]),x=ad(["vlist"],[w]);x.style.height=nu(-u);var k=ad(["vlist-s"],[new hu("")]);y=[ad(["vlist-r"],[_,k]),ad(["vlist-r"],[x])]}else y=[ad(["vlist-r"],[_])];var N=ad(["vlist-t"],y);return 2===y.length&&N.classes.push("vlist-t2"),N.height=d,N.depth=-u,N},makeOrd:function(e,t,n){var r=e.mode,o=e.text,i=["mord"],a="math"===r||"text"===r&&t.font,s=a?t.font:t.fontFamily,l="",c="";if(55349===o.charCodeAt(0)&&([l,c]=function(e,t){var n=1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536,r="math"===t?0:1;if(119808<=n&&n<120484){var o=Math.floor((n-119808)/26);return[ed[o][2],ed[o][r]]}
|
|
317
|
+
if(120782<=n&&n<=120831){var i=Math.floor((n-120782)/10);return[td[i][2],td[i][r]]}if(120485===n||120486===n)return[ed[0][2],ed[0][r]];if(120486<n&&n<120782)return["",""];throw new yc("Unsupported character: "+e)}(o,r)),l.length>0)return rd(o,l,r,t,i.concat(c));if(s){var u,d;if("boldsymbol"===s){var h=function(e,t,n,r,o){return"textord"!==o&&nd(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(o,r,0,0,n);u=h.fontName,d=[h.fontClass]}else a?(u=ud[s].fontName,d=[s]):(u=cd(s,t.fontWeight,t.fontShape),d=[s,t.fontWeight,t.fontShape]);if(nd(o,u,r).metrics)return rd(o,u,r,t,i.concat(d));if(Pu.hasOwnProperty(o)&&"Typewriter"===u.slice(0,10)){for(var m=[],p=0;p<o.length;p++)m.push(rd(o[p],u,r,t,i.concat(d)));return ld(m)}}if("mathord"===n)return rd(o,"Math-Italic",r,t,i.concat(["mathnormal"]));if("textord"===n){var f=yu[r][o]&&yu[r][o].font;if("ams"===f){var g=cd("amsrm",t.fontWeight,t.fontShape)
|
|
318
|
+
;return rd(o,g,r,t,i.concat("amsrm",t.fontWeight,t.fontShape))}if("main"!==f&&f){var v=cd(f,t.fontWeight,t.fontShape);return rd(o,v,r,t,i.concat(v,t.fontWeight,t.fontShape))}var b=cd("textrm",t.fontWeight,t.fontShape);return rd(o,b,r,t,i.concat(t.fontWeight,t.fontShape))}throw new Error("unexpected type: "+n+" in makeOrd")},makeGlue:(e,t)=>{var n=ad(["mspace"],[],t),r=tu(e,t);return n.style.marginRight=nu(r),n},staticSvg:function(e,t){var[n,r,o]=dd[e],i=new pu(n),a=new mu([i],{width:nu(r),height:nu(o),style:"width:"+nu(r),viewBox:"0 0 "+1e3*r+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),s=sd(["overlay"],[a],t);return s.height=o,s.style.height=nu(o),s.style.width=nu(r),s},svgData:dd,tryCombineChars:e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof hu&&r instanceof hu&&od(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e}},md={number:3,unit:"mu"},pd={number:4,unit:"mu"},fd={number:5,unit:"mu"},gd={mord:{
|
|
319
|
+
mop:md,mbin:pd,mrel:fd,minner:md},mop:{mord:md,mop:md,mrel:fd,minner:md},mbin:{mord:pd,mop:pd,mopen:pd,minner:pd},mrel:{mord:fd,mop:fd,mopen:fd,minner:fd},mopen:{},mclose:{mop:md,mbin:pd,mrel:fd,minner:md},mpunct:{mord:md,mop:md,mrel:fd,mopen:md,mclose:md,mpunct:md,minner:md},minner:{mord:md,mop:md,mbin:pd,mrel:fd,mopen:md,mpunct:md,minner:md}},vd={mord:{mop:md},mop:{mord:md,mop:md},mbin:{},mrel:{},mopen:{},mclose:{mop:md},mpunct:{},minner:{mop:md}},bd={},yd={},_d={};function wd(e){for(var{type:t,names:n,props:r,handler:o,htmlBuilder:i,mathmlBuilder:a}=e,s={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:void 0===r.allowedInMath||r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:o},l=0;l<n.length;++l)bd[n[l]]=s;t&&(i&&(yd[t]=i),a&&(_d[t]=a))}function xd(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;wd({type:t,names:[],props:{numArgs:0},handler(){
|
|
320
|
+
throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var kd=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e},Nd=function(e){return"ordgroup"===e.type?e.body:[e]},Sd=hd.makeSpan,Ad=["leftmost","mbin","mopen","mrel","mop","mpunct"],Td=["rightmost","mrel","mclose","mpunct"],Ed={display:Pc.DISPLAY,text:Pc.TEXT,script:Pc.SCRIPT,scriptscript:Pc.SCRIPTSCRIPT},Cd={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Md=function(e,t,n,r){void 0===r&&(r=[null,null]);for(var o=[],i=0;i<e.length;i++){var a=Pd(e[i],t);if(a instanceof Bc){var s=a.children;o.push(...s)}else o.push(a)}if(hd.tryCombineChars(o),!n)return o;var l=t;if(1===e.length){var c=e[0];"sizing"===c.type?l=t.havingSize(c.size):"styling"===c.type&&(l=t.havingStyle(Ed[c.style]))}var u=Sd([r[0]||"leftmost"],[],t),d=Sd([r[1]||"rightmost"],[],t),h="root"===n;return Id(o,((e,t)=>{var n=t.classes[0],r=e.classes[0]
|
|
321
|
+
;"mbin"===n&&Nc.contains(Td,r)?t.classes[0]="mord":"mbin"===r&&Nc.contains(Ad,n)&&(e.classes[0]="mord")}),{node:u},d,h),Id(o,((e,t)=>{var n=Ld(t),r=Ld(e),o=n&&r?e.hasClass("mtight")?vd[n][r]:gd[n][r]:null;if(o)return hd.makeGlue(o,l)}),{node:u},d,h),o},Id=function e(t,n,r,o,i){o&&t.push(o);for(var a=0;a<t.length;a++){var s=t[a],l=zd(s);if(l)e(l.children,n,r,null,i);else{var c=!s.hasClass("mspace");if(c){var u=n(s,r.node);u&&(r.insertAfter?r.insertAfter(u):(t.unshift(u),a++))}c?r.node=s:i&&s.hasClass("newline")&&(r.node=Sd(["leftmost"])),r.insertAfter=(e=>n=>{t.splice(e+1,0,n),a++})(a)}}o&&t.pop()},zd=function(e){return e instanceof Bc||e instanceof cu||e instanceof lu&&e.hasClass("enclosing")?e:null},Od=function e(t,n){var r=zd(t);if(r){var o=r.children;if(o.length){if("right"===n)return e(o[o.length-1],"right");if("left"===n)return e(o[0],"left")}}return t},Ld=function(e,t){return e?(t&&(e=Od(e,t)),Cd[e.classes[0]]||null):null},Rd=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses())
|
|
322
|
+
;return Sd(t.concat(n))},Pd=function(e,t,n){if(!e)return Sd();if(yd[e.type]){var r=yd[e.type](e,t);if(n&&t.size!==n.size){r=Sd(t.sizingClasses(n),[r],t);var o=t.sizeMultiplier/n.sizeMultiplier;r.height*=o,r.depth*=o}return r}throw new yc("Got group of unknown type: '"+e.type+"'")};function Dd(e,t){var n=Sd(["base"],e,t),r=Sd(["strut"]);return r.style.height=nu(n.height+n.depth),n.depth&&(r.style.verticalAlign=nu(-n.depth)),n.children.unshift(r),n}function Hd(e,t){var n=null;1===e.length&&"tag"===e[0].type&&(n=e[0].tag,e=e[0].body);var r,o=Md(e,t,"root");2===o.length&&o[1].hasClass("tag")&&(r=o.pop());for(var i,a=[],s=[],l=0;l<o.length;l++)if(s.push(o[l]),o[l].hasClass("mbin")||o[l].hasClass("mrel")||o[l].hasClass("allowbreak")){for(var c=!1;l<o.length-1&&o[l+1].hasClass("mspace")&&!o[l+1].hasClass("newline");)l++,s.push(o[l]),o[l].hasClass("nobreak")&&(c=!0);c||(a.push(Dd(s,t)),s=[])}else o[l].hasClass("newline")&&(s.pop(),s.length>0&&(a.push(Dd(s,t)),s=[]),a.push(o[l]));s.length>0&&a.push(Dd(s,t)),
|
|
323
|
+
n?((i=Dd(Md(n,t,!0))).classes=["tag"],a.push(i)):r&&a.push(r);var u=Sd(["katex-html"],a);if(u.setAttribute("aria-hidden","true"),i){var d=i.children[0];d.style.height=nu(u.height+u.depth),u.depth&&(d.style.verticalAlign=nu(-u.depth))}return u}function Fd(e){return new Bc(e)}class jd{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=ru(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof $d&&this.children[n+1]instanceof $d){
|
|
324
|
+
for(var r=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof $d;)r+=this.children[++n].toText();e.appendChild(new $d(r).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=Nc.escape(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+Nc.escape(ru(this.classes))+'"'),e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</"+this.type+">"}toText(){return this.children.map((e=>e.toText())).join("")}}class $d{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Nc.escape(this.toText())}toText(){return this.text}}var Bd={MathNode:jd,TextNode:$d,SpaceNode:class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,
|
|
325
|
+
this.character=e>=.05555&&e<=.05556?" ":e>=.1666&&e<=.1667?" ":e>=.2222&&e<=.2223?" ":e>=.2777&&e<=.2778?" ":e>=-.05556&&e<=-.05555?" ":e>=-.1667&&e<=-.1666?" ":e>=-.2223&&e<=-.2222?" ":e>=-.2778&&e<=-.2777?" ":null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",nu(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+nu(this.width)+'"/>'}toText(){return this.character?this.character:" "}},newDocumentFragment:Fd},qd=function(e,t,n){return!yu[t][e]||!yu[t][e].replace||55349===e.charCodeAt(0)||Pu.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.slice(4,6)||n.font&&"tt"===n.font.slice(4,6))||(e=yu[t][e].replace),new Bd.TextNode(e)},Ud=function(e){return 1===e.length?e[0]:new Bd.MathNode("mrow",e)},Gd=function(e,t){if("texttt"===t.fontFamily)return"monospace"
|
|
326
|
+
;if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";var n=t.font;if(!n||"mathnormal"===n)return null;var r=e.mode;if("mathit"===n)return"italic";if("boldsymbol"===n)return"textord"===e.type?"bold":"bold-italic";if("mathbf"===n)return"bold";if("mathbb"===n)return"double-struck";if("mathsfit"===n)return"sans-serif-italic";if("mathfrak"===n)return"fraktur";if("mathscr"===n||"mathcal"===n)return"script";if("mathsf"===n)return"sans-serif";if("mathtt"===n)return"monospace";var o=e.text;return Nc.contains(["\\imath","\\jmath"],o)?null:(yu[r][o]&&yu[r][o].replace&&(o=yu[r][o].replace),Vc(o,hd.fontMap[n].fontName,r)?hd.fontMap[n].variant:null)};function Vd(e){if(!e)return!1;if("mi"===e.type&&1===e.children.length){
|
|
327
|
+
var t=e.children[0];return t instanceof $d&&"."===t.text}if("mo"===e.type&&1===e.children.length&&"true"===e.getAttribute("separator")&&"0em"===e.getAttribute("lspace")&&"0em"===e.getAttribute("rspace")){var n=e.children[0];return n instanceof $d&&","===n.text}return!1}var Wd=function(e,t,n){if(1===e.length){var r=Yd(e[0],t);return n&&r instanceof jd&&"mo"===r.type&&(r.setAttribute("lspace","0em"),r.setAttribute("rspace","0em")),[r]}for(var o,i=[],a=0;a<e.length;a++){var s=Yd(e[a],t);if(s instanceof jd&&o instanceof jd){if("mtext"===s.type&&"mtext"===o.type&&s.getAttribute("mathvariant")===o.getAttribute("mathvariant")){o.children.push(...s.children);continue}if("mn"===s.type&&"mn"===o.type){o.children.push(...s.children);continue}if(Vd(s)&&"mn"===o.type){o.children.push(...s.children);continue}if("mn"===s.type&&Vd(o))s.children=[...o.children,...s.children],i.pop();else if(("msup"===s.type||"msub"===s.type)&&s.children.length>=1&&("mn"===o.type||Vd(o))){var l=s.children[0]
|
|
328
|
+
;l instanceof jd&&"mn"===l.type&&(l.children=[...o.children,...l.children],i.pop())}else if("mi"===o.type&&1===o.children.length){var c=o.children[0];if(c instanceof $d&&"̸"===c.text&&("mo"===s.type||"mi"===s.type||"mn"===s.type)){var u=s.children[0];u instanceof $d&&u.text.length>0&&(u.text=u.text.slice(0,1)+"̸"+u.text.slice(1),i.pop())}}}i.push(s),o=s}return i},Kd=function(e,t,n){return Ud(Wd(e,t,n))},Yd=function(e,t){if(!e)return new Bd.MathNode("mrow");if(_d[e.type])return _d[e.type](e,t);throw new yc("Got group of unknown type: '"+e.type+"'")};function Xd(e,t,n,r,o){var i,a=Wd(e,n);i=1===a.length&&a[0]instanceof jd&&Nc.contains(["mrow","mtable"],a[0].type)?a[0]:new Bd.MathNode("mrow",a);var s=new Bd.MathNode("annotation",[new Bd.TextNode(t)]);s.setAttribute("encoding","application/x-tex");var l=new Bd.MathNode("semantics",[i,s]),c=new Bd.MathNode("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block");var u=o?"katex":"katex-mathml"
|
|
329
|
+
;return hd.makeSpan([u],[c])}var Zd=function(e){return new Zc({style:e.displayMode?Pc.DISPLAY:Pc.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},Jd=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=hd.makeSpan(n,[e])}return e},Qd={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:"⇋",
|
|
330
|
+
"\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},eh={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],
|
|
330
331
|
"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],
|
|
331
|
-
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]},
|
|
332
|
-
;return t.setAttribute("stretchy","true"),t},
|
|
333
|
-
if(3!==_)throw new Error("Correct katexImagesData or update code here to support\n "+_+" children.");d=["brace-left","brace-center","brace-right"],h=["xMinYMin","xMidYMin","xMaxYMin"]}for(var w=0;w<_;w++){var x=new
|
|
334
|
-
e.base=n,o=function(e){if(e instanceof
|
|
335
|
-
positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-u},{type:"elem",elem:l}]},t)}var f=
|
|
336
|
-
var n=
|
|
337
|
-
var n=
|
|
338
|
-
names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:o}=e;return{type:"xArrow",mode:r.mode,label:o,body:t[0],below:n[0]}},htmlBuilder(e,t){var n,r=t.style,o=t.havingStyle(r.sup()),i=
|
|
339
|
-
;if((i.depth>.25||"\\xleftequilibrium"===e.label)&&(u-=i.depth),n){var d=-t.fontMetrics().axisHeight+n.height+.5*l.height+.111;s=
|
|
340
|
-
;return"minner"===e.mclass?n=new
|
|
341
|
-
type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:
|
|
342
|
-
var n=
|
|
343
|
-
;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=
|
|
344
|
-
for(var{parser:n}=e,r=
|
|
345
|
-
var{parser:n,breakOnTokenText:r}=e,o=
|
|
346
|
-
"\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},
|
|
347
|
-
;for(var i,a=0,s=[[]];"{"!==t.gullet.future().text;)if("#"===(r=t.gullet.popToken()).text){if("{"===t.gullet.future().text){i=t.gullet.future(),s[a].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new
|
|
348
|
-
;return
|
|
349
|
-
return
|
|
350
|
-
;case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257zM478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z";default:return""}}(e,Math.round(1e3*t))),i=new
|
|
332
|
+
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]},th=function(e,t,n,r,o){var i,a=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(i=hd.makeSpan(["stretchy",t],[],o),"fbox"===t){var s=o.color&&o.getColor();s&&(i.style.borderColor=s)}}else{var l=[];/^[bx]cancel$/.test(t)&&l.push(new fu({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new fu({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new mu(l,{width:"100%",height:nu(a)});i=hd.makeSvgSpan([],[c],o)}return i.height=a,i.style.height=nu(a),i},nh=function(e){var t=new Bd.MathNode("mo",[new Bd.TextNode(Qd[e.replace(/^\\/,"")])])
|
|
333
|
+
;return t.setAttribute("stretchy","true"),t},rh=function(e,t){var{span:n,minWidth:r,height:o}=function(){var n=4e5,r=e.label.slice(1);if(Nc.contains(["widehat","widecheck","widetilde","utilde"],r)){var o,i,a,s="ordgroup"===(m=e.base).type?m.body.length:1;if(s>5)"widehat"===r||"widecheck"===r?(o=420,n=2364,a=.42,i=r+"4"):(o=312,n=2340,a=.34,i="tilde4");else{var l=[1,1,2,2,3,3][s];"widehat"===r||"widecheck"===r?(n=[0,1062,2364,2364,2364][l],o=[0,239,300,360,420][l],a=[0,.24,.3,.3,.36,.42][l],i=r+l):(n=[0,600,1033,2339,2340][l],o=[0,260,286,306,312][l],a=[0,.26,.286,.3,.306,.34][l],i="tilde"+l)}var c=new pu(i),u=new mu([c],{width:"100%",height:nu(a),viewBox:"0 0 "+n+" "+o,preserveAspectRatio:"none"});return{span:hd.makeSvgSpan([],[u],t),minWidth:0,height:a}}var d,h,m,p=[],f=eh[r],[g,v,b]=f,y=b/1e3,_=g.length;if(1===_)d=["hide-tail"],h=[f[3]];else if(2===_)d=["halfarrow-left","halfarrow-right"],h=["xMinYMin","xMaxYMin"];else{
|
|
334
|
+
if(3!==_)throw new Error("Correct katexImagesData or update code here to support\n "+_+" children.");d=["brace-left","brace-center","brace-right"],h=["xMinYMin","xMidYMin","xMaxYMin"]}for(var w=0;w<_;w++){var x=new pu(g[w]),k=new mu([x],{width:"400em",height:nu(y),viewBox:"0 0 "+n+" "+b,preserveAspectRatio:h[w]+" slice"}),N=hd.makeSvgSpan([d[w]],[k],t);if(1===_)return{span:N,minWidth:v,height:y};N.style.height=nu(y),p.push(N)}return{span:hd.makeSpan(["stretchy"],p,t),minWidth:v,height:y}}();return n.height=o,n.style.height=nu(o),r>0&&(n.style.minWidth=nu(r)),n};function oh(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function ih(e){var t=ah(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 ah(e){return e&&("atom"===e.type||bu.hasOwnProperty(e.type))?e:null}var sh=(e,t)=>{var n,r,o;e&&"supsub"===e.type?(n=(r=oh(e.base,"accent")).base,
|
|
335
|
+
e.base=n,o=function(e){if(e instanceof lu)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(Pd(e,t)),e.base=r):n=(r=oh(e,"accent")).base;var i=Pd(n,t.havingCrampedStyle()),a=0;if(r.isShifty&&Nc.isCharacterBox(n)){var s=Nc.getBaseElem(n);a=gu(Pd(s,t.havingCrampedStyle())).skew}var l,c="\\c"===r.label,u=c?i.height+i.depth:Math.min(i.height,t.fontMetrics().xHeight);if(r.isStretchy)l=rh(r,t),l=hd.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:l,wrapperClasses:["svg-align"],wrapperStyle:a>0?{width:"calc(100% - "+nu(2*a)+")",marginLeft:nu(2*a)}:void 0}]},t);else{var d,h;"\\vec"===r.label?(d=hd.staticSvg("vec",t),h=hd.svgData.vec[1]):((d=gu(d=hd.makeOrd({mode:r.mode,text:r.label},t,"textord"))).italic=0,h=d.width,c&&(u+=d.depth)),l=hd.makeSpan(["accent-body"],[d]);var m="\\textcircled"===r.label;m&&(l.classes.push("accent-full"),u=i.height);var p=a;m||(p-=h/2),l.style.left=nu(p),"\\textcircled"===r.label&&(l.style.top=".2em"),l=hd.makeVList({
|
|
336
|
+
positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-u},{type:"elem",elem:l}]},t)}var f=hd.makeSpan(["mord","accent"],[l],t);return o?(o.children[0]=f,o.height=Math.max(f.height,o.height),o.classes[0]="mord",o):f},lh=(e,t)=>{var n=e.isStretchy?nh(e.label):new Bd.MathNode("mo",[qd(e.label,e.mode)]),r=new Bd.MathNode("mover",[Yd(e.base,t),n]);return r.setAttribute("accent","true"),r},ch=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map((e=>"\\"+e)).join("|"));wd({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{
|
|
337
|
+
var n=kd(t[0]),r=!ch.test(e.funcName),o=!r||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:o,base:n}},htmlBuilder:sh,mathmlBuilder:lh}),wd({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return"math"===r&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:sh,mathmlBuilder:lh}),wd({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:o}},htmlBuilder:(e,t)=>{
|
|
338
|
+
var n=Pd(e.base,t),r=rh(e,t),o="\\utilde"===e.label?.12:0,i=hd.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:o},{type:"elem",elem:n}]},t);return hd.makeSpan(["mord","accentunder"],[i],t)},mathmlBuilder:(e,t)=>{var n=nh(e.label),r=new Bd.MathNode("munder",[Yd(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var uh=e=>{var t=new Bd.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};wd({type:"xArrow",
|
|
339
|
+
names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:o}=e;return{type:"xArrow",mode:r.mode,label:o,body:t[0],below:n[0]}},htmlBuilder(e,t){var n,r=t.style,o=t.havingStyle(r.sup()),i=hd.wrapFragment(Pd(e.body,o,t),t),a="\\x"===e.label.slice(0,2)?"x":"cd";i.classes.push(a+"-arrow-pad"),e.below&&(o=t.havingStyle(r.sub()),(n=hd.wrapFragment(Pd(e.below,o,t),t)).classes.push(a+"-arrow-pad"));var s,l=rh(e,t),c=-t.fontMetrics().axisHeight+.5*l.height,u=-t.fontMetrics().axisHeight-.5*l.height-.111
|
|
340
|
+
;if((i.depth>.25||"\\xleftequilibrium"===e.label)&&(u-=i.depth),n){var d=-t.fontMetrics().axisHeight+n.height+.5*l.height+.111;s=hd.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:l,shift:c},{type:"elem",elem:n,shift:d}]},t)}else s=hd.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:l,shift:c}]},t);return s.children[0].children[0].children[1].classes.push("svg-align"),hd.makeSpan(["mrel","x-arrow"],[s],t)},mathmlBuilder(e,t){var n,r=nh(e.label);if(r.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var o=uh(Yd(e.body,t));if(e.below){var i=uh(Yd(e.below,t));n=new Bd.MathNode("munderover",[r,i,o])}else n=new Bd.MathNode("mover",[r,o])}else if(e.below){var a=uh(Yd(e.below,t));n=new Bd.MathNode("munder",[r,a])}else n=uh(),n=new Bd.MathNode("mover",[r,n]);return n}});var dh=hd.makeSpan;function hh(e,t){var n=Md(e.body,t,!0);return dh([e.mclass],n,t)}function mh(e,t){var n,r=Wd(e.body,t)
|
|
341
|
+
;return"minner"===e.mclass?n=new Bd.MathNode("mpadded",r):"mord"===e.mclass?e.isCharacterBox?(n=r[0]).type="mi":n=new Bd.MathNode("mi",r):(e.isCharacterBox?(n=r[0]).type="mo":n=new Bd.MathNode("mo",r),"mbin"===e.mclass?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):"mpunct"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):"mopen"===e.mclass||"mclose"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0em"):"minner"===e.mclass&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}wd({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:Nd(o),isCharacterBox:Nc.isCharacterBox(o)}},htmlBuilder:hh,mathmlBuilder:mh});var ph=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};wd({
|
|
342
|
+
type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:ph(t[0]),body:Nd(t[1]),isCharacterBox:Nc.isCharacterBox(t[1])}}}),wd({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var n,{parser:r,funcName:o}=e,i=t[1],a=t[0];n="\\stackrel"!==o?ph(i):"mrel";var s={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==o,body:Nd(i)},l={type:"supsub",mode:a.mode,base:s,sup:"\\underset"===o?null:a,sub:"\\underset"===o?a:null};return{type:"mclass",mode:r.mode,mclass:n,body:[l],isCharacterBox:Nc.isCharacterBox(l)}},htmlBuilder:hh,mathmlBuilder:mh}),wd({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:ph(t[0]),body:Nd(t[0])}},htmlBuilder(e,t){var n=Md(e.body,t,!0),r=hd.makeSpan([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){
|
|
343
|
+
var n=Wd(e.body,t),r=new Bd.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var fh={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},gh=e=>"textord"===e.type&&"@"===e.text;function vh(e,t,n){var r=fh[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":var o={type:"atom",text:r,mode:"math",family:"rel"},i={type:"ordgroup",mode:"math",body:[n.callFunction("\\\\cdleft",[t[0]],[]),n.callFunction("\\Big",[o],[]),n.callFunction("\\\\cdright",[t[1]],[])]};return n.callFunction("\\\\cdparent",[i],[]);case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return n.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}}}wd({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e
|
|
344
|
+
;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=hd.wrapFragment(Pd(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=nu(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Bd.MathNode("mrow",[Yd(e.label,t)]);return(n=new Bd.MathNode("mpadded",[n])).setAttribute("width","0"),"left"===e.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),(n=new Bd.MathNode("mstyle",[n])).setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),wd({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=hd.wrapFragment(Pd(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder:(e,t)=>new Bd.MathNode("mrow",[Yd(e.fragment,t)])}),wd({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){
|
|
345
|
+
for(var{parser:n}=e,r=oh(t[0],"ordgroup").body,o="",i=0;i<r.length;i++){o+=oh(r[i],"textord").text}var a,s=parseInt(o);if(isNaN(s))throw new yc("\\@char has non-numeric argument "+o);if(s<0||s>=1114111)throw new yc("\\@char with invalid code point "+o);return s<=65535?a=String.fromCharCode(s):(s-=65536,a=String.fromCharCode(55296+(s>>10),56320+(1023&s))),{type:"textord",mode:n.mode,text:a}}});var bh=(e,t)=>{var n=Md(e.body,t.withColor(e.color),!1);return hd.makeFragment(n)},yh=(e,t)=>{var n=Wd(e.body,t.withColor(e.color)),r=new Bd.MathNode("mstyle",n);return r.setAttribute("mathcolor",e.color),r};wd({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=oh(t[0],"color-token").color,o=t[1];return{type:"color",mode:n.mode,color:r,body:Nd(o)}},htmlBuilder:bh,mathmlBuilder:yh}),wd({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){
|
|
346
|
+
var{parser:n,breakOnTokenText:r}=e,o=oh(t[0],"color-token").color;n.gullet.macros.set("\\current@color",o);var i=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:o,body:i}},htmlBuilder:bh,mathmlBuilder:yh}),wd({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,o="["===r.gullet.future().text?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:o&&oh(o,"size").value}},htmlBuilder(e,t){var n=hd.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=nu(tu(e.size,t)))),n},mathmlBuilder(e,t){var n=new Bd.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",nu(tu(e.size,t)))),n}});var _h={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef",
|
|
347
|
+
"\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},wh=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new yc("Expected a control sequence",e);return t},xh=(e,t,n,r)=>{var o=e.gullet.macros.get(n.text);null==o&&(n.noexpand=!0,o={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,o,r)};wd({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(_h[r.text])return"\\global"!==n&&"\\\\globallong"!==n||(r.text=_h[r.text]),oh(t.parseFunction(),"internal");throw new yc("Invalid token after macro prefix",r)}}),wd({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),o=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(o))throw new yc("Expected a control sequence",r)
|
|
348
|
+
;for(var i,a=0,s=[[]];"{"!==t.gullet.future().text;)if("#"===(r=t.gullet.popToken()).text){if("{"===t.gullet.future().text){i=t.gullet.future(),s[a].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new yc('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==a+1)throw new yc('Argument number "'+r.text+'" out of order');a++,s.push([])}else{if("EOF"===r.text)throw new yc("Expected a macro definition");s[a].push(r.text)}var{tokens:l}=t.gullet.consumeArg();return i&&l.unshift(i),"\\edef"!==n&&"\\xdef"!==n||(l=t.gullet.expandTokens(l)).reverse(),t.gullet.macros.set(o,{tokens:l,numArgs:a,delimiters:s},n===_h[n]),{type:"internal",mode:t.mode}}}),wd({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=wh(t.gullet.popToken());t.gullet.consumeSpaces();var o=(e=>{var t=e.gullet.popToken();return"="===t.text&&" "===(t=e.gullet.popToken()).text&&(t=e.gullet.popToken()),t})(t)
|
|
349
|
+
;return xh(t,r,o,"\\\\globallet"===n),{type:"internal",mode:t.mode}}}),wd({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=wh(t.gullet.popToken()),o=t.gullet.popToken(),i=t.gullet.popToken();return xh(t,r,i,"\\\\globalfuture"===n),t.gullet.pushToken(i),t.gullet.pushToken(o),{type:"internal",mode:t.mode}}});var kh=function(e,t,n){var r=Vc(yu.math[e]&&yu.math[e].replace||e,t,n);if(!r)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return r},Nh=function(e,t,n,r){var o=n.havingBaseStyle(t),i=hd.makeSpan(r.concat(o.sizingClasses(n)),[e],n),a=o.sizeMultiplier/n.sizeMultiplier;return i.height*=a,i.depth*=a,i.maxFontSize=o.sizeMultiplier,i},Sh=function(e,t,n){var r=t.havingBaseStyle(n),o=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=nu(o),e.height-=o,e.depth+=o},Ah=function(e,t,n,r,o,i){var a=function(e,t,n,r){
|
|
350
|
+
return hd.makeSymbol(e,"Size"+t+"-Regular",n,r)}(e,t,o,r),s=Nh(hd.makeSpan(["delimsizing","size"+t],[a],r),Pc.TEXT,r,i);return n&&Sh(s,r,Pc.TEXT),s},Th=function(e,t,n){var r;return r="Size1-Regular"===t?"delim-size1":"delim-size4",{type:"elem",elem:hd.makeSpan(["delimsizinginner",r],[hd.makeSpan([],[hd.makeSymbol(e,t,n)])])}},Eh=function(e,t,n){var r=qc["Size4-Regular"][e.charCodeAt(0)]?qc["Size4-Regular"][e.charCodeAt(0)][4]:qc["Size1-Regular"][e.charCodeAt(0)][4],o=new pu("inner",function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"∣":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145zM367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z";case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z"
|
|
351
|
+
;case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257zM478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z";default:return""}}(e,Math.round(1e3*t))),i=new mu([o],{width:nu(r),height:nu(t),style:"width:"+nu(r),viewBox:"0 0 "+1e3*r+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),a=hd.makeSvgSpan([],[i],n);return a.height=t,a.style.height=nu(t),a.style.width=nu(r),{type:"elem",elem:a}},Ch={type:"kern",size:-.008},Mh=["|","\\lvert","\\rvert","\\vert"],Ih=["\\|","\\lVert","\\rVert","\\Vert"],zh=function(e,t,n,r,o,i){var a,s,l,c,u="",d=0;a=l=c=e,s=null;var h="Size1-Regular";"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?a=l="⏐":"\\Downarrow"===e?a=l="‖":"\\updownarrow"===e?(a="\\uparrow",l="⏐",c="\\downarrow"):"\\Updownarrow"===e?(a="\\Uparrow",l="‖",c="\\Downarrow"):Nc.contains(Mh,e)?(l="∣",u="vert",d=333):Nc.contains(Ih,e)?(l="∥",u="doublevert",d=556):"["===e||"\\lbrack"===e?(a="⎡",l="⎢",c="⎣",h="Size4-Regular",
|
|
351
352
|
u="lbrack",d=667):"]"===e||"\\rbrack"===e?(a="⎤",l="⎥",c="⎦",h="Size4-Regular",u="rbrack",d=667):"\\lfloor"===e||"⌊"===e?(l=a="⎢",c="⎣",h="Size4-Regular",u="lfloor",d=667):"\\lceil"===e||"⌈"===e?(a="⎡",l=c="⎢",h="Size4-Regular",u="lceil",d=667):"\\rfloor"===e||"⌋"===e?(l=a="⎥",c="⎦",h="Size4-Regular",u="rfloor",d=667):"\\rceil"===e||"⌉"===e?(a="⎤",l=c="⎥",h="Size4-Regular",u="rceil",d=667):"("===e||"\\lparen"===e?(a="⎛",l="⎜",c="⎝",h="Size4-Regular",u="lparen",d=875):")"===e||"\\rparen"===e?(a="⎞",l="⎟",c="⎠",h="Size4-Regular",u="rparen",d=875):"\\{"===e||"\\lbrace"===e?(a="⎧",s="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(a="⎫",s="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(a="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(a="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(a="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(a="⎫",c="⎩",l="⎪",h="Size4-Regular")
|
|
352
|
-
;var m=
|
|
353
|
+
;var m=kh(a,h,o),p=m.height+m.depth,f=kh(l,h,o),g=f.height+f.depth,v=kh(c,h,o),b=v.height+v.depth,y=0,_=1;if(null!==s){var w=kh(s,h,o);y=w.height+w.depth,_=2}var x=p+b+y,k=x+Math.max(0,Math.ceil((t-x)/(_*g)))*_*g,N=r.fontMetrics().axisHeight;n&&(N*=r.sizeMultiplier);var S=k/2-N,A=[];if(u.length>0){var T=k-p-b,E=Math.round(1e3*k),C=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z";case"doublevert":
|
|
353
354
|
return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z\nM367 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v602 h84z\nM403 1759 V0 H319 V1759 v"+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+t+" v602 h84z";case"lparen":
|
|
354
355
|
return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(t+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(t+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":
|
|
355
|
-
return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}}(u,Math.round(1e3*T)),M=new
|
|
356
|
-
var R=k-p-b+.016;A.push(
|
|
357
|
-
;case"sqrtSize1":r=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
|
|
358
|
-
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
|
|
359
|
-
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
|
|
360
|
-
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
|
|
361
|
-
;return
|
|
362
|
-
type:"stack"}],
|
|
363
|
-
var n,r,o=t.havingBaseSizing(),i=
|
|
364
|
-
var a=r.fontMetrics().axisHeight*r.sizeMultiplier,s=5/r.fontMetrics().ptPerEm,l=Math.max(t-a,n+a),c=Math.max(l/500*901,2*l-s);return
|
|
365
|
-
},
|
|
366
|
-
mode:e.parser.mode,size:
|
|
367
|
-
;--r.leftrightDepth,r.expect("\\right",!1);var i=
|
|
368
|
-
;o.setAttribute("fence","true"),e.rightColor&&o.setAttribute("mathcolor",e.rightColor),n.push(o)}return
|
|
369
|
-
number:.6,unit:"pt"},t),u=
|
|
370
|
-
s=o.depth+g,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)r=
|
|
371
|
-
r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),"\\fcolorbox"===e.label){var o=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+o+"em solid "+String(e.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};
|
|
372
|
-
argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:o}=e,i=
|
|
373
|
-
handler:o},l=0;l<n.length;++l)
|
|
374
|
-
function _(){b&&(e.gullet.macros.get("\\df@tag")?(b.push(e.subparse([new
|
|
375
|
-
return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:o,arraystretch:a,body:f,cols:i,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:v,colSeparationType:s,tags:b,leqno:h}}function
|
|
376
|
-
e.addJot&&(w+=m),x.height=_,x.depth=w,v+=_,x.pos=v,v+=w+S,s[n]=x,b(i[n+1])}var A,T,E=v/2+t.fontMetrics().axisHeight,C=e.cols||[],M=[],I=[];if(e.tags&&e.tags.some((e=>e)))for(n=0;n<o;++n){var z=s[n],O=z.pos-E,L=e.tags[n],R=void 0;(R=!0===L?
|
|
377
|
-
;(r>0||e.hskipBeforeAndAfter)&&0!==($=
|
|
378
|
-
},
|
|
379
|
-
for(var y=e.cols||[],_="",w=1;w<y.length;w++)_+=w%2?"0em ":"1em ";c.setAttribute("columnspacing",_.trim())}else"alignat"===e.colSeparationType||"gather"===e.colSeparationType?c.setAttribute("columnspacing","0em"):"small"===e.colSeparationType?c.setAttribute("columnspacing","0.2778em"):"CD"===e.colSeparationType?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var x="",k=e.hLinesBeforeRow;d+=k[0].length>0?"left ":"",d+=k[k.length-1].length>0?"right ":"";for(var N=1;N<k.length-1;N++)x+=0===k[N].length?"none ":k[N][0]?"dashed ":"solid ";return/[sd]/.test(x)&&c.setAttribute("rowlines",x.trim()),""!==d&&(c=new
|
|
380
|
-
colSeparationType:o,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},"display"),s=0,l={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){for(var c="",u=0;u<t[0].body.length;u++){c+=
|
|
381
|
-
;throw new
|
|
382
|
-
type:"leftright",mode:e.mode,body:[i],left:t[0],right:t[1],rightColor:void 0}:i},htmlBuilder:
|
|
383
|
-
type:"align",align:"l",pregap:0,postgap:0}]},
|
|
384
|
-
;return
|
|
385
|
-
}if(
|
|
386
|
-
argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];if("ordgroup"!==o.type)throw new
|
|
387
|
-
names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=
|
|
388
|
-
;return"display"===e?n=n.id>=
|
|
389
|
-
;var w=-(_-.5*u);f=
|
|
390
|
-
;if(e.hasBarLine){if(e.barSize){var r=
|
|
391
|
-
;case"\\\\atopfrac":n=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=!1,s="(",l=")";break;case"\\\\bracefrac":n=!1,s="\\{",l="\\}";break;case"\\\\brackfrac":n=!1,s="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(o){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text"}return{type:"genfrac",mode:r.mode,continued:!1,numer:i,denom:a,hasBarLine:n,leftDelim:s,rightDelim:l,size:c,barSize:null}},htmlBuilder:
|
|
392
|
-
t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:t,token:o}}});var
|
|
393
|
-
props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:o}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:
|
|
394
|
-
},t)).children[0].children[0].children[1].classes.push("svg-align"):(i=
|
|
395
|
-
type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],o=
|
|
396
|
-
allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:
|
|
397
|
-
throw new Error("Unrecognized html command")}return r.settings.isTrusted(n)?{type:"html",mode:r.mode,attributes:l,body:
|
|
398
|
-
;if(!
|
|
399
|
-
;e.totalheight.number>0&&(r=
|
|
400
|
-
"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:o.value}},htmlBuilder:(e,t)=>
|
|
401
|
-
var n=new
|
|
402
|
-
script:
|
|
403
|
-
children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:
|
|
404
|
-
var d=a.italic,h=
|
|
405
|
-
"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};
|
|
406
|
-
names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:
|
|
407
|
-
var n,r,o,i,a=!1;if("supsub"===e.type?(n=e.sup,r=e.sub,o=
|
|
408
|
-
alwaysHandleSupSub:"\\operatornamewithlimits"===r,limits:!1,parentIsSupSub:!1}},htmlBuilder:
|
|
409
|
-
names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=
|
|
410
|
-
allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=
|
|
411
|
-
;return o.setAttribute("width","0px"),o}}),
|
|
412
|
-
var n=
|
|
413
|
-
body:i}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return
|
|
414
|
-
mathmlBuilder:(e,t)=>{var n=new
|
|
415
|
-
var m=t.havingStyle(
|
|
416
|
-
text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return i.setAttribute("scriptlevel",a[0]),i.setAttribute("displaystyle",a[1]),i}});
|
|
417
|
-
var _=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof
|
|
418
|
-
;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(r=!0,n=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var o,i=[
|
|
419
|
-
var n=new
|
|
420
|
-
"\\nobreakspace":{className:"nobreak"}};
|
|
421
|
-
"\\textnormal":"textrm"},
|
|
422
|
-
var n=
|
|
423
|
-
throw new
|
|
424
|
-
setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new
|
|
425
|
-
if(0===this.undefStack.length)throw new
|
|
426
|
-
;return e.expandOnce(!0),{tokens:[t],numArgs:0}})),
|
|
427
|
-
if(null==(r=
|
|
428
|
-
var t=e.consumeArgs(1)[0];return console.log(t.reverse().map((e=>e.text)).join("")),""})),
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
"\\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"};
|
|
433
|
-
;return t in
|
|
434
|
-
if(e.macros.get("\\df@tag"))throw new
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
;return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
this.stack=[]}feed(e){this.lexer=new
|
|
446
|
-
}else if("EOF"===r.text)throw new
|
|
447
|
-
if(e&&null==r&&"\\"===n[0]&&!this.isDefined(n))throw new
|
|
448
|
-
return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t?t.map((e=>e.text)).join(""):t}_getExpansion(e){var t=this.macros.get(e);if(null==t)return t;if(1===e.length){var n=this.lexer.catcodes[e];if(null!=n&&13!==n)return}var r="function"==typeof t?t(this):t;if("string"==typeof r){var o=0;if(-1!==r.indexOf("#"))for(var i=r.replace(/##/g,"");-1!==i.indexOf("#"+(o+1));)++o;for(var a=new
|
|
449
|
-
"ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g","ʰ":"h","ⁱ":"i","ʲ":"j","ᵏ":"k","ˡ":"l","ᵐ":"m","ⁿ":"n","ᵒ":"o","ᵖ":"p","ʳ":"r","ˢ":"s","ᵗ":"t","ᵘ":"u","ᵛ":"v","ʷ":"w","ˣ":"x","ʸ":"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),
|
|
450
|
-
text:"\\H"},"̧":{text:"\\c"}},
|
|
356
|
+
return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}}(u,Math.round(1e3*T)),M=new pu(u,C),I=(d/1e3).toFixed(3)+"em",z=(E/1e3).toFixed(3)+"em",O=new mu([M],{width:I,height:z,viewBox:"0 0 "+d+" "+E}),L=hd.makeSvgSpan([],[O],r);L.height=E/1e3,L.style.width=I,L.style.height=z,A.push({type:"elem",elem:L})}else{if(A.push(Th(c,h,o)),A.push(Ch),null===s){
|
|
357
|
+
var R=k-p-b+.016;A.push(Eh(l,R,r))}else{var P=(k-p-b-y)/2+.016;A.push(Eh(l,P,r)),A.push(Ch),A.push(Th(s,h,o)),A.push(Ch),A.push(Eh(l,P,r))}A.push(Ch),A.push(Th(a,h,o))}var D=r.havingBaseStyle(Pc.TEXT),H=hd.makeVList({positionType:"bottom",positionData:S,children:A},D);return Nh(hd.makeSpan(["delimsizing","mult"],[H],D),Pc.TEXT,r,i)},Oh=.08,Lh=function(e,t,n,r,o){var i=function(e,t,n){t*=1e3;var r="";switch(e){case"sqrtMain":r=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,jc);break
|
|
358
|
+
;case"sqrtSize1":r=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,jc);break;case"sqrtSize2":r=function(e,t){
|
|
359
|
+
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,jc);break;case"sqrtSize3":r=function(e,t){
|
|
360
|
+
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,jc);break;case"sqrtSize4":r=function(e,t){
|
|
361
|
+
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,jc);break;case"sqrtTall":r=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,jc,n)}return r}(e,r,n),a=new pu(e,i),s=new mu([a],{width:"400em",height:nu(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"})
|
|
362
|
+
;return hd.makeSvgSpan(["hide-tail"],[s],o)},Rh=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],Ph=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],Dh=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Hh=[0,1.2,1.8,2.4,3],Fh=[{type:"small",style:Pc.SCRIPTSCRIPT},{type:"small",style:Pc.SCRIPT},{type:"small",style:Pc.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],jh=[{type:"small",style:Pc.SCRIPTSCRIPT},{type:"small",style:Pc.SCRIPT},{type:"small",style:Pc.TEXT},{type:"stack"}],$h=[{type:"small",style:Pc.SCRIPTSCRIPT},{type:"small",style:Pc.SCRIPT},{type:"small",style:Pc.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{
|
|
363
|
+
type:"stack"}],Bh=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.")},qh=function(e,t,n,r){for(var o=Math.min(2,3-r.style.size);o<n.length&&"stack"!==n[o].type;o++){var i=kh(e,Bh(n[o]),"math"),a=i.height+i.depth;if("small"===n[o].type&&(a*=r.havingBaseStyle(n[o].style).sizeMultiplier),a>t)return n[o]}return n[n.length-1]},Uh=function(e,t,n,r,o,i){var a;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),a=Nc.contains(Dh,e)?Fh:Nc.contains(Rh,e)?$h:jh;var s=qh(e,t,a,r);return"small"===s.type?function(e,t,n,r,o,i){var a=hd.makeSymbol(e,"Main-Regular",o,r),s=Nh(a,t,r,i);return n&&Sh(s,r,t),s}(e,s.style,n,r,o,i):"large"===s.type?Ah(e,s.size,n,r,o,i):zh(e,t,n,r,o,i)},Gh={sqrtImage:function(e,t){
|
|
364
|
+
var n,r,o=t.havingBaseSizing(),i=qh("\\surd",e*o.sizeMultiplier,$h,o),a=o.sizeMultiplier,s=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),l=0,c=0,u=0;return"small"===i.type?(e<1?a=1:e<1.4&&(a=.7),c=(1+s)/a,(n=Lh("sqrtMain",l=(1+s+Oh)/a,u=1e3+1e3*s+80,s,t)).style.minWidth="0.853em",r=.833/a):"large"===i.type?(u=1080*Hh[i.size],c=(Hh[i.size]+s)/a,l=(Hh[i.size]+s+Oh)/a,(n=Lh("sqrtSize"+i.size,l,u,s,t)).style.minWidth="1.02em",r=1/a):(l=e+s+Oh,c=e+s,u=Math.floor(1e3*e+s)+80,(n=Lh("sqrtTall",l,u,s,t)).style.minWidth="0.742em",r=1.056),n.height=c,n.style.height=nu(l),{span:n,advanceWidth:r,ruleWidth:(t.fontMetrics().sqrtRuleThickness+s)*a}},sizedDelim:function(e,t,n,r,o){if("<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),Nc.contains(Rh,e)||Nc.contains(Dh,e))return Ah(e,t,!1,n,r,o);if(Nc.contains(Ph,e))return zh(e,Hh[t],!1,n,r,o);throw new yc("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:Hh,customSizedDelim:Uh,leftRightDelim:function(e,t,n,r,o,i){
|
|
365
|
+
var a=r.fontMetrics().axisHeight*r.sizeMultiplier,s=5/r.fontMetrics().ptPerEm,l=Math.max(t-a,n+a),c=Math.max(l/500*901,2*l-s);return Uh(e,c,!0,r,o,i)}},Vh={"\\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}
|
|
366
|
+
},Wh=["(","\\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 Kh(e,t){var n=ah(e);if(n&&Nc.contains(Wh,n.text))return n;throw new yc(n?"Invalid delimiter '"+n.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function Yh(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}wd({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=Kh(t[0],e);return{type:"delimsizing",
|
|
367
|
+
mode:e.parser.mode,size:Vh[e.funcName].size,mclass:Vh[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?hd.makeSpan([e.mclass]):Gh.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(qd(e.delim,e.mode));var n=new Bd.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=nu(Gh.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}}),wd({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&"string"!=typeof n)throw new yc("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Kh(t[0],e).text,color:n}}}),wd({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Kh(t[0],e),r=e.parser;++r.leftrightDepth;var o=r.parseExpression(!1)
|
|
368
|
+
;--r.leftrightDepth,r.expect("\\right",!1);var i=oh(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:o,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,t)=>{Yh(e);for(var n,r,o=Md(e.body,t,!0,["mopen","mclose"]),i=0,a=0,s=!1,l=0;l<o.length;l++)o[l].isMiddle?s=!0:(i=Math.max(o[l].height,i),a=Math.max(o[l].depth,a));if(i*=t.sizeMultiplier,a*=t.sizeMultiplier,n="."===e.left?Rd(t,["mopen"]):Gh.leftRightDelim(e.left,i,a,t,e.mode,["mopen"]),o.unshift(n),s)for(var c=1;c<o.length;c++){var u=o[c].isMiddle;u&&(o[c]=Gh.leftRightDelim(u.delim,i,a,u.options,e.mode,[]))}if("."===e.right)r=Rd(t,["mclose"]);else{var d=e.rightColor?t.withColor(e.rightColor):t;r=Gh.leftRightDelim(e.right,i,a,d,e.mode,["mclose"])}return o.push(r),hd.makeSpan(["minner"],o,t)},mathmlBuilder:(e,t)=>{Yh(e);var n=Wd(e.body,t);if("."!==e.left){var r=new Bd.MathNode("mo",[qd(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if("."!==e.right){var o=new Bd.MathNode("mo",[qd(e.right,e.mode)])
|
|
369
|
+
;o.setAttribute("fence","true"),e.rightColor&&o.setAttribute("mathcolor",e.rightColor),n.push(o)}return Ud(n)}}),wd({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Kh(t[0],e);if(!e.parser.leftrightDepth)throw new yc("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if("."===e.delim)n=Rd(t,[]);else{n=Gh.sizedDelim(e.delim,1,t,e.mode,[]);var r={delim:e.delim,options:t};n.isMiddle=r}return n},mathmlBuilder:(e,t)=>{var n="\\vert"===e.delim||"|"===e.delim?qd("|","text"):qd(e.delim,e.mode),r=new Bd.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Xh=(e,t)=>{var n,r,o=hd.wrapFragment(Pd(e.body,t),t),i=e.label.slice(1),a=t.sizeMultiplier,s=0,l=Nc.isCharacterBox(e.body);if("sout"===i)(n=hd.makeSpan(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/a,s=-.5*t.fontMetrics().xHeight;else if("phase"===i){var c=tu({
|
|
370
|
+
number:.6,unit:"pt"},t),u=tu({number:.35,unit:"ex"},t);a/=t.havingBaseSizing().sizeMultiplier;var d=o.height+o.depth+c+u;o.style.paddingLeft=nu(d/2+c);var h=Math.floor(1e3*d*a),m=function(e){return"M400000 "+e+" H0 L"+e/2+" 0 l65 45 L145 "+(e-80)+" H400000z"}(h),p=new mu([new pu("phase",m)],{width:"400em",height:nu(h/1e3),viewBox:"0 0 400000 "+h,preserveAspectRatio:"xMinYMin slice"});(n=hd.makeSvgSpan(["hide-tail"],[p],t)).style.height=nu(d),s=o.depth+c+u}else{/cancel/.test(i)?l||o.classes.push("cancel-pad"):"angl"===i?o.classes.push("anglpad"):o.classes.push("boxpad");var f=0,g=0,v=0;/box/.test(i)?(v=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),g=f=t.fontMetrics().fboxsep+("colorbox"===i?0:v)):"angl"===i?(f=4*(v=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness)),g=Math.max(0,.25-o.depth)):g=f=l?.2:0,n=th(o,i,f,g,t),/fbox|boxed|fcolorbox/.test(i)?(n.style.borderStyle="solid",n.style.borderWidth=nu(v)):"angl"===i&&.049!==v&&(n.style.borderTopWidth=nu(v),n.style.borderRightWidth=nu(v)),
|
|
371
|
+
s=o.depth+g,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)r=hd.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:s},{type:"elem",elem:o,shift:0}]},t);else{var b=/cancel|phase/.test(i)?["svg-align"]:[];r=hd.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:n,shift:s,wrapperClasses:b}]},t)}return/cancel/.test(i)&&(r.height=o.height,r.depth=o.depth),/cancel/.test(i)&&!l?hd.makeSpan(["mord","cancel-lap"],[r],t):hd.makeSpan(["mord"],[r],t)},Zh=(e,t)=>{var n=0,r=new Bd.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Yd(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":
|
|
372
|
+
r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),"\\fcolorbox"===e.label){var o=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+o+"em solid "+String(e.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};wd({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:r,funcName:o}=e,i=oh(t[0],"color-token").color,a=t[1];return{type:"enclose",mode:r.mode,label:o,backgroundColor:i,body:a}},htmlBuilder:Xh,mathmlBuilder:Zh}),wd({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,
|
|
373
|
+
argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:o}=e,i=oh(t[0],"color-token").color,a=oh(t[1],"color-token").color,s=t[2];return{type:"enclose",mode:r.mode,label:o,backgroundColor:a,borderColor:i,body:s}},htmlBuilder:Xh,mathmlBuilder:Zh}),wd({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}}),wd({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];return{type:"enclose",mode:n.mode,label:r,body:o}},htmlBuilder:Xh,mathmlBuilder:Zh}),wd({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var Jh={};function Qh(e){for(var{type:t,names:n,props:r,handler:o,htmlBuilder:i,mathmlBuilder:a}=e,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,
|
|
374
|
+
handler:o},l=0;l<n.length;++l)Jh[n[l]]=s;i&&(yd[t]=i),a&&(_d[t]=a)}var em={};function tm(e,t){em[e]=t}function nm(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for("\\relax"===n&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);"\\hline"===n||"\\hdashline"===n;)e.consume(),t.push("\\hdashline"===n),e.consumeSpaces(),n=e.fetch().text;return t}var rm=e=>{if(!e.parser.settings.displayMode)throw new yc("{"+e.envName+"} can be used only in display mode.")};function om(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function im(e,t,n){var{hskipBeforeAndAfter:r,addJot:o,cols:i,arraystretch:a,colSeparationType:s,autoTag:l,singleRow:c,emptySingleRow:u,maxNumCols:d,leqno:h}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var m=e.gullet.expandMacroAsText("\\arraystretch");if(null==m)a=1;else if(!(a=parseFloat(m))||a<0)throw new yc("Invalid \\arraystretch: "+m)}e.gullet.beginGroup();var p=[],f=[p],g=[],v=[],b=null!=l?[]:void 0;function y(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}
|
|
375
|
+
function _(){b&&(e.gullet.macros.get("\\df@tag")?(b.push(e.subparse([new bc("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):b.push(Boolean(l)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(y(),v.push(nm(e));;){var w=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),w={type:"ordgroup",mode:e.mode,body:w},n&&(w={type:"styling",mode:e.mode,style:n,body:[w]}),p.push(w);var x=e.fetch().text;if("&"===x){if(d&&p.length===d){if(c||s)throw new yc("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else{if("\\end"===x){_(),1===p.length&&"styling"===w.type&&0===w.body[0].body.length&&(f.length>1||!u)&&f.pop(),v.length<f.length+1&&v.push([]);break}if("\\\\"!==x)throw new yc("Expected & or \\\\ or \\cr or \\end",e.nextToken);e.consume();var k=void 0;" "!==e.gullet.future().text&&(k=e.parseSizeGroup(!0)),g.push(k?k.value:null),_(),v.push(nm(e)),p=[],f.push(p),y()}}
|
|
376
|
+
return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:o,arraystretch:a,body:f,cols:i,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:v,colSeparationType:s,tags:b,leqno:h}}function am(e){return"d"===e.slice(0,1)?"display":"text"}var sm=function(e,t){var n,r,o=e.body.length,i=e.hLinesBeforeRow,a=0,s=new Array(o),l=[],c=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),u=1/t.fontMetrics().ptPerEm,d=5*u;e.colSeparationType&&"small"===e.colSeparationType&&(d=t.havingStyle(Pc.SCRIPT).sizeMultiplier/t.sizeMultiplier*.2778);var h="CD"===e.colSeparationType?tu({number:3,unit:"ex"},t):12*u,m=3*u,p=e.arraystretch*h,f=.7*p,g=.3*p,v=0;function b(e){for(var t=0;t<e.length;++t)t>0&&(v+=.25),l.push({pos:v,isDashed:e[t]})}for(b(i[0]),n=0;n<e.body.length;++n){var y=e.body[n],_=f,w=g;a<y.length&&(a=y.length);var x=new Array(y.length);for(r=0;r<y.length;++r){var k=Pd(y[r],t);w<k.depth&&(w=k.depth),_<k.height&&(_=k.height),x[r]=k}var N=e.rowGaps[n],S=0;N&&(S=tu(N,t))>0&&(w<(S+=g)&&(w=S),S=0),
|
|
377
|
+
e.addJot&&(w+=m),x.height=_,x.depth=w,v+=_,x.pos=v,v+=w+S,s[n]=x,b(i[n+1])}var A,T,E=v/2+t.fontMetrics().axisHeight,C=e.cols||[],M=[],I=[];if(e.tags&&e.tags.some((e=>e)))for(n=0;n<o;++n){var z=s[n],O=z.pos-E,L=e.tags[n],R=void 0;(R=!0===L?hd.makeSpan(["eqn-num"],[],t):!1===L?hd.makeSpan([],[],t):hd.makeSpan([],Md(L,t,!0),t)).depth=z.depth,R.height=z.height,I.push({type:"elem",elem:R,shift:O})}for(r=0,T=0;r<a||T<C.length;++r,++T){for(var P=C[T]||{},D=!0;"separator"===P.type;){if(D||((A=hd.makeSpan(["arraycolsep"],[])).style.width=nu(t.fontMetrics().doubleRuleSep),M.push(A)),"|"!==P.separator&&":"!==P.separator)throw new yc("Invalid separator type: "+P.separator);var H="|"===P.separator?"solid":"dashed",F=hd.makeSpan(["vertical-separator"],[],t);F.style.height=nu(v),F.style.borderRightWidth=nu(c),F.style.borderRightStyle=H,F.style.margin="0 "+nu(-c/2);var j=v-E;j&&(F.style.verticalAlign=nu(-j)),M.push(F),P=C[++T]||{},D=!1}if(!(r>=a)){var $=void 0
|
|
378
|
+
;(r>0||e.hskipBeforeAndAfter)&&0!==($=Nc.deflt(P.pregap,d))&&((A=hd.makeSpan(["arraycolsep"],[])).style.width=nu($),M.push(A));var B=[];for(n=0;n<o;++n){var q=s[n],U=q[r];if(U){var G=q.pos-E;U.depth=q.depth,U.height=q.height,B.push({type:"elem",elem:U,shift:G})}}B=hd.makeVList({positionType:"individualShift",children:B},t),B=hd.makeSpan(["col-align-"+(P.align||"c")],[B]),M.push(B),(r<a-1||e.hskipBeforeAndAfter)&&0!==($=Nc.deflt(P.postgap,d))&&((A=hd.makeSpan(["arraycolsep"],[])).style.width=nu($),M.push(A))}}if(s=hd.makeSpan(["mtable"],M),l.length>0){for(var V=hd.makeLineSpan("hline",t,c),W=hd.makeLineSpan("hdashline",t,c),K=[{type:"elem",elem:s,shift:0}];l.length>0;){var Y=l.pop(),X=Y.pos-E;Y.isDashed?K.push({type:"elem",elem:W,shift:X}):K.push({type:"elem",elem:V,shift:X})}s=hd.makeVList({positionType:"individualShift",children:K},t)}if(0===I.length)return hd.makeSpan(["mord"],[s],t);var Z=hd.makeVList({positionType:"individualShift",children:I},t);return Z=hd.makeSpan(["tag"],[Z],t),hd.makeFragment([s,Z])
|
|
379
|
+
},lm={c:"center ",l:"left ",r:"right "},cm=function(e,t){for(var n=[],r=new Bd.MathNode("mtd",[],["mtr-glue"]),o=new Bd.MathNode("mtd",[],["mml-eqn-num"]),i=0;i<e.body.length;i++){for(var a=e.body[i],s=[],l=0;l<a.length;l++)s.push(new Bd.MathNode("mtd",[Yd(a[l],t)]));e.tags&&e.tags[i]&&(s.unshift(r),s.push(r),e.leqno?s.unshift(o):s.push(o)),n.push(new Bd.MathNode("mtr",s))}var c=new Bd.MathNode("mtable",n),u=.5===e.arraystretch?.1:.16+e.arraystretch-1+(e.addJot?.09:0);c.setAttribute("rowspacing",nu(u));var d="",h="";if(e.cols&&e.cols.length>0){var m=e.cols,p="",f=!1,g=0,v=m.length;"separator"===m[0].type&&(d+="top ",g=1),"separator"===m[m.length-1].type&&(d+="bottom ",v-=1);for(var b=g;b<v;b++)"align"===m[b].type?(h+=lm[m[b].align],f&&(p+="none "),f=!0):"separator"===m[b].type&&f&&(p+="|"===m[b].separator?"solid ":"dashed ",f=!1);c.setAttribute("columnalign",h.trim()),/[sd]/.test(p)&&c.setAttribute("columnlines",p.trim())}if("align"===e.colSeparationType){
|
|
380
|
+
for(var y=e.cols||[],_="",w=1;w<y.length;w++)_+=w%2?"0em ":"1em ";c.setAttribute("columnspacing",_.trim())}else"alignat"===e.colSeparationType||"gather"===e.colSeparationType?c.setAttribute("columnspacing","0em"):"small"===e.colSeparationType?c.setAttribute("columnspacing","0.2778em"):"CD"===e.colSeparationType?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var x="",k=e.hLinesBeforeRow;d+=k[0].length>0?"left ":"",d+=k[k.length-1].length>0?"right ":"";for(var N=1;N<k.length-1;N++)x+=0===k[N].length?"none ":k[N][0]?"dashed ":"solid ";return/[sd]/.test(x)&&c.setAttribute("rowlines",x.trim()),""!==d&&(c=new Bd.MathNode("menclose",[c])).setAttribute("notation",d.trim()),e.arraystretch&&e.arraystretch<1&&(c=new Bd.MathNode("mstyle",[c])).setAttribute("scriptlevel","1"),c},um=function(e,t){-1===e.envName.indexOf("ed")&&rm(e);var n,r=[],o=e.envName.indexOf("at")>-1?"alignat":"align",i="split"===e.envName,a=im(e.parser,{cols:r,addJot:!0,autoTag:i?void 0:om(e.envName),emptySingleRow:!0,
|
|
381
|
+
colSeparationType:o,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},"display"),s=0,l={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){for(var c="",u=0;u<t[0].body.length;u++){c+=oh(t[0].body[u],"textord").text}n=Number(c),s=2*n}var d=!s;a.body.forEach((function(e){for(var t=1;t<e.length;t+=2){var r=oh(e[t],"styling");oh(r.body[0],"ordgroup").body.unshift(l)}if(d)s<e.length&&(s=e.length);else{var o=e.length/2;if(n<o)throw new yc("Too many math in a row: expected "+n+", but got "+o,e[0])}}));for(var h=0;h<s;++h){var m="r",p=0;h%2==1?m="l":h>0&&d&&(p=1),r[h]={type:"align",align:m,pregap:p,postgap:0}}return a.colSeparationType=d?"align":"alignat",a};Qh({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=(ah(t[0])?[t[0]]:oh(t[0],"ordgroup").body).map((function(e){var t=ih(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"}
|
|
382
|
+
;throw new yc("Unknown column alignment: "+t,e)})),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return im(e.parser,r,am(e.envName))},htmlBuilder:sm,mathmlBuilder:cm}),Qh({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if("*"===e.envName.charAt(e.envName.length-1)){var o=e.parser;if(o.consumeSpaces(),"["===o.fetch().text){if(o.consume(),o.consumeSpaces(),n=o.fetch().text,-1==="lcr".indexOf(n))throw new yc("Expected l or c or r",o.nextToken);o.consume(),o.consumeSpaces(),o.expect("]"),o.consume(),r.cols=[{type:"align",align:n}]}}var i=im(e.parser,r,am(e.envName)),a=Math.max(0,...i.body.map((e=>e.length)));return i.cols=new Array(a).fill({type:"align",align:n}),t?{
|
|
383
|
+
type:"leftright",mode:e.mode,body:[i],left:t[0],right:t[1],rightColor:void 0}:i},htmlBuilder:sm,mathmlBuilder:cm}),Qh({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t=im(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:sm,mathmlBuilder:cm}),Qh({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=(ah(t[0])?[t[0]]:oh(t[0],"ordgroup").body).map((function(e){var t=ih(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new yc("Unknown column alignment: "+t,e)}));if(n.length>1)throw new yc("{subarray} can contain only one column");var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if((r=im(e.parser,r,"script")).body.length>0&&r.body[0].length>1)throw new yc("{subarray} can contain only one column");return r},htmlBuilder:sm,mathmlBuilder:cm}),Qh({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=im(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{
|
|
384
|
+
type:"align",align:"l",pregap:0,postgap:0}]},am(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:sm,mathmlBuilder:cm}),Qh({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:um,htmlBuilder:sm,mathmlBuilder:cm}),Qh({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){Nc.contains(["gather","gather*"],e.envName)&&rm(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:om(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return im(e.parser,t,"display")},htmlBuilder:sm,mathmlBuilder:cm}),Qh({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:um,htmlBuilder:sm,mathmlBuilder:cm}),Qh({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){rm(e);var t={autoTag:om(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno}
|
|
385
|
+
;return im(e.parser,t,"display")},htmlBuilder:sm,mathmlBuilder:cm}),Qh({type:"array",names:["CD"],props:{numArgs:0},handler:e=>(rm(e),function(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if("&"!==n&&"\\\\"!==n){if("\\end"===n){0===t[t.length-1].length&&t.pop();break}throw new yc("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}for(var r,o,i=[],a=[i],s=0;s<t.length;s++){for(var l=t[s],c={type:"styling",body:[],mode:"math",style:"display"},u=0;u<l.length;u++)if(gh(l[u])){i.push(c);var d=ih(l[u+=1]).text,h=new Array(2);if(h[0]={type:"ordgroup",mode:"math",body:[]},h[1]={type:"ordgroup",mode:"math",body:[]},"=|.".indexOf(d)>-1);else{if(!("<>AV".indexOf(d)>-1))throw new yc('Expected one of "<>AV=|." after @',l[u]);for(var m=0;m<2;m++){for(var p=!0,f=u+1;f<l.length;f++){if(o=d,("mathord"===(r=l[f]).type||"atom"===r.type)&&r.text===o){p=!1,u=f;break
|
|
386
|
+
}if(gh(l[f]))throw new yc("Missing a "+d+" character to complete a CD arrow.",l[f]);h[m].body.push(l[f])}if(p)throw new yc("Missing a "+d+" character to complete a CD arrow.",l[u])}}var g={type:"styling",body:[vh(d,h,e)],mode:"math",style:"display"};i.push(g),c={type:"styling",body:[],mode:"math",style:"display"}}else c.body.push(l[u]);s%2==0?i.push(c):i.shift(),i=[],a.push(i)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:"math",body:a,arraystretch:1,addJot:!0,rowGaps:[null],cols:new Array(a[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25}),colSeparationType:"CD",hLinesBeforeRow:new Array(a.length+1).fill([])}}(e.parser)),htmlBuilder:sm,mathmlBuilder:cm}),tm("\\nonumber","\\gdef\\@eqnsw{0}"),tm("\\notag","\\nonumber"),wd({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new yc(e.funcName+" valid only within array environment")}});var dm=Jh;wd({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,
|
|
387
|
+
argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];if("ordgroup"!==o.type)throw new yc("Invalid environment name",o);for(var i="",a=0;a<o.body.length;++a)i+=oh(o.body[a],"textord").text;if("\\begin"===r){if(!dm.hasOwnProperty(i))throw new yc("No such environment: "+i,o);var s=dm[i],{args:l,optArgs:c}=n.parseArguments("\\begin{"+i+"}",s),u={mode:n.mode,envName:i,parser:n},d=s.handler(u,l,c);n.expect("\\end",!1);var h=n.nextToken,m=oh(n.parseFunction(),"environment");if(m.name!==i)throw new yc("Mismatch: \\begin{"+i+"} matched by \\end{"+m.name+"}",h);return d}return{type:"environment",mode:n.mode,name:i,nameGroup:o}}});var hm=(e,t)=>{var n=e.font,r=t.withFont(n);return Pd(e.body,r)},mm=(e,t)=>{var n=e.font,r=t.withFont(n);return Yd(e.body,r)},pm={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};wd({type:"font",
|
|
388
|
+
names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=kd(t[0]),i=r;return i in pm&&(i=pm[i]),{type:"font",mode:n.mode,font:i.slice(1),body:o}},htmlBuilder:hm,mathmlBuilder:mm}),wd({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0],o=Nc.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:ph(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:o}}}),wd({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:o}=e,{mode:i}=n,a=n.parseExpression(!0,o);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:a}}},htmlBuilder:hm,mathmlBuilder:mm});var fm=(e,t)=>{var n=t
|
|
389
|
+
;return"display"===e?n=n.id>=Pc.SCRIPT.id?n.text():Pc.DISPLAY:"text"===e&&n.size===Pc.DISPLAY.size?n=Pc.TEXT:"script"===e?n=Pc.SCRIPT:"scriptscript"===e&&(n=Pc.SCRIPTSCRIPT),n},gm=(e,t)=>{var n,r=fm(e.size,t.style),o=r.fracNum(),i=r.fracDen();n=t.havingStyle(o);var a=Pd(e.numer,n,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;a.height=a.height<s?s:a.height,a.depth=a.depth<l?l:a.depth}n=t.havingStyle(i);var c,u,d,h,m,p,f,g,v,b,y=Pd(e.denom,n,t);if(e.hasBarLine?(e.barSize?(u=tu(e.barSize,t),c=hd.makeLineSpan("frac-line",t,u)):c=hd.makeLineSpan("frac-line",t),u=c.height,d=c.height):(c=null,u=0,d=t.fontMetrics().defaultRuleThickness),r.size===Pc.DISPLAY.size||"display"===e.size?(h=t.fontMetrics().num1,m=u>0?3*d:7*d,p=t.fontMetrics().denom1):(u>0?(h=t.fontMetrics().num2,m=d):(h=t.fontMetrics().num3,m=3*d),p=t.fontMetrics().denom2),c){var _=t.fontMetrics().axisHeight;h-a.depth-(_+.5*u)<m&&(h+=m-(h-a.depth-(_+.5*u))),_-.5*u-(y.height-p)<m&&(p+=m-(_-.5*u-(y.height-p)))
|
|
390
|
+
;var w=-(_-.5*u);f=hd.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:p},{type:"elem",elem:c,shift:w},{type:"elem",elem:a,shift:-h}]},t)}else{var x=h-a.depth-(y.height-p);x<m&&(h+=.5*(m-x),p+=.5*(m-x)),f=hd.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:p},{type:"elem",elem:a,shift:-h}]},t)}return n=t.havingStyle(r),f.height*=n.sizeMultiplier/t.sizeMultiplier,f.depth*=n.sizeMultiplier/t.sizeMultiplier,g=r.size===Pc.DISPLAY.size?t.fontMetrics().delim1:r.size===Pc.SCRIPTSCRIPT.size?t.havingStyle(Pc.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,v=null==e.leftDelim?Rd(t,["mopen"]):Gh.customSizedDelim(e.leftDelim,g,!0,t.havingStyle(r),e.mode,["mopen"]),b=e.continued?hd.makeSpan([]):null==e.rightDelim?Rd(t,["mclose"]):Gh.customSizedDelim(e.rightDelim,g,!0,t.havingStyle(r),e.mode,["mclose"]),hd.makeSpan(["mord"].concat(n.sizingClasses(t)),[v,hd.makeSpan(["mfrac"],[f]),b],t)},vm=(e,t)=>{var n=new Bd.MathNode("mfrac",[Yd(e.numer,t),Yd(e.denom,t)])
|
|
391
|
+
;if(e.hasBarLine){if(e.barSize){var r=tu(e.barSize,t);n.setAttribute("linethickness",nu(r))}}else n.setAttribute("linethickness","0px");var o=fm(e.size,t.style);if(o.size!==t.style.size){n=new Bd.MathNode("mstyle",[n]);var i=o.size===Pc.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",i),n.setAttribute("scriptlevel","0")}if(null!=e.leftDelim||null!=e.rightDelim){var a=[];if(null!=e.leftDelim){var s=new Bd.MathNode("mo",[new Bd.TextNode(e.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),a.push(s)}if(a.push(n),null!=e.rightDelim){var l=new Bd.MathNode("mo",[new Bd.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),a.push(l)}return Ud(a)}return n};wd({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var n,{parser:r,funcName:o}=e,i=t[0],a=t[1],s=null,l=null,c="auto";switch(o){case"\\dfrac":case"\\frac":case"\\tfrac":n=!0;break
|
|
392
|
+
;case"\\\\atopfrac":n=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=!1,s="(",l=")";break;case"\\\\bracefrac":n=!1,s="\\{",l="\\}";break;case"\\\\brackfrac":n=!1,s="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(o){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text"}return{type:"genfrac",mode:r.mode,continued:!1,numer:i,denom:a,hasBarLine:n,leftDelim:s,rightDelim:l,size:c,barSize:null}},htmlBuilder:gm,mathmlBuilder:vm}),wd({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0],i=t[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:o,denom:i,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),wd({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var t,{parser:n,funcName:r,token:o}=e;switch(r){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":
|
|
393
|
+
t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:t,token:o}}});var bm=["display","text","script","scriptscript"],ym=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};wd({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var n,{parser:r}=e,o=t[4],i=t[5],a=kd(t[0]),s="atom"===a.type&&"open"===a.family?ym(a.text):null,l=kd(t[1]),c="atom"===l.type&&"close"===l.family?ym(l.text):null,u=oh(t[2],"size"),d=null;n=!!u.isBlank||(d=u.value).number>0;var h="auto",m=t[3];if("ordgroup"===m.type){if(m.body.length>0){var p=oh(m.body[0],"textord");h=bm[Number(p.text)]}}else m=oh(m,"textord"),h=bm[Number(m.text)];return{type:"genfrac",mode:r.mode,numer:o,denom:i,continued:!1,hasBarLine:n,barSize:d,leftDelim:s,rightDelim:c,size:h}},htmlBuilder:gm,mathmlBuilder:vm}),wd({type:"infix",names:["\\above"],
|
|
394
|
+
props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:o}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:oh(t[0],"size").value,token:o}}}),wd({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0],i=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}(oh(t[1],"infix").size),a=t[2],s=i.number>0;return{type:"genfrac",mode:n.mode,numer:o,denom:a,continued:!1,hasBarLine:s,barSize:i,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:gm,mathmlBuilder:vm});var _m=(e,t)=>{var n,r,o=t.style;"supsub"===e.type?(n=e.sup?Pd(e.sup,t.havingStyle(o.sup()),t):Pd(e.sub,t.havingStyle(o.sub()),t),r=oh(e.base,"horizBrace")):r=oh(e,"horizBrace");var i,a=Pd(r.base,t.havingBaseStyle(Pc.DISPLAY)),s=rh(r,t);if(r.isOver?(i=hd.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s}]
|
|
395
|
+
},t)).children[0].children[0].children[1].classes.push("svg-align"):(i=hd.makeVList({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a}]},t)).children[0].children[0].children[0].classes.push("svg-align"),n){var l=hd.makeSpan(["mord",r.isOver?"mover":"munder"],[i],t);i=r.isOver?hd.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},t):hd.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},t)}return hd.makeSpan(["mord",r.isOver?"mover":"munder"],[i],t)};wd({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:t[0]}},htmlBuilder:_m,mathmlBuilder:(e,t)=>{var n=nh(e.label);return new Bd.MathNode(e.isOver?"mover":"munder",[Yd(e.base,t),n])}}),wd({
|
|
396
|
+
type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],o=oh(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:o})?{type:"href",mode:n.mode,href:o,body:Nd(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=Md(e.body,t,!1);return hd.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=Kd(e.body,t);return n instanceof jd||(n=new jd("mrow",[n])),n.setAttribute("href",e.href),n}}),wd({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=oh(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var o=[],i=0;i<r.length;i++){var a=r[i];"~"===a&&(a="\\textasciitilde"),o.push({type:"textord",mode:"text",text:a})}var s={type:"text",mode:n.mode,font:"\\texttt",body:o};return{type:"href",mode:n.mode,href:r,body:Nd(s)}}}),wd({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],
|
|
397
|
+
allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:Nd(t[0])}},htmlBuilder(e,t){var n=Md(e.body,t,!1);return hd.makeFragment(n)},mathmlBuilder:(e,t)=>new Bd.MathNode("mrow",Wd(e.body,t))}),wd({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var n,{parser:r,funcName:o,token:i}=e,a=oh(t[0],"raw").string,s=t[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(o){case"\\htmlClass":l.class=a,n={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,n={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,n={command:"\\htmlStyle",style:a};break;case"\\htmlData":for(var c=a.split(","),u=0;u<c.length;u++){var d=c[u].split("=");if(2!==d.length)throw new yc("Error parsing key-value for \\htmlData");l["data-"+d[0].trim()]=d[1].trim()}n={command:"\\htmlData",attributes:l};break;default:
|
|
398
|
+
throw new Error("Unrecognized html command")}return r.settings.isTrusted(n)?{type:"html",mode:r.mode,attributes:l,body:Nd(s)}:r.formatUnsupportedCmd(o)},htmlBuilder:(e,t)=>{var n=Md(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var o=hd.makeSpan(r,n,t);for(var i in e.attributes)"class"!==i&&e.attributes.hasOwnProperty(i)&&o.setAttribute(i,e.attributes[i]);return o},mathmlBuilder:(e,t)=>Kd(e.body,t)}),wd({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Nd(t[0]),mathml:Nd(t[1])}},htmlBuilder:(e,t)=>{var n=Md(e.html,t,!1);return hd.makeFragment(n)},mathmlBuilder:(e,t)=>Kd(e.mathml,t)});var wm=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 yc("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]}
|
|
399
|
+
;if(!eu(n))throw new yc("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};wd({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,o={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},s="";if(n[0])for(var l=oh(n[0],"raw").string.split(","),c=0;c<l.length;c++){var u=l[c].split("=");if(2===u.length){var d=u[1].trim();switch(u[0].trim()){case"alt":s=d;break;case"width":o=wm(d);break;case"height":i=wm(d);break;case"totalheight":a=wm(d);break;default:throw new yc("Invalid key: '"+u[0]+"' in \\includegraphics.")}}}var h=oh(t[0],"url").url;return""===s&&(s=(s=(s=h).replace(/^.*[\\/]/,"")).substring(0,s.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:h})?{type:"includegraphics",mode:r.mode,alt:s,width:o,height:i,totalheight:a,src:h}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=tu(e.height,t),r=0
|
|
400
|
+
;e.totalheight.number>0&&(r=tu(e.totalheight,t)-n);var o=0;e.width.number>0&&(o=tu(e.width,t));var i={height:nu(n+r)};o>0&&(i.width=nu(o)),r>0&&(i.verticalAlign=nu(-r));var a=new uu(e.src,e.alt,i);return a.height=n,a.depth=r,a},mathmlBuilder:(e,t)=>{var n=new Bd.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var r=tu(e.height,t),o=0;if(e.totalheight.number>0&&(o=tu(e.totalheight,t)-r,n.setAttribute("valign",nu(-o))),n.setAttribute("height",nu(r+o)),e.width.number>0){var i=tu(e.width,t);n.setAttribute("width",nu(i))}return n.setAttribute("src",e.src),n}}),wd({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,o=oh(t[0],"size");if(n.settings.strict){var i="m"===r[1],a="mu"===o.value.unit;i?(a||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, not "+o.value.unit+" units"),
|
|
401
|
+
"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:o.value}},htmlBuilder:(e,t)=>hd.makeGlue(e.dimension,t),mathmlBuilder(e,t){var n=tu(e.dimension,t);return new Bd.SpaceNode(n)}}),wd({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:o}},htmlBuilder:(e,t)=>{var n;"clap"===e.alignment?(n=hd.makeSpan([],[Pd(e.body,t)]),n=hd.makeSpan(["inner"],[n],t)):n=hd.makeSpan(["inner"],[Pd(e.body,t)]);var r=hd.makeSpan(["fix"],[]),o=hd.makeSpan([e.alignment],[n,r],t),i=hd.makeSpan(["strut"]);return i.style.height=nu(o.height+o.depth),o.depth&&(i.style.verticalAlign=nu(-o.depth)),o.children.unshift(i),o=hd.makeSpan(["thinbox"],[o],t),hd.makeSpan(["mord","vbox"],[o],t)},mathmlBuilder:(e,t)=>{
|
|
402
|
+
var n=new Bd.MathNode("mpadded",[Yd(e.body,t)]);if("rlap"!==e.alignment){var r="llap"===e.alignment?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}}),wd({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,o=r.mode;r.switchMode("math");var i="\\("===n?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(o),{type:"styling",mode:r.mode,style:"text",body:a}}}),wd({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new yc("Mismatched "+e.funcName)}});var xm=(e,t)=>{switch(t.style.size){case Pc.DISPLAY.size:return e.display;case Pc.TEXT.size:return e.text;case Pc.SCRIPT.size:return e.script;case Pc.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};wd({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Nd(t[0]),text:Nd(t[1]),
|
|
403
|
+
script:Nd(t[2]),scriptscript:Nd(t[3])}},htmlBuilder:(e,t)=>{var n=xm(e,t),r=Md(n,t,!1);return hd.makeFragment(r)},mathmlBuilder:(e,t)=>{var n=xm(e,t);return Kd(n,t)}});var km=(e,t,n,r,o,i,a)=>{e=hd.makeSpan([],[e]);var s,l,c,u=n&&Nc.isCharacterBox(n);if(t){var d=Pd(t,r.havingStyle(o.sup()),r);l={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-d.depth)}}if(n){var h=Pd(n,r.havingStyle(o.sub()),r);s={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-h.height)}}if(l&&s){var m=r.fontMetrics().bigOpSpacing5+s.elem.height+s.elem.depth+s.kern+e.depth+a;c=hd.makeVList({positionType:"bottom",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:nu(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:nu(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(s){var p=e.height-a;c=hd.makeVList({positionType:"top",positionData:p,
|
|
404
|
+
children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:nu(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e}]},r)}else{if(!l)return e;var f=e.depth+a;c=hd.makeVList({positionType:"bottom",positionData:f,children:[{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:nu(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}var g=[c];if(s&&0!==i&&!u){var v=hd.makeSpan(["mspace"],[],r);v.style.marginRight=nu(i),g.unshift(v)}return hd.makeSpan(["mop","op-limits"],g,r)},Nm=["\\smallint"],Sm=(e,t)=>{var n,r,o,i=!1;"supsub"===e.type?(n=e.sup,r=e.sub,o=oh(e.base,"op"),i=!0):o=oh(e,"op");var a,s=t.style,l=!1;if(s.size===Pc.DISPLAY.size&&o.symbol&&!Nc.contains(Nm,o.name)&&(l=!0),o.symbol){var c=l?"Size2-Regular":"Size1-Regular",u="";if("\\oiint"!==o.name&&"\\oiiint"!==o.name||(u=o.name.slice(1),o.name="oiint"===u?"\\iint":"\\iiint"),a=hd.makeSymbol(o.name,c,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),u.length>0){
|
|
405
|
+
var d=a.italic,h=hd.staticSvg(u+"Size"+(l?"2":"1"),t);a=hd.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:0},{type:"elem",elem:h,shift:l?.08:0}]},t),o.name="\\"+u,a.classes.unshift("mop"),a.italic=d}}else if(o.body){var m=Md(o.body,t,!0);1===m.length&&m[0]instanceof hu?(a=m[0]).classes[0]="mop":a=hd.makeSpan(["mop"],m,t)}else{for(var p=[],f=1;f<o.name.length;f++)p.push(hd.mathsym(o.name[f],o.mode,t));a=hd.makeSpan(["mop"],p,t)}var g=0,v=0;return(a instanceof hu||"\\oiint"===o.name||"\\oiiint"===o.name)&&!o.suppressBaseShift&&(g=(a.height-a.depth)/2-t.fontMetrics().axisHeight,v=a.italic),i?km(a,n,r,t,s,v,g):(g&&(a.style.position="relative",a.style.top=nu(g)),a)},Am=(e,t)=>{var n;if(e.symbol)n=new jd("mo",[qd(e.name,e.mode)]),Nc.contains(Nm,e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new jd("mo",Wd(e.body,t));else{n=new jd("mi",[new $d(e.name.slice(1))]);var r=new jd("mo",[qd("","text")]);n=e.parentIsSupSub?new jd("mrow",[n,r]):Fd([n,r])}return n},Tm={
|
|
406
|
+
"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};wd({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=r;return 1===o.length&&(o=Tm[o]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:o}},htmlBuilder:Sm,mathmlBuilder:Am}),wd({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Nd(r)}},htmlBuilder:Sm,mathmlBuilder:Am});var Em={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};wd({type:"op",
|
|
407
|
+
names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Sm,mathmlBuilder:Am}),wd({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Sm,mathmlBuilder:Am}),wd({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e,r=n;return 1===r.length&&(r=Em[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Sm,mathmlBuilder:Am});var Cm=(e,t)=>{
|
|
408
|
+
var n,r,o,i,a=!1;if("supsub"===e.type?(n=e.sup,r=e.sub,o=oh(e.base,"operatorname"),a=!0):o=oh(e,"operatorname"),o.body.length>0){for(var s=o.body.map((e=>{var t=e.text;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e})),l=Md(s,t.withFont("mathrm"),!0),c=0;c<l.length;c++){var u=l[c];u instanceof hu&&(u.text=u.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}i=hd.makeSpan(["mop"],l,t)}else i=hd.makeSpan(["mop"],[],t);return a?km(i,n,r,t,t.style,0,0):i};function Mm(e,t,n){for(var r=Md(e,t,!1),o=t.sizeMultiplier/n.sizeMultiplier,i=0;i<r.length;i++){var a=r[i].classes.indexOf("sizing");a<0?Array.prototype.push.apply(r[i].classes,t.sizingClasses(n)):r[i].classes[a+1]==="reset-size"+t.size&&(r[i].classes[a+1]="reset-size"+n.size),r[i].height*=o,r[i].depth*=o}return hd.makeFragment(r)}wd({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0];return{type:"operatorname",mode:n.mode,body:Nd(o),
|
|
409
|
+
alwaysHandleSupSub:"\\operatornamewithlimits"===r,limits:!1,parentIsSupSub:!1}},htmlBuilder:Cm,mathmlBuilder:(e,t)=>{for(var n=Wd(e.body,t.withFont("mathrm")),r=!0,o=0;o<n.length;o++){var i=n[o];if(i instanceof Bd.SpaceNode);else if(i instanceof Bd.MathNode)switch(i.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":var a=i.children[0];1===i.children.length&&a instanceof Bd.TextNode?a.text=a.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break;default:r=!1}else r=!1}if(r){var s=n.map((e=>e.toText())).join("");n=[new Bd.TextNode(s)]}var l=new Bd.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new Bd.MathNode("mo",[qd("","text")]);return e.parentIsSupSub?new Bd.MathNode("mrow",[l,c]):Bd.newDocumentFragment([l,c])}}),tm("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),xd({type:"ordgroup",htmlBuilder:(e,t)=>e.semisimple?hd.makeFragment(Md(e.body,t,!1)):hd.makeSpan(["mord"],Md(e.body,t,!0),t),mathmlBuilder:(e,t)=>Kd(e.body,t,!0)}),wd({type:"overline",
|
|
410
|
+
names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=Pd(e.body,t.havingCrampedStyle()),r=hd.makeLineSpan("overline-line",t),o=t.fontMetrics().defaultRuleThickness,i=hd.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*o},{type:"elem",elem:r},{type:"kern",size:o}]},t);return hd.makeSpan(["mord","overline"],[i],t)},mathmlBuilder(e,t){var n=new Bd.MathNode("mo",[new Bd.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Bd.MathNode("mover",[Yd(e.body,t),n]);return r.setAttribute("accent","true"),r}}),wd({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:Nd(r)}},htmlBuilder:(e,t)=>{var n=Md(e.body,t.withPhantom(),!1);return hd.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=Wd(e.body,t);return new Bd.MathNode("mphantom",n)}}),wd({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,
|
|
411
|
+
allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=hd.makeSpan([],[Pd(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r<n.children.length;r++)n.children[r].height=0,n.children[r].depth=0;return n=hd.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t),hd.makeSpan(["mord"],[n],t)},mathmlBuilder:(e,t)=>{var n=Wd(Nd(e.body),t),r=new Bd.MathNode("mphantom",n),o=new Bd.MathNode("mpadded",[r]);return o.setAttribute("height","0px"),o.setAttribute("depth","0px"),o}}),wd({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=hd.makeSpan(["inner"],[Pd(e.body,t.withPhantom())]),r=hd.makeSpan(["fix"],[]);return hd.makeSpan(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=Wd(Nd(e.body),t),r=new Bd.MathNode("mphantom",n),o=new Bd.MathNode("mpadded",[r])
|
|
412
|
+
;return o.setAttribute("width","0px"),o}}),wd({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=oh(t[0],"size").value,o=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:o}},htmlBuilder(e,t){var n=Pd(e.body,t),r=tu(e.dy,t);return hd.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new Bd.MathNode("mpadded",[Yd(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}}),wd({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),wd({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,o=n[0],i=oh(t[0],"size"),a=oh(t[1],"size");return{type:"rule",mode:r.mode,shift:o&&oh(o,"size").value,width:i.value,height:a.value}},htmlBuilder(e,t){
|
|
413
|
+
var n=hd.makeSpan(["mord","rule"],[],t),r=tu(e.width,t),o=tu(e.height,t),i=e.shift?tu(e.shift,t):0;return n.style.borderRightWidth=nu(r),n.style.borderTopWidth=nu(o),n.style.bottom=nu(i),n.width=r,n.height=o+i,n.depth=-i,n.maxFontSize=1.125*o*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=tu(e.width,t),r=tu(e.height,t),o=e.shift?tu(e.shift,t):0,i=t.color&&t.getColor()||"black",a=new Bd.MathNode("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",nu(n)),a.setAttribute("height",nu(r));var s=new Bd.MathNode("mpadded",[a]);return o>=0?s.setAttribute("height",nu(o)):(s.setAttribute("height",nu(o)),s.setAttribute("depth",nu(-o))),s.setAttribute("voffset",nu(o)),s}});var Im=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];wd({type:"sizing",names:Im,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:o}=e,i=o.parseExpression(!1,n);return{type:"sizing",mode:o.mode,size:Im.indexOf(r)+1,
|
|
414
|
+
body:i}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return Mm(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=Wd(e.body,n),o=new Bd.MathNode("mstyle",r);return o.setAttribute("mathsize",nu(n.sizeMultiplier)),o}}),wd({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,o=!1,i=!1,a=n[0]&&oh(n[0],"ordgroup");if(a)for(var s="",l=0;l<a.body.length;++l){if("t"===(s=a.body[l].text))o=!0;else{if("b"!==s){o=!1,i=!1;break}i=!0}}else o=!0,i=!0;var c=t[0];return{type:"smash",mode:r.mode,body:c,smashHeight:o,smashDepth:i}},htmlBuilder:(e,t)=>{var n=hd.makeSpan([],[Pd(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var r=0;r<n.children.length;r++)n.children[r].height=0;if(e.smashDepth&&(n.depth=0,n.children))for(var o=0;o<n.children.length;o++)n.children[o].depth=0;var i=hd.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t);return hd.makeSpan(["mord"],[i],t)},
|
|
415
|
+
mathmlBuilder:(e,t)=>{var n=new Bd.MathNode("mpadded",[Yd(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),wd({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,o=n[0],i=t[0];return{type:"sqrt",mode:r.mode,body:i,index:o}},htmlBuilder(e,t){var n=Pd(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=hd.wrapFragment(n,t);var r=t.fontMetrics().defaultRuleThickness,o=r;t.style.id<Pc.TEXT.id&&(o=t.fontMetrics().xHeight);var i=r+o/4,a=n.height+n.depth+i+r,{span:s,ruleWidth:l,advanceWidth:c}=Gh.sqrtImage(a,t),u=s.height-l;u>n.height+n.depth+i&&(i=(i+u-n.height-n.depth)/2);var d=s.height-n.height-i-l;n.style.paddingLeft=nu(c);var h=hd.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+d)},{type:"elem",elem:s},{type:"kern",size:l}]},t);if(e.index){
|
|
416
|
+
var m=t.havingStyle(Pc.SCRIPTSCRIPT),p=Pd(e.index,m,t),f=.6*(h.height-h.depth),g=hd.makeVList({positionType:"shift",positionData:-f,children:[{type:"elem",elem:p}]},t),v=hd.makeSpan(["root"],[g]);return hd.makeSpan(["mord","sqrt"],[v,h],t)}return hd.makeSpan(["mord","sqrt"],[h],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new Bd.MathNode("mroot",[Yd(n,t),Yd(r,t)]):new Bd.MathNode("msqrt",[Yd(n,t)])}});var zm={display:Pc.DISPLAY,text:Pc.TEXT,script:Pc.SCRIPT,scriptscript:Pc.SCRIPTSCRIPT};wd({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:o}=e,i=o.parseExpression(!0,n),a=r.slice(1,r.length-5);return{type:"styling",mode:o.mode,style:a,body:i}},htmlBuilder(e,t){var n=zm[e.style],r=t.havingStyle(n).withFont("");return Mm(e.body,r,t)},mathmlBuilder(e,t){var n=zm[e.style],r=t.havingStyle(n),o=Wd(e.body,r),i=new Bd.MathNode("mstyle",o),a={display:["0","true"],
|
|
417
|
+
text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return i.setAttribute("scriptlevel",a[0]),i.setAttribute("displaystyle",a[1]),i}});xd({type:"supsub",htmlBuilder(e,t){var n=function(e,t){var n=e.base;return n?"op"===n.type?n.limits&&(t.style.size===Pc.DISPLAY.size||n.alwaysHandleSupSub)?Sm:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(t.style.size===Pc.DISPLAY.size||n.limits)?Cm:null:"accent"===n.type?Nc.isCharacterBox(n.base)?sh:null:"horizBrace"===n.type&&!e.sub===n.isOver?_m:null:null}(e,t);if(n)return n(e,t);var r,o,i,{base:a,sup:s,sub:l}=e,c=Pd(a,t),u=t.fontMetrics(),d=0,h=0,m=a&&Nc.isCharacterBox(a);if(s){var p=t.havingStyle(t.style.sup());r=Pd(s,p,t),m||(d=c.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(l){var f=t.havingStyle(t.style.sub());o=Pd(l,f,t),m||(h=c.depth+f.fontMetrics().subDrop*f.sizeMultiplier/t.sizeMultiplier)}i=t.style===Pc.DISPLAY?u.sup1:t.style.cramped?u.sup3:u.sup2;var g,v=t.sizeMultiplier,b=nu(.5/u.ptPerEm/v),y=null;if(o){
|
|
418
|
+
var _=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof hu||_)&&(y=nu(-c.italic))}if(r&&o){d=Math.max(d,i,r.depth+.25*u.xHeight),h=Math.max(h,u.sub2);var w=4*u.defaultRuleThickness;if(d-r.depth-(o.height-h)<w){h=w-(d-r.depth)+o.height;var x=.8*u.xHeight-(d-r.depth);x>0&&(d+=x,h-=x)}var k=[{type:"elem",elem:o,shift:h,marginRight:b,marginLeft:y},{type:"elem",elem:r,shift:-d,marginRight:b}];g=hd.makeVList({positionType:"individualShift",children:k},t)}else if(o){h=Math.max(h,u.sub1,o.height-.8*u.xHeight);var N=[{type:"elem",elem:o,marginLeft:y,marginRight:b}];g=hd.makeVList({positionType:"shift",positionData:h,children:N},t)}else{if(!r)throw new Error("supsub must have either sup or sub.");d=Math.max(d,i,r.depth+.25*u.xHeight),g=hd.makeVList({positionType:"shift",positionData:-d,children:[{type:"elem",elem:r,marginRight:b}]},t)}var S=Ld(c,"right")||"mord";return hd.makeSpan([S],[c,hd.makeSpan(["msupsub"],[g])],t)},mathmlBuilder(e,t){var n,r=!1
|
|
419
|
+
;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(r=!0,n=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var o,i=[Yd(e.base,t)];if(e.sub&&i.push(Yd(e.sub,t)),e.sup&&i.push(Yd(e.sup,t)),r)o=n?"mover":"munder";else if(e.sub)if(e.sup){var a=e.base;o=a&&"op"===a.type&&a.limits&&t.style===Pc.DISPLAY||a&&"operatorname"===a.type&&a.alwaysHandleSupSub&&(t.style===Pc.DISPLAY||a.limits)?"munderover":"msubsup"}else{var s=e.base;o=s&&"op"===s.type&&s.limits&&(t.style===Pc.DISPLAY||s.alwaysHandleSupSub)||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(s.limits||t.style===Pc.DISPLAY)?"munder":"msub"}else{var l=e.base;o=l&&"op"===l.type&&l.limits&&(t.style===Pc.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===Pc.DISPLAY)?"mover":"msup"}return new Bd.MathNode(o,i)}}),xd({type:"atom",htmlBuilder:(e,t)=>hd.mathsym(e.text,e.mode,t,["m"+e.family]),mathmlBuilder(e,t){
|
|
420
|
+
var n=new Bd.MathNode("mo",[qd(e.text,e.mode)]);if("bin"===e.family){var r=Gd(e,t);"bold-italic"===r&&n.setAttribute("mathvariant",r)}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var Om={mi:"italic",mn:"normal",mtext:"normal"};xd({type:"mathord",htmlBuilder:(e,t)=>hd.makeOrd(e,t,"mathord"),mathmlBuilder(e,t){var n=new Bd.MathNode("mi",[qd(e.text,e.mode,t)]),r=Gd(e,t)||"italic";return r!==Om[n.type]&&n.setAttribute("mathvariant",r),n}}),xd({type:"textord",htmlBuilder:(e,t)=>hd.makeOrd(e,t,"textord"),mathmlBuilder(e,t){var n,r=qd(e.text,e.mode,t),o=Gd(e,t)||"normal";return n="text"===e.mode?new Bd.MathNode("mtext",[r]):/[0-9]/.test(e.text)?new Bd.MathNode("mn",[r]):"\\prime"===e.text?new Bd.MathNode("mo",[r]):new Bd.MathNode("mi",[r]),o!==Om[n.type]&&n.setAttribute("mathvariant",o),n}});var Lm={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Rm={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},
|
|
421
|
+
"\\nobreakspace":{className:"nobreak"}};xd({type:"spacing",htmlBuilder(e,t){if(Rm.hasOwnProperty(e.text)){var n=Rm[e.text].className||"";if("text"===e.mode){var r=hd.makeOrd(e,t,"textord");return r.classes.push(n),r}return hd.makeSpan(["mspace",n],[hd.mathsym(e.text,e.mode,t)],t)}if(Lm.hasOwnProperty(e.text))return hd.makeSpan(["mspace",Lm[e.text]],[],t);throw new yc('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){if(!Rm.hasOwnProperty(e.text)){if(Lm.hasOwnProperty(e.text))return new Bd.MathNode("mspace");throw new yc('Unknown type of space "'+e.text+'"')}return new Bd.MathNode("mtext",[new Bd.TextNode(" ")])}});var Pm=()=>{var e=new Bd.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};xd({type:"tag",mathmlBuilder(e,t){var n=new Bd.MathNode("mtable",[new Bd.MathNode("mtr",[Pm(),new Bd.MathNode("mtd",[Kd(e.body,t)]),Pm(),new Bd.MathNode("mtd",[Kd(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var Dm={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt",
|
|
422
|
+
"\\textnormal":"textrm"},Hm={"\\textbf":"textbf","\\textmd":"textmd"},Fm={"\\textit":"textit","\\textup":"textup"},jm=(e,t)=>{var n=e.font;return n?Dm[n]?t.withTextFontFamily(Dm[n]):Hm[n]?t.withTextFontWeight(Hm[n]):"\\emph"===n?"textit"===t.fontShape?t.withTextFontShape("textup"):t.withTextFontShape("textit"):t.withTextFontShape(Fm[n]):t};wd({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];return{type:"text",mode:n.mode,body:Nd(o),font:r}},htmlBuilder(e,t){var n=jm(e,t),r=Md(e.body,n,!0);return hd.makeSpan(["mord","text"],r,n)},mathmlBuilder(e,t){var n=jm(e,t);return Kd(e.body,n)}}),wd({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){
|
|
423
|
+
var n=Pd(e.body,t),r=hd.makeLineSpan("underline-line",t),o=t.fontMetrics().defaultRuleThickness,i=hd.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:o},{type:"elem",elem:r},{type:"kern",size:3*o},{type:"elem",elem:n}]},t);return hd.makeSpan(["mord","underline"],[i],t)},mathmlBuilder(e,t){var n=new Bd.MathNode("mo",[new Bd.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Bd.MathNode("munder",[Yd(e.body,t),n]);return r.setAttribute("accentunder","true"),r}}),wd({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Pd(e.body,t),r=t.fontMetrics().axisHeight,o=.5*(n.height-r-(n.depth+r));return hd.makeVList({positionType:"shift",positionData:o,children:[{type:"elem",elem:n}]},t)},mathmlBuilder:(e,t)=>new Bd.MathNode("mpadded",[Yd(e.body,t)],["vcenter"])}),wd({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){
|
|
424
|
+
throw new yc("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=$m(e),r=[],o=t.havingStyle(t.style.text()),i=0;i<n.length;i++){var a=n[i];"~"===a&&(a="\\textasciitilde"),r.push(hd.makeSymbol(a,"Typewriter-Regular",e.mode,o,["mord","texttt"]))}return hd.makeSpan(["mord","text"].concat(o.sizingClasses(t)),hd.tryCombineChars(r),o)},mathmlBuilder(e,t){var n=new Bd.TextNode($m(e)),r=new Bd.MathNode("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var $m=e=>e.body.replace(/ /g,e.star?"␣":" "),Bm=bd,qm="[ \r\n\t]",Um="(\\\\[a-zA-Z@]+)"+qm+"*",Gm="[̀-ͯ]",Vm=new RegExp(Gm+"+$"),Wm="("+qm+"+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧-豈-]"+Gm+"*|[\ud800-\udbff][\udc00-\udfff]"+Gm+"*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|"+Um+"|\\\\[^\ud800-\udfff])";class Km{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(Wm,"g"),this.catcodes={"%":14,"~":13}}
|
|
425
|
+
setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new bc("EOF",new vc(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new yc("Unexpected character: '"+e[t]+"'",new bc(e[t],new vc(this,t,t+1)));var r=n[6]||n[3]||(n[2]?"\\ ":" ");if(14===this.catcodes[r]){var o=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===o?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=o+1,this.lex()}return new bc(r,new vc(this,t,this.tokenRegex.lastIndex))}}class Ym{constructor(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){
|
|
426
|
+
if(0===this.undefStack.length)throw new yc("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(null==e[t]?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(void 0===n&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var o=this.undefStack[this.undefStack.length-1];o&&!o.hasOwnProperty(e)&&(o[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}var Xm=em;tm("\\noexpand",(function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}})),tm("\\expandafter",(function(e){var t=e.popToken()
|
|
427
|
+
;return e.expandOnce(!0),{tokens:[t],numArgs:0}})),tm("\\@firstoftwo",(function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}})),tm("\\@secondoftwo",(function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}})),tm("\\@ifnextchar",(function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return 1===t[0].length&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}})),tm("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),tm("\\TextOrMath",(function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}}));var Zm={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};tm("\\char",(function(e){var t,n=e.popToken(),r="";if("'"===n.text)t=8,n=e.popToken();else if('"'===n.text)t=16,n=e.popToken();else if("`"===n.text)if("\\"===(n=e.popToken()).text[0])r=n.text.charCodeAt(1);else{if("EOF"===n.text)throw new yc("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){
|
|
428
|
+
if(null==(r=Zm[n.text])||r>=t)throw new yc("Invalid base-"+t+" digit "+n.text);for(var o;null!=(o=Zm[e.future().text])&&o<t;)r*=t,r+=o,e.popToken()}return"\\@char{"+r+"}"}));var Jm=(e,t,n,r)=>{var o=e.consumeArg().tokens;if(1!==o.length)throw new yc("\\newcommand's first argument must be a macro name");var i=o[0].text,a=e.isDefined(i);if(a&&!t)throw new yc("\\newcommand{"+i+"} attempting to redefine "+i+"; use \\renewcommand");if(!a&&!n)throw new yc("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var s=0;if(1===(o=e.consumeArg().tokens).length&&"["===o[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 yc("Invalid number of arguments: "+l);s=parseInt(l),o=e.consumeArg().tokens}return a&&r||e.macros.set(i,{tokens:o,numArgs:s}),""};tm("\\newcommand",(e=>Jm(e,!1,!0,!1))),tm("\\renewcommand",(e=>Jm(e,!0,!1,!1))),tm("\\providecommand",(e=>Jm(e,!0,!0,!0))),tm("\\message",(e=>{
|
|
429
|
+
var t=e.consumeArgs(1)[0];return console.log(t.reverse().map((e=>e.text)).join("")),""})),tm("\\errmessage",(e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map((e=>e.text)).join("")),""})),tm("\\show",(e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Bm[n],yu.math[n],yu.text[n]),""})),tm("\\bgroup","{"),tm("\\egroup","}"),tm("~","\\nobreakspace"),tm("\\lq","`"),tm("\\rq","'"),tm("\\aa","\\r a"),tm("\\AA","\\r A"),tm("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),tm("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),tm("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),tm("ℬ","\\mathscr{B}"),tm("ℰ","\\mathscr{E}"),tm("ℱ","\\mathscr{F}"),tm("ℋ","\\mathscr{H}"),tm("ℐ","\\mathscr{I}"),tm("ℒ","\\mathscr{L}"),tm("ℳ","\\mathscr{M}"),tm("ℛ","\\mathscr{R}"),tm("ℭ","\\mathfrak{C}"),tm("ℌ","\\mathfrak{H}"),tm("ℨ","\\mathfrak{Z}"),tm("\\Bbbk","\\Bbb{k}"),tm("·","\\cdotp"),tm("\\llap","\\mathllap{\\textrm{#1}}"),
|
|
430
|
+
tm("\\rlap","\\mathrlap{\\textrm{#1}}"),tm("\\clap","\\mathclap{\\textrm{#1}}"),tm("\\mathstrut","\\vphantom{(}"),tm("\\underbar","\\underline{\\text{#1}}"),tm("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),tm("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),tm("\\ne","\\neq"),tm("≠","\\neq"),tm("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),tm("∉","\\notin"),tm("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),tm("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),tm("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),tm("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),tm("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),tm("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),tm("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),
|
|
431
|
+
tm("⟂","\\perp"),tm("‼","\\mathclose{!\\mkern-0.8mu!}"),tm("∌","\\notni"),tm("⌜","\\ulcorner"),tm("⌝","\\urcorner"),tm("⌞","\\llcorner"),tm("⌟","\\lrcorner"),tm("©","\\copyright"),tm("®","\\textregistered"),tm("️","\\textregistered"),tm("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),tm("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),tm("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),tm("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),tm("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),tm("⋮","\\vdots"),tm("\\varGamma","\\mathit{\\Gamma}"),tm("\\varDelta","\\mathit{\\Delta}"),tm("\\varTheta","\\mathit{\\Theta}"),tm("\\varLambda","\\mathit{\\Lambda}"),tm("\\varXi","\\mathit{\\Xi}"),tm("\\varPi","\\mathit{\\Pi}"),tm("\\varSigma","\\mathit{\\Sigma}"),tm("\\varUpsilon","\\mathit{\\Upsilon}"),tm("\\varPhi","\\mathit{\\Phi}"),tm("\\varPsi","\\mathit{\\Psi}"),tm("\\varOmega","\\mathit{\\Omega}"),tm("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),
|
|
432
|
+
tm("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),tm("\\boxed","\\fbox{$\\displaystyle{#1}$}"),tm("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),tm("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),tm("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),tm("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),tm("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Qm={",":"\\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",
|
|
433
|
+
"\\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"};tm("\\dots",(function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in Qm?t=Qm[n]:("\\not"===n.slice(0,4)||n in yu.math&&Nc.contains(["bin","rel"],yu.math[n].group))&&(t="\\dotsb"),t}));var ep={")":!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};tm("\\dotso",(function(e){return e.future().text in ep?"\\ldots\\,":"\\ldots"})),tm("\\dotsc",(function(e){var t=e.future().text
|
|
434
|
+
;return t in ep&&","!==t?"\\ldots\\,":"\\ldots"})),tm("\\cdots",(function(e){return e.future().text in ep?"\\@cdots\\,":"\\@cdots"})),tm("\\dotsb","\\cdots"),tm("\\dotsm","\\cdots"),tm("\\dotsi","\\!\\cdots"),tm("\\dotsx","\\ldots\\,"),tm("\\DOTSI","\\relax"),tm("\\DOTSB","\\relax"),tm("\\DOTSX","\\relax"),tm("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),tm("\\,","\\tmspace+{3mu}{.1667em}"),tm("\\thinspace","\\,"),tm("\\>","\\mskip{4mu}"),tm("\\:","\\tmspace+{4mu}{.2222em}"),tm("\\medspace","\\:"),tm("\\;","\\tmspace+{5mu}{.2777em}"),tm("\\thickspace","\\;"),tm("\\!","\\tmspace-{3mu}{.1667em}"),tm("\\negthinspace","\\!"),tm("\\negmedspace","\\tmspace-{4mu}{.2222em}"),tm("\\negthickspace","\\tmspace-{5mu}{.277em}"),tm("\\enspace","\\kern.5em "),tm("\\enskip","\\hskip.5em\\relax"),tm("\\quad","\\hskip1em\\relax"),tm("\\qquad","\\hskip2em\\relax"),tm("\\tag","\\@ifstar\\tag@literal\\tag@paren"),tm("\\tag@paren","\\tag@literal{({#1})}"),tm("\\tag@literal",(e=>{
|
|
435
|
+
if(e.macros.get("\\df@tag"))throw new yc("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"})),tm("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),tm("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),tm("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),tm("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),tm("\\newline","\\\\\\relax"),tm("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var tp=nu(qc["Main-Regular"]["T".charCodeAt(0)][1]-.7*qc["Main-Regular"]["A".charCodeAt(0)][1]);tm("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+tp+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),tm("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+tp+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),tm("\\hspace","\\@ifstar\\@hspacer\\@hspace"),
|
|
436
|
+
tm("\\@hspace","\\hskip #1\\relax"),tm("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),tm("\\ordinarycolon",":"),tm("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),tm("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),tm("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),tm("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),tm("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),tm("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),tm("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),tm("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),
|
|
437
|
+
tm("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),tm("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),tm("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),tm("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),tm("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),tm("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),tm("∷","\\dblcolon"),tm("∹","\\eqcolon"),tm("≔","\\coloneqq"),tm("≕","\\eqqcolon"),tm("⩴","\\Coloneqq"),tm("\\ratio","\\vcentcolon"),tm("\\coloncolon","\\dblcolon"),tm("\\colonequals","\\coloneqq"),tm("\\coloncolonequals","\\Coloneqq"),tm("\\equalscolon","\\eqqcolon"),
|
|
438
|
+
tm("\\equalscoloncolon","\\Eqqcolon"),tm("\\colonminus","\\coloneq"),tm("\\coloncolonminus","\\Coloneq"),tm("\\minuscolon","\\eqcolon"),tm("\\minuscoloncolon","\\Eqcolon"),tm("\\coloncolonapprox","\\Colonapprox"),tm("\\coloncolonsim","\\Colonsim"),tm("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),tm("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),tm("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),tm("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),tm("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),tm("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),tm("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),tm("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),tm("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),tm("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),tm("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),tm("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),
|
|
439
|
+
tm("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),tm("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),tm("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),tm("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),tm("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),tm("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),tm("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),tm("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),tm("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),tm("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),tm("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),tm("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),tm("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),tm("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),tm("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),tm("\\imath","\\html@mathml{\\@imath}{ı}"),tm("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),tm("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),
|
|
440
|
+
tm("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),tm("⟦","\\llbracket"),tm("⟧","\\rrbracket"),tm("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),tm("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),tm("⦃","\\lBrace"),tm("⦄","\\rBrace"),tm("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),tm("⦵","\\minuso"),tm("\\darr","\\downarrow"),tm("\\dArr","\\Downarrow"),tm("\\Darr","\\Downarrow"),tm("\\lang","\\langle"),tm("\\rang","\\rangle"),tm("\\uarr","\\uparrow"),tm("\\uArr","\\Uparrow"),tm("\\Uarr","\\Uparrow"),tm("\\N","\\mathbb{N}"),tm("\\R","\\mathbb{R}"),tm("\\Z","\\mathbb{Z}"),tm("\\alef","\\aleph"),tm("\\alefsym","\\aleph"),tm("\\Alpha","\\mathrm{A}"),tm("\\Beta","\\mathrm{B}"),tm("\\bull","\\bullet"),tm("\\Chi","\\mathrm{X}"),tm("\\clubs","\\clubsuit"),tm("\\cnums","\\mathbb{C}"),
|
|
441
|
+
tm("\\Complex","\\mathbb{C}"),tm("\\Dagger","\\ddagger"),tm("\\diamonds","\\diamondsuit"),tm("\\empty","\\emptyset"),tm("\\Epsilon","\\mathrm{E}"),tm("\\Eta","\\mathrm{H}"),tm("\\exist","\\exists"),tm("\\harr","\\leftrightarrow"),tm("\\hArr","\\Leftrightarrow"),tm("\\Harr","\\Leftrightarrow"),tm("\\hearts","\\heartsuit"),tm("\\image","\\Im"),tm("\\infin","\\infty"),tm("\\Iota","\\mathrm{I}"),tm("\\isin","\\in"),tm("\\Kappa","\\mathrm{K}"),tm("\\larr","\\leftarrow"),tm("\\lArr","\\Leftarrow"),tm("\\Larr","\\Leftarrow"),tm("\\lrarr","\\leftrightarrow"),tm("\\lrArr","\\Leftrightarrow"),tm("\\Lrarr","\\Leftrightarrow"),tm("\\Mu","\\mathrm{M}"),tm("\\natnums","\\mathbb{N}"),tm("\\Nu","\\mathrm{N}"),tm("\\Omicron","\\mathrm{O}"),tm("\\plusmn","\\pm"),tm("\\rarr","\\rightarrow"),tm("\\rArr","\\Rightarrow"),tm("\\Rarr","\\Rightarrow"),tm("\\real","\\Re"),tm("\\reals","\\mathbb{R}"),tm("\\Reals","\\mathbb{R}"),tm("\\Rho","\\mathrm{P}"),tm("\\sdot","\\cdot"),tm("\\sect","\\S"),tm("\\spades","\\spadesuit"),
|
|
442
|
+
tm("\\sub","\\subset"),tm("\\sube","\\subseteq"),tm("\\supe","\\supseteq"),tm("\\Tau","\\mathrm{T}"),tm("\\thetasym","\\vartheta"),tm("\\weierp","\\wp"),tm("\\Zeta","\\mathrm{Z}"),tm("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),tm("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),tm("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),tm("\\bra","\\mathinner{\\langle{#1}|}"),tm("\\ket","\\mathinner{|{#1}\\rangle}"),tm("\\braket","\\mathinner{\\langle{#1}\\rangle}"),tm("\\Bra","\\left\\langle#1\\right|"),tm("\\Ket","\\left|#1\\right\\rangle");var np=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,o=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.macros.get("|"),s=t.macros.get("\\|");t.macros.beginGroup();var l=t=>n=>{e&&(n.macros.set("|",a),o.length&&n.macros.set("\\|",s));var i=t;!t&&o.length&&("|"===n.future().text&&(n.popToken(),i=!0));return{tokens:i?o:r,numArgs:0}};t.macros.set("|",l(!1)),o.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,u=t.expandTokens([...i,...c,...n])
|
|
443
|
+
;return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};tm("\\bra@ket",np(!1)),tm("\\bra@set",np(!0)),tm("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),tm("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),tm("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),tm("\\angln","{\\angl n}"),tm("\\blue","\\textcolor{##6495ed}{#1}"),tm("\\orange","\\textcolor{##ffa500}{#1}"),tm("\\pink","\\textcolor{##ff00af}{#1}"),tm("\\red","\\textcolor{##df0030}{#1}"),tm("\\green","\\textcolor{##28ae7b}{#1}"),tm("\\gray","\\textcolor{gray}{#1}"),tm("\\purple","\\textcolor{##9d38bd}{#1}"),tm("\\blueA","\\textcolor{##ccfaff}{#1}"),tm("\\blueB","\\textcolor{##80f6ff}{#1}"),tm("\\blueC","\\textcolor{##63d9ea}{#1}"),tm("\\blueD","\\textcolor{##11accd}{#1}"),tm("\\blueE","\\textcolor{##0c7f99}{#1}"),tm("\\tealA","\\textcolor{##94fff5}{#1}"),tm("\\tealB","\\textcolor{##26edd5}{#1}"),tm("\\tealC","\\textcolor{##01d1c1}{#1}"),
|
|
444
|
+
tm("\\tealD","\\textcolor{##01a995}{#1}"),tm("\\tealE","\\textcolor{##208170}{#1}"),tm("\\greenA","\\textcolor{##b6ffb0}{#1}"),tm("\\greenB","\\textcolor{##8af281}{#1}"),tm("\\greenC","\\textcolor{##74cf70}{#1}"),tm("\\greenD","\\textcolor{##1fab54}{#1}"),tm("\\greenE","\\textcolor{##0d923f}{#1}"),tm("\\goldA","\\textcolor{##ffd0a9}{#1}"),tm("\\goldB","\\textcolor{##ffbb71}{#1}"),tm("\\goldC","\\textcolor{##ff9c39}{#1}"),tm("\\goldD","\\textcolor{##e07d10}{#1}"),tm("\\goldE","\\textcolor{##a75a05}{#1}"),tm("\\redA","\\textcolor{##fca9a9}{#1}"),tm("\\redB","\\textcolor{##ff8482}{#1}"),tm("\\redC","\\textcolor{##f9685d}{#1}"),tm("\\redD","\\textcolor{##e84d39}{#1}"),tm("\\redE","\\textcolor{##bc2612}{#1}"),tm("\\maroonA","\\textcolor{##ffbde0}{#1}"),tm("\\maroonB","\\textcolor{##ff92c6}{#1}"),tm("\\maroonC","\\textcolor{##ed5fa6}{#1}"),tm("\\maroonD","\\textcolor{##ca337c}{#1}"),tm("\\maroonE","\\textcolor{##9e034e}{#1}"),tm("\\purpleA","\\textcolor{##ddd7ff}{#1}"),tm("\\purpleB","\\textcolor{##c6b9fc}{#1}"),
|
|
445
|
+
tm("\\purpleC","\\textcolor{##aa87ff}{#1}"),tm("\\purpleD","\\textcolor{##7854ab}{#1}"),tm("\\purpleE","\\textcolor{##543b78}{#1}"),tm("\\mintA","\\textcolor{##f5f9e8}{#1}"),tm("\\mintB","\\textcolor{##edf2df}{#1}"),tm("\\mintC","\\textcolor{##e0e5cc}{#1}"),tm("\\grayA","\\textcolor{##f6f7f7}{#1}"),tm("\\grayB","\\textcolor{##f0f1f2}{#1}"),tm("\\grayC","\\textcolor{##e3e5e6}{#1}"),tm("\\grayD","\\textcolor{##d6d8da}{#1}"),tm("\\grayE","\\textcolor{##babec2}{#1}"),tm("\\grayF","\\textcolor{##888d93}{#1}"),tm("\\grayG","\\textcolor{##626569}{#1}"),tm("\\grayH","\\textcolor{##3b3e40}{#1}"),tm("\\grayI","\\textcolor{##21242c}{#1}"),tm("\\kaBlue","\\textcolor{##314453}{#1}"),tm("\\kaGreen","\\textcolor{##71B307}{#1}");var rp={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class op{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new Ym(Xm,t.macros),this.mode=n,
|
|
446
|
+
this.stack=[]}feed(e){this.lexer=new Km(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:r,end:n}=this.consumeArg(["]"]))}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new bc("EOF",n.loc)),this.pushTokens(r),t.range(n,"")}consumeSpaces(){for(;;){if(" "!==this.future().text)break;this.stack.pop()}}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r,o=this.future(),i=0,a=0;do{if(r=this.popToken(),t.push(r),"{"===r.text)++i;else if("}"===r.text){if(-1===--i)throw new yc("Extra }",r)
|
|
447
|
+
}else if("EOF"===r.text)throw new yc("Unexpected end of input in a macro argument, expected '"+(e&&n?e[a]:"}")+"'",r);if(e&&n)if((0===i||1===i&&"{"===e[a])&&r.text===e[a]){if(++a===e.length){t.splice(-a,a);break}}else a=0}while(0!==i||n);return"{"===o.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:o,end:r}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new yc("The length of delimiters doesn't match the number of args!");for(var n=t[0],r=0;r<n.length;r++){var o=this.popToken();if(n[r]!==o.text)throw new yc("Use of the macro doesn't match its definition",o)}}for(var i=[],a=0;a<e;a++)i.push(this.consumeArg(t&&t[a+1]).tokens);return i}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new yc("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(null==r||e&&r.unexpandable){
|
|
448
|
+
if(e&&null==r&&"\\"===n[0]&&!this.isDefined(n))throw new yc("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var o=r.tokens,i=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs)for(var a=(o=o.slice()).length-1;a>=0;--a){var s=o[a];if("#"===s.text){if(0===a)throw new yc("Incomplete placeholder at end of macro body",s);if("#"===(s=o[--a]).text)o.splice(a+1,1);else{if(!/^[1-9]$/.test(s.text))throw new yc("Not a valid argument number",s);o.splice(a,2,...i[+s.text-1])}}}return this.pushTokens(o),o.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(!1===this.expandOnce()){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new bc(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(!1===this.expandOnce(!0)){var r=this.stack.pop();r.treatAsRelax&&(r.noexpand=!1,r.treatAsRelax=!1),t.push(r)}
|
|
449
|
+
return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t?t.map((e=>e.text)).join(""):t}_getExpansion(e){var t=this.macros.get(e);if(null==t)return t;if(1===e.length){var n=this.lexer.catcodes[e];if(null!=n&&13!==n)return}var r="function"==typeof t?t(this):t;if("string"==typeof r){var o=0;if(-1!==r.indexOf("#"))for(var i=r.replace(/##/g,"");-1!==i.indexOf("#"+(o+1));)++o;for(var a=new Km(r,this.settings),s=[],l=a.lex();"EOF"!==l.text;)s.push(l),l=a.lex();return s.reverse(),{tokens:s,numArgs:o}}return r}isDefined(e){return this.macros.has(e)||Bm.hasOwnProperty(e)||yu.math.hasOwnProperty(e)||yu.text.hasOwnProperty(e)||rp.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:Bm.hasOwnProperty(e)&&!Bm[e].primitive}}var ip=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,ap=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9",
|
|
450
|
+
"ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g","ʰ":"h","ⁱ":"i","ʲ":"j","ᵏ":"k","ˡ":"l","ᵐ":"m","ⁿ":"n","ᵒ":"o","ᵖ":"p","ʳ":"r","ˢ":"s","ᵗ":"t","ᵘ":"u","ᵛ":"v","ʷ":"w","ˣ":"x","ʸ":"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),sp={"́":{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"},"̋":{
|
|
451
|
+
text:"\\H"},"̧":{text:"\\c"}},lp={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","ḉ":"ḉ","č":"č","ĉ":"ĉ","ċ":"ċ","ç":"ç","ď":"ď","ḋ":"ḋ","ḑ":"ḑ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ḝ":"ḝ","ě":"ě","ê":"ê","ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ȩ":"ȩ","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ģ":"ģ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","ḩ":"ḩ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ķ":"ķ","ĺ":"ĺ","ľ":"ľ","ļ":"ļ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ņ":"ņ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ","ŏ":"ŏ","ǒ":"ǒ","ô":"ô","ố":"ố","ồ":"ồ","ỗ":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","ṕ":"ṕ","ṗ":"ṗ","ŕ":"ŕ","ř":"ř",
|
|
451
452
|
"ṙ":"ṙ","ŗ":"ŗ","ś":"ś","ṥ":"ṥ","š":"š","ṧ":"ṧ","ŝ":"ŝ","ṡ":"ṡ","ş":"ş","ẗ":"ẗ","ť":"ť","ṫ":"ṫ","ţ":"ţ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","ṹ":"ṹ","ū":"ū","ṻ":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","ṽ":"ṽ","ẃ":"ẃ","ẁ":"ẁ","ẅ":"ẅ","ŵ":"ŵ","ẇ":"ẇ","ẘ":"ẘ","ẍ":"ẍ","ẋ":"ẋ","ý":"ý","ỳ":"ỳ","ÿ":"ÿ","ỹ":"ỹ","ȳ":"ȳ","ŷ":"ŷ","ẏ":"ẏ","ẙ":"ẙ","ź":"ź","ž":"ž","ẑ":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","Ắ":"Ắ","Ằ":"Ằ","Ẵ":"Ẵ","Ǎ":"Ǎ","Â":"Â","Ấ":"Ấ","Ầ":"Ầ","Ẫ":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","Ḃ":"Ḃ","Ć":"Ć","Ḉ":"Ḉ","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ç":"Ç","Ď":"Ď","Ḋ":"Ḋ","Ḑ":"Ḑ","É":"É","È":"È","Ë":"Ë","Ẽ":"Ẽ","Ē":"Ē","Ḗ":"Ḗ","Ḕ":"Ḕ","Ĕ":"Ĕ","Ḝ":"Ḝ","Ě":"Ě","Ê":"Ê","Ế":"Ế","Ề":"Ề","Ễ":"Ễ","Ė":"Ė","Ȩ":"Ȩ","Ḟ":"Ḟ","Ǵ":"Ǵ","Ḡ":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","Ģ":"Ģ","Ḧ":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","Ḣ":"Ḣ","Ḩ":"Ḩ","Í":"Í","Ì":"Ì","Ï":"Ï",
|
|
452
453
|
"Ḯ":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","Ḱ":"Ḱ","Ǩ":"Ǩ","Ķ":"Ķ","Ĺ":"Ĺ","Ľ":"Ľ","Ļ":"Ļ","Ḿ":"Ḿ","Ṁ":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","Ṅ":"Ṅ","Ņ":"Ņ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","Ṍ":"Ṍ","Ṏ":"Ṏ","Ȭ":"Ȭ","Ō":"Ō","Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ","Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ŗ":"Ŗ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ş":"Ş","Ť":"Ť","Ṫ":"Ṫ","Ţ":"Ţ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ",
|
|
453
|
-
"ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"};class
|
|
454
|
-
this.gullet.pushToken(new
|
|
455
|
-
var t,n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();do{var o;t=this.parseGroup(e)}while("internal"===(null==(o=t)?void 0:o.type));if(!t)throw new
|
|
456
|
-
}else if("_"===o.text){if(n)throw new
|
|
457
|
-
;if("text"===this.mode&&!o.allowedInText)throw new
|
|
458
|
-
return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":var r=this.parseArgumentGroup(n,"text");return null!=r?{type:"styling",mode:r.mode,body:[r],style:"text"}:null;case"raw":var o=this.parseStringGroup("raw",n);return null!=o?{type:"raw",mode:"text",string:o.text}:null;case"primitive":if(n)throw new
|
|
459
|
-
;if(""===i)throw new
|
|
460
|
-
;if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==t)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(null==n)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var o=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var i={type:"ordgroup",mode:this.mode,loc:n.loc,body:o};return t&&this.switchMode(r),i}parseGroup(e,t){var n,r=this.fetch(),o=r.text;if("{"===o||"\\begingroup"===o){this.consume();var i="{"===o?"}":"\\endgroup";this.gullet.beginGroup();var a=this.parseExpression(!1,i),s=this.fetch();this.expect(i),this.gullet.endGroup(),n={type:"ordgroup",mode:this.mode,loc:
|
|
461
|
-
;n=this.formatUnsupportedCmd(o),this.consume()}return n}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n],o=r.text;"-"===o&&"-"===e[n+1].text&&(n+1<t&&"-"===e[n+2].text?(e.splice(n,3,{type:"textord",mode:"text",loc:
|
|
462
|
-
|
|
463
|
-
;this.settings.strict&&(
|
|
464
|
-
delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new
|
|
465
|
-
var a=
|
|
454
|
+
"ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"};class cp{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new op(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new yc("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),
|
|
455
|
+
this.gullet.pushToken(new bc("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){"math"===this.mode&&this.consumeSpaces();var r=this.fetch();if(-1!==cp.endOfExpression.indexOf(r.text))break;if(t&&r.text===t)break;if(e&&Bm[r.text]&&Bm[r.text].infix)break;var o=this.parseAtom(t);if(!o)break;"internal"!==o.type&&n.push(o)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t,n=-1,r=0;r<e.length;r++)if("infix"===e[r].type){if(-1!==n)throw new yc("only one infix operator per group",e[r].token);n=r,t=e[r].replaceWith}if(-1!==n&&t){var o,i,a=e.slice(0,n),s=e.slice(n+1);return o=1===a.length&&"ordgroup"===a[0].type?a[0]:{type:"ordgroup",mode:this.mode,body:a},i=1===s.length&&"ordgroup"===s[0].type?s[0]:{type:"ordgroup",mode:this.mode,body:s},["\\\\abovefrac"===t?this.callFunction(t,[o,e[n],i],[]):this.callFunction(t,[o,i],[])]}return e}handleSupSubscript(e){
|
|
456
|
+
var t,n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();do{var o;t=this.parseGroup(e)}while("internal"===(null==(o=t)?void 0:o.type));if(!t)throw new yc("Expected group after '"+r+"'",n);return t}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var r={type:"text",mode:this.mode,body:t};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t,n,r=this.parseGroup("atom",e);if("internal"===(null==r?void 0:r.type))return r;if("text"===this.mode)return r;for(;;){this.consumeSpaces();var o=this.fetch();if("\\limits"===o.text||"\\nolimits"===o.text){if(r&&"op"===r.type){var i="\\limits"===o.text;r.limits=i,r.alwaysHandleSupSub=!0}else{if(!r||"operatorname"!==r.type)throw new yc("Limit controls must follow a math operator",o);r.alwaysHandleSupSub&&(r.limits="\\limits"===o.text)}this.consume()}else if("^"===o.text){if(t)throw new yc("Double superscript",o);t=this.handleSupSubscript("superscript")
|
|
457
|
+
}else if("_"===o.text){if(n)throw new yc("Double subscript",o);n=this.handleSupSubscript("subscript")}else if("'"===o.text){if(t)throw new yc("Double superscript",o);var a={type:"textord",mode:this.mode,text:"\\prime"},s=[a];for(this.consume();"'"===this.fetch().text;)s.push(a),this.consume();"^"===this.fetch().text&&s.push(this.handleSupSubscript("superscript")),t={type:"ordgroup",mode:this.mode,body:s}}else{if(!ap[o.text])break;var l=ip.test(o.text),c=[];for(c.push(new bc(ap[o.text])),this.consume();;){var u=this.fetch().text;if(!ap[u])break;if(ip.test(u)!==l)break;c.unshift(new bc(ap[u])),this.consume()}var d=this.subparse(c);l?n={type:"ordgroup",mode:"math",body:d}:t={type:"ordgroup",mode:"math",body:d}}}return t||n?{type:"supsub",mode:this.mode,base:r,sup:t,sub:n}:r}parseFunction(e,t){var n=this.fetch(),r=n.text,o=Bm[r];if(!o)return null;if(this.consume(),t&&"atom"!==t&&!o.allowedInArgument)throw new yc("Got function '"+r+"' with no arguments"+(t?" as "+t:""),n)
|
|
458
|
+
;if("text"===this.mode&&!o.allowedInText)throw new yc("Can't use function '"+r+"' in text mode",n);if("math"===this.mode&&!1===o.allowedInMath)throw new yc("Can't use function '"+r+"' in math mode",n);var{args:i,optArgs:a}=this.parseArguments(r,o);return this.callFunction(r,i,a,n,e)}callFunction(e,t,n,r,o){var i={funcName:e,parser:this,token:r,breakOnTokenText:o},a=Bm[e];if(a&&a.handler)return a.handler(i,t,n);throw new yc("No function handler for "+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(0===n)return{args:[],optArgs:[]};for(var r=[],o=[],i=0;i<n;i++){var a=t.argTypes&&t.argTypes[i],s=i<t.numOptionalArgs;(t.primitive&&null==a||"sqrt"===t.type&&1===i&&null==o[0])&&(a="primitive");var l=this.parseGroupOfType("argument to '"+e+"'",a,s);if(s)o.push(l);else{if(null==l)throw new yc("Null argument, please report this as a bug");r.push(l)}}return{args:r,optArgs:o}}parseGroupOfType(e,t,n){switch(t){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":
|
|
459
|
+
return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":var r=this.parseArgumentGroup(n,"text");return null!=r?{type:"styling",mode:r.mode,body:[r],style:"text"}:null;case"raw":var o=this.parseStringGroup("raw",n);return null!=o?{type:"raw",mode:"text",string:o.text}:null;case"primitive":if(n)throw new yc("A primitive argument cannot be optional");var i=this.parseGroup(e);if(null==i)throw new yc("Expected group as "+e,this.fetch());return i;case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new yc("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;" "===this.fetch().text;)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(null==n)return null;for(var r,o="";"EOF"!==(r=this.fetch()).text;)o+=r.text,this.consume();return this.consume(),n.text=o,n}parseRegexGroup(e,t){for(var n,r=this.fetch(),o=r,i="";"EOF"!==(n=this.fetch()).text&&e.test(i+n.text);)i+=(o=n).text,this.consume()
|
|
460
|
+
;if(""===i)throw new yc("Invalid "+t+": '"+r.text+"'",r);return r.range(o,i)}parseColorGroup(e){var t=this.parseStringGroup("color",e);if(null==t)return null;var n=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new yc("Invalid color: '"+t.text+"'",t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r="#"+r),{type:"color-token",mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),!(t=e||"{"===this.gullet.future().text?this.parseStringGroup("size",e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;e||0!==t.text.length||(t.text="0pt",n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new yc("Invalid size: '"+t.text+"'",t);var o={number:+(r[1]+r[2]),unit:r[3]};if(!eu(o))throw new yc("Invalid unit: '"+o.unit+"'",t);return{type:"size",mode:this.mode,value:o,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup("url",e)
|
|
461
|
+
;if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==t)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(null==n)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var o=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var i={type:"ordgroup",mode:this.mode,loc:n.loc,body:o};return t&&this.switchMode(r),i}parseGroup(e,t){var n,r=this.fetch(),o=r.text;if("{"===o||"\\begingroup"===o){this.consume();var i="{"===o?"}":"\\endgroup";this.gullet.beginGroup();var a=this.parseExpression(!1,i),s=this.fetch();this.expect(i),this.gullet.endGroup(),n={type:"ordgroup",mode:this.mode,loc:vc.range(r,s),body:a,semisimple:"\\begingroup"===o||void 0}}else if(null==(n=this.parseFunction(t,e)||this.parseSymbol())&&"\\"===o[0]&&!rp.hasOwnProperty(o)){if(this.settings.throwOnError)throw new yc("Undefined control sequence: "+o,r)
|
|
462
|
+
;n=this.formatUnsupportedCmd(o),this.consume()}return n}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n],o=r.text;"-"===o&&"-"===e[n+1].text&&(n+1<t&&"-"===e[n+2].text?(e.splice(n,3,{type:"textord",mode:"text",loc:vc.range(r,e[n+2]),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:vc.range(r,e[n+1]),text:"--"}),t-=1)),"'"!==o&&"`"!==o||e[n+1].text!==o||(e.splice(n,2,{type:"textord",mode:"text",loc:vc.range(r,e[n+1]),text:o+o}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r="*"===n.charAt(0);if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new yc("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:n=n.slice(1,-1),star:r}}
|
|
463
|
+
lp.hasOwnProperty(t[0])&&!yu[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=lp[t[0]]+t.slice(1));var o,i=Vm.exec(t);if(i&&("i"===(t=t.substring(0,i.index))?t="ı":"j"===t&&(t="ȷ")),yu[this.mode][t]){this.settings.strict&&"math"===this.mode&&Zu.indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var a,s=yu[this.mode][t].group,l=vc.range(e);if(vu.hasOwnProperty(s)){var c=s;a={type:"atom",mode:this.mode,family:c,loc:l,text:t}}else a={type:s,mode:this.mode,loc:l,text:t};o=a}else{if(!(t.charCodeAt(0)>=128))return null
|
|
464
|
+
;this.settings.strict&&(Fc(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),o={type:"textord",mode:"text",loc:vc.range(e),text:t}}if(this.consume(),i)for(var u=0;u<i[0].length;u++){var d=i[0][u];if(!sp[d])throw new yc("Unknown accent ' "+d+"'",e);var h=sp[d][this.mode]||sp[d].text;if(!h)throw new yc("Accent "+d+" unsupported in "+this.mode+" mode",e);o={type:"accent",mode:this.mode,loc:vc.range(e),label:h,isStretchy:!1,isShifty:!0,base:o}}return o}}cp.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var up=function(e,t){if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new cp(e,t);delete n.gullet.macros.current["\\df@tag"];var r=n.parse();if(delete n.gullet.macros.current["\\current@color"],
|
|
465
|
+
delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new yc("\\tag works only in display equations");r=[{type:"tag",mode:"text",body:r,tag:n.subparse([new bc("\\df@tag")])}]}return r},dp=function(e,t,n){t.textContent="";var r=pp(e,n).toNode();t.appendChild(r)};"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."),dp=function(){throw new yc("KaTeX doesn't work in quirks mode.")});var hp,mp=function(e,t,n){if(n.throwOnError||!(e instanceof yc))throw e;var r=hd.makeSpan(["katex-error"],[new hu(t)]);return r.setAttribute("title",e.toString()),r.setAttribute("style","color:"+n.errorColor),r},pp=function(e,t){var n=new Tc(t);try{return function(e,t,n){var r,o=Zd(n);if("mathml"===n.output)return Xd(e,t,o,n.displayMode,!0);if("html"===n.output){var i=Hd(e,o);r=hd.makeSpan(["katex"],[i])}else{
|
|
466
|
+
var a=Xd(e,t,o,n.displayMode,!1),s=Hd(e,o);r=hd.makeSpan(["katex"],[a,s])}return Jd(r,n)}(up(e,n),e,n)}catch(t){return mp(t,e,n)}},fp={version:"0.16.22",render:dp,renderToString:function(e,t){return pp(e,t).toMarkup()},ParseError:yc,SETTINGS_SCHEMA:Sc,__parse:function(e,t){var n=new Tc(t);return up(e,n)},__renderToDomTree:pp,__renderToHTMLTree:function(e,t){var n=new Tc(t);try{return function(e,t,n){var r=Hd(e,Zd(n)),o=hd.makeSpan(["katex"],[r]);return Jd(o,n)}(up(e,n),0,n)}catch(t){return mp(t,e,n)}},__setFontMetrics:function(e,t){qc[e]=t},__defineSymbol:_u,__defineFunction:wd,__defineMacro:tm,__domTree:{Span:lu,Anchor:cu,SymbolNode:hu,SvgNode:mu,PathNode:pu,LineNode:fu}},gp={exports:{}},vp=gp.exports;var bp,yp=(hp||(hp=1,function(e){(function(){function t(e){var t={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,
|
|
466
467
|
describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:"Remove only spaces, ' and \" from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids",type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{
|
|
467
468
|
defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},
|
|
468
469
|
smartIndentationFix:{defaultValue:!1,describe:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,describe:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,describe:"Parses simple line breaks as <br> (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,describe:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,describe:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",describe:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,describe:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,
|
|
@@ -534,35 +535,35 @@ var o=new Array(r+1).join("#"),i="";if(e.hasChildNodes()){i=o+" ";for(var a=e.ch
|
|
|
534
535
|
r||(o=n.subParser("makeMarkdown.header")(e,t,4)+"\n\n");break;case"h5":r||(o=n.subParser("makeMarkdown.header")(e,t,5)+"\n\n");break;case"h6":r||(o=n.subParser("makeMarkdown.header")(e,t,6)+"\n\n");break;case"p":r||(o=n.subParser("makeMarkdown.paragraph")(e,t)+"\n\n");break;case"blockquote":r||(o=n.subParser("makeMarkdown.blockquote")(e,t)+"\n\n");break;case"hr":r||(o=n.subParser("makeMarkdown.hr")(e,t)+"\n\n");break;case"ol":r||(o=n.subParser("makeMarkdown.list")(e,t,"ol")+"\n\n");break;case"ul":r||(o=n.subParser("makeMarkdown.list")(e,t,"ul")+"\n\n");break;case"precode":r||(o=n.subParser("makeMarkdown.codeBlock")(e,t)+"\n\n");break;case"pre":r||(o=n.subParser("makeMarkdown.pre")(e,t)+"\n\n");break;case"table":r||(o=n.subParser("makeMarkdown.table")(e,t)+"\n\n");break;case"code":o=n.subParser("makeMarkdown.codeSpan")(e,t);break;case"em":case"i":o=n.subParser("makeMarkdown.emphasis")(e,t);break;case"strong":case"b":o=n.subParser("makeMarkdown.strong")(e,t);break;case"del":
|
|
535
536
|
o=n.subParser("makeMarkdown.strikethrough")(e,t);break;case"a":o=n.subParser("makeMarkdown.links")(e,t);break;case"img":o=n.subParser("makeMarkdown.image")(e,t);break;default:o=e.outerHTML+"\n\n"}return o})),n.subParser("makeMarkdown.paragraph",(function(e,t){var r="";if(e.hasChildNodes())for(var o=e.childNodes,i=o.length,a=0;a<i;++a)r+=n.subParser("makeMarkdown.node")(o[a],t);return r=r.trim()})),n.subParser("makeMarkdown.pre",(function(e,t){var n=e.getAttribute("prenum");return"<pre>"+t.preList[n]+"</pre>"})),n.subParser("makeMarkdown.strikethrough",(function(e,t){var r="";if(e.hasChildNodes()){r+="~~";for(var o=e.childNodes,i=o.length,a=0;a<i;++a)r+=n.subParser("makeMarkdown.node")(o[a],t);r+="~~"}return r})),n.subParser("makeMarkdown.strong",(function(e,t){var r="";if(e.hasChildNodes()){r+="**";for(var o=e.childNodes,i=o.length,a=0;a<i;++a)r+=n.subParser("makeMarkdown.node")(o[a],t);r+="**"}return r})),n.subParser("makeMarkdown.table",(function(e,t){
|
|
536
537
|
var r,o,i="",a=[[],[]],s=e.querySelectorAll("thead>tr>th"),l=e.querySelectorAll("tbody>tr");for(r=0;r<s.length;++r){var c=n.subParser("makeMarkdown.tableCell")(s[r],t),u="---";if(s[r].hasAttribute("style"))switch(s[r].getAttribute("style").toLowerCase().replace(/\s/g,"")){case"text-align:left;":u=":---";break;case"text-align:right;":u="---:";break;case"text-align:center;":u=":---:"}a[0][r]=c.trim(),a[1][r]=u}for(r=0;r<l.length;++r){var d=a.push([])-1,h=l[r].getElementsByTagName("td");for(o=0;o<s.length;++o){var m=" ";void 0!==h[o]&&(m=n.subParser("makeMarkdown.tableCell")(h[o],t)),a[d].push(m)}}var p=3;for(r=0;r<a.length;++r)for(o=0;o<a[r].length;++o){var f=a[r][o].length;f>p&&(p=f)}for(r=0;r<a.length;++r){for(o=0;o<a[r].length;++o)1===r?":"===a[r][o].slice(-1)?a[r][o]=n.helper.padEnd(a[r][o].slice(-1),p-1,"-")+":":a[r][o]=n.helper.padEnd(a[r][o],p,"-"):a[r][o]=n.helper.padEnd(a[r][o],p);i+="| "+a[r].join(" | ")+" |\n"}return i.trim()})),n.subParser("makeMarkdown.tableCell",(function(e,t){var r=""
|
|
537
|
-
;if(!e.hasChildNodes())return"";for(var o=e.childNodes,i=o.length,a=0;a<i;++a)r+=n.subParser("makeMarkdown.node")(o[a],t,!0);return r.trim()})),n.subParser("makeMarkdown.txt",(function(e){var t=e.nodeValue;return t=(t=t.replace(/ +/g," ")).replace(/¨NBSP;/g," "),t=(t=(t=(t=(t=(t=(t=(t=(t=n.helper.unescapeHTMLEntities(t)).replace(/([*_~|`])/g,"\\$1")).replace(/^(\s*)>/g,"\\$1>")).replace(/^#/gm,"\\#")).replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3")).replace(/^( {0,3}\d+)\./gm,"$1\\.")).replace(/^( {0,3})([+-])/gm,"$1\\$2")).replace(/]([\s]*)\(/g,"\\]$1\\(")).replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:")})),e.exports?e.exports=n:this.showdown=n}).call(
|
|
538
|
-
;if(-1!==o&&(-1===i||o<i)?(a=o,s=r.indexOf("$$",a+2)):(a=i,s=r.indexOf("\\)",a+2)),-1===s)break;s+=2;var l=t.length+1,c=
|
|
539
|
-
0===t);else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||
|
|
540
|
-
e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%";var n=document.createElement("div");return n.style.paddingBottom="".concat(1/t*100,"%"),n.style.position="relative",n.appendChild(e),n}(n,t)}function
|
|
541
|
-
f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(r);try{for(i.s();!(t=i.n()).done;){var a=
|
|
542
|
-
},
|
|
543
|
-
var n=function(e){var t,n;for(n=0;n<
|
|
544
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function
|
|
545
|
-
for(var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).className,n=0,r=Array.from(e.getElementsByTagName("a"));n<r.length;n++){var o=
|
|
546
|
-
"data-testid":"markdown-text",ref:p,dangerouslySetInnerHTML:{__html:m},style:r,onMouseEnterCapture:s?function(e){var t=e.target,n=v.current.get(t);n&&(x(n),f.current=t)}:void 0,onMouseLeaveCapture:function(e){var t=e.target;f.current!==t||y||(x(null),f.current=null)}},void 0,0,{fileName:
|
|
547
|
-
title:"Toggle visibility of full excerpt text",style:n,underline:"always",inline:!0,children:e?"More":"Less"})})})}const
|
|
548
|
-
className:Xe("transition-[opacity] duration-150 ease-linear","absolute w-full bottom-0 h-touch-minimum",{"bg-gradient-to-b from-excerpt-stop-1 via-excerpt-stop-2 to-excerpt-stop-3":!r&&f,"bg-none":r,"opacity-0 pointer-events-none":!f}),title:"Show the full excerpt"}),p&&r&&Qe(
|
|
549
|
-
className:Xe("px-1.5 py-1 touch:p-2","border-l rounded rounded-l-none","text-grey-6 hover:text-color-text hover:bg-grey-2","transition-colors duration-200","focus-visible-ring ring-inset"),onClick:()=>{t(n)},title:`Remove tag: ${n}`,children:Qe(yt,{className:"font-base w-em h-em",title:`Remove ${n}`})})]})}function
|
|
550
|
-
;return Qe("div",{className:"space-y-4",children:[h&&Qe(
|
|
551
|
-
const n=[...e.slice(0,t).matchAll(new RegExp(
|
|
552
|
-
;return r=
|
|
553
|
-
;return
|
|
554
|
-
"aria-orientation":"vertical",id:i,children:e?Qe("li",{className:"italic p-2","data-testid":"suggestions-loading-indicator",children:"Loading suggestions…"}):Qe(y,{children:[t.map(((e,t)=>Qe(
|
|
555
|
-
function
|
|
556
|
-
;const r=e.selectionStart,o=document.createElement("span");o.style.display="inline-block",o.style.verticalAlign="bottom";const i=e.value.substring(0,r),a=e.value.slice(r),s="\nx";
|
|
557
|
-
"aria-controls":_,"aria-expanded":!0,"aria-autocomplete":"list","aria-haspopup":"listbox","aria-activedescendant":t}}),[p,c,v,_]);return Qe("div",{className:"relative",children:[Qe("textarea",{className:Xe("border rounded p-2","placeholder:text-grey-6 bg-grey-0","focus:bg-white focus:outline-none focus:shadow-focus-inner",e),onInput:e=>{const t=e.target;o(t.value),f(0),b(t)},...l,onKeyUp:e=>{c&&b(e.target)},onKeyDown:e=>{i?.(e),c&&0!==v.length&&("ArrowDown"===e.key?(e.preventDefault(),f((e=>Math.min(e+1,v.length-1)))):"ArrowUp"===e.key?(e.preventDefault(),f((e=>Math.max(e-1,0)))):"Enter"===e.key&&(e.preventDefault(),y(v[p])))},ref:m,...w}),Qe("div",{ref:g,className:"absolute top-0 left-0 w-0 h-0 pointer-events-none"}),n&&Qe(
|
|
558
|
-
const i=le(null);return ke(i),Qe("div",{className:Xe("flex flex-wrap w-full items-center","p-1 border-x border-t rounded-t bg-white","touch:h-auto touch:overflow-x-scroll touch:flex-nowrap touch:pb-2.5"),"data-testid":"markdown-toolbar",role:"toolbar","aria-label":"Markdown editor toolbar",ref:i,children:[Qe(
|
|
559
|
-
title:"Bulleted list"}),o&&Qe(
|
|
560
|
-
;const i=o.querySelector("a[data-hyp-mention]")?.getAttribute("data-userid"),a=n.find((({original_userid:e})=>e===i));return"username"===t?`@${a?.username??r}`:
|
|
561
|
-
n((e=>
|
|
562
|
-
className:Xe("flex items-center","border-l-4 py-1 px-3 cursor-pointer hover:bg-grey-2","touch:h-touch-minimum",{"border-brand bg-grey-1":e===r,"border-transparent":e!==r}),onClick:()=>{i(t)},...a,children:o(t,r)},`AutocompleteList-${r}`)}))),[e,n,r,o,i]),l=t?{id:t}:{},c=0===r.length||!a;return Qe("div",{className:"relative",children:Qe("div",{className:Xe({hidden:c},"absolute top-[3px] z-3","min-w-[10em]"),"data-testid":"autocomplete-list-container",children:Qe(st,{width:"auto",classes:"overflow-hidden",children:[Qe("ul",{tabIndex:-1,"aria-label":"Suggestions",role:"listbox",...l,children:s}),Qe(
|
|
563
|
-
},b=e=>{let t=l+e;t<-1?t=a.length-1:t>=a.length&&(t=-1),c(t)},y=l>=0?`${h}-AutocompleteList-item-${l}`:"";return Qe("div",{className:"space-y-4",children:[Qe(
|
|
564
|
-
dir:"auto",role:"combobox",classes:Xe("text-base touch:text-touch-base")}),Qe(_f,{id:`${h}-AutocompleteList`,list:a,listFormatter:e=>{const t=p().toLowerCase(),n=e.toLowerCase().indexOf(t);if(-1===n)return Qe("span",{children:e});const r=e.slice(0,n),o=e.slice(n,n+t.length),i=e.slice(n+t.length);return Qe("span",{children:[Qe("strong",{children:r}),o,Qe("strong",{children:i})]})},open:u,onSelectItem:e=>{e&&v(e)},itemPrefixId:`${h}-AutocompleteList-item-`,activeItem:l})]})]})}),["tags"]);let kf=0;function Nf(e){e.preventDefault(),e.returnValue=!0}function Sf(){return Qe("div",{className:"pt-2 border-t text-xs leading-none",children:Qe(ho,{href:"http://creativecommons.org/publicdomain/zero/1.0/",target:"_blank",title:"View more information about the Creative Commons Public Domain dedication",underline:"none",variant:"text-light",children:Qe("div",{className:"flex items-center",
|
|
565
|
-
children:"Annotations can be freely reused by anyone for any purpose."})]})})})}function Af(e){return null!==e.offsetParent}function Tf({className:e,closeMenu:t,children:n,visible:r}){const o=le(null);ae((()=>{let e;return r&&(e=setTimeout((()=>{const e=o.current.querySelector('[role^="menuitem"]');e&&e.focus()}))),()=>{clearTimeout(e)}}),[r]);return Qe("div",{role:"menu",className:e,ref:o,onKeyDown:e=>{const n=Array.from(o.current.querySelectorAll('[role^="menuitem"]')).filter(Af);let r=n.findIndex((e=>e.contains(document.activeElement))),i=!1;switch(e.key){case"ArrowLeft":case"Escape":t&&(t(e),i=!0);break;case"ArrowUp":r-=1,r<0&&(r=n.length-1),i=!0;break;case"ArrowDown":r+=1,r===n.length&&(r=0),i=!0;break;case"Home":r=0,i=!0;break;case"End":r=n.length-1,i=!0}i&&r>=0&&(e.stopPropagation(),e.preventDefault(),n[r].focus())},children:n})}let Ef=!1;const Cf=()=>{}
|
|
538
|
+
;if(!e.hasChildNodes())return"";for(var o=e.childNodes,i=o.length,a=0;a<i;++a)r+=n.subParser("makeMarkdown.node")(o[a],t,!0);return r.trim()})),n.subParser("makeMarkdown.txt",(function(e){var t=e.nodeValue;return t=(t=t.replace(/ +/g," ")).replace(/¨NBSP;/g," "),t=(t=(t=(t=(t=(t=(t=(t=(t=n.helper.unescapeHTMLEntities(t)).replace(/([*_~|`])/g,"\\$1")).replace(/^(\s*)>/g,"\\$1>")).replace(/^#/gm,"\\#")).replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3")).replace(/^( {0,3}\d+)\./gm,"$1\\.")).replace(/^( {0,3})([+-])/gm,"$1\\$2")).replace(/]([\s]*)\(/g,"\\]$1\\(")).replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:")})),e.exports?e.exports=n:this.showdown=n}).call(vp)}(gp)),gp.exports),_p=Ge(yp),wp=pc(window);function xp(){return[{type:"output",filter:function(e){return e.replace(/<a href=/g,'<a target="_blank" href=')}}]}function kp(e){return"{math:"+e.toString()+"}"}function Np(e){var t=function(e){for(var t=[],n=0,r=e;;){var o=r.indexOf("$$",n),i=r.indexOf("\\(",n);if(-1===o&&-1===i)break;var a=void 0,s=void 0
|
|
539
|
+
;if(-1!==o&&(-1===i||o<i)?(a=o,s=r.indexOf("$$",a+2)):(a=i,s=r.indexOf("\\)",a+2)),-1===s)break;s+=2;var l=t.length+1,c=kp(l);t.push({id:l,expression:r.slice(a+2,s-2),inline:-1!==i});var u=void 0;u=-1!==i?c:"\n\n"+c+"\n\n",r=r.slice(0,a)+u+r.slice(s),n=a+u.length}return{mathBlocks:t,content:r}}(e),n=wp.sanitize(function(e){return bp||(bp=new _p.Converter({extensions:[xp],simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0})),bp.makeHtml(e)}(t.content)),r=function(e,t){return t.reduce((function(e,t){var n;try{n=t.inline?fp.renderToString(t.expression):fp.renderToString(t.expression,{displayMode:!0})}catch(e){n=gc(t.expression)}return e.replace(kp(t.id),n)}),e)}(n,t.mathBlocks);return r}function Sp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,
|
|
540
|
+
0===t);else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||Ap(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ap(e,t){if(e){if("string"==typeof e)return Tp(e,t);var n={}.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)?Tp(e,t):void 0}}function Tp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ep(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16/9,n=document.createElement("iframe");return n.src=e,n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",""),function(e,t){e.style.position="absolute",
|
|
541
|
+
e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%";var n=document.createElement("div");return n.style.paddingBottom="".concat(1/t*100,"%"),n.style.position="relative",n.appendChild(e),n}(n,t)}function Cp(e){for(var t,n=/(\d+)([hms]?)/g,r={h:3600,m:60,s:1},o=0;null!==(t=n.exec(e));)if(t[2]){var i=t[2];o+=Number(t[1])*r[i]}else o+=+t[1];return o.toString()}function Mp(e){var t,n=["end","start","t"],r=new URLSearchParams(e.search),o=new URLSearchParams,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Ap(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},
|
|
542
|
+
f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(r);try{for(i.s();!(t=i.n()).done;){var a=Sp(t.value,2),s=a[0],l=a[1];n.includes(s)&&("t"===s?o.append("start",Cp(l)):o.append(s,l))}}catch(e){i.e(e)}finally{i.f()}o.sort();var c=o.toString();return c&&(c="?".concat(c)),c}function Ip(e,t){var n=Mp(t);return Ep("https://www.youtube.com/embed/".concat(e).concat(n))}function zp(e,t,n){var r=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).aspectRatio;return function(o){if(o.hostname!==e)return null;var i=t.exec(o.pathname);if(!i)return null;var a=i[1];return Ep(n(a),r)}}wp.addHook("afterSanitizeAttributes",(function(e){"target"in e&&e.setAttribute("target","_blank")}));var Op=[function(e){if("www.youtube.com"!==e.hostname)return null;if(!/\/watch\/?/.test(e.pathname))return null;var t=/[&?]v=([^&#]+)/.exec(e.search);return t?Ip(t[1],e):null},function(e){if("youtu.be"!==e.hostname)return null;var t=/^\/([^/]+)\/?$/.exec(e.pathname);return t?Ip(t[1],e):null
|
|
543
|
+
},zp("vimeo.com",/^\/([^/?#]+)\/?$/,(function(e){return"https://player.vimeo.com/video/".concat(e)})),zp("vimeo.com",/^\/channels\/[^/]+\/([^/?#]+)\/?$/,(function(e){return"https://player.vimeo.com/video/".concat(e)})),function(e){if("archive.org"!==e.hostname)return null;var t=/^\/(embed|details)\/(.+)/.exec(e.pathname);if(!t)return null;var n=t[2],r=new URLSearchParams(e.search),o=r.get("start"),i=r.get("end");if(!o){var a=n.match(/\/start\/([^/]+)/);a&&(o=a[1],n=n.replace(a[0],""))}if(!i){var s=n.match(/\/end\/([^/]+)/);s&&(i=s[1],n=n.replace(s[0],""))}var l=new URL("https://archive.org/embed/".concat(n));return o&&l.searchParams.append("start",o),i&&l.searchParams.append("end",i),Ep(l.href)},function(e){return e.pathname.endsWith(".mp3")||e.pathname.endsWith(".ogg")||e.pathname.endsWith(".wav")?(t=e.href,(n=document.createElement("audio")).controls=!0,n.src=t,n):null;var t,n}];function Lp(e){if(e.href!==e.textContent)try{var t=encodeURI(e.textContent);if(e.href!==t)return null}catch(e){return null}
|
|
544
|
+
var n=function(e){var t,n;for(n=0;n<Op.length;n++)if(t=Op[n](e))return t;return null}(e);return n&&e.parentElement.replaceChild(n,e),n}var Rp="/home/runner/work/annotation-ui/annotation-ui/src/components/MarkdownView.tsx";function Pp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Dp(e,t);var n={}.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)?Dp(e,t):void 0}}(e,t)||function(){
|
|
545
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Hp(e){var t=Math.floor(e.x),n=Math.floor(e.y),r=Math.ceil(e.right),o=Math.ceil(e.bottom);return new DOMRect(t,n,r-t,o-n)}function Fp(e){var t=e.markdown,n=e.classes,r=e.style,o=e.mentions,i=void 0===o?[]:o,a=e.mentionsEnabled,s=void 0!==a&&a,l=e.mentionMode,c=e.setTimeout_,u=void 0===c?setTimeout:c,d=e.clearTimeout_,h=void 0===d?clearTimeout:d,m=ce((function(){return t?Np(t):""}),[t]),p=le(null),f=le(null),g=le(null),v=le(new Map),b=Pp(oe(null),2),y=b[0],_=b[1],w=le(),x=ue((function(e){w.current&&h(w.current);var t=function(){_(e),w.current=null};null===e?t():w.current=u(t,400)}),[h,u]);return ae((function(){return function(){w.current&&h(w.current)}}),[h]),ae((function(){!function(e){
|
|
546
|
+
for(var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).className,n=0,r=Array.from(e.getElementsByTagName("a"));n<r.length;n++){var o=Lp(r[n]);o&&(t?o.className=t:o.style.width="350px")}}(p.current,{className:"w-full md:w-[380px]"})}),[t]),ae((function(){v.current=sl(p.current,i,l)}),[l,i]),se((function(){var e=f.current,t=g.current;if(!e||!t||!y)return function(){};var n=function(n){var r=function(e,t){var n=Math.min(e.x,t.x),r=Math.min(e.y,t.y),o=Math.max(e.right,t.right),i=Math.max(e.bottom,t.bottom);return DOMRect.fromRect({x:n,y:r,width:o-n,height:i-r})}(Hp(e.getBoundingClientRect()),Hp(t.getBoundingClientRect()));(function(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom})(r,n.clientX,n.clientY)||(x(null),f.current=null)};return document.body.addEventListener("mousemove",n),function(){document.body.removeEventListener("mousemove",n)}}),[y,x]),Qe("div",{className:Xe("w-full break-anywhere cursor-text",{relative:s}),children:[Qe(rl,{children:Qe("div",{className:n,
|
|
547
|
+
"data-testid":"markdown-text",ref:p,dangerouslySetInnerHTML:{__html:m},style:r,onMouseEnterCapture:s?function(e){var t=e.target,n=v.current.get(t);n&&(x(n),f.current=t)}:void 0,onMouseLeaveCapture:function(e){var t=e.target;f.current!==t||y||(x(null),f.current=null)}},void 0,0,{fileName:Rp,lineNumber:209,columnNumber:9},this)},void 0,0,{fileName:Rp,lineNumber:208,columnNumber:7},this),s&&Qe(Yr,{open:!!y,onClose:function(){return x(null)},anchorElementRef:f,classes:"!max-w-[75%]",elementRef:g,children:Qe(Xs,{content:null!=y?y:"",mentionMode:l},void 0,0,{fileName:Rp,lineNumber:254,columnNumber:11},this)},void 0,0,{fileName:Rp,lineNumber:247,columnNumber:9},this)]},void 0,0,{fileName:Rp,lineNumber:201,columnNumber:5},this)}function jp({isCollapsed:e,setCollapsed:t,linkStyle:n}){return Qe("div",{className:Xe("absolute block right-0 bottom-0","w-20 bg-gradient-to-l from-white"),children:Qe("div",{className:"flex justify-end",children:Qe(po,{variant:"text",onClick:()=>t(!e),expanded:!e,
|
|
548
|
+
title:"Toggle visibility of full excerpt text",style:n,underline:"always",inline:!0,children:e?"More":"Less"})})})}const $p=()=>{};var Bp=Eo((function({children:e,collapse:t=!1,collapsedHeight:n,inlineControls:r=!0,onCollapsibleChanged:o=$p,onToggleCollapsed:i=$p,overflowThreshold:a=0,settings:s={}}){const[l,c]=oe(!0),u=le(null),[d,h]=oe(0),m=ue((()=>{const e=u.current.clientHeight;h(e);o(e>n+a)}),[n,o,a]);se((()=>{const e=function(e,t){const n=new ResizeObserver((()=>t(e.clientWidth,e.clientHeight)));return n.observe(e),()=>n.disconnect()}(u.current,m);return m(),e}),[m]);const p=d>n+a,f=p&&(r?l:t),g={};0!==d&&(g["max-height"]=f?n:d);const v=e=>r?c(e):i(e);return Qe("div",{"data-testid":"excerpt-container",className:Xe("relative overflow-hidden","transition-[max-height] ease-in duration-150"),style:g,children:[Qe("div",{className:Xe("inline-block w-full"),"data-testid":"excerpt-content",ref:u,children:e}),Qe("div",{"data-testid":"excerpt-expand",role:"presentation",onClick:()=>v(!1),
|
|
549
|
+
className:Xe("transition-[opacity] duration-150 ease-linear","absolute w-full bottom-0 h-touch-minimum",{"bg-gradient-to-b from-excerpt-stop-1 via-excerpt-stop-2 to-excerpt-stop-3":!r&&f,"bg-none":r,"opacity-0 pointer-events-none":!f}),title:"Show the full excerpt"}),p&&r&&Qe(jp,{isCollapsed:l,setCollapsed:v,linkStyle:Ao(["selectionFontFamily"],s)})]})}),["settings"]);function qp({children:e}){return Qe("ul",{className:"flex flex-wrap gap-2 leading-none","aria-label":"Annotation tags",children:e})}function Up({href:e,onRemoveTag:t,tag:n}){return Qe("li",{className:"flex items-center border rounded bg-grey-0",children:[Qe("div",{className:"grow px-1.5 py-1 touch:p-2",children:e?Qe(ho,{variant:"text-light",href:e,lang:"",target:"_blank","aria-label":`Tag: ${n}`,title:`View annotations with tag: ${n}`,underline:"none",children:n}):Qe("span",{className:"text-color-text-light cursor-default","aria-label":`Tag: ${n}`,lang:"",children:n})}),t&&Qe("button",{
|
|
550
|
+
className:Xe("px-1.5 py-1 touch:p-2","border-l rounded rounded-l-none","text-grey-6 hover:text-color-text hover:bg-grey-2","transition-colors duration-200","focus-visible-ring ring-inset"),onClick:()=>{t(n)},title:`Remove tag: ${n}`,children:Qe(yt,{className:"font-base w-em h-em",title:`Remove ${n}`})})]})}function Gp({classes:e,setCollapsed:t,collapsed:n}){const r=n?"More":"Less";return Qe(gr,{classes:Xe("text-grey-7 font-normal",e),expanded:!n,onClick:()=>t(!n),title:`Toggle visibility of full annotation text: Show ${r}`,children:Qe("div",{className:"flex items-center gap-x-2",children:[Qe(n?Zt:Rt,{className:"w-3 h-3"}),Qe("div",{children:r})]})})}var Vp=Eo((function({annotation:e,settings:t}){const[n,r]=oe(!0),[o,i]=oe(!1),a=ds(),s=a.defaultAuthority(),l=a.getDraft(e),c=a.isFeatureEnabled("at_mentions"),u=l?.tags??e.tags,d=l?.text??e.text,h=d.length>0,m=u.length>0,p=Ao(["annotationFontFamily"],t),f=ce((()=>li(e.user,s)),[e,s]),g=f?"display-name":"username",v=e=>a.getLink("search.tag",{tag:e})
|
|
551
|
+
;return Qe("div",{className:"space-y-4",children:[h&&Qe(Bp,{collapse:n,collapsedHeight:400,inlineControls:!1,onCollapsibleChanged:i,onToggleCollapsed:r,overflowThreshold:20,children:Qe(Fp,{markdown:d,classes:Xe({"p-redacted-text":pi(e)}),style:p,mentions:e.mentions,mentionsEnabled:c,mentionMode:g})}),(o||m)&&Qe("div",{className:"flex flex-row gap-x-2",children:[Qe("div",{className:"grow",children:m&&Qe(qp,{children:u.map((e=>Qe(Up,{tag:e,href:f?void 0:v(e)},e)))})}),o&&Qe("div",{children:Qe(Gp,{classes:Xe("-mt-3"),collapsed:n,setCollapsed:r})})]})]})}),["settings"]);const Wp=String.raw`[\s,.;:|?!'"\-()[\]{}]`,Kp=new RegExp(`(^|${Wp})@([A-Za-z0-9_][A-Za-z0-9._]+[A-Za-z0-9_])(?=${Wp}|$)`,"g"),Yp=String.raw`[^\]^[]*`,Xp=new RegExp(`(^|${Wp})@\\[(${Yp})](?=${Wp}|$)`,"g");function Zp(e,t){const n=document.createElement("a");return n.setAttribute("data-hyp-mention",""),n.setAttribute("data-userid",e),n.textContent=t,n.outerHTML}const Jp=/<a[^>]\bdata-hyp-mention\b[^>]*>@([^<]+)<\/a>/g;function Qp(e,t){
|
|
552
|
+
const n=[...e.slice(0,t).matchAll(new RegExp(Wp,"g"))],r=n.length>0?Math.max(...n.map((e=>e.index))):-1,o=e.slice(t).search(new RegExp(Wp));return{start:r+1,end:-1===o?e.length:t+o}}function ef(e){return`@[${e.replace(/[[\]]/g,"")}]`}let tf,nf=function(e){return e.ANCHOR_LINK="ANCHOR_LINK",e.IMAGE_LINK="IMAGE_LINK",e}({});function rf(e,t,n,r){let o=e.selectionStart,i=e.selectionEnd;return o>=t+n?(o+=r.length-n,i+=r.length-n):i<=t||(o<=t&&i>=t+n?i+=r.length-n:o<t&&i<t+n?o=t:o<t+n&&i>t+n?i+=r.length-n:t<o&&t+n>i&&(o=t,i=t+n)),{text:e.text.slice(0,t)+r+e.text.slice(t+n),selectionStart:o,selectionEnd:i}}function of(e,t=nf.ANCHOR_LINK){const n=e.text.slice(e.selectionStart,e.selectionEnd);let r,o="";if(t===nf.IMAGE_LINK&&(o="!"),n.match(/[a-z]+:\/\/.*/)){const t="Description";return r=rf(e,e.selectionStart,n.length,o+"["+t+"]("+n+")"),r.selectionStart=e.selectionStart+o.length+1,r.selectionEnd=r.selectionStart+t.length,r}{const t=o+"["+n+"](",i="http://insert-your-link-here.com"
|
|
553
|
+
;return r=rf(e,e.selectionStart,n.length,t+i+")"),r.selectionStart=e.selectionStart+t.length,r.selectionEnd=r.selectionStart+i.length,r}}function af(e,t,n,r){void 0===n&&(n=t);const o=e.text.slice(e.selectionStart-t.length,e.selectionStart),i=e.text.slice(e.selectionEnd,e.selectionEnd+t.length);let a=e;return e.selectionStart===e.selectionEnd&&r&&(a=rf(e,e.selectionStart,0,r),a.selectionStart=a.selectionEnd-r.length),o===t&&i===n?(a=rf(a,a.selectionStart-t.length,t.length,""),a=rf(a,a.selectionEnd,n.length,"")):(a=rf(a,a.selectionStart,0,t),a=rf(a,a.selectionEnd,0,n)),a}function sf(e,t){const n=e.indexOf("\n",t);return n<0?e.length:n}function lf(e,t,n,r){let o=function(e,t){const n=e.lastIndexOf("\n",t);return n<0?0:n+1}(e.text,t),i=sf(e.text,t),a=0;for(;i<=sf(e.text,n);){const t=i===e.text.length,s=i-o,l=sf((e=r(e,o,i,a)).text,o)-o;if(n+=l-s,t)break;o=o+l+1,i=sf(e.text,o),a+=1}return e}function cf(e,t){const n=e.selectionStart,r=e.selectionEnd,o=e=>"function"==typeof t?t(e):t;let i=!0
|
|
554
|
+
;return lf(e,n,r,((e,t,n,r)=>{const a=o(r);return e.text.slice(t,t+a.length)!==a&&(i=!1),e})),lf(e,n,r,i?(e,t,n,r)=>rf(e,t,o(r).length,""):(e,t,n,r)=>{const i=o(r);return e.text.slice(t,t+i.length)===i?e:rf(e,t,0,i)})}const uf=!1;function df({user:e,usersListboxId:t,highlighted:n,mentionMode:r,onSelect:o,onHighlight:i}){const a="username"===r;return Qe("li",{id:`${t}-${e.username}`,className:Xe("flex justify-between items-center gap-x-2 rounded p-2","leading-tight",{"bg-grey-2":n}),onClick:e=>{e.stopPropagation(),o()},onMouseMove:i,role:"option","aria-selected":n,children:[a&&Qe("span",{className:"truncate","data-testid":`username-${e.username}`,children:e.username}),Qe("span",{className:Xe({"text-color-text-light":a}),children:e.displayName})]},e.username)}function hf({loadingUsers:e,users:t,onSelectUser:n,highlightedSuggestion:r,onHighlightSuggestion:o,usersListboxId:i,mentionMode:a,...s}){return Qe(Yr,{...s,classes:Xe("p-1",["!max-h-96"]),children:Qe("ul",{className:"flex-col gap-y-0.5",role:"listbox",
|
|
555
|
+
"aria-orientation":"vertical",id:i,children:e?Qe("li",{className:"italic p-2","data-testid":"suggestions-loading-indicator",children:"Loading suggestions…"}):Qe(y,{children:[t.map(((e,t)=>Qe(df,{user:e,highlighted:r===t,mentionMode:a,usersListboxId:i,onSelect:()=>n(e),onHighlight:()=>o(t)},e.username))),0===t.length&&Qe("li",{className:"italic p-2","data-testid":"suggestions-fallback",children:"No matches. You can still write the username"})]})})})}const mf={bold:"b",image:"g",italic:"i",link:"l",list:"u",math:"m",numlist:"o",quote:"q"};function pf({disabled:e=!1,icon:t,label:n,onClick:r,shortcutKey:o,title:i="",classes:a}){const s=ce((()=>Ms()?"Cmd":"Ctrl"),[]);let l=i;o&&(l+=` (${s}-${o.toUpperCase()})`);const c={disabled:e,onClick:r,title:l};return n?Qe(gr,{classes:Xe("p-1.5 text-grey-7 hover:text-grey-9",a),...c,size:"custom",variant:"custom",children:n}):Qe(wr,{classes:Xe("px-2 py-2.5",a),...c,children:t&&Qe(t,{className:"w-[10px] h-[10px] touch:w-[13px] touch:h-[13px]"})})}
|
|
556
|
+
function ff({classes:e,containerRef:t,mentionsEnabled:n,usersForMentions:r,onEditText:o,onKeyDown:i,mentionMode:a,onInsertMentionSuggestion:s,...l}){const[c,u]=oe(!1),[d,h]=oe(),m=Me(t),[p,f]=oe(0),g=le(null),v=ce((()=>n?function(e,t,{mentionMode:n,maxUsers:r=10}){return void 0===e||"loading"===t.status?[]:t.users.filter((t=>{if(!e)return!0;const r=t.displayName??"";return("username"===n?`${t.username} ${r}`:r).toLowerCase().includes(e.toLowerCase())})).slice(0,r)}(d,r,{mentionMode:a}):[]),[d,a,n,r]),b=ue((e=>{if(!n)return;const{x:t,y:r}=function(e){tf||(tf=document.createElement("div"),document.body.append(tf));try{const t=e.getBoundingClientRect(),n=window.getComputedStyle(e);tf.style.font=n.font,tf.style.padding=n.padding,tf.style.whiteSpace="pre-wrap",tf.style.wordWrap="break-word",tf.style.position="fixed",uf||(tf.style.visibility="hidden"),tf.style.width=`${t.width}px`,tf.style.height=`${t.height}px`,tf.style.top=`${t.top}px`,tf.style.left=`${t.left}px`
|
|
557
|
+
;const r=e.selectionStart,o=document.createElement("span");o.style.display="inline-block",o.style.verticalAlign="bottom";const i=e.value.substring(0,r),a=e.value.slice(r),s="\nx";tf.innerHTML="",tf.append(i,o,a,s),tf.style.overflowY="auto",tf.scrollTop=e.scrollTop;const l=o.getBoundingClientRect();return{x:l.left-t.left,y:l.top-t.top}}finally{tf.remove(),tf=void 0}}(e);g.current&&(g.current.style.transform=`translate(${t}px, ${r}px)`);const o=function(e,t){const{start:n}=Qp(e,t);return e.slice(n,t)}(e.value,e.selectionStart),i=o.startsWith("@");u(i),h(i?o.substring(1):void 0)}),[n]),y=ue((e=>{const t=m.current,{value:n}=t,{start:r,end:i}=Qp(n,t.selectionStart),l=`${n.slice(0,r)}${function(e,t){return"display-name"===t?ef(e.displayName??""):`@${e.username}`}(e,a)} `,c=n.slice(i);t.value=`${l}${c}`,t.selectionStart=l.length,t.selectionEnd=l.length,t.focus(),o(t.value),s?.(e),u(!1),f(0)}),[a,o,s,m]),_=he(),w=ce((()=>{if(!c)return{};const e=v[p],t=e?`${_}-${e.username}`:void 0;return{role:"combobox",
|
|
558
|
+
"aria-controls":_,"aria-expanded":!0,"aria-autocomplete":"list","aria-haspopup":"listbox","aria-activedescendant":t}}),[p,c,v,_]);return Qe("div",{className:"relative",children:[Qe("textarea",{className:Xe("border rounded p-2","placeholder:text-grey-6 bg-grey-0","focus:bg-white focus:outline-none focus:shadow-focus-inner",e),onInput:e=>{const t=e.target;o(t.value),f(0),b(t)},...l,onKeyUp:e=>{c&&b(e.target)},onKeyDown:e=>{i?.(e),c&&0!==v.length&&("ArrowDown"===e.key?(e.preventDefault(),f((e=>Math.min(e+1,v.length-1)))):"ArrowUp"===e.key?(e.preventDefault(),f((e=>Math.max(e-1,0)))):"Enter"===e.key&&(e.preventDefault(),y(v[p])))},ref:m,...w}),Qe("div",{ref:g,className:"absolute top-0 left-0 w-0 h-0 pointer-events-none"}),n&&Qe(hf,{open:c,onClose:()=>u(!1),anchorElementRef:g,loadingUsers:"loading"===r.status,users:v,highlightedSuggestion:p,onHighlightSuggestion:f,onSelectUser:y,usersListboxId:_,mentionMode:a})]})}function gf({isPreviewing:e,onCommand:t,onTogglePreview:n,showHelpLink:r,mentionsEnabled:o}){
|
|
559
|
+
const i=le(null);return ke(i),Qe("div",{className:Xe("flex flex-wrap w-full items-center","p-1 border-x border-t rounded-t bg-white","touch:h-auto touch:overflow-x-scroll touch:flex-nowrap touch:pb-2.5"),"data-testid":"markdown-toolbar",role:"toolbar","aria-label":"Markdown editor toolbar",ref:i,children:[Qe(pf,{disabled:e,icon:Wt,onClick:()=>t("bold"),shortcutKey:mf.bold,title:"Bold"}),Qe(pf,{disabled:e,icon:Yt,onClick:()=>t("italic"),shortcutKey:mf.italic,title:"Italic"}),Qe(pf,{disabled:e,icon:Gt,onClick:()=>t("quote"),shortcutKey:mf.quote,title:"Quote"}),Qe(pf,{disabled:e,icon:An,onClick:()=>t("link"),shortcutKey:mf.link,title:"Insert link"}),Qe(pf,{disabled:e,icon:_n,onClick:()=>t("image"),shortcutKey:mf.image,title:"Insert image"}),Qe(pf,{disabled:e,icon:qt,onClick:()=>t("math"),title:"Insert math (LaTeX is supported)"}),Qe(pf,{disabled:e,icon:En,onClick:()=>t("numlist"),shortcutKey:mf.numlist,title:"Numbered list"}),Qe(pf,{disabled:e,icon:Mn,onClick:()=>t("list"),shortcutKey:mf.list,
|
|
560
|
+
title:"Bulleted list"}),o&&Qe(pf,{disabled:e,icon:Pn,onClick:()=>t("mention"),title:"Mention",classes:"!text-brand"}),Qe("div",{className:"grow flex justify-end",children:[r&&Qe(ho,{classes:"text-grey-7 hover:!text-grey-7",href:"https://web.hypothes.is/help/formatting-annotations-with-markdown/",target:"_blank",title:"Formatting help","aria-label":"Formatting help",underline:"none",variant:"custom",children:Qe("div",{className:Xe("flex justify-center items-center","touch:h-touch-minimum touch:w-touch-minimum","px-2 py-2.5 touch:p-0"),children:Qe(pn,{className:"w-2.5 h-2.5"})})}),Qe(pf,{label:e?"Write":"Preview",onClick:n})]})]})}function vf({mentionsEnabled:e=!1,label:t,onEditText:n=(()=>{}),text:r,textStyle:o={},showHelpLink:i=!0,usersForMentions:a,mentions:s,mentionMode:l,onInsertMentionSuggestion:c}){const[u,d]=oe(!1),h=le(null),m=ce((()=>function({text:e,mentionMode:t,mentions:n=[]}){return e.replace(Jp,((e,r)=>{const o=document.createElement("div");o.innerHTML=e
|
|
561
|
+
;const i=o.querySelector("a[data-hyp-mention]")?.getAttribute("data-userid"),a=n.find((({original_userid:e})=>e===i));return"username"===t?`@${a?.username??r}`:ef(a?.display_name||r)}))}({text:r,mentionMode:l,mentions:s})),[l,s,r]);ae((()=>{u||h.current?.focus()}),[u]);const p=e=>{h.current&&(!function(e,t){const n=e=>{const n=e({text:t.value,selectionStart:t.selectionStart,selectionEnd:t.selectionEnd});t.value=n.text,t.selectionStart=n.selectionStart,t.selectionEnd=n.selectionEnd,t.focus()},r=e=>{const t=e.text.slice(0,e.selectionStart);return 0===t.length||"\n"===t.slice(-1)||"$$"===t.slice(-2)?af(e,"$$","$$","Insert LaTeX"):af(e,"\\(","\\)","Insert LaTeX")};switch(e){case"bold":n((e=>af(e,"**","**","Bold")));break;case"italic":n((e=>af(e,"*","*","Italic")));break;case"quote":n((e=>cf(e,"> ")));break;case"link":n((e=>of(e)));break;case"image":n((e=>of(e,nf.IMAGE_LINK)));break;case"math":n(r);break;case"numlist":n((e=>cf(e,(e=>`${e+1}. `))));break;case"list":n((e=>cf(e,"* ")));break;case"mention":
|
|
562
|
+
n((e=>af(e,"@","",""))),t.dispatchEvent(new KeyboardEvent("input",{key:"@"}))}}(e,h.current),n(h.current.value))};return Qe("div",{className:"leading-none",children:[Qe(gf,{onCommand:p,isPreviewing:u,onTogglePreview:()=>d(!u),showHelpLink:i,mentionsEnabled:e}),u?Qe(Fp,{markdown:r,classes:"border bg-grey-1 p-2",style:o,mentions:s,mentionsEnabled:e,mentionMode:l}):Qe(ff,{"aria-label":t,placeholder:t,dir:"auto",classes:Xe("w-full min-h-[8em] resize-y","rounded-t-none","text-base touch:text-touch-base"),containerRef:h,onKeyDown:e=>{if(e.ctrlKey||e.metaKey)for(const[t,n]of Object.entries(mf))n===e.key&&(e.stopPropagation(),e.preventDefault(),p(t))},onEditText:n,value:m,style:o,mentionsEnabled:e,usersForMentions:a,mentionMode:l,onInsertMentionSuggestion:c})]})}function bf({classes:e,direction:t="up"}){return Qe("up"===t?Kn:Vn,{className:Xe("absolute inline z-2 text-grey-3 fill-white",e)})}const yf=e=>e;function _f({activeItem:e=-1,id:t,itemPrefixId:n,list:r,listFormatter:o=yf,onSelectItem:i,open:a=!1}){
|
|
563
|
+
const s=ce((()=>r.map(((t,r)=>{const a=n?{id:`${n}${r}`}:{};return Qe("li",{role:"option","aria-selected":e===r,className:Xe("flex items-center","border-l-4 py-1 px-3 cursor-pointer hover:bg-grey-2","touch:h-touch-minimum",{"border-brand bg-grey-1":e===r,"border-transparent":e!==r}),onClick:()=>{i(t)},...a,children:o(t,r)},`AutocompleteList-${r}`)}))),[e,n,r,o,i]),l=t?{id:t}:{},c=0===r.length||!a;return Qe("div",{className:"relative",children:Qe("div",{className:Xe({hidden:c},"absolute top-[3px] z-3","min-w-[10em]"),"data-testid":"autocomplete-list-container",children:Qe(st,{width:"auto",classes:"overflow-hidden",children:[Qe("ul",{tabIndex:-1,"aria-label":"Suggestions",role:"listbox",...l,children:s}),Qe(bf,{direction:"up",classes:"top-[-8px] left-2"})]})})})}let wf=0;var xf=Eo((function({onAddTag:e,onRemoveTag:t,onTagInput:n,tagList:r,tags:o}){const i=le(),[a,s]=oe([]),[l,c]=oe(-1),[u,d]=oe(!1),[h]=oe((()=>(++wf,`TagEditor-${wf}`))),m=le(null);Te(m,(()=>d(!1)),{enabled:u})
|
|
564
|
+
;const p=()=>i.current.value.trim(),f=()=>p()&&p().length>0,g=()=>{i.current.value="",n?.("")},v=t=>{e(t)&&(d(!1),c(-1),g(),i.current.focus())},b=e=>{let t=l+e;t<-1?t=a.length-1:t>=a.length&&(t=-1),c(t)},y=l>=0?`${h}-AutocompleteList-item-${l}`:"";return Qe("div",{className:"space-y-4",children:[Qe(qp,{children:r.map((e=>Qe(Up,{onRemoveTag:t,tag:e},e)))}),Qe("div",{id:h,"data-testid":"combobox-container",ref:m,children:[Qe(Br,{onInput:()=>{n?.(p()),(()=>{if(f()){const e=o.filter(p());s(((e,t)=>{const n=[];for(const r of e)t.indexOf(r)<0&&n.push(r);return n.sort()})(e,r)),d(e.length>0)}else d(!1);c(-1)})()},onKeyDown:e=>{switch(e.key){case"ArrowUp":b(-1),e.preventDefault();break;case"ArrowDown":b(1),e.preventDefault();break;case"Escape":g(),e.preventDefault();break;case"Enter":case",":v(-1===l?p():a[l]),e.preventDefault();break;case"Tab":if(!f())break;-1!==l?v(a[l]):1===a.length?v(a[0]):v(p()),e.preventDefault()}},onFocus:()=>{f()&&d(!0)},elementRef:i,placeholder:"Add new tags",type:"text",autoComplete:"off",
|
|
565
|
+
"aria-autocomplete":"list","aria-activedescendant":y,"aria-controls":`${h}-AutocompleteList`,"aria-expanded":u,"aria-label":"Add tags",dir:"auto",role:"combobox",classes:Xe("text-base touch:text-touch-base")}),Qe(_f,{id:`${h}-AutocompleteList`,list:a,listFormatter:e=>{const t=p().toLowerCase(),n=e.toLowerCase().indexOf(t);if(-1===n)return Qe("span",{children:e});const r=e.slice(0,n),o=e.slice(n,n+t.length),i=e.slice(n+t.length);return Qe("span",{children:[Qe("strong",{children:r}),o,Qe("strong",{children:i})]})},open:u,onSelectItem:e=>{e&&v(e)},itemPrefixId:`${h}-AutocompleteList-item-`,activeItem:l})]})]})}),["tags"]);let kf=0;function Nf(e){e.preventDefault(),e.returnValue=!0}function Sf(){return Qe("div",{className:"pt-2 border-t text-xs leading-none",children:Qe(ho,{href:"http://creativecommons.org/publicdomain/zero/1.0/",target:"_blank",title:"View more information about the Creative Commons Public Domain dedication",underline:"none",variant:"text-light",children:Qe("div",{className:"flex items-center",
|
|
566
|
+
children:[Qe(St,{className:"w-[10px] h-[10px]"}),Qe(Tt,{className:"w-[10px] h-[10px] ml-px"}),Qe("div",{className:"ml-1",children:"Annotations can be freely reused by anyone for any purpose."})]})})})}function Af(e){return null!==e.offsetParent}function Tf({className:e,closeMenu:t,children:n,visible:r}){const o=le(null);ae((()=>{let e;return r&&(e=setTimeout((()=>{const e=o.current.querySelector('[role^="menuitem"]');e&&e.focus()}))),()=>{clearTimeout(e)}}),[r]);return Qe("div",{role:"menu",className:e,ref:o,onKeyDown:e=>{const n=Array.from(o.current.querySelectorAll('[role^="menuitem"]')).filter(Af);let r=n.findIndex((e=>e.contains(document.activeElement))),i=!1;switch(e.key){case"ArrowLeft":case"Escape":t&&(t(e),i=!0);break;case"ArrowUp":r-=1,r<0&&(r=n.length-1),i=!0;break;case"ArrowDown":r+=1,r===n.length&&(r=0),i=!0;break;case"Home":r=0,i=!0;break;case"End":r=n.length-1,i=!0}i&&r>=0&&(e.stopPropagation(),e.preventDefault(),n[r].focus())},children:n})}let Ef=!1;const Cf=()=>{}
|
|
566
567
|
;function Mf({align:e="left",children:t,containerPositioned:n=!0,contentClass:r,defaultOpen:o=!1,disabled:i=!1,label:a,open:s,onOpenChanged:l,menuIndicator:c=!0,title:u}){let[d,h]=oe(o);"boolean"==typeof s&&(d=s,h=l||Cf);const m=le(d);ae((()=>{"function"==typeof l&&m.current!==d&&(m.current=d,l(d))}),[d,l]);const p=e=>{if("mousedown"===e.type)Ef=!0;else if("click"===e.type&&Ef)return Ef=!1,e.stopPropagation(),void e.preventDefault();h(!d)},f=ue((()=>h(!1)),[h]),g=le(null);Te(g,f,{enabled:d});const v=e=>e.stopPropagation();return Qe("div",{className:"relative","data-testid":"menu-container",ref:g,style:{position:n?"relative":"static"},onClick:v,onMouseDown:v,children:[Qe("button",{"aria-expanded":d?"true":"false","aria-haspopup":!0,className:Xe("focus-visible-ring","flex items-center justify-center rounded transition-colors",{"text-grey-7 hover:text-grey-9":!d,"text-brand":d}),"data-testid":"menu-toggle-button",disabled:i,onMouseDown:p,onClick:p,"aria-label":u,title:u,children:Qe("span",{
|
|
567
568
|
className:"flex items-center gap-x-1",children:[a,c&&Qe("span",{className:Xe({"rotate-180 text-color-text":d}),children:Qe(jn,{className:"w-2.5 h-2.5"})})]})}),d&&Qe("div",{className:Xe("focus-visible-ring","absolute top-[calc(100%+3px)] z-1","border shadow-intense rounded-lg overflow-hidden bg-white text-md",{"left-0":"left"===e,"right-0":"right"===e},r),"data-testid":"menu-content",role:"menu",tabIndex:-1,onClick:f,onKeyDown:e=>{const t=e.key;"Enter"!==t&&" "!==t||setTimeout((()=>{f()}))},children:Qe(Tf,{visible:!0,children:t})})]})}function If({title:e,isExpanded:t,onToggleSubmenu:n}){const r=t?Hn:jn;return Qe("div",{"data-testid":"submenu-toggle",role:"none",className:Xe("flex flex-col items-center justify-center w-10 h-10","text-grey-6 bg-grey-1","bg-clip-content border-[8px] border-transparent rounded-xl","group-hover:hover:text-grey-8",{"bg-grey-4":t,"group-hover:bg-grey-3":!t}),onClick:n,title:e,children:Qe(r,{className:"w-3 h-3",viewBox:"0 0 16 16"})})}
|
|
568
569
|
function zf({href:e,icon:t,isDisabled:n,isExpanded:r,isSelected:o,isSubmenuItem:i,isSubmenuVisible:a,label:s,leftChannelContent:l,onClick:c,onToggleSubmenu:u,submenu:d,submenuToggleTitle:h}){const m=le(null);let p,f;const g="boolean"==typeof a,v="boolean"==typeof o;ae((()=>()=>{clearTimeout(p)}),[]);const b=e=>{switch(e.key){case"ArrowRight":u&&(e.stopPropagation(),e.preventDefault(),u(e));break;case"Enter":case" ":c&&c(e)}},_=t?Qe(t,{className:"h-3 w-3"}):null,w=i?null:_,x=i?_:null,k=!!x,N=Qe(y,{children:[(l||i||!!w)&&Qe("div",{className:"w-7 flex items-center justify-center","data-testid":"left-item-container",children:l??w}),Qe("span",{className:"flex items-center grow whitespace-nowrap px-1",children:s}),k&&Qe("div",{className:"w-8 flex items-center justify-center","data-testid":"right-item-container",children:x}),g&&Qe(If,{title:h??("string"==typeof s?`Show actions for ${s}`:"Toggle submenu"),isExpanded:a,onToggleSubmenu:u})]
|
|
@@ -571,12 +572,12 @@ className:"border-y border-grey-3",children:d})})]})}var Of=Eo((function({group:
|
|
|
571
572
|
}),Qe("div",{children:Qe(gr,{"data-testid":"cancel-button",onClick:r,size:"lg",children:[Qe(yt,{}),"Cancel"]})})]})}),["settings"]);function Lf({description:e,onEdit:t}){const[n,r]=oe(!1),o=le(null);return Qe("div",{className:"relative",children:[Qe("div",{className:"flex gap-1 items-center",children:[Qe(Br,{"data-testid":"description",placeholder:"Thumbnail description","aria-label":"Thumbnail description",value:e,onInput:e=>t(e.target.value),maxlength:250,classes:"flex-1"}),Qe(wr,{icon:xn,title:"About thumbnail descriptions",onClick:()=>r(!n),expanded:n,elementRef:o,classes:"text-[16px]"})]}),Qe(Yr,{open:n,align:"right",anchorElementRef:o,onClose:()=>r(!1),classes:Xe("mt-1","w-80 max-w-[100vw]","p-2 text-sm"),children:Qe("div",{className:"flex flex-col gap-y-2",children:["Description of the thumbnail image used for accessibility, search and export to text formats.",Qe(ho,{href:"https://web.hypothes.is/help/how-to-write-alt-text/",underline:"always",target:"_blank",children:"Learn how to write alt text"})]})
|
|
572
573
|
})]})}var Rf=Eo((function({annotation:e,draft:t,annotationsService:n,groups:r,settings:o,tags:i,toastMessenger:a}){const[s,l]=oe(null),c=ds(),u=c.getGroup(e.group),d=ce((()=>ci(e)),[e]),h=ce((()=>Ni(e)&&c.isFeatureEnabled("image_descriptions")),[e,c]),m=!t.isPrivate&&u&&"private"!==u.type,p=ko(o)?.enableHelpPanel??!0,f=t.tags,g=t.text,v=t.description,b=!g&&!f.length&&!v;!function(e,t=window){ae((()=>e?(kf+=1,1===kf&&t.addEventListener("beforeunload",Nf),()=>{kf-=1,0===kf&&t.removeEventListener("beforeunload",Nf)}):()=>{}),[e,t])}(!b);const y=ue((e=>{c.createDraft(t.annotation,{...t,description:e})}),[t,c]),_=ue((e=>{c.createDraft(t.annotation,{...t,tags:e})}),[t,c]),w=ue((e=>{if(!e||f.indexOf(e)>=0)return!1;const t=[...f,e];return i.store(t),_(t),!0}),[_,f,i]),x=ue((e=>{const t=[...f],n=t.indexOf(e);return n>=0&&(t.splice(n,1),_(t),!0)}),[_,f]),k=ue((e=>{c.createDraft(t.annotation,{...t,text:e})}),[t,c]),N=ue((n=>{c.createDraft(e,{...t,isPrivate:n}),d||c.setDefault("annotationPrivacy",n?"private":"shared")
|
|
573
574
|
}),[e,t,d,c]),S=c.defaultAuthority(),A=ce((()=>li(e.user,S)?"display-name":"username"),[e.user,S]),T=le(new Map("username"===A?[]:e.mentions?.filter((e=>!!e.display_name)).map((({userid:e,username:t,display_name:n})=>[n,{userid:e,username:t,displayName:n}])))),E=ue((e=>{const{displayName:t}=e;t&&"display-name"===A&&T.current.set(t,e)}),[A]),C=async()=>{s&&w(s);const t=`${yi(e)} ${ui(e)?"updated":"saved"}`;try{await n.save(e,"username"===A?{mentionMode:A}:{mentionMode:A,usersMap:T.current}),a.success(t,{visuallyHidden:!0}),T.current=new Map}catch{a.error("Saving annotation failed")}},M=ue((()=>{c.removeDraft(e),T.current=new Map,ui(e)||c.removeAnnotations([e])}),[e,c]),I=Ao(["annotationFontFamily"],o),z=c.isFeatureEnabled("at_mentions"),O=c.usersWhoAnnotated(),L=c.usersWhoWereMentioned(),R=c.getFocusedGroupMembers(),P=ce((()=>function({usersWhoAnnotated:e,usersWhoWereMentioned:t,focusedGroupMembers:n,mentionMode:r}){if("loaded"!==n.status)return{status:"loading"}
|
|
574
|
-
;const o=n.members.map((({userid:e,username:t,display_name:n})=>({userid:e,username:t,displayName:n}))),i=new Set,a=[...e,...t,...o].filter((({userid:e})=>{const t=i.has(e);return i.add(e),!t})).sort(((e,t)=>{if("username"===r)return e.username.localeCompare(t.username);const n=e.displayName??"",o=t.displayName??"";return n.localeCompare(o,void 0,{sensitivity:"base"})||e.username.localeCompare(t.username)}));return{status:"loaded",users:a}}({usersWhoAnnotated:O,usersWhoWereMentioned:L,focusedGroupMembers:R,mentionMode:A})),[R,A,O,L]);return ae((()=>{z&&"not-loaded"===R.status&&r.loadFocusedGroupMembers()}),[R,r,z]),Qe("div",{"data-testid":"annotation-editor",className:"space-y-4",onKeyDown:e=>{const t=e.key;b||(e.metaKey||e.ctrlKey)&&"Enter"===t&&(e.stopPropagation(),e.preventDefault(),C())},children:[h&&Qe(Lf,{description:v??"",onEdit:y}),Qe(
|
|
575
|
+
;const o=n.members.map((({userid:e,username:t,display_name:n})=>({userid:e,username:t,displayName:n}))),i=new Set,a=[...e,...t,...o].filter((({userid:e})=>{const t=i.has(e);return i.add(e),!t})).sort(((e,t)=>{if("username"===r)return e.username.localeCompare(t.username);const n=e.displayName??"",o=t.displayName??"";return n.localeCompare(o,void 0,{sensitivity:"base"})||e.username.localeCompare(t.username)}));return{status:"loaded",users:a}}({usersWhoAnnotated:O,usersWhoWereMentioned:L,focusedGroupMembers:R,mentionMode:A})),[R,A,O,L]);return ae((()=>{z&&"not-loaded"===R.status&&r.loadFocusedGroupMembers()}),[R,r,z]),Qe("div",{"data-testid":"annotation-editor",className:"space-y-4",onKeyDown:e=>{const t=e.key;b||(e.metaKey||e.ctrlKey)&&"Enter"===t&&(e.stopPropagation(),e.preventDefault(),C())},children:[h&&Qe(Lf,{description:v??"",onEdit:y}),Qe(vf,{textStyle:I,label:d?"Enter reply":"Enter comment",text:g,onEditText:k,mentionsEnabled:z,usersForMentions:P,showHelpLink:p,mentions:e.mentions,mentionMode:A,
|
|
575
576
|
onInsertMentionSuggestion:E}),Qe(xf,{onAddTag:w,onRemoveTag:x,onTagInput:l,tagList:f}),u&&Qe(Of,{group:u,isDisabled:b,isPrivate:t.isPrivate,onCancel:M,onSave:C,onSetPrivate:N}),m&&Qe(Sf,{})]})}),["annotationsService","groups","settings","tags","toastMessenger"]);var Pf=Eo((function({annotation:e,isEditing:t,replyCount:n,threadIsCollapsed:r,settings:o}){const i=ds(),a=i.defaultAuthority(),s=i.isFeatureEnabled("client_display_names"),l=i.getLink("user",{user:e.user}),c=ce((()=>ks(e,a,s)),[e,a,s]),u=ce((()=>function(e,t,n,r){return!li(e.user,n)&&r?r:(t.usernameUrl&&`${t.usernameUrl}${si(e.user)}`)??void 0}(e,o,a,l)),[e,o,a,l]),d=ci(e)&&r,h=e.links?.html||"",m=ce((()=>function(e){if(!e.updated||!e.created||e.updated===e.created)return!1;const t=new Date(e.created).getTime(),n=new Date(e.updated).getTime();return!isNaN(t)&&!isNaN(n)&&n-t>2e3}(e)&&!d),[e,d]),p="sidebar"!==i.route();let f;"sidebar"!==i.route()&&(f=i.getGroup(e.group));const g=Ai(e);return Qe("header",{children:[Qe("div",{
|
|
576
|
-
className:"flex gap-x-1 items-center flex-wrap-reverse",children:[Cs(e.permissions)&&!t&&Qe(zn,{className:"w-[12px] h-[12px]",title:"This annotation is visible only to you"}),Qe(
|
|
577
|
-
})]})]})}),["settings"]);var Df=Eo((function({quote:e,isHovered:t,isOrphan:n,settings:r}){return Qe(
|
|
578
|
-
className:"flex flex-row justify-center relative","data-testid":"thumbnail-container",children:[i&&Qe("img",{src:i.url,alt:u,className:"border rounded-md",style:{width:`${d}px`,height:`${h}px`}}),!i&&!s&&Qe("span",{"data-testid":"placeholder",children:"Loading thumbnail..."}),!i&&s&&Qe("span",{"data-testid":"error",children:["Unable to render thumbnail: ",s]})]}),i&&u&&o&&Qe(
|
|
579
|
-
const a=ds(),s=xi(e),l=ki(e),c=a.getDraft(e),u=a.profile().userid,d=a.isAnnotationHovered(e.$tag),h=a.isSavingAnnotation(e),m=!!c&&!h,p=t&&o,f=!h&&!m&&ui(e),g=a.defaultAuthority(),v=a.isFeatureEnabled("client_display_names"),b=ce((()=>ks(e,g,v)),[e,g,v]),y=ui(e)?yi(e):`New ${yi(e).toLowerCase()}`,_=a.isAnnotationHighlighted(e)?" - Highlighted":"",w=ce((()=>Ni(e)),[e]);return Qe("article",{className:"space-y-4","aria-label":`${y} by ${b}${_}`,children:[Qe(Pf,{annotation:e,isEditing:m,replyCount:r,threadIsCollapsed:o}),w&&Qe(Ff,{tag:e.$tag,textInImage:w.text,description:l,showDescription:!m}),s&&Qe(Df,{quote:s,isHovered:d,isOrphan:gi(e)}),!p&&!m&&Qe(
|
|
577
|
+
className:"flex gap-x-1 items-center flex-wrap-reverse",children:[Cs(e.permissions)&&!t&&Qe(zn,{className:"w-[12px] h-[12px]",title:"This annotation is visible only to you"}),Qe(Ks,{authorLink:u,displayName:c}),n>0&&d&&Qe(po,{variant:"text-light",onClick:()=>i.setExpanded(e.id,!0),title:"Expand replies",underline:"hover",children:`${n} ${n>1?"replies":"reply"}`}),!t&&e.created&&Qe("div",{className:"flex justify-end grow",children:Qe(Vs,{annotationCreated:e.created,annotationUpdated:e.updated,annotationURL:h,withEditedTimestamp:m})})]}),!ci(e)&&Qe("div",{className:"flex gap-x-1 items-baseline flex-wrap-reverse","data-testid":"extended-header-info",children:[f&&Qe(Bs,{group:f}),!t&&fi(e)&&Qe(bn,{title:"This is a highlight. Click 'edit' to add a note or tag.",className:"w-[10px] h-[10px] text-color-text-light"}),p&&Qe("div",{className:"flex",children:[Qe(js,{annotation:e}),g&&Qe("span",{className:"text-grey-6",children:", "})]}),g&&Qe("span",{className:"text-grey-6","data-testid":"page-number",children:["p. ",g]
|
|
578
|
+
})]})]})}),["settings"]);var Df=Eo((function({quote:e,isHovered:t,isOrphan:n,settings:r}){return Qe(Bp,{collapsedHeight:35,inlineControls:!0,overflowThreshold:20,children:Qe(rl,{classes:Xe({"p-redacted-text":n}),children:Qe("blockquote",{className:Xe("hover:border-l-blue-quote",{"border-l-blue-quote":t}),style:Ao(["selectionFontFamily"],r),children:e})})})}),["settings"]);function Hf({onToggleReplies:e,replyCount:t,threadIsCollapsed:n}){const r=`${n?"Show replies":"Hide replies"} (${t})`;return Qe(gr,{classes:Xe("text-grey-7 enabled:hover:text-brand-dark","enabled:hover:underline"),onClick:e,title:r,variant:"custom",children:r})}var Ff=Eo((function({description:e,textInImage:t,tag:n,thumbnailService:r,showDescription:o=!0}){const[i,a]=oe((()=>r.get(n))),[s,l]=oe(),c=ce((()=>window.devicePixelRatio),[]);let u;ae((()=>{i||s||r.fetch(n,{maxWidth:196*c,devicePixelRatio:c}).then(a).catch((e=>l(e.message)))}),[s,c,n,i,r]),e?u=e:t&&(u=t);const d=i?i.width/c:0,h=i?i.height/c:0,m=he();return Qe(y,{children:[Qe("div",{
|
|
579
|
+
className:"flex flex-row justify-center relative","data-testid":"thumbnail-container",children:[i&&Qe("img",{src:i.url,alt:u,className:"border rounded-md",style:{width:`${d}px`,height:`${h}px`}}),!i&&!s&&Qe("span",{"data-testid":"placeholder",children:"Loading thumbnail..."}),!i&&s&&Qe("span",{"data-testid":"error",children:["Unable to render thumbnail: ",s]})]}),i&&u&&o&&Qe(Bp,{collapsedHeight:35,inlineControls:!0,children:Qe(rl,{"aria-hidden":"true",children:Qe("blockquote",{id:m,children:u})})})]})}),["thumbnailService"]);function jf(){return Qe("div",{className:Xe("flex grow justify-end items-center gap-x-1","h-8 touch:h-touch-minimum"),"data-testid":"saving-message",children:[Qe("span",{className:"text-[16px] animate-fade-in-slow",children:Qe(ro,{size:"sm"})}),Qe("div",{className:"text-color-text-light font-medium",children:"Saving..."})]})}var $f=Eo((function({annotation:e,isReply:t,onToggleReplies:n,replyCount:r,threadIsCollapsed:o,annotationsService:i}){
|
|
580
|
+
const a=ds(),s=xi(e),l=ki(e),c=a.getDraft(e),u=a.profile().userid,d=a.isAnnotationHovered(e.$tag),h=a.isSavingAnnotation(e),m=!!c&&!h,p=t&&o,f=!h&&!m&&ui(e),g=a.defaultAuthority(),v=a.isFeatureEnabled("client_display_names"),b=ce((()=>ks(e,g,v)),[e,g,v]),y=ui(e)?yi(e):`New ${yi(e).toLowerCase()}`,_=a.isAnnotationHighlighted(e)?" - Highlighted":"",w=ce((()=>Ni(e)),[e]);return Qe("article",{className:"space-y-4","aria-label":`${y} by ${b}${_}`,children:[Qe(Pf,{annotation:e,isEditing:m,replyCount:r,threadIsCollapsed:o}),w&&Qe(Ff,{tag:e.$tag,textInImage:w.text,description:l,showDescription:!m}),s&&Qe(Df,{quote:s,isHovered:d,isOrphan:gi(e)}),!p&&!m&&Qe(Vp,{annotation:e}),m&&Qe(Rf,{annotation:e,draft:c}),!p&&Qe("footer",{className:"flex items-center",children:[n&&Qe(Hf,{onToggleReplies:n,replyCount:r,threadIsCollapsed:o}),h&&Qe(jf,{}),f&&Qe(ct,{classes:"grow",children:Qe(Ls,{annotation:e,onReply:()=>{ui(e)&&u&&i.reply(e,u)}})})]})]})}),["annotationsService"])
|
|
580
581
|
;function Bf({isReply:e,replyCount:t,threadIsCollapsed:n,onToggleReplies:r}){return Qe("article",{className:"space-y-4","aria-label":(e?"Reply":"Annotation")+" with unavailable content",children:[Qe("div",{children:Qe("em",{children:"Message not available."})}),r&&Qe("footer",{className:"flex items-center",children:Qe(Hf,{onToggleReplies:r,replyCount:t,threadIsCollapsed:n})})]})}var qf=Eo((function({annotation:e,api:t,toastMessenger:n}){const r=ds(),o=function(e){return e.moderation?e.moderation.flagCount:null}(e);return null!==o&&(o>0||e.hidden)?Qe("div",{className:Xe("flex gap-x-3 bg-grey-1 text-color-text font-semibold","rounded-t-lg overflow-hidden","mb-2 ",{"-mt-3 -ml-3 -mr-3":!ci(e),"-mr-3":ci(e)}),children:[Qe("div",{className:Xe("p-3 text-white",{"bg-red-error":!e.hidden,"bg-grey-6":e.hidden}),children:e.hidden?Qe(gn,{className:"w-em h-em"}):Qe(rn,{className:"w-em h-em"})}),Qe("div",{className:"self-center grow",children:[!e.hidden&&Qe("span",{
|
|
581
582
|
children:["Flagged for review by ",o," ",1===o?"user":"users"]}),e.hidden&&Qe("span",{children:"Hidden from users"})]}),Qe("div",{className:"self-center pr-2",children:Qe(gr,{classes:Xe("px-1.5 py-1","bg-slate-1 text-grey-7 bg-grey-2","enabled:hover:text-grey-9 enabled:hover:bg-grey-3 disabled:text-grey-5","aria-pressed:bg-grey-3 aria-expanded:bg-grey-3"),onClick:e.hidden?()=>{const o=e.id;t.annotation.unhide({id:o}).then((()=>{r.unhideAnnotation(o)})).catch((()=>{n.error("Failed to unhide annotation")}))}:()=>{const o=e.id;t.annotation.hide({id:o}).then((()=>{r.hideAnnotation(o)})).catch((()=>{n.error("Failed to hide annotation")}))},title:e.hidden?"Make this annotation visible to everyone":"Hide this annotation from non-moderators",size:"custom",variant:"custom",children:e.hidden?"Unhide":"Hide"})})]}):null}),["api","toastMessenger"]);function Uf({threadIsCollapsed:e,onToggleReplies:t}){const n=e?wt:jn,r=e?"Expand replies":"Collapse replies";return Qe("div",{className:Xe("cursor-auto",{"bg-thread-line":!e
|
|
582
583
|
}),"data-testid":"thread-collapse-channel",children:Qe("div",{className:Xe("bg-white"),children:Qe(gr,{classes:Xe("-mt-1 touch:min-w-[auto] touch:min-h-[auto] p-[6.5px]","text-grey-5 hover:text-grey-7"),"data-testid":"toggle-button",expanded:!e,title:r,onClick:t,size:"custom",variant:"custom",children:Qe(n,{className:"w-em h-em"})})})})}var Gf=Eo((function e({thread:t,threadsService:n}){const r=!!t.parent,o=t.children.filter((e=>ws(e)>0)),i=ds(),a=i.hasAppliedFilter(),s=t.annotation&&i.isSavingAnnotation(t.annotation),l=t.annotation&&!!i.getDraft(t.annotation)&&!s,c=ue((()=>i.setExpanded(t.id,!!t.collapsed)),[i,t.id,t.collapsed]),u=!r&&!l&&!a&&t.replyCount>0,d=ce((()=>t.visible&&Qe(y,{children:t.annotation?Qe(y,{children:[Qe(qf,{annotation:t.annotation}),Qe($f,{annotation:t.annotation,isReply:r,onToggleReplies:u?c:void 0,replyCount:t.replyCount,threadIsCollapsed:t.collapsed})]}):Qe(Bf,{isReply:r,onToggleReplies:u?c:void 0,replyCount:t.replyCount,threadIsCollapsed:t.collapsed})
|
|
@@ -593,7 +594,7 @@ const e=["quote","text","tag","user"];r=t.terms.map((t=>new yg("or",e.map((e=>n(
|
|
|
593
594
|
return xs([e]).reduce(((e,t)=>t.created>e?t.created:e),"")}function Ig(e){return xs([e]).reduce(((e,t)=>(e||(e=t.created),t.created<e?t.created:e)),"")}function zg(e,t){const n=e??Number.MIN_SAFE_INTEGER,r=t??Number.MIN_SAFE_INTEGER;return Math.sign(n-r)}function Og(e,t){return e===t?0:e<t?-1:1}function Lg(e,t,n){switch(n.sortBy){case"newest":{const n=Mg(e);return Og(Mg(t),n)}case"oldest":return Og(Ig(e),Ig(t));case"location":return function(e,t){if(!e.annotation||!t.annotation)return function(e,t){return e.annotation||t.annotation?e.annotation?1:-1:0}(e,t);const n=_i(e.annotation),r=_i(t.annotation);if(n.cfi||r.cfi){const e="/0",t=dg(n.cfi??e,r.cfi??e);if(0!==t)return Math.sign(t)}const o=zg(n.pageIndex,r.pageIndex);if(0!==o)return o;const i=zg(n.top,r.top);if(0!==i)return i;const a=zg(n.charOffset,r.charOffset);if(0!==a)return a;return Og(e.annotation.created,t.annotation.created)}(e,t);default:return 0}}const Rg=function(e){if(1!==e.length)throw new Error("Memoize input must be a function of one argument")
|
|
594
595
|
;let t,n;return function(r){return r===t||(t=r,n=e(r)),n}}((function(e){const t=e.selection,n={expanded:t.expanded,forcedVisible:t.forcedVisible,selected:t.selected,sortCompareFn:(e,n)=>Lg(e,n,{sortBy:t.sortKey})};if(!!t.filterQuery||Object.keys(t.filters).length>0){const e=function(e,t={}){const n=e=>{const n=t[e];return"string"==typeof n?[n]:[]},r=n("cfi"),o=n("page"),i=n("quote"),a=n("tag"),s=n("text"),l=n("uri"),c=n("user"),u=[],d=[],h=Tg(e,kg);for(const e of h){const t=e.slice(0,e.indexOf(":")),n=e.slice(t.length+1);switch(t){case"cfi":r.push(n);break;case"quote":i.push(n);break;case"page":o.push(n);break;case"since":{const t=86400,n={sec:1,min:60,hour:3600,day:t,week:7*t,month:30*t,year:365*t},r=e.slice(6).toLowerCase().match(/^(\d+)(sec|min|hour|day|week|month|year)?$/);if(r){const e=parseFloat(r[1]),t=r[2]||"sec";d.push(e*n[t])}}break;case"tag":a.push(n);break;case"text":s.push(n);break;case"uri":l.push(n);break;case"user":c.push(n);break;default:u.push(e)}}return{any:{terms:u,operator:"and",
|
|
595
596
|
filterReplies:!0},cfi:{terms:r,operator:"or",filterReplies:!1},quote:{terms:i,operator:"and",filterReplies:!1},page:{terms:o,operator:"or",filterReplies:!1},since:{terms:d,operator:"and",filterReplies:!0},tag:{terms:a,operator:"and",filterReplies:!0},text:{terms:s,operator:"and",filterReplies:!0},uri:{terms:l,operator:"or",filterReplies:!1},user:{terms:c,operator:"or",filterReplies:!0}}}(t.filterQuery||"",t.filters),r={},o={};for(const[t,n]of Object.entries(e))n.filterReplies?r[t]=n:o[t]=n;n.filterFn=e=>xg([e],r).length>0,Object.values(o).some((e=>e.terms.length>0))&&(n.threadFilterFn=e=>!!e.annotation&&xg([e.annotation],o).length>0)}const r=lg(e.annotations,n),o={annotation:0,note:0,orphan:0};return e.showTabs&&(r.children=r.children.filter((e=>{if(!e.annotation)return!1;if(mi(e.annotation))return!1;const n=Cg(e.annotation);return o[n]+=1,n===t.selectedTab}))),{tabCounts:o,rootThread:r}}));function Pg(){
|
|
596
|
-
const e=ds(),t=e.allAnnotations(),n=e.filterQuery(),r=e.route(),o=e.selectionState(),i=e.getFilterValues(),a="sidebar"===r,s=ce((()=>{const e={...o,filterQuery:n,filters:i};return{annotations:t,selection:e,showTabs:a}}),[t,n,o,i,a]);return Rg(s)}var Dg,Hg,Fg=Eo((function({loadAnnotationsService:e,onLogin:t}){const n=ds(),r=n.routeParams().id??"",{rootThread:o}=Pg(),i=n.profile().userid,[a,s]=oe(!1);return ae((()=>{s(!1),n.clearAnnotations(),e.loadThread(r).then((e=>{const t=e.filter((e=>0===(e.references||[]).length))[0];t&&(e.forEach((e=>e.id&&n.setExpanded(e.id,!0))),t.id!==r&&n.highlightAnnotations([r]))})).catch((()=>{s(!0)}))}),[r,i,e,n]),Qe(y,{children:[a&&Qe(hs,{errorType:"annotation",onLoginRequest:t}),Qe(Jf,{threads:o.children})]})}),["loadAnnotationsService"]);class jg{constructor(e,t,n=window){const r="N/A";let o=r;e.userid&&(o=e.userid,e.displayName&&(o=`${e.displayName} (${o})`)),this.version="1.
|
|
597
|
+
const e=ds(),t=e.allAnnotations(),n=e.filterQuery(),r=e.route(),o=e.selectionState(),i=e.getFilterValues(),a="sidebar"===r,s=ce((()=>{const e={...o,filterQuery:n,filters:i};return{annotations:t,selection:e,showTabs:a}}),[t,n,o,i,a]);return Rg(s)}var Dg,Hg,Fg=Eo((function({loadAnnotationsService:e,onLogin:t}){const n=ds(),r=n.routeParams().id??"",{rootThread:o}=Pg(),i=n.profile().userid,[a,s]=oe(!1);return ae((()=>{s(!1),n.clearAnnotations(),e.loadThread(r).then((e=>{const t=e.filter((e=>0===(e.references||[]).length))[0];t&&(e.forEach((e=>e.id&&n.setExpanded(e.id,!0))),t.id!==r&&n.highlightAnnotations([r]))})).catch((()=>{s(!0)}))}),[r,i,e,n]),Qe(y,{children:[a&&Qe(hs,{errorType:"annotation",onLoginRequest:t}),Qe(Jf,{threads:o.children})]})}),["loadAnnotationsService"]);class jg{constructor(e,t,n=window){const r="N/A";let o=r;e.userid&&(o=e.userid,e.displayName&&(o=`${e.displayName} (${o})`)),this.version="1.1664.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||r,
|
|
597
598
|
this.fingerprint=t[0]?.metadata?.documentFingerprint??r,this.account=o,this.timestamp=(new Date).toString();const i=t[0]?.segment;if(i){const e=[];if(i.cfi&&e.push(["CFI",i.cfi]),i.pages){const t=`${i.pages.start}-${i.pages.end}`;e.push(["Pages",t])}i.url&&e.push(["URL",i.url]),this.segment=e.map((([e,t])=>`${e}: ${t}`)).join(", ")}}asFormattedString(){return`Version: ${this.version}\nUser Agent: ${this.userAgent}\nURL: ${this.urls}\nFingerprint: ${this.fingerprint}\nAccount: ${this.account}\nDate: ${this.timestamp}\n`}asEncodedURLString(){return encodeURIComponent(this.asFormattedString())}}var $g=function(){if(Hg)return Dg;Hg=1;var e="complete",t="canceled";function n(e,t,n){e.self===e?e.scrollTo(t,n):(e.scrollLeft=t,e.scrollTop=n)}function r(t){var o=t._scrollSettings;if(o){var i=o.maxSynchronousAlignments,a=function(e,t){
|
|
598
599
|
var n,r,o,i,a,s,l,c=e.align,u=e.target.getBoundingClientRect(),d=c&&null!=c.left?c.left:.5,h=c&&null!=c.top?c.top:.5,m=c&&null!=c.leftOffset?c.leftOffset:0,p=c&&null!=c.topOffset?c.topOffset:0,f=d,g=h;if(e.isWindow(t))s=Math.min(u.width,t.innerWidth),l=Math.min(u.height,t.innerHeight),r=u.left+t.pageXOffset-t.innerWidth*f+s*f,o=u.top+t.pageYOffset-t.innerHeight*g+l*g,r-=m,o-=p,r=e.align.lockX?t.pageXOffset:r,o=e.align.lockY?t.pageYOffset:o,i=r-t.pageXOffset,a=o-t.pageYOffset;else{s=u.width,l=u.height,n=t.getBoundingClientRect();var v=u.left-(n.left-t.scrollLeft),b=u.top-(n.top-t.scrollTop);r=v+s*f-t.clientWidth*f,o=b+l*g-t.clientHeight*g,r-=m,o-=p,r=Math.max(Math.min(r,t.scrollWidth-t.clientWidth),0),o=Math.max(Math.min(o,t.scrollHeight-t.clientHeight),0),r=e.align.lockX?t.scrollLeft:r,o=e.align.lockY?t.scrollTop:o,i=r-t.scrollLeft,a=o-t.scrollTop}return{x:r,y:o,differenceX:i,differenceY:a}}(o,t),s=Date.now()-o.startTime,l=Math.min(1/o.time*s,1);if(o.endIterations>=i)return n(t,a.x,a.y),
|
|
599
600
|
t._scrollSettings=null,o.end(e);var c=1-o.ease(l);if(n(t,a.x-a.differenceX*c,a.y-a.differenceY*c),s>=o.time)return o.endIterations++,o.scrollAncestor&&r(o.scrollAncestor),void r(t);!function(e){if("requestAnimationFrame"in window)return window.requestAnimationFrame(e);setTimeout(e,16)}(r.bind(null,t))}}function o(e){return e.self===e}function i(e){return"pageXOffset"in e||(e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth)&&"hidden"!==getComputedStyle(e).overflow}function a(){return!0}function s(e){if(e.assignedSlot)return s(e.assignedSlot);if(e.parentElement)return"body"===e.parentElement.tagName.toLowerCase()?e.parentElement.ownerDocument.defaultView||e.parentElement.ownerDocument.ownerWindow:e.parentElement;if(e.getRootNode){var t=e.getRootNode();if(11===t.nodeType)return t.host}}return Dg=function(n,l,c){if(n){"function"==typeof l&&(c=l,l=null),l||(l={}),l.time=isNaN(l.time)?1e3:l.time,l.ease=l.ease||function(e){return 1-Math.pow(1-e,e/2)},l.align=l.align||{}
|
|
@@ -650,7 +651,7 @@ className:"container",children:[Qe(jv,{}),Qe(Zg,{}),Qe(sb,{}),Qe(Ev,{shareTab:!h
|
|
|
650
651
|
const t=e.join();bb.has(t)||(console.warn(...e),bb.add(t))}var _b,wb;yb.reset=()=>{bb.clear()};var xb=Ge(wb?_b:(wb=1,_b=e=>{if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}));function kb(e){const t=ko(e);return!t||!!t.allowLeavingGroups}const Nb="__world__";function Sb(e,t,n,r){const o=t.find((e=>e.id===Nb));o&&e.unshift(o);const i=e.map((e=>e.id));t=t.filter((e=>!i.includes(e.id))),t.forEach((e=>e.isMember=!1)),e.forEach((e=>e.isMember=!0));const a=e.concat(t);for(const e of a)e.canLeave=kb(r)&&e.isMember&&e.id!==Nb;return a.forEach((e=>e.isScopedToUri=function(e,t){if(e.scopes&&e.scopes.uri_patterns.length>0&&t)return function(e,t){return t.some((t=>e.match(t.split("*").map(xb).join(".*"))))}(t,e.scopes.uri_patterns);return!0}(e,n))),a}let Ab=[];const Tb=e=>({changeFocusModeUser:t=>{e.changeFocusModeUser(t);const n=t?.groups??[],r=function(e,t){return function(e,t){
|
|
651
652
|
return t.filter((t=>e.includes(t.id)||t.groupid&&e.includes(t.groupid)))}(e,t).map((e=>e.id))}(n,e.allGroups());n.length&&!r.length&&console.error("No matching groups found in list of filtered group IDs"),e.filterGroups(r)},showContentInfo:t=>{e.setContentInfo(t)}});function Eb(e,t,n){const r=Tb(e);function o(e){const n=t.rpcAllowedOrigins||[];if(null==(o=e.data)||"object"!=typeof o||"2.0"!==o.jsonrpc)return;var o;if(!n.includes(e.origin))return void yb(`Ignoring JSON-RPC request from non-whitelisted origin ${e.origin}`);const i=e.data;e.source.postMessage(function(e){const t=r[e.method];if(void 0===t)return{jsonrpc:"2.0",id:e.id,error:{code:-32601,message:"Method not found"}};e.params?t(...e.params):t();return{jsonrpc:"2.0",result:"ok",id:e.id}}(i),e.origin)}Ab.forEach((e=>{o(e)})),Ab=[],window.removeEventListener("message",Cb),n.addEventListener("message",o)}function Cb(e){Ab.push(e)}Eb.$inject=["store","settings","$window"];class Mb{constructor(e){this._api=e}trackEvent(e){
|
|
652
653
|
this._api.analytics.events.create({},{event:e}).catch((t=>console.warn(`Could not track event "${e}"`,t)))}}Mb.$inject=["api"];class Ib{constructor(e){this._rpc=e.rpc,this._reportConfig=e.reportActivity}reportActivity(e,t){if(!this._rpc||!this._reportConfig)return;let n;switch(e){case"create":n=new Date(t.created).toISOString();break;case"update":n=new Date(t.updated).toISOString();break;default:n=(new Date).toISOString()}const r={date:n,annotation:{id:t.id,isShared:Es(t.permissions)}};this._reportConfig.events.includes(e)&&function(e,t,n,r=[]){const o={jsonrpc:"2.0",method:n,params:r};e.postMessage(o,t)}(this._rpc.targetFrame,this._rpc.origin,this._reportConfig.method,[e,r])}}Ib.$inject=["settings"];class zb{constructor(e,t,n,r){this._activity=e,this._api=t,this._settings=n,this._store=r}_applyDraftChanges(e,t){const n={},r=this._store.getDraft(e),o=ai(this._store.profile().userid)?.provider??this._store.defaultAuthority(),i=this._store.isFeatureEnabled("at_mentions");if(!r)return{...e}
|
|
653
|
-
;i?"username"===t.mentionMode?n.text=function(e,t){return e.replace(
|
|
654
|
+
;i?"username"===t.mentionMode?n.text=function(e,t){return e.replace(Kp,((e,n,r)=>`${n}${Zp(function(e,t){return`acct:${e}@${t}`}(r,t),`@${r}`)}`))}(r.text,o):n.text=function(e,t){return e.replace(Xp,((e,n,r)=>{const o=t.get(r);return o?`${n}${Zp(o.userid,`@${r}`)}`:`${n}${ef(r)}`}))}(r.text,t.usersMap):n.text=r.text,n.tags=r.tags,n.permissions=r.isPrivate?Ss(e.user):As(e.user,e.group);const a=e.target;if(a[0]&&a[0].description!==r.description){const e=structuredClone(a);e[0].description=r.description,n.target=e}return{...e,...n}}annotationFromData(e,t=new Date){const n=this._store.getDefault("annotationPrivacy"),r=this._store.focusedGroupId(),o=this._store.profile();if(!r)throw new Error("Cannot create annotation without a group");const i=o.userid;if(!i)throw new Error("Cannot create annotation when logged out");const a=o.user_info,s=`s:${db(8)}`,l=Object.assign({created:t.toISOString(),group:r,permissions:Ts(i,r,n),tags:[],text:"",updated:t.toISOString(),user:i,user_info:a,$tag:s,hidden:!1,links:{},
|
|
654
655
|
document:{title:""}},e);return fi(l)&&(l.permissions=Ss(i)),this._settings.annotationMetadata&&(l.metadata={...this._settings.annotationMetadata}),l}create(e,t=new Date){const n=this.annotationFromData(e,t);this._store.addAnnotations([n]),this._store.deleteNewAndEmptyDrafts(),fi(n)||this._store.createDraft(n,{tags:n.tags,text:n.text,isPrivate:Cs(n.permissions),description:n.target[0]?.description}),vi(n)?this._store.selectTab("note"):bi(n)&&this._store.selectTab("annotation"),(n.references||[]).forEach((e=>{this._store.setExpanded(e,!0)}))}createPageNote(){const e=this._store.mainFrame();if(!this._store.isLoggedIn())return void this._store.openSidebarPanel("loginPrompt");if(!e)return;const t={target:[{source:e.uri}],uri:e.uri};this.create(t)}async delete(e){await this._api.annotation.delete({id:e.id}),this._activity.reportActivity("delete",e),this._store.removeAnnotations([e])}async flag(e){await this._api.annotation.flag({id:e.id}),this._activity.reportActivity("flag",e),this._store.updateFlagStatus(e.id,!0)
|
|
655
656
|
}reply(e,t){const n={group:e.group,permissions:Cs(e.permissions)?Ss(t):As(t,e.group),references:(e.references||[]).concat(e.id),target:[{source:e.target[0].source}],uri:e.uri};this.create(n)}async save(e,t={mentionMode:"username"}){let n,r;const o=this._applyDraftChanges(e,t);let i;ui(e)?(n=this._api.annotation.update({id:e.id},o),r="update"):(n=this._api.annotation.create({},o),r="create"),this._store.annotationSaveStarted(e);try{i=await n,this._activity.reportActivity(r,i)}finally{this._store.annotationSaveFinished(e)}for(const[t,n]of Object.entries(e))if(t.startsWith("$")){i[t]=n}return this._store.removeDraft(e),this._store.addAnnotations([i]),i}}if(zb.$inject=["annotationActivity","api","settings","store"],"function"!=typeof Symbol){var Ob=0;Symbol=function(e){return"@@"+e+ ++Ob},Symbol.for=function(e){return"@@"+e}}
|
|
656
657
|
var Lb=/^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,Rb=/[\s\n\\/='"\0<>]/,Pb=/^(xlink|xmlns|xml)([A-Z])/,Db=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,Hb=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,Fb=/["&<]/;function jb(e){if(0===e.length||!1===Fb.test(e))return e;for(var t=0,n=0,r="",o="";n<e.length;n++){switch(e.charCodeAt(n)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=o,t=n+1}return n!==t&&(r+=e.slice(t,n)),r}var $b=function(e,t){return String(e).replace(/(\n+)/g,"$1"+(t||"\t"))},Bb=function(e,t,n){
|
|
@@ -678,10 +679,10 @@ null==v._nextState&&null==v.__s&&(v._nextState=v.__s=v.state),v.context=_,h.getD
|
|
|
678
679
|
Total replies: ${l.length}
|
|
679
680
|
|
|
680
681
|
${u.join("\n\n")}`}buildCSVExportContent(e,{groupName:t="",defaultAuthority:n="",displayNamesEnabled:r=!1,separator:o=","}={}){const{uri:i,extractUsername:a}=this._exportCommon(e,{displayNamesEnabled:r,defaultAuthority:n}),s=e=>[My(new Date(e.created)),a(e),Ai(e)??"",i,t,yi(e),xi(e)??ki(e)??"",e.text,e.tags.join(",")].map((e=>function(e,t){return new RegExp(`["\n\r${t}]`).test(e)?`"${e.replace(/"/g,'""')}"`:e}(e,o))).join(o);return`${["Created at","Author","Page","URL","Group","Type","Quote/description","Comment","Tags"].join(o)}\n${e.map((e=>s(e))).join("\n")}`}buildHTMLExportContent(e,{groupName:t="",displayNamesEnabled:n=!1,defaultAuthority:r="",now:o=new Date}={}){const{uri:i,title:a,uniqueUsers:s,replies:l,extractUsername:c}=this._exportCommon(e,{displayNamesEnabled:n,defaultAuthority:r});return function(e,t,n){var r=Object.assign({},Ay,n||{});return r.jsx||(r.attributeHook=null),Qb(e,t,r)}(Qe("html",{lang:"en",children:[Qe("head",{children:[Qe("title",{children:`Annotations on "${a}"`
|
|
681
|
-
}),Qe("meta",{charSet:"UTF-8"})]}),Qe("body",{children:[Qe("section",{children:[Qe("h1",{children:"Summary"}),Qe("p",{children:Qe("time",{dateTime:o.toISOString(),children:My(o)})}),Qe("p",{children:Qe("strong",{children:a})}),Qe("p",{children:Qe("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:i})}),Qe("table",{children:Qe("tbody",{style:{verticalAlign:"top"},children:[Qe("tr",{children:[Qe("td",{children:"Group:"}),Qe("td",{children:t})]}),Qe("tr",{children:[Qe("td",{children:"Total users:"}),Qe("td",{children:s.length})]}),Qe("tr",{children:[Qe("td",{children:"Users:"}),Qe("td",{children:s.join(", ")})]}),Qe("tr",{children:[Qe("td",{children:"Total annotations:"}),Qe("td",{children:e.length})]}),Qe("tr",{children:[Qe("td",{children:"Total replies:"}),Qe("td",{children:l.length})]})]})})]}),Qe("hr",{}),Qe("section",{children:[Qe("h1",{children:"Annotations"}),e.map(((e,t)=>{const n=Ai(e),r=xi(e),o=ki(e),i=
|
|
682
|
+
}),Qe("meta",{charSet:"UTF-8"})]}),Qe("body",{children:[Qe("section",{children:[Qe("h1",{children:"Summary"}),Qe("p",{children:Qe("time",{dateTime:o.toISOString(),children:My(o)})}),Qe("p",{children:Qe("strong",{children:a})}),Qe("p",{children:Qe("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:i})}),Qe("table",{children:Qe("tbody",{style:{verticalAlign:"top"},children:[Qe("tr",{children:[Qe("td",{children:"Group:"}),Qe("td",{children:t})]}),Qe("tr",{children:[Qe("td",{children:"Total users:"}),Qe("td",{children:s.length})]}),Qe("tr",{children:[Qe("td",{children:"Users:"}),Qe("td",{children:s.join(", ")})]}),Qe("tr",{children:[Qe("td",{children:"Total annotations:"}),Qe("td",{children:e.length})]}),Qe("tr",{children:[Qe("td",{children:"Total replies:"}),Qe("td",{children:l.length})]})]})})]}),Qe("hr",{}),Qe("section",{children:[Qe("h1",{children:"Annotations"}),e.map(((e,t)=>{const n=Ai(e),r=xi(e),o=ki(e),i=Np(e.text),a=i===`<p>${e.text}</p>`?e.text:i;return Qe("article",{children:[Qe("h2",{
|
|
682
683
|
children:["Annotation ",t+1,":"]}),Qe("table",{children:Qe("tbody",{style:{verticalAlign:"top"},children:[Qe("tr",{children:[Qe("td",{children:"Created at:"}),Qe("td",{children:Qe("time",{dateTime:e.created,children:My(new Date(e.created))})})]}),Qe("tr",{children:[Qe("td",{children:"Author:"}),Qe("td",{children:c(e)})]}),n&&Qe("tr",{children:[Qe("td",{children:"Page:"}),Qe("td",{children:n})]}),Qe("tr",{children:[Qe("td",{children:"Type:"}),Qe("td",{children:yi(e)})]}),r&&Qe("tr",{children:[Qe("td",{children:"Quote:"}),Qe("td",{children:Qe("blockquote",{style:{margin:0},children:r})})]}),o&&Qe("tr",{children:[Qe("td",{children:"Description:"}),Qe("td",{children:o})]}),Qe("tr",{children:[Qe("td",{children:"Comment:"}),Qe("td",{dangerouslySetInnerHTML:{__html:a}})]}),e.tags.length>0&&Qe("tr",{children:[Qe("td",{children:"Tags:"}),Qe("td",{children:e.tags.join(", ")})]})]})})]},e.id)}))]})]})]}),{},{pretty:!0}).replace(/\t/g," ")}_exportCommon(e,{displayNamesEnabled:t,defaultAuthority:n}){const[r]=e
|
|
683
|
-
;if(!r)throw new Error("No annotations to export");const o=e=>ks(e,n,t),{uri:i,title:a}=
|
|
684
|
-
if(o&&e===r.length-1)return o;break}n=o}return null}(o,t);if(!c)throw new Error(`Missing API route: ${t}`);const u={"Content-Type":"application/json","Hypothesis-Client-Version":"1.
|
|
684
|
+
;if(!r)throw new Error("No annotations to export");const o=e=>ks(e,n,t),{uri:i,title:a}=Rs(r);return{uri:i,title:a,uniqueUsers:[...new Set(e.map((e=>o(e))).filter(Boolean))],replies:e.filter((e=>ci(e))),extractUsername:o}}}Iy.$inject=[];class zy extends Error{constructor(e,t,n=""){let r="Network request failed";t&&(r+=` (${t.status})`),n&&(r+=`: ${n}`),super(r),this.url=e,this.response=t,this.reason=n}}async function Oy(e,t){let n,r;try{n=await fetch(e,t)}catch(t){throw new zy(e,null,t.message)}if(204===n.status)return null;try{r=await n.json()}catch{throw new zy(e,n,"Failed to parse response")}if(!n.ok)throw new zy(e,n,r?.reason);return r}class Ly{constructor(e,t,n){this._clientId=null;const r=e.routes(),o=()=>this._clientId,i=e=>function(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s,l)=>{o();try{const[o,i]=await Promise.all([e,n()]),c=function(e,t){let n=e;const r=t.split(".");for(const[e,t]of r.entries()){const o=n[t];if(!o||"url"in o){
|
|
685
|
+
if(o&&e===r.length-1)return o;break}n=o}return null}(o,t);if(!c)throw new Error(`Missing API route: ${t}`);const u={"Content-Type":"application/json","Hypothesis-Client-Version":"1.1664.0"};i&&(u.Authorization="Bearer "+i);const d=r();d&&(u["X-Client-Id"]=d);const{url:h,unusedParams:m}=Pa(c.url,a),p=new URL(h);for(const[e,t]of Object.entries(m)){const n=Array.isArray(t)?t:[t];for(const t of n)null!=t&&p.searchParams.append(e,t.toString())}return await Oy(p.toString(),{body:s?JSON.stringify(Cy(s)):null,headers:u,method:c.method,signal:l})}finally{i()}}}(r,e,{getAccessToken:()=>t.getAccessToken(),getClientId:o,onRequestStarted:n.apiRequestStarted,onRequestFinished:n.apiRequestFinished});this.search=i("search"),this.annotation={create:i("annotation.create"),delete:i("annotation.delete"),get:i("annotation.read"),update:i("annotation.update"),flag:i("annotation.flag"),hide:i("annotation.hide"),unhide:i("annotation.unhide")},this.group={member:{delete:i("group.member.delete")},members:{read:i("group.members.read")
|
|
685
686
|
},read:i("group.read")},this.groups={list:i("groups.read")},this.profile={groups:{read:i("profile.groups.read")},read:i("profile.read"),update:i("profile.update")},this.analytics={events:{create:i("analytics.events.create")}}}setClientId(e){this._clientId=e}}Ly.$inject=["apiRoutes","auth","store"];var Ry,Py,Dy,Hy,Fy,jy={};function $y(){return Dy||(Dy=1,e=jy,t=function(){if(Py)return Ry;function e(e,t){"boolean"==typeof t&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}return Py=1,Ry=e,e.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},e.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),
|
|
686
687
|
this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},e.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=(new Date).getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var n=this._timeouts.shift();if(void 0===n){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1)}var r=this;return this._timer=setTimeout((function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout((function(){r._operationTimeoutCb(r._attempts)}),r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)}),n),this._options.unref&&this._timer.unref(),!0},e.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout((function(){
|
|
687
688
|
n._operationTimeoutCb()}),n._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},e.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},e.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},e.prototype.start=e.prototype.try,e.prototype.errors=function(){return this._errors},e.prototype.attempts=function(){return this._attempts},e.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var o=this._errors[r],i=o.message,a=(e[i]||0)+1;e[i]=a,a>=n&&(t=o,n=a)}return t},Ry}(),e.operation=function(n){var r=e.timeouts(n);return new t(r,{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n]
|
|
@@ -796,8 +797,8 @@ this._socket?.isConnected()&&this._socket.send(t)}async _reconnect(){const e=awa
|
|
|
796
797
|
this._reconnectSetUp||(this._reconnectSetUp=!0,s_(this._store.subscribe,(()=>this._store.profile().userid),(()=>this._reconnect()))),this._socket||await this._reconnect()}}TS.$inject=["store","apiRoutes","auth","groups","session","$window"];const ES="hypothesis.user.tags.list",CS="hypothesis.user.tags.map";class MS{constructor(e){this._storage=e}filter(e,t=null){const n=this._storage.getObject(ES)||[];let r=0;return n.filter((n=>{if(null!==t&&r>=t)return!1;const o=n.split(/\W+/),i=new RegExp(`^${xb(e)}`,"i");return!(!o.some((e=>e.match(i)))&&!n.match(i))&&(++r,!0)}))}store(e){const t=this._storage.getObject(CS)||{};e.forEach((e=>{t[e]?(t[e].count+=1,t[e].updated=Date.now()):t[e]={text:e,count:1,updated:Date.now()}})),this._storage.setObject(CS,t);const n=Object.keys(t).sort(((e,n)=>t[e].count!==t[n].count?t[n].count-t[e].count:e.localeCompare(n)));this._storage.setObject(ES,n)}}MS.$inject=["localStorage"];class IS{constructor(e){this._store=e}forceVisible(e){e.children.forEach((e=>{this.forceVisible(e)})),
|
|
797
798
|
e.visible||this._store.setForcedVisible(e.id,!0)}}IS.$inject=["store"];class zS{#t=new Map;#n=30;#r;constructor(e){this.#r=e}get cacheSize(){return this.#n}set cacheSize(e){this.#n=e,this.#o()}#o(){for(const e of this.#t.keys()){const t=this.#t.get(e);if(t&&URL.revokeObjectURL(t.url),this.#t.delete(e),this.#t.size<=this.cacheSize)break}}async fetch(e,t={}){const n=this.get(e);if(n)return n;const r=await this.#r.requestThumbnail(e,t),o=await async function(e){const t=new OffscreenCanvas(e.width,e.height);t.getContext("2d").drawImage(e,0,0,e.width,e.height);const n=await t.convertToBlob();return URL.createObjectURL(n)}(r),i={url:o,width:r.width,height:r.height};return this.#t.set(e,i),this.#t.size>this.cacheSize&&this.#o(),i}get(e){const t=this.#t.get(e);return t?(this.#t.delete(e),this.#t.set(e,t),t):null}cachedThumbnailTags(){return[...this.#t.keys()]}}zS.$inject=["frameSync"];class OS extends Jg{constructor(e,t){super(),this._store=e,this._window=t,this._delayedMessageQueue=[],
|
|
798
799
|
this._window.addEventListener("focus",(()=>{this._delayedMessageQueue.forEach((({type:e,messageText:t,options:n})=>this._addMessage(e,t,n))),this._delayedMessageQueue=[]}))}dismiss(e){this._store.getToastMessage(e)&&(this._store.removeToastMessage(e),this.emit("toastMessageDismissed",e))}_addMessage(e,t,{autoDismiss:n=!0,visuallyHidden:r=!1,delayed:o=!1}={}){if(this._store.hasToastMessage(e,t))return;if(o&&!this._window.document.hasFocus()){const o={autoDismiss:n,visuallyHidden:r};return void this._delayedMessageQueue.push({type:e,messageText:t,options:o})}const i={type:e,id:db(10),message:t,visuallyHidden:r,autoDismiss:n};this._store.addToastMessage(i),this.emit("toastMessageAdded",i)}error(e,t){this._addMessage("error",e,t)}success(e,t){this._addMessage("success",e,t)}notice(e,t){this._addMessage("notice",e,t)}}OS.$inject=["store","$window"];const LS=function(e){for(var t={},n=e.querySelectorAll("script.js-hypothesis-config"),r=0;r<n.length;r++){var o=void 0;try{o=JSON.parse(n[r].textContent||"")}catch(e){
|
|
799
|
-
console.warn("Could not parse settings from js-hypothesis-config tags",e),o={}}Object.assign(t,o)}return t}(document),RS=function(e){const{version:t,origin:n}=mb(e.location.href);return"1.
|
|
800
|
-
}(),n=t?[t]:void 0;!function(e={}){const t=!e.skipBrowserExtensionCheck&&hS(),n={...e,enabled:!t&&e.enabled,stackParser:(r=e.stackParser||XN,Array.isArray(r)?ox(...r):r),integrations:uk({integrations:e.integrations,defaultIntegrations:null==e.defaultIntegrations?[Bk(),Fk(),nS(),eS(),sS(),dS(),Zk(),uS(),aS()]:e.defaultIntegrations}),transport:e.transport||$N};var r;Ak(SN,n)}({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.
|
|
800
|
+
console.warn("Could not parse settings from js-hypothesis-config tags",e),o={}}Object.assign(t,o)}return t}(document),RS=function(e){const{version:t,origin:n}=mb(e.location.href);return"1.1664.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.1664.0) than the host page (${t}). It may not work.`),!1):"null"===e.origin?(console.warn("Hypothesis has been loaded in a sandboxed frame. This is not supported."),!1):e.origin===n||(console.warn(`The Hypothesis sidebar is running in a different origin (${e.origin}) than expected (${n}). It may not work.`),!1)}(window);function PS(e,t){e.setClientId(t.clientId)}function DS(e){e.sync()}function HS(e,t){e.load(),t.load()}function FS(e,t,n){e.init(),t.init(),n.init()}function jS(e,t,n){"sidebar"===t.route()&&e.connect().catch((()=>{n.error("Hypothesis failed to connect to the web page. Try reloading the page.",{autoDismiss:!1})}))}LS.sentry&&RS&&function(e){const t=function(){const e=import.meta.url;return e?new URL(e).origin:null
|
|
801
|
+
}(),n=t?[t]:void 0;!function(e={}){const t=!e.skipBrowserExtensionCheck&&hS(),n={...e,enabled:!t&&e.enabled,stackParser:(r=e.stackParser||XN,Array.isArray(r)?ox(...r):r),integrations:uk({integrations:e.integrations,defaultIntegrations:null==e.defaultIntegrations?[Bk(),Fk(),nS(),eS(),sS(),dS(),Zk(),uS(),aS()]:e.defaultIntegrations}),transport:e.transport||$N};var r;Ak(SN,n)}({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1664.0",beforeSend:(e,t)=>{if(mS>=5)return yb("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++mS;try{const n=t&&t.originalException;n instanceof Event&&(e.extra||(e.extra={}),Object.assign(e.extra,{type:n.type,detail:n.detail,isTrusted:n.isTrusted}))}catch{}return e}});try{nk("host_config",mb(window.location.href))}catch{}nk("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),
|
|
801
802
|
e_(((e,t)=>{pS(e,t)}))}(LS.sentry),document.body.addEventListener("click",(e=>{const t=e.target;"A"===t.tagName&&"_blank"===t.target&&(t.rel="noopener")})),PS.$inject=["api","streamer"],DS.$inject=["router"],HS.$inject=["groups","session"],FS.$inject=["autosaveService","persistedDefaults","serviceURL"],jS.$inject=["frameSync","store","toastMessenger"];const $S=document.querySelector("hypothesis-app");!function(e=window){e.addEventListener("message",Cb)}(),async function(e,t=window){const n=function(e){const t=mb(e.location.href),n=["annotations","group","query","appType","openSidebar","showHighlights","services","branding","enableExperimentalNewNoteButton","focus","requestConfigFromFrame","theme","usernameUrl"],r={openSidebar:pb,requestConfigFromFrame:e=>{if("string"==typeof e)return e;const t=function(e){return"object"==typeof e&&null!==e?e:{}}(e);return{origin:gb(t.origin),ancestorLevel:fb(t.ancestorLevel)}}},o={};for(const[e,i]of Object.entries(t))n.includes(e)&&null!==i&&(r[e]?o[e]=r[e](i):o[e]=i)
|
|
802
803
|
;return o}(window),r=function(e,t){const n=e.requestConfigFromFrame;if(!n)return null;if("number"!=typeof n.ancestorLevel||"string"!=typeof n.origin)throw new Error("Improper `requestConfigFromFrame` object. Both `ancestorLevel` and `origin` need to be specified");return{targetFrame:vb(n.ancestorLevel,t),origin:n.origin}}(n,t);let o;if(r){const e=await async function(e,t){return{...await hb(t.targetFrame,t.origin,"requestConfig",[],3e3),...e.group?{group:e.group}:{}}}(n,r);o=function(e,t){const n=e.services;return Array.isArray(n)?(n.forEach(((e,n)=>{"$rpc:requestGroups"===e.groups&&(e.groups=hb(t.targetFrame,t.origin,"requestGroups",[n],0).catch((()=>{throw new Error("Unable to fetch groups")})))})),e):e}(e,r)}else o=n;const i={...e,...o};return r&&(i.rpc=r),i.apiUrl=function(e){const t=ko(e);if(!t)return e.apiUrl;if(t.apiUrl)return t.apiUrl;throw new Error("Service should contain an apiUrl value.")}(i),i}(LS).then((e=>{!function(e,t){const n=new q
|
|
803
804
|
;n.register("analytics",Mb).register("annotationsExporter",Iy).register("annotationsService",zb).register("annotationActivity",Ib).register("api",Ly).register("apiRoutes",Gy).register("auth",Ky).register("autosaveService",Yy).register("dashboard",Xy).register("frameSync",u_).register("groups",m_).register("importAnnotationsService",gS).register("loadAnnotationsService",vS).register("localStorage",yS).register("persistedDefaults",wS).register("router",xS).register("serviceURL",kS).register("session",NS).register("streamer",TS).register("streamFilter",SS).register("tags",MS).register("threadsService",IS).register("thumbnailService",zS).register("toastMessenger",OS).register("store",{factory:us}),n.register("$window",{value:window}).register("settings",{value:e}),n.run(DS),n.run(FS),n.run(PS),n.run(HS),n.run(Eb),n.run(jS),H(Qe(To.Provider,{value:n,children:Qe(lb,{})}),t)}(e,$S)})).catch((e=>function(e,t){console.error("Failed to start Hypothesis client: ",e),H(Qe(cb,{error:e}),t)}(e,$S)));
|