hypothesis 1.1066.0 → 1.1069.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.js +1 -1
- package/build/manifest.json +13 -13
- package/build/scripts/annotator.bundle.js +102 -102
- package/build/scripts/annotator.bundle.js.map +1 -1
- package/build/scripts/sidebar.bundle.js +492 -503
- package/build/scripts/sidebar.bundle.js.map +1 -1
- package/build/scripts/ui-playground.bundle.js +165 -165
- package/build/scripts/ui-playground.bundle.js.map +1 -1
- package/build/styles/annotator.css +91 -854
- package/build/styles/annotator.css.map +1 -1
- package/build/styles/katex.min.css +1 -1
- package/build/styles/sidebar.css +6 -151
- package/build/styles/sidebar.css.map +1 -1
- package/build/styles/ui-playground.css +6 -151
- package/build/styles/ui-playground.css.map +1 -1
- package/package.json +4 -4
|
@@ -1,123 +1,112 @@
|
|
|
1
|
-
function e(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}var t,n,r,o,i,a,s,l={},c=[],u=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function
|
|
2
|
-
(!e.__d&&(e.__d=!0)&&o.push(e)&&!b.__r++||a!==n.debounceRendering)&&((a=n.debounceRendering)||i)(b)}function b(){for(var e;b.__r=o.length;)e=o.sort((function(e,t){return e.__v.__b-t.__v.__b})),o=[],e.some((function(e){var t,n,r,o,i,a;e.__d&&(i=(o=(t=e).__v).__e,(a=t.__P)&&(n=[],(r=
|
|
3
|
-
v.ref&&x.push(v.ref,null,
|
|
4
|
-
"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||u.test(t)?n:n+"px"}function C(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||S(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||S(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r||e.addEventListener(t,i?
|
|
5
|
-
var u,
|
|
6
|
-
t.__v!==r.__v&&(
|
|
7
|
-
n.__e(e,t.__v)}}))}function M(e,n,r,o,i,a,s,c){var u,
|
|
8
|
-
_(e,Array.isArray(
|
|
9
|
-
;if(arguments.length>2&&(s.children=arguments.length>3?t.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return p(e,s,o,i,null)}(m,null,[e]),a||l,l,void 0!==r.ownerSVGElement,!i&&o?[o]:a?null:r.firstChild?t.call(r.childNodes):null,s,!i&&o?o:a?a.__e:r.firstChild,i),N(s,e)}function
|
|
10
|
-
jsonrpc:"2.0",method:n,params:r,id:a};try{e.postMessage(s,t)}catch(e){return Promise.reject(e)}let l;const c=new Promise(((e,n)=>{l=r=>{if(r.origin!==t)return;if(!(r.data instanceof Object)||"2.0"!==r.data.jsonrpc||r.data.id!==a)return;const{error:o,result:i}=r.data;void 0!==o?n(o):void 0!==i?e(i):n(new Error("RPC reply had no result or error"))},i.addEventListener("message",l)})),u=[c];var d
|
|
11
|
-
if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},r=0,f.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=
|
|
12
|
-
var Y=e=>{if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")};function K(e,t,n,r){const o=t.find((e=>"__world__"===e.id));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);return a.forEach((e=>{e.canLeave=!!function(e){const t=
|
|
13
|
-
;r.length&&!o.length&&console.error("No matching groups found in list of filtered group IDs"),e.filterGroups(o)}}))(e);function o(e){let 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 G(`Ignoring JSON-RPC request from non-whitelisted origin ${e.origin}`);let 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)}X.forEach((e=>{o(e)})),X=[],window.removeEventListener("message",J),n.addEventListener("message",o)}function J(e){X.push(e)}
|
|
14
|
-
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}))
|
|
24
|
-
|
|
25
|
-
;return
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return this.
|
|
40
|
-
e.
|
|
41
|
-
this.
|
|
42
|
-
}()
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
e.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
this.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
e
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
;n
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
;function Go({children:e,classes:t,containerRef:n,elementRef:r,...o}){return Ro("div",{className:uo("Hyp-Frame",t),...o,ref:null!=r?r:n,children:e},void 0,!1,{fileName:$o,lineNumber:40,columnNumber:5})}function Vo({children:e,classes:t,containerRef:n,elementRef:r,...o}){return Ro("div",{className:uo("Hyp-Card",t),...o,ref:null!=r?r:n,children:e},void 0,!1,{fileName:$o,lineNumber:63,columnNumber:5})}function Wo({children:e,direction:t="row",classes:n,containerRef:r,elementRef:o,...i}){return Ro("div",{className:uo(`Hyp-Actions--${t}`,n),...i,ref:null!=o?o:r,children:e},void 0,!1,{fileName:$o,lineNumber:89,columnNumber:5})}
|
|
104
|
-
var Yo='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 8l3.536-3.536L8 8 4.464 4.464 8 8zm0 0l-3.536 3.536L8 8l3.536 3.536L8 8z"></path></g></svg>\n',Ko="/home/runner/work/frontend-shared/frontend-shared/src/components/Dialog.js";const Xo=Bo("cancel",Yo);let Zo=0;function Jo(e){const[t]=_o((()=>(++Zo,`${e}-${Zo}`)));return t}function Qo({buttons:e,cancelLabel:t="Cancel",children:n,contentClass:r,icon:o,initialFocus:i,onCancel:a,role:s="dialog",title:l,withCancelButton:c=!0,withCloseButton:u=!0}){const d=Jo("dialog-description"),h=Jo("dialog-title"),p=So();xo((()=>{if(null!==i){const e=null==i?void 0:i.current;e&&!e.disabled?e.focus():p.current.focus()}}),[]),ko((()=>{const e=p.current.querySelector("p");e&&(e.id=d,
|
|
105
|
-
p.current.setAttribute("aria-describedby",d))}),[d]);const m=a&&c,f=e||m;return Ro("div",{"aria-labelledby":h,className:uo("Hyp-Dialog",{"Hyp-Dialog--closeable":a&&u},r),ref:p,role:s,tabIndex:-1,children:[Ro("header",{className:"Hyp-Dialog__header",children:[o&&Ro("div",{className:"Hyp-Dialog__header-icon",children:Ro(Do,{name:o,title:l,"data-testid":"header-icon"},void 0,!1,{fileName:Ko,lineNumber:139,columnNumber:13})},void 0,!1,{fileName:Ko,lineNumber:138,columnNumber:11}),Ro("h2",{className:"Hyp-Dialog__title",id:h,children:l},void 0,!1,{fileName:Ko,lineNumber:142,columnNumber:9}),a&&u&&Ro("div",{className:"Hyp-Dialog__close",children:Ro(Ho,{"data-testid":"close-button",icon:Xo,title:"Close",onClick:a},void 0,!1,{fileName:Ko,lineNumber:147,columnNumber:13})},void 0,!1,{fileName:Ko,lineNumber:146,columnNumber:11})]},void 0,!0,{fileName:Ko,lineNumber:136,columnNumber:7}),n,f&&Ro("div",{className:"Hyp-Dialog__actions",children:[m&&Ro(qo,{"data-testid":"cancel-button",onClick:a,children:t},void 0,!1,{
|
|
106
|
-
fileName:Ko,lineNumber:160,columnNumber:13}),e]},void 0,!0,{fileName:Ko,lineNumber:158,columnNumber:9})]},void 0,!0,{fileName:Ko,lineNumber:125,columnNumber:5})}function ei({name:e,classes:t="",containerClasses:n="",title:r=""}){const o=Po.get(e);if(!o)throw new Error(`Icon "${e.toString()}" is not registered`);const i=So();ko((()=>{const e=i.current.querySelector("svg");e&&e.setAttribute("class",uo("Hyp-Icon",t))}),[t,o]);const a={};return r&&(a.title=r),Ro("span",{className:n,dangerouslySetInnerHTML:{__html:o},ref:i,...a},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Icon.js",lineNumber:60,columnNumber:5})}function ti({children:e,classes:t="",linkRef:n,...r}){return Ro("a",{className:uo("Hyp-Link",t),ref:n,rel:"noopener noreferrer",...r,children:e},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Link.js",lineNumber:24,columnNumber:5})}function ni(e){const t={Left:"ArrowLeft",Up:"ArrowUp",Down:"ArrowDown",Right:"ArrowRight",
|
|
107
|
-
Spacebar:" ",Del:"Delete"};return t[e]?t[e]:e}function ri(e,t,n,{useCapture:r=!1}={}){return t.forEach((t=>e.addEventListener(t,n,r))),()=>{t.forEach((t=>e.removeEventListener(t,n,r)))}}function oi(e,t,n){xo((()=>{if(!t)return()=>{};const r=ri(document.body,["keydown"],(e=>{"Escape"===ni(e.key)&&n()})),o=ri(document.body,["focus"],(t=>{e.current&&!e.current.contains(t.target)&&n()}),{useCapture:!0}),i=ri(document.body,["mousedown","click"],(t=>{e.current&&!e.current.contains(t.target)&&n()}),{useCapture:!0});return()=>{r(),i(),o()}}),[e,t,n])}var ii="/home/runner/work/frontend-shared/frontend-shared/src/components/Modal.js";function ai({children:e,onCancel:t,...n}){const r=So();return oi(r,!0,(()=>{t&&t()})),Ro(m,{children:[Ro("div",{className:"Hyp-Modal__overlay"},void 0,!1,{fileName:ii,lineNumber:39,columnNumber:7}),Ro("div",{className:"Hyp-Modal",ref:r,children:Ro(Qo,{onCancel:t,...n,children:e},void 0,!1,{fileName:ii,lineNumber:41,columnNumber:9})},void 0,!1,{fileName:ii,lineNumber:40,columnNumber:7})]
|
|
108
|
-
},void 0,!0)}function si({message:e,confirmAction:t,onConfirm:n,onCancel:r,...o}){return Ro(ai,{onCancel:r,buttons:[Ro(qo,{onClick:n,variant:"primary","data-testid":"confirm-button",children:t},"ok",!1,{fileName:ii,lineNumber:76,columnNumber:9})],...o,children:Ro("p",{children:e},void 0,!1,{fileName:ii,lineNumber:87,columnNumber:7})},void 0,!1,{fileName:ii,lineNumber:73,columnNumber:5})}var li="/home/runner/work/frontend-shared/frontend-shared/src/components/Panel.js";const ci=Bo("cancel",Yo);function ui({children:e,icon:t,onClose:n,title:r}){const o=!!n;return Ro("div",{className:uo("Hyp-Panel",{"Hyp-Panel--closeable":o}),children:[Ro("header",{className:"Hyp-Panel__header",children:[t&&Ro("div",{className:"Hyp-Panel__header-icon",children:Ro(Do,{name:t,title:r},void 0,!1,{fileName:li,lineNumber:37,columnNumber:13})},void 0,!1,{fileName:li,lineNumber:36,columnNumber:11}),Ro("h2",{className:"Hyp-Panel__title",children:r},void 0,!1,{fileName:li,lineNumber:40,columnNumber:9}),o&&Ro("div",{
|
|
109
|
-
className:"Hyp-Panel__close",children:Ro(Ho,{icon:ci,title:"Close",onClick:n},void 0,!1,{fileName:li,lineNumber:43,columnNumber:13})},void 0,!1,{fileName:li,lineNumber:42,columnNumber:11})]},void 0,!0,{fileName:li,lineNumber:34,columnNumber:7}),Ro("div",{className:"Hyp-Panel__content",children:e},void 0,!1,{fileName:li,lineNumber:47,columnNumber:7})]},void 0,!0,{fileName:li,lineNumber:29,columnNumber:5})}
|
|
110
|
-
const di=Bo("spinner",'<svg viewBox="0 0 64 64">\n <g stroke-width="6" stroke="currentColor" stroke-linecap="round">\n <line y1="16" y2="28" transform="translate(32,32) rotate(180)">\n <animate attributeName="stroke-opacity" dur="750ms" values="0;1;.8;.65;.45;.3;.15;0" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(225)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".15;0;1;.8;.65;.45;.3;.15" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(270)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".3;.15;0;1;.8;.65;.45;.3" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(315)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".45;.3;.15;0;1;.85;.65;.45" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(0)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".65;.45;.3;.15;0;1;.8;.65;" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(45)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".8;.65;.45;.3;.15;0;1;.8" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(90)">\n <animate attributeName="stroke-opacity" dur="750ms" values="1;.85;.6;.45;.3;.15;0;1;" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(135)">\n <animate attributeName="stroke-opacity" dur="750ms" values="0;1;.8;.65;.45;.3;.15;0" repeatCount="indefinite"></animate>\n </line>\n </g>\n</svg>')
|
|
111
|
-
;function hi({classes:e="",size:t="medium"}){return Ro(ei,{name:di,containerClasses:uo(`Hyp-Spinner--${t}`,e)},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Spinner.js",lineNumber:32,columnNumber:5})}var pi="/home/runner/work/frontend-shared/frontend-shared/src/components/TextInput.js";function mi({classes:e="",inputRef:t,hasError:n=!1,type:r="text",...o}){return Ro("input",{className:uo("Hyp-TextInput",{"has-error":n},e),...o,ref:t,type:r},void 0,!1,{fileName:pi,lineNumber:39,columnNumber:5})}function fi({children:e,classes:t=""}){return Ro("div",{className:uo("Hyp-TextInputWithButton",t),children:e},void 0,!1,{fileName:pi,lineNumber:67,columnNumber:5})}
|
|
112
|
-
var gi='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 4l4 4-4 4"></path></g></svg>',vi='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg width="24px" height="28px" viewBox="0 0 24 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <rect fill="#ffffff" stroke="none" width="17.14407" height="16.046612" x="3.8855932" y="3.9449153" />\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <path d="M0,2.00494659 C0,0.897645164 0.897026226,0 2.00494659,0 L21.9950534,0 C23.1023548,0 24,0.897026226 24,2.00494659 L24,21.9950534 C24,23.1023548 23.1029738,24 21.9950534,24 L2.00494659,24 C0.897645164,24 0,23.1029738 0,21.9950534 L0,2.00494659 Z M9,24 L12,28 L15,24 L9,24 Z M7.00811294,4 L4,4 L4,20 L7.00811294,20 L7.00811294,15.0028975 C7.00811294,12.004636 8.16824717,12.0097227 9,12 C10,12.0072451 11.0189302,12.0606714 11.0189302,14.003477 L11.0189302,20 L14.0270431,20 L14.0270431,13.1087862 C14.0270433,10 12,9.00309038 10,9.00309064 C8.01081726,9.00309091 8,9.00309086 7.00811294,11.0019317 L7.00811294,4 Z M19,19.9869002 C20.1045695,19.9869002 21,19.0944022 21,17.9934501 C21,16.892498 20.1045695,16 19,16 C17.8954305,16 17,16.892498 17,17.9934501 C17,19.0944022 17.8954305,19.9869002 19,19.9869002 Z" fill="currentColor"></path>\n </g>\n</svg>\n'
|
|
113
|
-
;const yi={add:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M8.99302964,2.86682521 L9,3 L9,6.999 L13,7 C13.5522847,7 14,7.44771525 14,8 C14,8.51283584 13.6139598,8.93550716 13.1166211,8.99327227 L13,9 L9,9 L9,13 C9,14.2873563 7.13555291,14.3317479 7.00697036,13.1331748 L7,13 L7,9 L3,9 C2.44771525,9 2,8.55228475 2,8 C2,7.48716416 2.38604019,7.06449284 2.88337887,7.00672773 L3,7 L7,7 L7,3 C7,1.71264368 8.86444709,1.66825208 8.99302964,2.86682521 Z"></path></svg>',
|
|
1
|
+
function e(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}var t,n,r,o,i,a,s,l={},c=[],u=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function h(e,t){for(var n in t)e[n]=t[n];return e}function d(e){var t=e.parentNode;t&&t.removeChild(e)}function p(e,t,o,i,a){var s={type:e,props:t,key:o,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==a?++r:a};return null==a&&null!=n.vnode&&n.vnode(s),s}function m(e){return e.children}function f(e,t){this.props=e,this.context=t}function g(e,t){if(null==t)return e.__?g(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?g(e):null}function v(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return v(e)}}function _(e){
|
|
2
|
+
(!e.__d&&(e.__d=!0)&&o.push(e)&&!b.__r++||a!==n.debounceRendering)&&((a=n.debounceRendering)||i)(b)}function b(){for(var e;b.__r=o.length;)e=o.sort((function(e,t){return e.__v.__b-t.__v.__b})),o=[],e.some((function(e){var t,n,r,o,i,a;e.__d&&(i=(o=(t=e).__v).__e,(a=t.__P)&&(n=[],(r=h({},o)).__v=o.__v+1,T(a,o,r,t.__n,void 0!==a.ownerSVGElement,null!=o.__h?[i]:null,n,null==i?g(o):i,o.__h),N(n,o),o.__e!=i&&v(o)))}))}function y(e,t,n,r,o,i,a,s,u,h){var d,f,v,_,b,y,x,S=r&&r.__k||c,C=S.length;for(n.__k=[],d=0;d<t.length;d++)if(null!=(_=n.__k[d]=null==(_=t[d])||"boolean"==typeof _?null:"string"==typeof _||"number"==typeof _||"bigint"==typeof _?p(null,_,null,null,_):Array.isArray(_)?p(m,{children:_},null,null,null):_.__b>0?p(_.type,_.props,_.key,null,_.__v):_)){if(_.__=n,_.__b=n.__b+1,null===(v=S[d])||v&&_.key==v.key&&_.type===v.type)S[d]=void 0;else for(f=0;f<C;f++){if((v=S[f])&&_.key==v.key&&_.type===v.type){S[f]=void 0;break}v=null}T(e,_,v=v||l,o,i,a,s,u,h),b=_.__e,(f=_.ref)&&v.ref!=f&&(x||(x=[]),
|
|
3
|
+
v.ref&&x.push(v.ref,null,_),x.push(f,_.__c||b,_)),null!=b?(null==y&&(y=b),"function"==typeof _.type&&_.__k===v.__k?_.__d=u=w(_,u,e):u=k(e,_,v,S,b,u),"function"==typeof n.type&&(n.__d=u)):u&&v.__e==u&&u.parentNode!=e&&(u=g(v))}for(n.__e=y,d=C;d--;)null!=S[d]&&("function"==typeof n.type&&null!=S[d].__e&&S[d].__e==n.__d&&(n.__d=g(r,d+1)),z(S[d],S[d]));if(x)for(d=0;d<x.length;d++)L(x[d],x[++d],x[++d])}function w(e,t,n){for(var r,o=e.__k,i=0;o&&i<o.length;i++)(r=o[i])&&(r.__=e,t="function"==typeof r.type?w(r,t,n):k(n,r,r,o,r.__e,t));return t}function x(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){x(e,t)})):t.push(e)),t}function k(e,t,n,r,o,i){var a,s,l;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||o!=i||null==o.parentNode)e:if(null==i||i.parentNode!==e)e.appendChild(o),a=null;else{for(s=i,l=0;(s=s.nextSibling)&&l<r.length;l+=2)if(s==o)break e;e.insertBefore(o,i),a=i}return void 0!==a?a:o.nextSibling}function S(e,t,n){
|
|
4
|
+
"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||u.test(t)?n:n+"px"}function C(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||S(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||S(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r||e.addEventListener(t,i?A:E,i):e.removeEventListener(t,i?A:E,i);else if("dangerouslySetInnerHTML"!==t){if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function E(e){this.l[e.type+!1](n.event?n.event(e):e)}function A(e){this.l[e.type+!0](n.event?n.event(e):e)}function T(e,t,r,o,i,a,s,l,c){
|
|
5
|
+
var u,d,p,g,v,_,b,w,x,k,S,C,E,A=t.type;if(void 0!==t.constructor)return null;null!=r.__h&&(c=r.__h,l=t.__e=r.__e,t.__h=null,a=[l]),(u=n.__b)&&u(t);try{e:if("function"==typeof A){if(w=t.props,x=(u=A.contextType)&&o[u.__c],k=u?x?x.props.value:u.__:o,r.__c?b=(d=t.__c=r.__c).__=d.__E:("prototype"in A&&A.prototype.render?t.__c=d=new A(w,k):(t.__c=d=new f(w,k),d.constructor=A,d.render=O),x&&x.sub(d),d.props=w,d.state||(d.state={}),d.context=k,d.__n=o,p=d.__d=!0,d.__h=[]),null==d.__s&&(d.__s=d.state),null!=A.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=h({},d.__s)),h(d.__s,A.getDerivedStateFromProps(w,d.__s))),g=d.props,v=d.state,p)null==A.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==A.getDerivedStateFromProps&&w!==g&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(w,k),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(w,d.__s,k)||t.__v===r.__v){d.props=w,d.state=d.__s,
|
|
6
|
+
t.__v!==r.__v&&(d.__d=!1),d.__v=t,t.__e=r.__e,t.__k=r.__k,t.__k.forEach((function(e){e&&(e.__=t)})),d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(w,d.__s,k),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(g,v,_)}))}if(d.context=k,d.props=w,d.__v=t,d.__P=e,S=n.__r,C=0,"prototype"in A&&A.prototype.render)d.state=d.__s,d.__d=!1,S&&S(t),u=d.render(d.props,d.state,d.context);else do{d.__d=!1,S&&S(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++C<25);d.state=d.__s,null!=d.getChildContext&&(o=h(h({},o),d.getChildContext())),p||null==d.getSnapshotBeforeUpdate||(_=d.getSnapshotBeforeUpdate(g,v)),E=null!=u&&u.type===m&&null==u.key?u.props.children:u,y(e,Array.isArray(E)?E:[E],t,r,o,i,a,s,l,c),d.base=t.__e,t.__h=null,d.__h.length&&s.push(d),b&&(d.__E=d.__=null),d.__e=!1}else null==a&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=M(r.__e,t,r,o,i,a,s,c);(u=n.diffed)&&u(t)}catch(e){t.__v=null,(c||null!=a)&&(t.__e=l,t.__h=!!c,
|
|
7
|
+
a[a.indexOf(l)]=null),n.__e(e,t,r)}}function N(e,t){n.__c&&n.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){n.__e(e,t.__v)}}))}function M(e,n,r,o,i,a,s,c){var u,h,p,m=r.props,f=n.props,v=n.type,_=0;if("svg"===v&&(i=!0),null!=a)for(;_<a.length;_++)if((u=a[_])&&"setAttribute"in u==!!v&&(v?u.localName===v:3===u.nodeType)){e=u,a[_]=null;break}if(null==e){if(null===v)return document.createTextNode(f);e=i?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,f.is&&f),a=null,c=!1}if(null===v)m===f||c&&e.data===f||(e.data=f);else{if(a=a&&t.call(e.childNodes),h=(m=r.props||l).dangerouslySetInnerHTML,p=f.dangerouslySetInnerHTML,!c){if(null!=a)for(m={},_=0;_<e.attributes.length;_++)m[e.attributes[_].name]=e.attributes[_].value;(p||h)&&(p&&(h&&p.__html==h.__html||p.__html===e.innerHTML)||(e.innerHTML=p&&p.__html||""))}if(function(e,t,n,r,o){var i;for(i in n)"children"===i||"key"===i||i in t||C(e,i,null,n[i],r)
|
|
8
|
+
;for(i in t)o&&"function"!=typeof t[i]||"children"===i||"key"===i||"value"===i||"checked"===i||n[i]===t[i]||C(e,i,t[i],n[i],r)}(e,f,m,i,c),p)n.__k=[];else if(_=n.props.children,y(e,Array.isArray(_)?_:[_],n,r,o,i&&"foreignObject"!==v,a,s,a?a[0]:r.__k&&g(r,0),c),null!=a)for(_=a.length;_--;)null!=a[_]&&d(a[_]);c||("value"in f&&void 0!==(_=f.value)&&(_!==e.value||"progress"===v&&!_||"option"===v&&_!==m.value)&&C(e,"value",_,m.value,!1),"checked"in f&&void 0!==(_=f.checked)&&_!==e.checked&&C(e,"checked",_,m.checked,!1))}return e}function L(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){n.__e(e,r)}}function z(e,t,r){var o,i;if(n.unmount&&n.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||L(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){n.__e(e,t)}o.base=o.__P=null}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&z(o[i],t,"function"!=typeof e.type);r||null==e.__e||d(e.__e),e.__e=e.__d=void 0}function O(e,t,n){return this.constructor(e,n)}function R(e,r,o){var i,a,s
|
|
9
|
+
;n.__&&n.__(e,r),a=(i="function"==typeof o)?null:o&&o.__k||r.__k,s=[],T(r,e=(!i&&o||r).__k=function(e,n,r){var o,i,a,s={};for(a in n)"key"==a?o=n[a]:"ref"==a?i=n[a]:s[a]=n[a];if(arguments.length>2&&(s.children=arguments.length>3?t.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return p(e,s,o,i,null)}(m,null,[e]),a||l,l,void 0!==r.ownerSVGElement,!i&&o?[o]:a?null:r.firstChild?t.call(r.childNodes):null,s,!i&&o?o:a?a.__e:r.firstChild,i),N(s,e)}function D(e){const t=new URL(e).hash.slice(1),n=new URLSearchParams(t).get("config");return JSON.parse(n||"{}")}function I({services:e}){return Array.isArray(e)&&e[0]?e[0]:null}function P(e){if("string"==typeof e&&"false"===e.trim().toLocaleLowerCase())return!1;const t=Number(e);return isNaN(t)?"string"==typeof e:Boolean(t)}function B(e){return parseInt(e)}function F(e){return e&&"function"==typeof e.toString?e.toString():""}function j(e){const t=e.toString(16);return 1===t.length?"0"+t:t}
|
|
10
|
+
function U(e){const t=new Uint8Array(e/2);return window.crypto.getRandomValues(t),Array.from(t).map(j).join("")}function H(e,t,n,r=[],o=2e3,i=window){const a=U(10),s={jsonrpc:"2.0",method:n,params:r,id:a};try{e.postMessage(s,t)}catch(e){return Promise.reject(e)}let l;const c=new Promise(((e,n)=>{l=r=>{if(r.origin!==t)return;if(!(r.data instanceof Object)||"2.0"!==r.data.jsonrpc||r.data.id!==a)return;const{error:o,result:i}=r.data;void 0!==o?n(o):void 0!==i?e(i):n(new Error("RPC reply had no result or error"))},i.addEventListener("message",l)})),u=[c];var h,d;return o&&u.push((h=o,d=`Request to ${t} timed out`,new Promise(((e,t)=>{setTimeout((()=>t(new Error(d))),h)})))),Promise.race(u).then((e=>(i.removeEventListener("message",l),e))).catch((e=>{throw i.removeEventListener("message",l),e}))}function q(e,t=window){let n=t;for(let t=0;t<e;t++){
|
|
11
|
+
if(n===n.top)throw new Error("The target parent frame has exceeded the ancestor tree. Try reducing the `requestConfigFromFrame.ancestorLevel` value in the `hypothesisConfig`");n=n.parent}return n}t=c.slice,n={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},r=0,f.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=h({},this.state),"function"==typeof e&&(e=e(h({},n),this.props)),e&&h(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),_(this))},f.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_(this))},f.prototype.render=m,o=[],i="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,b.__r=0,s=0;let $=new Set;function G(...e){const t=e.join();$.has(t)||(console.warn(...e),$.add(t))}
|
|
12
|
+
G.reset=()=>{$.clear()};var V="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Y(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var W=e=>{if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")};function K(e,t,n,r){const o=t.find((e=>"__world__"===e.id));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);return a.forEach((e=>{e.canLeave=!!function(e){const t=I(e);return!t||!!t.allowLeavingGroups}(r)&&"private"===e.type})),a.forEach((e=>e.isScopedToUri=function(e,t){if(e.scopes&&e.scopes.uri_patterns.length>0&&t)return function(e,t){return void 0!==t.find((t=>e.match(t.split("*").map(W).join(".*"))))}(t,e.scopes.uri_patterns);return!0}(e,n))),a}let X=[];function Z(e,t,n){const r=(e=>({
|
|
13
|
+
changeFocusModeUser:t=>{var n;e.changeFocusModeUser(t);const r=null!==(n=null==t?void 0:t.groups)&&void 0!==n?n:[],o=function(e,t){return function(e,t){return t.filter((t=>e.includes(t.id)||t.groupid&&e.includes(t.groupid)))}(e,t).map((e=>e.id))}(r,e.allGroups());r.length&&!o.length&&console.error("No matching groups found in list of filtered group IDs"),e.filterGroups(o)}}))(e);function o(e){let 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 G(`Ignoring JSON-RPC request from non-whitelisted origin ${e.origin}`);let 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)}X.forEach((e=>{o(e)})),X=[],window.removeEventListener("message",J),n.addEventListener("message",o)}function J(e){X.push(e)}function Q(){
|
|
14
|
+
return!("undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&__SENTRY_BROWSER_BUNDLE__)&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}Z.$inject=["store","settings","$window"];var ee={};function te(){return Q()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:ee}function ne(e,t,n){var r=n||te(),o=r.__SENTRY__=r.__SENTRY__||{};return o[e]||(o[e]=t())}var re=Object.prototype.toString;function oe(e){switch(re.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return pe(e,Error)}}function ie(e,t){return re.call(e)===`[object ${t}]`}function ae(e){return ie(e,"ErrorEvent")}function se(e){return ie(e,"DOMError")}function le(e){return ie(e,"String")}function ce(e){return null===e||"object"!=typeof e&&"function"!=typeof e}function ue(e){return ie(e,"Object")}function he(e){return"undefined"!=typeof Event&&pe(e,Event)}function de(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function pe(e,t){try{
|
|
15
|
+
return e instanceof t}catch(e){return!1}}function me(e,t){try{let o=e;var n=[];let i=0,a=0;var r=" > ".length;let s;for(;o&&i++<5&&(s=fe(o,t),!("html"===s||i>1&&a+n.length*r+s.length>=80));)n.push(s),a+=s.length,o=o.parentNode;return n.reverse().join(" > ")}catch(e){return"<unknown>"}}function fe(e,t){var n=e,r=[];let o,i,a,s,l;if(!n||!n.tagName)return"";r.push(n.tagName.toLowerCase());var c=t&&t.length?t.filter((e=>n.getAttribute(e))).map((e=>[e,n.getAttribute(e)])):null;if(c&&c.length)c.forEach((e=>{r.push(`[${e[0]}="${e[1]}"]`)}));else if(n.id&&r.push(`#${n.id}`),o=n.className,o&&le(o))for(i=o.split(/\s+/),l=0;l<i.length;l++)r.push(`.${i[l]}`);var u=["type","name","title","alt"];for(l=0;l<u.length;l++)a=u[l],s=n.getAttribute(a),s&&r.push(`[${a}="${s}"]`);return r.join("")}class ge extends Error{constructor(e){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype)}}var ve=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/
|
|
16
|
+
;function _e(e,t=!1){const{host:n,path:r,pass:o,port:i,projectId:a,protocol:s,publicKey:l}=e;return`${s}://${l}${t&&o?`:${o}`:""}@${n}${i?`:${i}`:""}/${r?`${r}/`:r}${a}`}function be(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function ye(e){var t="string"==typeof e?function(e){var t=ve.exec(e);if(!t)throw new ge(`Invalid Sentry Dsn: ${e}`);const[n,r,o="",i,a="",s]=t.slice(1);let l="",c=s;var u=c.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),c=u.pop()),c){var h=c.match(/^\d+/);h&&(c=h[0])}return be({host:i,pass:o,path:l,projectId:c,port:a,protocol:n,publicKey:r})}(e):be(e);return function(e){if("undefined"!=typeof __SENTRY_DEBUG__&&!__SENTRY_DEBUG__)return;const{port:t,projectId:n,protocol:r}=e;if(["protocol","publicKey","host","projectId"].forEach((t=>{if(!e[t])throw new ge(`Invalid Sentry Dsn: ${t} missing`)})),!n.match(/^\d+$/))throw new ge(`Invalid Sentry Dsn: Invalid projectId ${n}`);if(!function(e){
|
|
17
|
+
return"http"===e||"https"===e}(r))throw new ge(`Invalid Sentry Dsn: Invalid protocol ${r}`);if(t&&isNaN(parseInt(t,10)))throw new ge(`Invalid Sentry Dsn: Invalid port ${t}`)}(t),t}var we=te(),xe=["debug","info","warn","error","log","assert","trace"];function ke(e){var t=te();if(!("console"in t))return e();var n=t.console,r={};xe.forEach((e=>{var o=n[e]&&n[e].__sentry_original__;e in t.console&&o&&(r[e]=n[e],n[e]=o)}));try{return e()}finally{Object.keys(r).forEach((e=>{n[e]=r[e]}))}}function Se(){let e=!1;var t={enable:()=>{e=!0},disable:()=>{e=!1}};return"undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?xe.forEach((n=>{t[n]=(...t)=>{e&&ke((()=>{we.console[n](`Sentry Logger [${n}]:`,...t)}))}})):xe.forEach((e=>{t[e]=()=>{}})),t}let Ce;function Ee(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.substr(0,t)}...`}function Ae(e,t){if(!Array.isArray(e))return"";var n=[];for(let t=0;t<e.length;t++){var r=e[t];try{n.push(String(r))}catch(e){n.push("[value cannot be serialized]")}}return n.join(t)}
|
|
18
|
+
function Te(e,t){return!!le(e)&&(ie(t,"RegExp")?t.test(e):"string"==typeof t&&-1!==e.indexOf(t))}function Ne(e,t,n){if(t in e){var r=e[t],o=n(r);if("function"==typeof o)try{Le(o,r)}catch(e){}e[t]=o}}function Me(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}function Le(e,t){var n=t.prototype||{};e.prototype=t.prototype=n,Me(e,"__sentry_original__",t)}function ze(e){return e.__sentry_original__}function Oe(e){if(oe(e))return{message:e.message,name:e.name,stack:e.stack,...De(e)};if(he(e)){var t={type:e.type,target:Re(e.target),currentTarget:Re(e.currentTarget),...De(e)};return"undefined"!=typeof CustomEvent&&pe(e,CustomEvent)&&(t.detail=e.detail),t}return e}function Re(e){try{return t=e,"undefined"!=typeof Element&&pe(t,Element)?me(e):Object.prototype.toString.call(e)}catch(e){return"<unknown>"}var t}function De(e){if("object"==typeof e&&null!==e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function Ie(e,t=40){var n=Object.keys(Oe(e))
|
|
19
|
+
;if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return Ee(n[0],t);for(let e=n.length;e>0;e--){var r=n.slice(0,e).join(", ");if(!(r.length>t))return e===n.length?r:Ee(r,t)}return""}function Pe(e){return Be(e,new Map)}function Be(e,t){if(ue(e)){if(void 0!==(o=t.get(e)))return o;var n={};for(var r of(t.set(e,n),Object.keys(e)))void 0!==e[r]&&(n[r]=Be(e[r],t));return n}if(Array.isArray(e)){var o;if(void 0!==(o=t.get(e)))return o;n=[];return t.set(e,n),e.forEach((e=>{n.push(Be(e,t))})),n}return e}Ce="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?ne("logger",Se):Se();function Fe(...e){var t=e.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return(e,n=0)=>{var r=[];for(var o of e.split("\n").slice(n))for(var i of t){var a=i(o);if(a){r.push(a);break}}return function(e){if(!e.length)return[];let t=e;var n=t[0].function||"",r=t[t.length-1].function||"";-1===n.indexOf("captureMessage")&&-1===n.indexOf("captureException")||(t=t.slice(1));-1!==r.indexOf("sentryWrapped")&&(t=t.slice(0,-1))
|
|
20
|
+
;return t.slice(0,50).map((e=>({...e,filename:e.filename||t[0].filename,function:e.function||"?"}))).reverse()}(r)}}function je(e){try{return e&&"function"==typeof e&&e.name||"<anonymous>"}catch(e){return"<anonymous>"}}function Ue(){if(!("fetch"in te()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(e){return!1}}function He(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}var qe=te(),$e={},Ge={};function Ve(e){if(!Ge[e])switch(Ge[e]=!0,e){case"console":!function(){if(!("console"in qe))return;xe.forEach((function(e){e in qe.console&&Ne(qe.console,e,(function(t){return function(...n){We("console",{args:n,level:e}),t&&t.apply(qe.console,n)}}))}))}();break;case"dom":!function(){if(!("document"in qe))return;var e=We.bind(null,"dom"),t=et(e,!0);qe.document.addEventListener("click",t,!1),qe.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((t=>{var n=qe[t]&&qe[t].prototype
|
|
21
|
+
;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(Ne(n,"addEventListener",(function(t){return function(n,r,o){if("click"===n||"keypress"==n)try{var i=this,a=i.__sentry_instrumentation_handlers__=i.__sentry_instrumentation_handlers__||{},s=a[n]=a[n]||{refCount:0};if(!s.handler){var l=et(e);s.handler=l,t.call(this,n,l,o)}s.refCount+=1}catch(e){}return t.call(this,n,r,o)}})),Ne(n,"removeEventListener",(function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{var o=this,i=o.__sentry_instrumentation_handlers__||{},a=i[t];a&&(a.refCount-=1,a.refCount<=0&&(e.call(this,t,a.handler,r),a.handler=void 0,delete i[t]),0===Object.keys(i).length&&delete o.__sentry_instrumentation_handlers__)}catch(e){}return e.call(this,t,n,r)}})))}))}();break;case"xhr":!function(){if(!("XMLHttpRequest"in qe))return;var e=XMLHttpRequest.prototype;Ne(e,"open",(function(e){return function(...t){var n=this,r=t[1],o=n.__sentry_xhr__={method:le(t[0])?t[0].toUpperCase():t[0],url:t[1]}
|
|
22
|
+
;le(r)&&"POST"===o.method&&r.match(/sentry_key/)&&(n.__sentry_own_request__=!0);var i=function(){if(4===n.readyState){try{o.status_code=n.status}catch(e){}We("xhr",{args:t,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:n})}};return"onreadystatechange"in n&&"function"==typeof n.onreadystatechange?Ne(n,"onreadystatechange",(function(e){return function(...t){return i(),e.apply(n,t)}})):n.addEventListener("readystatechange",i),e.apply(n,t)}})),Ne(e,"send",(function(e){return function(...t){return this.__sentry_xhr__&&void 0!==t[0]&&(this.__sentry_xhr__.body=t[0]),We("xhr",{args:t,startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}}))}();break;case"fetch":!function(){if(!function(){if(!Ue())return!1;var e=te();if(He(e.fetch))return!0;let t=!1;var n=e.document;if(n&&"function"==typeof n.createElement)try{var r=n.createElement("iframe");r.hidden=!0,n.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(t=He(r.contentWindow.fetch)),n.head.removeChild(r)}catch(e){
|
|
23
|
+
("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return t}())return;Ne(qe,"fetch",(function(e){return function(...t){var n={args:t,fetchData:{method:Ke(t),url:Xe(t)},startTimestamp:Date.now()};return We("fetch",{...n}),e.apply(qe,t).then((e=>(We("fetch",{...n,endTimestamp:Date.now(),response:e}),e)),(e=>{throw We("fetch",{...n,endTimestamp:Date.now(),error:e}),e}))}}))}();break;case"history":!function(){if(!function(){var e=te(),t=e.chrome,n=t&&t.app&&t.app.runtime,r="history"in e&&!!e.history.pushState&&!!e.history.replaceState;return!n&&r}())return;var e=qe.onpopstate;function t(e){return function(...t){var n=t.length>2?t[2]:void 0;if(n){var r=Ze,o=String(n);Ze=o,We("history",{from:r,to:o})}return e.apply(this,t)}}qe.onpopstate=function(...t){var n=qe.location.href,r=Ze;if(Ze=n,We("history",{from:r,to:n}),e)try{return e.apply(this,t)}catch(e){}},Ne(qe.history,"pushState",t),Ne(qe.history,"replaceState",t)
|
|
24
|
+
}();break;case"error":tt=qe.onerror,qe.onerror=function(e,t,n,r,o){return We("error",{column:r,error:o,line:n,msg:e,url:t}),!!tt&&tt.apply(this,arguments)};break;case"unhandledrejection":nt=qe.onunhandledrejection,qe.onunhandledrejection=function(e){return We("unhandledrejection",e),!nt||nt.apply(this,arguments)};break;default:return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn("unknown instrumentation type:",e))}}function Ye(e,t){$e[e]=$e[e]||[],$e[e].push(t),Ve(e)}function We(e,t){if(e&&$e[e])for(var n of $e[e]||[])try{n(t)}catch(t){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${je(n)}\nError:`,t)}}function Ke(e=[]){return"Request"in qe&&pe(e[0],Request)&&e[0].method?String(e[0].method).toUpperCase():e[1]&&e[1].method?String(e[1].method).toUpperCase():"GET"}function Xe(e=[]){return"string"==typeof e[0]?e[0]:"Request"in qe&&pe(e[0],Request)?e[0].url:String(e[0])}let Ze;let Je,Qe
|
|
25
|
+
;function et(e,t=!1){return n=>{if(n&&Qe!==n&&!function(e){if("keypress"!==e.type)return!1;try{var t=e.target;if(!t||!t.tagName)return!0;if("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)return!1}catch(e){}return!0}(n)){var r="keypress"===n.type?"input":n.type;(void 0===Je||function(e,t){if(!e)return!0;if(e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch(e){}return!1}(Qe,n))&&(e({event:n,name:r,global:t}),Qe=n),clearTimeout(Je),Je=qe.setTimeout((()=>{Je=void 0}),1e3)}}}let tt=null;let nt=null;function rt(){var e=te(),t=e.crypto||e.msCrypto;if(void 0!==t&&t.getRandomValues){var n=new Uint16Array(8);t.getRandomValues(n),n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;var r=e=>{let t=e.toString(16);for(;t.length<4;)t=`0${t}`;return t};return r(n[0])+r(n[1])+r(n[2])+r(n[3])+r(n[4])+r(n[5])+r(n[6])+r(n[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(e=>{var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function ot(e){if(!e)return{}
|
|
26
|
+
;var t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};var n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+n+r}}function it(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function at(e){const{message:t,event_id:n}=e;if(t)return t;var r=it(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function st(e,t,n){var r=e.exception=e.exception||{},o=r.values=r.values||[],i=o[0]=o[0]||{};i.value||(i.value=t||""),i.type||(i.type=n||"Error")}function lt(e,t){var n=it(e);if(n){var r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){var o={...r&&r.data,...t.data};n.mechanism.data=o}}}function ct(e){if(e&&e.__sentry_captured__)return!0;try{Me(e,"__sentry_captured__",!0)}catch(e){}return!1}function ut(e,t=1/0,n=1/0){try{return dt("",e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function ht(e,t=3,n=102400){var r,o=ut(e,t);return r=o,
|
|
27
|
+
function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(r))>n?ht(e,t-1,n):o}function dt(e,t,n=1/0,r=1/0,o=function(){var e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let e=0;e<t.length;e++){var r=t[e];if(r===n)return!0}return t.push(n),!1},function(n){if(e)t.delete(n);else for(let e=0;e<t.length;e++)if(t[e]===n){t.splice(e,1);break}}]}()){const[i,a]=o;var s,l=t;if(l&&"function"==typeof l.toJSON)try{return l.toJSON()}catch(e){}if(null===t||["number","boolean","string"].includes(typeof t)&&("number"!=typeof(s=t)||s==s))return t;var c=function(e,t){try{return"domain"===e&&t&&"object"==typeof t&&t._events?"[Domain]":"domainEmitter"===e?"[DomainEmitter]":"undefined"!=typeof global&&t===global?"[Global]":"undefined"!=typeof window&&t===window?"[Window]":"undefined"!=typeof document&&t===document?"[Document]":function(e){return ue(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e
|
|
28
|
+
}(t)?"[SyntheticEvent]":"number"==typeof t&&t!=t?"[NaN]":void 0===t?"[undefined]":"function"==typeof t?`[Function: ${je(t)}]`:"symbol"==typeof t?`[${String(t)}]`:"bigint"==typeof t?`[BigInt: ${String(t)}]`:`[object ${Object.getPrototypeOf(t).constructor.name}]`}catch(e){return`**non-serializable** (${e})`}}(e,t);if(!c.startsWith("[object "))return c;if(t.__sentry_skip_normalization__)return t;if(0===n)return c.replace("object ","");if(i(t))return"[Circular ~]";var u=Array.isArray(t)?[]:{};let h=0;var d=Oe(t);for(var p in d)if(Object.prototype.hasOwnProperty.call(d,p)){if(h>=r){u[p]="[MaxProperties ~]";break}var m=d[p];u[p]=dt(p,m,n-1,r,o),h+=1}return a(t),u}var pt;function mt(e){return new gt((t=>{t(e)}))}function ft(e){return new gt(((t,n)=>{n(e)}))}!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(pt||(pt={}));class gt{__init(){this._state=pt.PENDING}__init2(){this._handlers=[]}constructor(e){gt.prototype.__init.call(this),gt.prototype.__init2.call(this),
|
|
29
|
+
gt.prototype.__init3.call(this),gt.prototype.__init4.call(this),gt.prototype.__init5.call(this),gt.prototype.__init6.call(this);try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new gt(((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){r(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){r(e)}else r(e)}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new gt(((t,n)=>{let r,o;return this.then((t=>{o=!1,r=t,e&&e()}),(t=>{o=!0,r=t,e&&e()})).then((()=>{o?n(r):t(r)}))}))}__init3(){this._resolve=e=>{this._setResult(pt.RESOLVED,e)}}__init4(){this._reject=e=>{this._setResult(pt.REJECTED,e)}}__init5(){this._setResult=(e,t)=>{this._state===pt.PENDING&&(de(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init6(){this._executeHandlers=()=>{if(this._state!==pt.PENDING){var e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===pt.RESOLVED&&e[1](this._value),
|
|
30
|
+
this._state===pt.REJECTED&&e[2](this._value),e[0]=!0)}))}}}}function vt(e){var t=[];function n(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(r){if(!(void 0===e||t.length<e))return ft(new ge("Not adding Promise due to buffer limit reached."));var o=r();return-1===t.indexOf(o)&&t.push(o),o.then((()=>n(o))).then(null,(()=>n(o).then(null,(()=>{})))),o},drain:function(e){return new gt(((n,r)=>{let o=t.length;if(!o)return n(!0);var i=setTimeout((()=>{e&&e>0&&n(!1)}),e);t.forEach((e=>{mt(e).then((()=>{--o||(clearTimeout(i),n(!0))}),r)}))}))}}}function _t(e){let t,n=e[0],r=1;for(;r<e.length;){var o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i(((...e)=>n.call(t,...e))),t=void 0)}return n}var bt=["fatal","error","warning","log","info","debug"];var yt={nowSeconds:()=>Date.now()/1e3};var wt=Q()?function(){try{return(e=module,t="perf_hooks",e.require(t)).performance}catch(e){return}
|
|
31
|
+
var e,t}():function(){const{performance:e}=te();if(e&&e.now)return{now:()=>e.now(),timeOrigin:Date.now()-e.now()}}(),xt=void 0===wt?yt:{nowSeconds:()=>(wt.timeOrigin+wt.now())/1e3},kt=yt.nowSeconds.bind(yt),St=xt.nowSeconds.bind(xt);function Ct(e,t=[]){return[e,t]}function Et(e,t){const[n,r]=e;return[n,[...r,t]]}function At(e,t){e[1].forEach((e=>{var n=e[0].type;t(e,n)}))}function Tt(e,t){return(t||new TextEncoder).encode(e)}function Nt(e,t){const[n,r]=e;let o=JSON.stringify(n);function i(e){"string"==typeof o?o="string"==typeof e?o+e:[Tt(o,t),e]:o.push("string"==typeof e?Tt(e,t):e)}for(var a of r){const[e,t]=a;i(`\n${JSON.stringify(e)}\n`),i("string"==typeof t||t instanceof Uint8Array?t:JSON.stringify(t))}return"string"==typeof o?o:function(e){var t=e.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(t);let r=0;for(var o of e)n.set(o,r),r+=o.length;return n}(o)}function Mt(e,t){var n="string"==typeof e.data?Tt(e.data,t):e.data;return[Pe({type:"attachment",length:n.length,filename:e.filename,
|
|
32
|
+
content_type:e.contentType,attachment_type:e.attachmentType}),n]}(()=>{const{performance:e}=te();if(e&&e.now){var t=36e5,n=e.now(),r=Date.now(),o=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,i=o<t,a=e.timing&&e.timing.navigationStart,s="number"==typeof a?Math.abs(a+n-r):t;(i||s<t)&&(o<=s&&e.timeOrigin)}})();var Lt={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default"};function zt(e){return Lt[e]}function Ot(e,{statusCode:t,headers:n},r=Date.now()){var o={...e},i=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(i)for(var s of i.trim().split(",")){const[e,t]=s.split(":",2);var l=parseInt(e,10),c=1e3*(isNaN(l)?60:l);if(t)for(var u of t.split(";"))o[u]=r+c;else o.all=r+c}else a?o.all=r+function(e,t=Date.now()){var n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;var r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(a,r):429===t&&(o.all=r+6e4);return o}function Rt(e){var t=St(),n={sid:rt(),init:!0,timestamp:t,started:t,
|
|
33
|
+
duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return Pe({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)};return e&&Dt(n,e),n}function Dt(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||St(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:rt()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{var n=e.timestamp-e.started;e.duration=n>=0?n:0}
|
|
34
|
+
t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}class It{constructor(){It.prototype.__init.call(this),It.prototype.__init2.call(this),It.prototype.__init3.call(this),It.prototype.__init4.call(this),It.prototype.__init5.call(this),It.prototype.__init6.call(this),It.prototype.__init7.call(this),It.prototype.__init8.call(this),It.prototype.__init9.call(this),It.prototype.__init10.call(this)}__init(){this._notifyingListeners=!1}__init2(){this._scopeListeners=[]}__init3(){this._eventProcessors=[]}__init4(){this._breadcrumbs=[]}__init5(){this._user={}}__init6(){this._tags={}}__init7(){this._extra={}}__init8(){this._contexts={}}__init9(){this._attachments=[]}__init10(){this._sdkProcessingMetadata={}}static clone(e){var t=new It;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags={...e._tags},t._extra={
|
|
35
|
+
...e._extra},t._contexts={...e._contexts},t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments]),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&Dt(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){
|
|
36
|
+
return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts={...this._contexts,[e]:t},this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){var e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if("function"==typeof e){var t=e(this);return t instanceof It?t:this}return e instanceof It?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),
|
|
37
|
+
e._requestSession&&(this._requestSession=e._requestSession)):ue(e)&&(e=e,this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this}addBreadcrumb(e,t){var n="number"==typeof t?Math.min(t,100):100;if(n<=0)return this;var r={timestamp:kt(),...e};return this._breadcrumbs=[...this._breadcrumbs,r].slice(-n),this._notifyScopeListeners(),this}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){
|
|
38
|
+
return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={}){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};var n=this._span.transaction&&this._span.transaction.name;n&&(e.tags={transaction:n,...e.tags})}return this._applyFingerprint(e),e.breadcrumbs=[...e.breadcrumbs||[],...this._breadcrumbs],e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata=this._sdkProcessingMetadata,this._notifyEventProcessors([...Pt(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){
|
|
39
|
+
return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}_notifyEventProcessors(e,t,n,r=0){return new gt(((o,i)=>{var a=e[r];if(null===t||"function"!=typeof a)o(t);else{var s=a({...t},n);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.id&&null===s&&Ce.log(`Event processor "${a.id}" dropped event`),de(s)?s.then((t=>this._notifyEventProcessors(e,t,n,r+1).then(o))).then(null,i):this._notifyEventProcessors(e,s,n,r+1).then(o).then(null,i)}}))}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function Pt(){return ne("globalEventProcessors",(()=>[]))}function Bt(e){Pt().push(e)}var Ft=100;class jt{__init(){this._stack=[{}]}
|
|
40
|
+
constructor(e,t=new It,n=4){this._version=n,jt.prototype.__init.call(this),this.getStackTop().scope=t,e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){var e=It.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){var t=this.pushScope();try{e(t)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){var n=this._lastEventId=t&&t.event_id?t.event_id:rt(),r=new Error("Sentry syntheticException");return this._withClient(((o,i)=>{o.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},i)})),n}captureMessage(e,t,n){var r=this._lastEventId=n&&n.event_id?n.event_id:rt(),o=new Error(e)
|
|
41
|
+
;return this._withClient(((i,a)=>{i.captureMessage(e,t,{originalException:e,syntheticException:o,...n,event_id:r},a)})),r}captureEvent(e,t){var n=t&&t.event_id?t.event_id:rt();return"transaction"!==e.type&&(this._lastEventId=n),this._withClient(((r,o)=>{r.captureEvent(e,{...t,event_id:n},o)})),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:n,client:r}=this.getStackTop();if(!n||!r)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:i=Ft}=r.getOptions&&r.getOptions()||{};if(!(i<=0)){var a={timestamp:kt(),...e},s=o?ke((()=>o(a,t))):a;null!==s&&n.addBreadcrumb(s,i)}}setUser(e){var t=this.getScope();t&&t.setUser(e)}setTags(e){var t=this.getScope();t&&t.setTags(e)}setExtras(e){var t=this.getScope();t&&t.setExtras(e)}setTag(e,t){var n=this.getScope();n&&n.setTag(e,t)}setExtra(e,t){var n=this.getScope();n&&n.setExtra(e,t)}setContext(e,t){var n=this.getScope();n&&n.setContext(e,t)}configureScope(e){const{scope:t,client:n}=this.getStackTop();t&&n&&e(t)}run(e){var t=Ht(this);try{e(this)}finally{
|
|
42
|
+
Ht(t)}}getIntegration(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){return this._callExtensionMethod("startTransaction",e,t)}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){var e=this.getStackTop(),t=e&&e.scope,n=t&&t.getSession();n&&function(e,t){let n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}),Dt(e,n)}(n),this._sendSessionUpdate(),t&&t.setSession()}startSession(e){const{scope:t,client:n}=this.getStackTop(),{release:r,environment:o}=n&&n.getOptions()||{};var i=te();const{userAgent:a}=i.navigator||{};var s=Rt({release:r,environment:o,...t&&{user:t.getUser()},...a&&{userAgent:a},...e});if(t){var l=t.getSession&&t.getSession();l&&"ok"===l.status&&Dt(l,{status:"exited"}),this.endSession(),
|
|
43
|
+
t.setSession(s)}return s}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop();if(e){var n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}}_withClient(e){const{scope:t,client:n}=this.getStackTop();n&&e(n,t)}_callExtensionMethod(e,...t){var n=Ut().__SENTRY__;if(n&&n.extensions&&"function"==typeof n.extensions[e])return n.extensions[e].apply(this,t);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Ut(){var e=te();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function Ht(e){var t=Ut(),n=Gt(t);return Vt(t,e),n}function qt(){var e=Ut();return $t(e)&&!Gt(e).isOlderThan(4)||Vt(e,new jt),Q()?function(e){try{var t=Ut().__SENTRY__,n=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active;if(!n)return Gt(e);if(!$t(n)||Gt(n).isOlderThan(4)){var r=Gt(e).getStackTop();Vt(n,new jt(r.client,It.clone(r.scope)))}return Gt(n)}catch(t){return Gt(e)}}(e):Gt(e)}function $t(e){
|
|
44
|
+
return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function Gt(e){return ne("hub",(()=>new jt),e)}function Vt(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}function Yt(e,t){return qt().captureException(e,{captureContext:t})}function Wt(e,t){qt().setExtra(e,t)}function Kt(e){qt().withScope(e)}function Xt(e){return t={sentry_key:e.publicKey,sentry_version:"7"},Object.keys(t).map((e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`)).join("&");var t}function Zt(e,t){return t||`${function(e){return`${function(e){var t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(e)}?${Xt(e)}`}function Jt(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function Qt(e,t,n,r){var o=Jt(n),i=e.type||"event";const{transactionSampling:a}=e.sdkProcessingMetadata||{},{method:s,rate:l}=a||{};!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,
|
|
45
|
+
e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]])}(e,n&&n.sdk),delete e.sdkProcessingMetadata;var c=function(e,t,n,r){var o=e.contexts&&e.contexts.baggage;const{environment:i,release:a,transaction:s,userid:l,usersegment:c}=o||{};return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&{dsn:_e(r)},..."transaction"===e.type&&e.contexts&&e.contexts.trace&&{trace:Pe({trace_id:e.contexts.trace.trace_id,public_key:r.publicKey,environment:i,release:a,transaction:s,...(l||c)&&{user:{id:l,segment:c}}})}}}(e,o,r,t);return Ct(c,[[{type:i,sample_rates:[{id:s,rate:l}]},e]])}var en=[];function tn(e){return e.reduce(((e,t)=>(e.every((e=>t.name!==e.name))&&e.push(t),e)),[])}function nn(e){var t=e.defaultIntegrations&&[...e.defaultIntegrations]||[],n=e.integrations;let r=[...tn(t)];Array.isArray(n)?r=[...r.filter((e=>n.every((t=>t.name!==e.name)))),...tn(n)]:"function"==typeof n&&(r=n(r),r=Array.isArray(r)?r:[r])
|
|
46
|
+
;var o=r.map((e=>e.name)),i="Debug";return-1!==o.indexOf(i)&&r.push(...r.splice(o.indexOf(i),1)),r}var rn="Not capturing exception because it's already been captured.";class on{__init(){this._integrations={}}__init2(){this._integrationsInitialized=!1}__init3(){this._numProcessing=0}__init4(){this._outcomes={}}constructor(e){if(on.prototype.__init.call(this),on.prototype.__init2.call(this),on.prototype.__init3.call(this),on.prototype.__init4.call(this),this._options=e,e.dsn){this._dsn=ye(e.dsn);var t=Zt(this._dsn,e.tunnel);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}else("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn("No DSN provided, client will not do anything.")}captureException(e,t,n){if(ct(e))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.log(rn));let r=t&&t.event_id;return this._process(this.eventFromException(e,t).then((e=>this._captureEvent(e,t,n))).then((e=>{r=e}))),r}
|
|
47
|
+
captureMessage(e,t,n,r){let o=n&&n.event_id;var i=ce(e)?this.eventFromMessage(String(e),t,n):this.eventFromException(e,n);return this._process(i.then((e=>this._captureEvent(e,n,r))).then((e=>{o=e}))),o}captureEvent(e,t,n){if(t&&t.originalException&&ct(t.originalException))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.log(rn));let r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then((e=>{r=e}))),r}captureSession(e){this._isEnabled()?"string"!=typeof e.release?("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Dt(e,{init:!1})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn("SDK not enabled, will not capture session.")}getDsn(){return this._dsn}getOptions(){return this._options}getTransport(){return this._transport}flush(e){var t=this._transport;return t?this._isClientDoneProcessing(e).then((n=>t.flush(e).then((e=>n&&e)))):mt(!0)}close(e){
|
|
48
|
+
return this.flush(e).then((e=>(this.getOptions().enabled=!1,e)))}setupIntegrations(){var e,t;this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=(e=this._options.integrations,t={},e.forEach((e=>{t[e.name]=e,-1===en.indexOf(e.name)&&(e.setupOnce(Bt,qt),en.push(e.name),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.log(`Integration installed: ${e.name}`))})),t),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}sendEvent(e,t={}){if(this._dsn){let r=Qt(e,this._dsn,this._options._metadata,this._options.tunnel);for(var n of t.attachments||[])r=Et(r,Mt(n,_t([this,"access",e=>e._options,"access",e=>e.transportOptions,"optionalAccess",e=>e.textEncoder])));this._sendEnvelope(r)}}sendSession(e){if(this._dsn){var t=function(e,t,n,r){var o=Jt(n)
|
|
49
|
+
;return Ct({sent_at:(new Date).toISOString(),...o&&{sdk:o},...!!r&&{dsn:_e(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}}recordDroppedEvent(e,t){if(this._options.sendClientReports){var n=`${e}:${t}`;("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}_updateSessionFromEvent(e,t){let n=!1,r=!1;var o=t.exception&&t.exception.values;if(o)for(var i of(r=!0,o)){var a=i.mechanism;if(a&&!1===a.handled){n=!0;break}}var s="ok"===e.status;(s&&0===e.errors||s&&n)&&(Dt(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new gt((t=>{let n=0;var r=setInterval((()=>{0==this._numProcessing?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))}),1)}))}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._dsn}_prepareEvent(e,t,n){
|
|
50
|
+
const{normalizeDepth:r=3,normalizeMaxBreadth:o=1e3}=this.getOptions();var i={...e,event_id:e.event_id||t.event_id||rt(),timestamp:e.timestamp||kt()};this._applyClientOptions(i),this._applyIntegrationsMetadata(i);let a=n;t.captureContext&&(a=It.clone(a).update(t.captureContext));let s=mt(i);if(a){var l=[...t.attachments||[],...a.getAttachments()];l.length&&(t.attachments=l),s=a.applyToEvent(i,t)}return s.then((e=>"number"==typeof r&&r>0?this._normalizeEvent(e,r,o):e))}_normalizeEvent(e,t,n){if(!e)return null;var r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((e=>({...e,...e.data&&{data:ut(e.data,t,n)}})))},...e.user&&{user:ut(e.user,t,n)},...e.contexts&&{contexts:ut(e.contexts,t,n)},...e.extra&&{extra:ut(e.extra,t,n)}};return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=ut(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map((e=>(e.data&&(e.data=ut(e.data,t,n)),e)))),r}_applyClientOptions(e){var t=this.getOptions()
|
|
51
|
+
;const{environment:n,release:r,dist:o,maxValueLength:i=250}=t;"environment"in e||(e.environment="environment"in t?n:"production"),void 0===e.release&&void 0!==r&&(e.release=r),void 0===e.dist&&void 0!==o&&(e.dist=o),e.message&&(e.message=Ee(e.message,i));var a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=Ee(a.value,i));var s=e.request;s&&s.url&&(s.url=Ee(s.url,i))}_applyIntegrationsMetadata(e){var t=Object.keys(this._integrations);t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then((e=>e.event_id),(e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn(e)}))}_processEvent(e,t,n){const{beforeSend:r,sampleRate:o}=this.getOptions();if(!this._isEnabled())return ft(new ge("SDK not enabled, will not capture event."));var i="transaction"===e.type;return!i&&"number"==typeof o&&Math.random()>o?(this.recordDroppedEvent("sample_rate","error"),
|
|
52
|
+
ft(new ge(`Discarding event because it's not included in the random sample (sampling rate = ${o})`))):this._prepareEvent(e,t,n).then((n=>{if(null===n)throw this.recordDroppedEvent("event_processor",e.type||"error"),new ge("An event processor returned null, will not send event.");return t.data&&!0===t.data.__sentry__||i||!r?n:function(e){var t="`beforeSend` method has to return `null` or a valid event.";if(de(e))return e.then((e=>{if(!ue(e)&&null!==e)throw new ge(t);return e}),(e=>{throw new ge(`beforeSend rejected with ${e}`)}));if(!ue(e)&&null!==e)throw new ge(t);return e}(r(n,t))})).then((r=>{if(null===r)throw this.recordDroppedEvent("before_send",e.type||"error"),new ge("`beforeSend` returned `null`, will not send event.");var o=n&&n.getSession();return!i&&o&&this._updateSessionFromEvent(o,r),this.sendEvent(r,t),r})).then(null,(e=>{if(e instanceof ge)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),
|
|
53
|
+
new ge(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)}))}_process(e){this._numProcessing+=1,e.then((e=>(this._numProcessing-=1,e)),(e=>(this._numProcessing-=1,e)))}_sendEnvelope(e){this._transport&&this._dsn?this._transport.send(e).then(null,(e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error("Error while sending event:",e)})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error("Transport disabled")}_clearOutcomes(){var e=this._outcomes;return this._outcomes={},Object.keys(e).map((t=>{const[n,r]=t.split(":");return{reason:n,category:r,quantity:e[t]}}))}}function an(e,t,n=vt(e.bufferSize||30)){let r={};return{send:function(o){var i=[];if(At(o,((t,n)=>{var o=zt(n);!function(e,t,n=Date.now()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,o)?i.push(t):e.recordDroppedEvent("ratelimit_backoff",o)})),0===i.length)return mt();var a=Ct(o[0],i),s=t=>{At(a,((n,r)=>{e.recordDroppedEvent(t,zt(r))
|
|
54
|
+
}))};return n.add((()=>t({body:Nt(a,e.textEncoder)}).then((e=>{void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=Ot(r,e)}),(e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error("Failed while sending event:",e),s("network_error")})))).then((e=>e),(e=>{if(e instanceof ge)return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error("Skipped sending event due to full buffer"),s("queue_overflow"),mt();throw e}))},flush:e=>n.drain(e)}}let sn;class ln{constructor(){ln.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=ln.id}setupOnce(){sn=Function.prototype.toString,Function.prototype.toString=function(...e){var t=ze(this)||this;return sn.apply(t,e)}}}ln.__initStatic();var cn=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/];class un{static __initStatic(){
|
|
55
|
+
this.id="InboundFilters"}__init(){this.name=un.id}constructor(e={}){this._options=e,un.prototype.__init.call(this)}setupOnce(e,t){var n=e=>{var n=t();if(n){var r=n.getIntegration(un);if(r){var o=n.getClient(),i=o?o.getOptions():{},a=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...cn],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(r._options,i);return function(e,t){if(t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}(e))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${at(e)}`),!0;if(function(e,t){if(!t||!t.length)return!1;return function(e){if(e.message)return[e.message];if(e.exception)try{const{type:t="",value:n=""}=e.exception.values&&e.exception.values[0]||{};return[`${n}`,`${t}: ${n}`]}catch(t){
|
|
56
|
+
return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error(`Cannot extract message for event ${at(e)}`),[]}return[]}(e).some((e=>t.some((t=>Te(e,t)))))}(e,t.ignoreErrors))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${at(e)}`),!0;if(function(e,t){if(!t||!t.length)return!1;var n=hn(e);return!!n&&t.some((e=>Te(n,e)))}(e,t.denyUrls))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${at(e)}.\nUrl: ${hn(e)}`),!0;if(!function(e,t){if(!t||!t.length)return!0;var n=hn(e);return!n||t.some((e=>Te(n,e)))}(e,t.allowUrls))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${at(e)}.\nUrl: ${hn(e)}`),!0;return!1}(e,a)?null:e}}return e};n.id=this.name,e(n)}}function hn(e){try{let t;try{t=e.exception.values[0].stacktrace.frames
|
|
57
|
+
}catch(e){}return t?function(e=[]){for(let n=e.length-1;n>=0;n--){var t=e[n];if(t&&"<anonymous>"!==t.filename&&"[native code]"!==t.filename)return t.filename||null}return null}(t):null}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error(`Cannot extract url for event ${at(e)}`),null}}un.__initStatic();function dn(e,t){var n=mn(e,t),r={type:t&&t.name,value:gn(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function pn(e,t){return{exception:{values:[dn(e,t)]}}}function mn(e,t){var n=t.stacktrace||t.stack||"",r=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(fn.test(e.message))return 1}return 0}(t);try{return e(n,r)}catch(e){}return[]}var fn=/Minified React error #\d+;/i;function gn(e){var t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function vn(e,t,n,r,o){let i;if(ae(t)&&t.error)return pn(e,t.error)
|
|
58
|
+
;if(se(t)||ie(t,"DOMException")){var a=t;if("stack"in t)i=pn(e,t);else{var s=a.name||(se(a)?"DOMError":"DOMException"),l=a.message?`${s}: ${a.message}`:s;i=_n(e,l,n,r),st(i,l)}return"code"in a&&(i.tags={...i.tags,"DOMException.code":`${a.code}`}),i}return oe(t)?pn(e,t):ue(t)||he(t)?(i=function(e,t,n,r){var o={exception:{values:[{type:he(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:`Non-Error ${r?"promise rejection":"exception"} captured with keys: ${Ie(t)}`}]},extra:{__serialized__:ht(t)}};if(n){var i=mn(e,n);i.length&&(o.exception.values[0].stacktrace={frames:i})}return o}(e,t,n,o),lt(i,{synthetic:!0}),i):(i=_n(e,t,n,r),st(i,`${t}`,void 0),lt(i,{synthetic:!0}),i)}function _n(e,t,n,r){var o={message:t};if(r&&n){var i=mn(e,n);i.length&&(o.exception={values:[{value:t,stacktrace:{frames:i}}]})}return o}class bn{static __initStatic(){this.id="Breadcrumbs"}__init(){this.name=bn.id}constructor(e){bn.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}
|
|
59
|
+
setupOnce(){this.options.console&&Ye("console",yn),this.options.dom&&Ye("dom",function(e){function t(t){let n,r="object"==typeof e?e.serializeAttribute:void 0;"string"==typeof r&&(r=[r]);try{n=t.event.target?me(t.event.target,r):me(t.event,r)}catch(e){n="<unknown>"}0!==n.length&&qt().addBreadcrumb({category:`ui.${t.name}`,message:n},{event:t.event,name:t.name,global:t.global})}return t}(this.options.dom)),this.options.xhr&&Ye("xhr",wn),this.options.fetch&&Ye("fetch",xn),this.options.history&&Ye("history",kn)}}function yn(e){var t,n={category:"console",data:{arguments:e.args,logger:"console"},level:(t=e.level,"warn"===t?"warning":bt.includes(t)?t:"log"),message:Ae(e.args," ")};if("assert"===e.level){if(!1!==e.args[0])return;n.message=`Assertion failed: ${Ae(e.args.slice(1)," ")||"console.assert"}`,n.data.arguments=e.args.slice(1)}qt().addBreadcrumb(n,{input:e.args,level:e.level})}function wn(e){if(e.endTimestamp){if(e.xhr.__sentry_own_request__)return
|
|
60
|
+
;const{method:t,url:n,status_code:r,body:o}=e.xhr.__sentry_xhr__||{};qt().addBreadcrumb({category:"xhr",data:{method:t,url:n,status_code:r},type:"http"},{xhr:e.xhr,input:o})}else;}function xn(e){e.endTimestamp&&(e.fetchData.url.match(/sentry_key/)&&"POST"===e.fetchData.method||(e.error?qt().addBreadcrumb({category:"fetch",data:e.fetchData,level:"error",type:"http"},{data:e.error,input:e.args}):qt().addBreadcrumb({category:"fetch",data:{...e.fetchData,status_code:e.response.status},type:"http"},{input:e.args,response:e.response})))}function kn(e){var t=te();let n=e.from,r=e.to;var o=ot(t.location.href);let i=ot(n);var a=ot(r);i.path||(i=o),o.protocol===a.protocol&&o.host===a.host&&(r=a.relative),o.protocol===i.protocol&&o.host===i.host&&(n=i.relative),qt().addBreadcrumb({category:"navigation",data:{from:n,to:r}})}bn.__initStatic();var Sn=te();let Cn;function En(){if(Cn)return Cn;if(He(Sn.fetch))return Cn=Sn.fetch.bind(Sn);var e=Sn.document;let t=Sn.fetch;if(e&&"function"==typeof e.createElement)try{
|
|
61
|
+
var n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);var r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(e){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return Cn=t.bind(Sn)}var An=te();class Tn extends on{constructor(e){e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:"7.2.0"}],version:"7.2.0"},super(e),e.sendClientReports&&An.document&&An.document.addEventListener("visibilitychange",(()=>{"hidden"===An.document.visibilityState&&this._flushOutcomes()}))}eventFromException(e,t){return function(e,t,n,r){var o=vn(e,t,n&&n.syntheticException||void 0,r);return lt(o),o.level="error",n&&n.event_id&&(o.event_id=n.event_id),mt(o)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,o){
|
|
62
|
+
var i=_n(e,t,r&&r.syntheticException||void 0,o);return i.level=n,r&&r.event_id&&(i.event_id=r.event_id),mt(i)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}sendEvent(e,t){var n=this.getIntegrationById("Breadcrumbs");n&&n.options&&n.options.sentry&&qt().addBreadcrumb({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:at(e)},{event:e}),super.sendEvent(e,t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}_flushOutcomes(){var e=this._clearOutcomes();if(0!==e.length)if(this._dsn){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.log("Sending outcomes:",e);var t,n,r,o=Zt(this._dsn,this._options.tunnel),i=(t=e,Ct((n=this._options.tunnel&&_e(this._dsn))?{dsn:n}:{},[[{type:"client_report"},{timestamp:r||kt(),discarded_events:t}]]));try{!function(e,t){
|
|
63
|
+
"[object Navigator]"===Object.prototype.toString.call(Sn&&Sn.navigator)&&"function"==typeof Sn.navigator.sendBeacon?Sn.navigator.sendBeacon.bind(Sn.navigator)(e,t):Ue()&&En()(e,{body:t,method:"POST",credentials:"omit",keepalive:!0}).then(null,(e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error(e)}))}(o,Nt(i))}catch(e){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.error(e)}}else("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.log("No dsn provided, will not send outcomes");else("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.log("No outcomes to send")}}function Nn(e,t=En()){return an(e,(function(n){var r={body:n.body,method:"POST",referrerPolicy:"origin",headers:e.headers,...e.fetchOptions};return t(e.url,r).then((e=>({statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}})))}))}function Mn(e){return an(e,(function(t){return new gt(((n,r)=>{var o=new XMLHttpRequest
|
|
64
|
+
;for(var i in o.onerror=r,o.onreadystatechange=()=>{4===o.readyState&&n({statusCode:o.status,headers:{"x-sentry-rate-limits":o.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":o.getResponseHeader("Retry-After")}})},o.open("POST",e.url),e.headers)Object.prototype.hasOwnProperty.call(e.headers,i)&&o.setRequestHeader(i,e.headers[i]);o.send(t.body)}))}))}function Ln(e,t,n,r){var o={filename:e,function:t,in_app:!0};return void 0!==n&&(o.lineno=n),void 0!==r&&(o.colno=r),o}var zn=/^\s*at (?:(.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,On=/\((\S*)(?::(\d+))(?::(\d+))\)/,Rn=[30,e=>{var t=zn.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){var n=On.exec(t[2]);n&&(t[2]=n[1],t[3]=n[2],t[4]=n[3])}const[e,r]=jn(t[1]||"?",t[2]);return Ln(r,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}
|
|
65
|
+
}],Dn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,In=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Pn=[50,e=>{var t=Dn.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=In.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}let e=t[3],r=t[1]||"?";return[r,e]=jn(r,e),Ln(e,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],Bn=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Fn=Fe(...[Rn,Pn,[40,e=>{var t=Bn.exec(e);return t?Ln(t[2],t[1]||"?",+t[3],t[4]?+t[4]:void 0):void 0}]]),jn=(e,t)=>{var n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};let Un=0;function Hn(){return Un>0}function qn(){Un+=1,setTimeout((()=>{Un-=1}))}function $n(e,t={},n){
|
|
66
|
+
if("function"!=typeof e)return e;try{var r=e.__sentry_wrapped__;if(r)return r;if(ze(e))return e}catch(t){return e}var o=function(){var r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);var o=r.map((e=>$n(e,t)));return e.apply(this,o)}catch(e){throw qn(),Kt((n=>{n.addEventProcessor((e=>(t.mechanism&&(st(e,void 0,void 0),lt(e,t.mechanism)),e.extra={...e.extra,arguments:r},e))),Yt(e)})),e}};try{for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i])}catch(e){}Le(o,e),Me(e,"__sentry_wrapped__",o);try{Object.getOwnPropertyDescriptor(o,"name").configurable&&Object.defineProperty(o,"name",{get:()=>e.name})}catch(e){}return o}class Gn{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=Gn.id}__init2(){this._installFunc={onerror:Vn,onunhandledrejection:Yn}}constructor(e){Gn.prototype.__init.call(this),Gn.prototype.__init2.call(this),this._options={onerror:!0,onunhandledrejection:!0,...e}}setupOnce(){Error.stackTraceLimit=50;var e,t=this._options
|
|
67
|
+
;for(var n in t){var r=this._installFunc[n];r&&t[n]&&(e=n,("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.log(`Global Handler attached: ${e}`),r(),this._installFunc[n]=void 0)}}}function Vn(){Ye("error",(e=>{const[t,n,r]=Xn();if(!t.getIntegration(Gn))return;const{msg:o,url:i,line:a,column:s,error:l}=e;if(!(Hn()||l&&l.__sentry_own_request__)){var c=void 0===l&&le(o)?function(e,t,n,r){var o=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let i=ae(e)?e.message:e,a="Error";var s=i.match(o);s&&(a=s[1],i=s[2]);return Wn({exception:{values:[{type:a,value:i}]}},t,n,r)}(o,i,a,s):Wn(vn(n,l||o,void 0,r,!1),i,a,s);c.level="error",Kn(t,l,c,"onerror")}}))}function Yn(){Ye("unhandledrejection",(e=>{const[t,n,r]=Xn();if(!t.getIntegration(Gn))return;let o=e;try{"reason"in e?o=e.reason:"detail"in e&&"reason"in e.detail&&(o=e.detail.reason)}catch(e){}if(Hn()||o&&o.__sentry_own_request__)return!0;var i=ce(o)?{exception:{values:[{type:"UnhandledRejection",
|
|
68
|
+
value:`Non-Error promise rejection captured with value: ${String(o)}`}]}}:vn(n,o,void 0,r,!0);i.level="error",Kn(t,o,i,"onunhandledrejection")}))}function Wn(e,t,n,r){var o=e.exception=e.exception||{},i=o.values=o.values||[],a=i[0]=i[0]||{},s=a.stacktrace=a.stacktrace||{},l=s.frames=s.frames||[],c=isNaN(parseInt(r,10))?void 0:r,u=isNaN(parseInt(n,10))?void 0:n,h=le(t)&&t.length>0?t:function(){var e=te();try{return e.document.location.href}catch(e){return""}}();return 0===l.length&&l.push({colno:c,filename:h,function:"?",in_app:!0,lineno:u}),e}function Kn(e,t,n,r){lt(n,{handled:!1,type:r}),e.captureEvent(n,{originalException:t})}function Xn(){var e=qt(),t=e.getClient(),n=t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[e,n.stackParser,n.attachStacktrace]}Gn.__initStatic()
|
|
69
|
+
;var Zn=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class Jn{static __initStatic(){this.id="TryCatch"}__init(){this.name=Jn.id}constructor(e){Jn.prototype.__init.call(this),this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){var e=te();this._options.setTimeout&&Ne(e,"setTimeout",Qn),this._options.setInterval&&Ne(e,"setInterval",Qn),this._options.requestAnimationFrame&&Ne(e,"requestAnimationFrame",er),this._options.XMLHttpRequest&&"XMLHttpRequest"in e&&Ne(XMLHttpRequest.prototype,"send",tr);var t=this._options.eventTarget
|
|
70
|
+
;t&&(Array.isArray(t)?t:Zn).forEach(nr)}}function Qn(e){return function(...t){var n=t[0];return t[0]=$n(n,{mechanism:{data:{function:je(e)},handled:!0,type:"instrument"}}),e.apply(this,t)}}function er(e){return function(t){return e.apply(this,[$n(t,{mechanism:{data:{function:"requestAnimationFrame",handler:je(e)},handled:!0,type:"instrument"}})])}}function tr(e){return function(...t){var n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((e=>{e in n&&"function"==typeof n[e]&&Ne(n,e,(function(t){var n={mechanism:{data:{function:e,handler:je(t)},handled:!0,type:"instrument"}},r=ze(t);return r&&(n.mechanism.data.handler=je(r)),$n(t,n)}))})),e.apply(this,t)}}function nr(e){var t=te(),n=t[e]&&t[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(Ne(n,"addEventListener",(function(t){return function(n,r,o){try{"function"==typeof r.handleEvent&&(r.handleEvent=$n(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:je(r),target:e},handled:!0,type:"instrument"}}))
|
|
71
|
+
}catch(e){}return t.apply(this,[n,$n(r,{mechanism:{data:{function:"addEventListener",handler:je(r),target:e},handled:!0,type:"instrument"}}),o])}})),Ne(n,"removeEventListener",(function(e){return function(t,n,r){var o=n;try{var i=o&&o.__sentry_wrapped__;i&&e.call(this,t,i,r)}catch(e){}return e.call(this,t,o,r)}})))}Jn.__initStatic();class rr{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=rr.id}constructor(e={}){rr.prototype.__init.call(this),this._key=e.key||"cause",this._limit=e.limit||5}setupOnce(){var e=qt().getClient();e&&Bt(((t,n)=>{var r=qt().getIntegration(rr);return r?function(e,t,n,r,o){if(!(r.exception&&r.exception.values&&o&&pe(o.originalException,Error)))return r;var i=or(e,n,o.originalException,t);return r.exception.values=[...i,...r.exception.values],r}(e.getOptions().stackParser,r._key,r._limit,t,n):t}))}}function or(e,t,n,r,o=[]){if(!pe(n[r],Error)||o.length+1>=t)return o;var i=dn(e,n[r]);return or(e,t,n[r],r,[i,...o])}rr.__initStatic();var ir=te();class ar{constructor(){
|
|
72
|
+
ar.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=ar.id}setupOnce(){Bt((e=>{if(qt().getIntegration(ar)){if(!ir.navigator&&!ir.location&&!ir.document)return e;var t=e.request&&e.request.url||ir.location&&ir.location.href;const{referrer:r}=ir.document||{},{userAgent:o}=ir.navigator||{};var n={...t&&{url:t},headers:{...e.request&&e.request.headers,...r&&{Referer:r},...o&&{"User-Agent":o}}};return{...e,request:n}}return e}))}}ar.__initStatic();class sr{constructor(){sr.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=sr.id}setupOnce(e,t){var n=e=>{var n=t().getIntegration(sr);if(n){try{if(function(e,t){if(!t)return!1;if(function(e,t){var n=e.message,r=t.message;if(!n&&!r)return!1;if(n&&!r||!n&&r)return!1;if(n!==r)return!1;if(!cr(e,t))return!1;if(!lr(e,t))return!1;return!0}(e,t))return!0;if(function(e,t){var n=ur(t),r=ur(e);if(!n||!r)return!1;if(n.type!==r.type||n.value!==r.value)return!1;if(!cr(e,t))return!1;if(!lr(e,t))return!1
|
|
73
|
+
;return!0}(e,t))return!0;return!1}(e,n._previousEvent))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(t){return n._previousEvent=e}return n._previousEvent=e}return e};n.id=this.name,e(n)}}function lr(e,t){let n=hr(e),r=hr(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(n=n,r=r,r.length!==n.length)return!1;for(let e=0;e<r.length;e++){var o=r[e],i=n[e];if(o.filename!==i.filename||o.lineno!==i.lineno||o.colno!==i.colno||o.function!==i.function)return!1}return!0}function cr(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return!(n.join("")!==r.join(""))}catch(e){return!1}}function ur(e){return e.exception&&e.exception.values&&e.exception.values[0]}function hr(e){var t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch(e){return}}sr.__initStatic();var dr=[new un,new ln,new Jn,new bn,new Gn,new rr,new sr,new ar];function pr(e={}){
|
|
74
|
+
if(void 0===e.defaultIntegrations&&(e.defaultIntegrations=dr),void 0===e.release){var t=te();t.SENTRY_RELEASE&&t.SENTRY_RELEASE.id&&(e.release=t.SENTRY_RELEASE.id)}void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);var n,r={...e,stackParser:(n=e.stackParser||Fn,Array.isArray(n)?Fe(...n):n),integrations:nn(e),transport:e.transport||(Ue()?Nn:Mn)};!function(e,t){!0===t.debug&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?Ce.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));var n=qt(),r=n.getScope();r&&r.update(t.initialScope);var o=new e(t);n.bindClient(o)}(Tn,r),e.autoSessionTracking&&function(){if(void 0===te().document)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ce.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));var e=qt();if(!e.captureSession)return;mr(e),Ye("history",(({from:e,to:t})=>{void 0!==e&&e!==t&&mr(qt())
|
|
75
|
+
}))}()}function mr(e){e.startSession({ignoreDuration:!0}),e.captureSession()}let fr={};var gr=te();function vr(e){const t=t=>{const{data:n}=t;if(n&&"hypothesis-error"===(null==n?void 0:n.type)){const{context:t,error:r}=n;e(r instanceof Error?r:function(e){const t=new Error(e.message);return t.stack=e.stack,t}(r),t)}};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}gr.Sentry&&gr.Sentry.Integrations&&(fr=gr.Sentry.Integrations);let _r=0;function br(e){!function(e){qt().setUser(e)}(e)}!function(){function e(e){var t=!0,n=!1,r=null,o={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function i(e){return!!(e&&e!==document&&"HTML"!==e.nodeName&&"BODY"!==e.nodeName&&"classList"in e&&"contains"in e.classList)}function a(e){var t=e.type,n=e.tagName;return!("INPUT"!==n||!o[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}function s(e){
|
|
76
|
+
e.classList.contains("focus-visible")||(e.classList.add("focus-visible"),e.setAttribute("data-focus-visible-added",""))}function l(e){e.hasAttribute("data-focus-visible-added")&&(e.classList.remove("focus-visible"),e.removeAttribute("data-focus-visible-added"))}function c(n){n.metaKey||n.altKey||n.ctrlKey||(i(e.activeElement)&&s(e.activeElement),t=!0)}function u(e){t=!1}function h(e){i(e.target)&&(t||a(e.target))&&s(e.target)}function d(e){i(e.target)&&(e.target.classList.contains("focus-visible")||e.target.hasAttribute("data-focus-visible-added"))&&(n=!0,window.clearTimeout(r),r=window.setTimeout((function(){n=!1}),100),l(e.target))}function p(e){"hidden"===document.visibilityState&&(n&&(t=!0),m())}function m(){document.addEventListener("mousemove",g),document.addEventListener("mousedown",g),document.addEventListener("mouseup",g),document.addEventListener("pointermove",g),document.addEventListener("pointerdown",g),document.addEventListener("pointerup",g),document.addEventListener("touchmove",g),
|
|
77
|
+
document.addEventListener("touchstart",g),document.addEventListener("touchend",g)}function f(){document.removeEventListener("mousemove",g),document.removeEventListener("mousedown",g),document.removeEventListener("mouseup",g),document.removeEventListener("pointermove",g),document.removeEventListener("pointerdown",g),document.removeEventListener("pointerup",g),document.removeEventListener("touchmove",g),document.removeEventListener("touchstart",g),document.removeEventListener("touchend",g)}function g(e){e.target.nodeName&&"html"===e.target.nodeName.toLowerCase()||(t=!1,f())}document.addEventListener("keydown",c,!0),document.addEventListener("mousedown",u,!0),document.addEventListener("pointerdown",u,!0),document.addEventListener("touchstart",u,!0),document.addEventListener("visibilitychange",p,!0),m(),e.addEventListener("focus",h,!0),e.addEventListener("blur",d,!0),
|
|
78
|
+
e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host?e.host.setAttribute("data-js-focus-visible",""):e.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if("undefined"!=typeof window&&"undefined"!=typeof document){var t;window.applyFocusVisiblePolyfill=e;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch(e){(t=document.createEvent("CustomEvent")).initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}"undefined"!=typeof document&&e(document)}(),"undefined"!=typeof window&&window.__PREACT_DEVTOOLS__&&window.__PREACT_DEVTOOLS__.attachPreact("10.8.1",n,{Fragment:m,Component:f});var yr={};function wr(e){return e.type===m?"Fragment":"function"==typeof e.type?e.type.displayName||e.type.name:"string"==typeof e.type?e.type:"#text"}var xr=[],kr=[];function Sr(){return xr.length>0?xr[xr.length-1]:null}var Cr=!1;function Er(e){return"function"==typeof e.type&&e.type!=m}
|
|
79
|
+
function Ar(e){for(var t=[e],n=e;null!=n.__o;)t.push(n.__o),n=n.__o;return t.reduce((function(e,t){e+=" in "+wr(t);var n=t.__source;return n?e+=" (at "+n.fileName+":"+n.lineNumber+")":Cr||(Cr=!0,console.warn("Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons.")),e+"\n"}),"")}var Tr="function"==typeof WeakMap,Nr=f.prototype.setState;f.prototype.setState=function(e,t){return null==this.__v?null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+Ar(Sr())):null==this.__P&&console.warn('Can\'t call "this.setState" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+Ar(this.__v)),Nr.call(this,e,t)}
|
|
80
|
+
;var Mr=f.prototype.forceUpdate;function Lr(e){var t=e.props,n=wr(e),r="";for(var o in t)if(t.hasOwnProperty(o)&&"children"!==o){var i=t[o];"function"==typeof i&&(i="function "+(i.displayName||i.name)+"() {}"),i=Object(i)!==i||i.toString?i+"":Object.prototype.toString.call(i),r+=" "+o+"="+JSON.stringify(i)}var a=t.children;return"<"+n+r+(a&&a.length?">..</"+n+">":" />")}f.prototype.forceUpdate=function(e){return null==this.__v?console.warn('Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n'+Ar(Sr())):null==this.__P&&console.warn('Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+Ar(this.__v)),Mr.call(this,e)},function(){!function(){var e=n.__b,t=n.diffed,r=n.__,o=n.vnode,i=n.__r;n.diffed=function(e){Er(e)&&kr.pop(),xr.pop(),t&&t(e)},n.__b=function(t){Er(t)&&xr.push(t),
|
|
81
|
+
e&&e(t)},n.__=function(e,t){kr=[],r&&r(e,t)},n.vnode=function(e){e.__o=kr.length>0?kr[kr.length-1]:null,o&&o(e)},n.__r=function(e){Er(e)&&kr.push(e),i&&i(e)}}();var e=!1,t=n.__b,r=n.diffed,o=n.vnode,i=n.__e,a=n.__,s=n.__h,l=Tr?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,c=[];n.__e=function(e,t,n,r){if(t&&t.__c&&"function"==typeof e.then){var o=e;e=new Error("Missing Suspense. The throwing component was: "+wr(t));for(var a=t;a;a=a.__)if(a.__c&&a.__c.__c){e=o;break}if(e instanceof Error)throw e}try{(r=r||{}).componentStack=Ar(t),i(e,t,n,r),"function"!=typeof e.then&&setTimeout((function(){throw e}))}catch(e){throw e}},n.__=function(e,t){if(!t)throw new Error("Undefined parent passed to render(), this is the second argument.\nCheck if the element is available in the DOM/has the correct id.");var n;switch(t.nodeType){case 1:case 11:case 9:n=!0;break;default:n=!1}if(!n){var r=wr(e)
|
|
82
|
+
;throw new Error("Expected a valid HTML node as a second argument to render.\tReceived "+t+" instead: render(<"+r+" />, "+t+");")}a&&a(e,t)},n.__b=function(n){var r=n.type,o=function e(t){return t?"function"==typeof t.type?e(t.__):t:{}}(n.__);if(e=!0,void 0===r)throw new Error("Undefined component passed to createElement()\n\nYou likely forgot to export your component or might have mixed up default and named imports"+Lr(n)+"\n\n"+Ar(n));if(null!=r&&"object"==typeof r){if(void 0!==r.__k&&void 0!==r.__e)throw new Error("Invalid type passed to createElement(): "+r+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+wr(n)+" = "+Lr(r)+";\n let vnode = <My"+wr(n)+" />;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+Ar(n));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(r)?"array":r))}
|
|
83
|
+
if("thead"!==r&&"tfoot"!==r&&"tbody"!==r||"table"===o.type?"tr"===r&&"thead"!==o.type&&"tfoot"!==o.type&&"tbody"!==o.type&&"table"!==o.type?console.error("Improper nesting of table. Your <tr> should have a <thead/tbody/tfoot/table> parent."+Lr(n)+"\n\n"+Ar(n)):"td"===r&&"tr"!==o.type?console.error("Improper nesting of table. Your <td> should have a <tr> parent."+Lr(n)+"\n\n"+Ar(n)):"th"===r&&"tr"!==o.type&&console.error("Improper nesting of table. Your <th> should have a <tr>."+Lr(n)+"\n\n"+Ar(n)):console.error("Improper nesting of table. Your <thead/tbody/tfoot> should have a <table> parent."+Lr(n)+"\n\n"+Ar(n)),void 0!==n.ref&&"function"!=typeof n.ref&&"object"!=typeof n.ref&&!("$$typeof"in n))throw new Error('Component\'s "ref" property should be a function, or an object created by createRef(), but got ['+typeof n.ref+"] instead\n"+Lr(n)+"\n\n"+Ar(n))
|
|
84
|
+
;if("string"==typeof n.type)for(var i in n.props)if("o"===i[0]&&"n"===i[1]&&"function"!=typeof n.props[i]&&null!=n.props[i])throw new Error("Component's \""+i+'" property should be a function, but got ['+typeof n.props[i]+"] instead\n"+Lr(n)+"\n\n"+Ar(n));if("function"==typeof n.type&&n.type.propTypes){if("Lazy"===n.type.displayName&&l&&!l.lazyPropTypes.has(n.type)){var a="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var s=n.type();l.lazyPropTypes.set(n.type,!0),console.warn(a+"Component wrapped in lazy() is "+wr(s))}catch(n){console.warn(a+"We will log the wrapped component's name once it is loaded.")}}var c=n.props;n.type.__f&&delete(c=function(e,t){for(var n in t)e[n]=t[n];return e}({},c)).ref,function(e,t,n,r,o){Object.keys(e).forEach((function(n){var i;try{i=e[n](t,n,r,"prop",null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){i=e}!i||i.message in yr||(yr[i.message]=!0,console.error("Failed prop type: "+i.message+(o&&"\n"+o()||"")))}))
|
|
85
|
+
}(n.type.propTypes,c,0,wr(n),(function(){return Ar(n)}))}t&&t(n)},n.__h=function(t,n,r){if(!t||!e)throw new Error("Hook can only be invoked from render methods.");s&&s(t,n,r)};var u=function(e,t){return{get:function(){var n="get"+e+t;c&&c.indexOf(n)<0&&(c.push(n),console.warn("getting vnode."+e+" is deprecated, "+t))},set:function(){var n="set"+e+t;c&&c.indexOf(n)<0&&(c.push(n),console.warn("setting vnode."+e+" is not allowed, "+t))}}},h={nodeName:u("nodeName","use vnode.type"),attributes:u("attributes","use vnode.props"),children:u("children","use vnode.props.children")},d=Object.create({},h);n.vnode=function(e){var t=e.props;if(null!==e.type&&null!=t&&("__source"in t||"__self"in t)){var n=e.props={};for(var r in t){var i=t[r];"__source"===r?e.__source=i:"__self"===r?e.__self=i:n[r]=i}}e.__proto__=d,o&&o(e)},n.diffed=function(t){if(t.__k&&t.__k.forEach((function(e){if(e&&void 0===e.type){delete e.__,delete e.__b;var n=Object.keys(e).join(",")
|
|
86
|
+
;throw new Error("Objects are not valid as a child. Encountered an object with the keys {"+n+"}.\n\n"+Ar(t))}})),e=!1,r&&r(t),null!=t.__k)for(var n=[],o=0;o<t.__k.length;o++){var i=t.__k[o];if(i&&null!=i.key){var a=i.key;if(-1!==n.indexOf(a)){console.error('Following component has two or more children with the same key attribute: "'+a+'". This may cause glitches and misbehavior in rendering process. Component: \n\n'+Lr(t)+"\n\n"+Ar(t));break}n.push(a)}}}}();var zr={exports:{}};!function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)e.push(o);else if(Array.isArray(o)){if(o.length){var a=n.apply(null,o);a&&e.push(a)}}else if("object"===i)if(o.toString===Object.prototype.toString)for(var s in o)t.call(o,s)&&o[s]&&e.push(s);else e.push(o.toString())}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n}()}(zr)
|
|
87
|
+
;var Or,Rr,Dr,Ir,Pr=zr.exports,Br=0,Fr=[],jr=n.__b,Ur=n.__r,Hr=n.diffed,qr=n.__c,$r=n.unmount;function Gr(e,t){n.__h&&n.__h(Rr,e,Br||t),Br=0;var r=Rr.__H||(Rr.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Vr(e){return Br=1,Yr(io,e)}function Yr(e,t,n){var r=Gr(Or++,2);return r.t=e,r.__c||(r.__=[n?n(t):io(void 0,t),function(e){var t=r.t(r.__[0],e);r.__[0]!==t&&(r.__=[t,r.__[1]],r.__c.setState({}))}],r.__c=Rr),r.__}function Wr(e,t){var r=Gr(Or++,3);!n.__s&&oo(r.__H,t)&&(r.__=e,r.u=t,Rr.__H.__h.push(r))}function Kr(e,t){var r=Gr(Or++,4);!n.__s&&oo(r.__H,t)&&(r.__=e,r.u=t,Rr.__h.push(r))}function Xr(e){return Br=5,Zr((function(){return{current:e}}),[])}function Zr(e,t){var n=Gr(Or++,7);return oo(n.__H,t)?(n.o=e(),n.u=t,n.__h=e,n.o):n.__}function Jr(e,t){return Br=8,Zr((function(){return e}),t)}function Qr(e){var t=Rr.context[e.__c],n=Gr(Or++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Rr)),t.props.value):e.__}function eo(){for(var e;e=Fr.shift();)if(e.__P)try{e.__H.__h.forEach(no),
|
|
88
|
+
e.__H.__h.forEach(ro),e.__H.__h=[]}catch(t){e.__H.__h=[],n.__e(t,e.__v)}}n.__b=function(e){Rr=null,jr&&jr(e)},n.__r=function(e){Ur&&Ur(e),Or=0;var t=(Rr=e.__c).__H;t&&(Dr===Rr?(t.__h=[],Rr.__h=[],t.__.forEach((function(e){e.o=e.u=void 0}))):(t.__.forEach((function(e){e.u&&(e.__H=e.u),e.o&&(e.__=e.o),e.o=e.u=void 0})),t.__h.forEach(no),t.__h.forEach(ro),t.__h=[])),Dr=Rr},n.diffed=function(e){Hr&&Hr(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==Fr.push(t)&&Ir===n.requestAnimationFrame||((Ir=n.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),to&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);to&&(t=requestAnimationFrame(n))})(eo)),Rr=null,Dr=null},n.__c=function(e,t){t.some((function(e){try{e.__H&&e.__H.__.forEach((function(e){e.u&&(e.__H=e.u),e.o&&(e.__=e.o),e.o=e.u=void 0})),e.__h.forEach(no),e.__h=e.__h.filter((function(e){return!e.__||ro(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],n.__e(r,e.__v)}})),qr&&qr(e,t)},n.unmount=function(e){$r&&$r(e)
|
|
89
|
+
;var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{no(e)}catch(e){t=e}})),t&&n.__e(t,r.__v))};var to="function"==typeof requestAnimationFrame;function no(e){var t=Rr,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Rr=t}function ro(e){var t=Rr;e.__c=e.__(),Rr=t}function oo(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function io(e,t){return"function"==typeof t?t(e):t}var ao=0;function so(e,t,r,o,i){var a,s,l={};for(s in t)"ref"==s?a=t[s]:l[s]=t[s];var c={type:e,props:l,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--ao,__source:i,__self:o};if("function"==typeof e&&(a=e.defaultProps))for(s in a)void 0===l[s]&&(l[s]=a[s]);return n.vnode&&n.vnode(c),c}const lo=new Map;function co({name:e,className:t="",inline:n=!1,title:r=""}){const o=lo.get(e);if(!o)throw new Error(`Icon "${e.toString()}" is not registered`);const i=Xr();Kr((()=>{const e=i.current.querySelector("svg");e&&e.setAttribute("class",t)}),[t,o]);const a={}
|
|
90
|
+
;return r&&(a.title=r),so("span",{className:Pr("Hyp-SvgIcon",{"Hyp-SvgIcon--inline":n}),dangerouslySetInnerHTML:{__html:o},ref:i,...a},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/SvgIcon.js",lineNumber:69,columnNumber:5})}function uo(e,t){const n="string"==typeof e?Symbol(e):e;return lo.set(n,t),n}var ho="/home/runner/work/frontend-shared/frontend-shared/src/components/buttons.js";function po({buttonRef:e,classes:t,className:n,icon:r,iconPosition:o="left",size:i="medium",variant:a="normal",expanded:s,pressed:l,type:c="button",...u}){var h;const d=null!==(h=null==u?void 0:u.role)&&void 0!==h?h:"button",p={"aria-label":u.title};return"tab"===d?p["aria-selected"]=l:(p["aria-pressed"]=l,p["aria-expanded"]=s),so("button",{ref:e,className:Pr(n,`${n}--${i}`,`${n}--${a}`,{[`${n}--icon-${o}`]:r},t),type:c,...p,...u},void 0,!1,{fileName:ho,lineNumber:82,columnNumber:5})}function mo({className:e="Hyp-IconButton",...t}){const{icon:n}=t;return so(po,{className:e,...t,
|
|
91
|
+
children:so(co,{name:n},void 0,!1,{fileName:ho,lineNumber:109,columnNumber:7})},void 0,!1,{fileName:ho,lineNumber:108,columnNumber:5})}function fo({children:e,className:t="Hyp-LabeledButton",...n}){const{icon:r,iconPosition:o="left"}=n;return so(po,{className:t,...n,children:[r&&"left"===o&&so(co,{name:r},void 0,!1,{fileName:ho,lineNumber:127,columnNumber:43}),e,r&&"right"===o&&so(co,{name:r},void 0,!1,{fileName:ho,lineNumber:129,columnNumber:44})]},void 0,!0,{fileName:ho,lineNumber:126,columnNumber:5})}function go(e){return so(po,{className:"Hyp-LinkButton",...e},void 0,!1,{fileName:ho,lineNumber:140,columnNumber:10})}
|
|
92
|
+
uo("checkbox",' <svg\n width="32"\n height="32"\n viewBox="-4 -4 39 39"\n aria-hidden="true"\n focusable="false"\n >\n <rect\n class="hyp-svg-checkbox--background"\n width="35"\n height="35"\n x="-2"\n y="-2"\n stroke="currentColor"\n fill="none"\n stroke-width="3"\n rx="5"\n ry="5"\n />\n <polyline\n class="hyp-svg-checkbox--checkmark"\n points="4,14 12,23 28,5"\n stroke="transparent"\n stroke-width="5"\n fill="none"\n />\n</svg>');var vo="/home/runner/work/frontend-shared/frontend-shared/src/components/containers.js";function _o({children:e,classes:t,containerRef:n,elementRef:r,...o}){return so("div",{className:Pr("Hyp-Frame",t),...o,ref:null!=r?r:n,children:e},void 0,!1,{fileName:vo,lineNumber:40,columnNumber:5})}function bo({children:e,classes:t,containerRef:n,elementRef:r,...o}){return so("div",{className:Pr("Hyp-Card",t),...o,ref:null!=r?r:n,children:e},void 0,!1,{fileName:vo,lineNumber:63,
|
|
93
|
+
columnNumber:5})}function yo({children:e,direction:t="row",classes:n,containerRef:r,elementRef:o,...i}){return so("div",{className:Pr(`Hyp-Actions--${t}`,n),...i,ref:null!=o?o:r,children:e},void 0,!1,{fileName:vo,lineNumber:89,columnNumber:5})}var wo='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 8l3.536-3.536L8 8 4.464 4.464 8 8zm0 0l-3.536 3.536L8 8l3.536 3.536L8 8z"></path></g></svg>\n',xo="/home/runner/work/frontend-shared/frontend-shared/src/components/Dialog.js";const ko=uo("cancel",wo);let So=0;function Co(e){const[t]=Vr((()=>(++So,`${e}-${So}`)));return t}
|
|
94
|
+
function Eo({buttons:e,cancelLabel:t="Cancel",children:n,contentClass:r,icon:o,initialFocus:i,onCancel:a,role:s="dialog",title:l,withCancelButton:c=!0,withCloseButton:u=!0}){const h=Co("dialog-description"),d=Co("dialog-title"),p=Xr();Wr((()=>{if(null!==i){const e=null==i?void 0:i.current;e&&!e.disabled?e.focus():p.current.focus()}}),[]),Kr((()=>{const e=p.current.querySelector("p");e&&(e.id=h,p.current.setAttribute("aria-describedby",h))}),[h]);const m=a&&c,f=e||m;return so("div",{"aria-labelledby":d,className:Pr("Hyp-Dialog",{"Hyp-Dialog--closeable":a&&u},r),ref:p,role:s,tabIndex:-1,children:[so("header",{className:"Hyp-Dialog__header",children:[o&&so("div",{className:"Hyp-Dialog__header-icon",children:so(co,{name:o,title:l,"data-testid":"header-icon"},void 0,!1,{fileName:xo,lineNumber:139,columnNumber:13})},void 0,!1,{fileName:xo,lineNumber:138,columnNumber:11}),so("h2",{className:"Hyp-Dialog__title",id:d,children:l},void 0,!1,{fileName:xo,lineNumber:142,columnNumber:9}),a&&u&&so("div",{
|
|
95
|
+
className:"Hyp-Dialog__close",children:so(mo,{"data-testid":"close-button",icon:ko,title:"Close",onClick:a},void 0,!1,{fileName:xo,lineNumber:147,columnNumber:13})},void 0,!1,{fileName:xo,lineNumber:146,columnNumber:11})]},void 0,!0,{fileName:xo,lineNumber:136,columnNumber:7}),n,f&&so("div",{className:"Hyp-Dialog__actions",children:[m&&so(fo,{"data-testid":"cancel-button",onClick:a,children:t},void 0,!1,{fileName:xo,lineNumber:160,columnNumber:13}),e]},void 0,!0,{fileName:xo,lineNumber:158,columnNumber:9})]},void 0,!0,{fileName:xo,lineNumber:125,columnNumber:5})}function Ao({name:e,classes:t="",containerClasses:n="",title:r=""}){const o=lo.get(e);if(!o)throw new Error(`Icon "${e.toString()}" is not registered`);const i=Xr();Kr((()=>{const e=i.current.querySelector("svg");e&&e.setAttribute("class",Pr("Hyp-Icon",t))}),[t,o]);const a={};return r&&(a.title=r),so("span",{className:n,dangerouslySetInnerHTML:{__html:o},ref:i,...a},void 0,!1,{
|
|
96
|
+
fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Icon.js",lineNumber:60,columnNumber:5})}function To({children:e,classes:t="",linkRef:n,...r}){return so("a",{className:Pr("Hyp-Link",t),ref:n,rel:"noopener noreferrer",...r,children:e},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Link.js",lineNumber:24,columnNumber:5})}function No(e){const t={Left:"ArrowLeft",Up:"ArrowUp",Down:"ArrowDown",Right:"ArrowRight",Spacebar:" ",Del:"Delete"};return t[e]?t[e]:e}function Mo(e,t,n,{useCapture:r=!1}={}){return t.forEach((t=>e.addEventListener(t,n,r))),()=>{t.forEach((t=>e.removeEventListener(t,n,r)))}}function Lo(e,t,n){Wr((()=>{if(!t)return()=>{};const r=Mo(document.body,["keydown"],(e=>{"Escape"===No(e.key)&&n()})),o=Mo(document.body,["focus"],(t=>{e.current&&!e.current.contains(t.target)&&n()}),{useCapture:!0}),i=Mo(document.body,["mousedown","click"],(t=>{e.current&&!e.current.contains(t.target)&&n()}),{useCapture:!0});return()=>{r(),i(),o()}}),[e,t,n])
|
|
97
|
+
}var zo="/home/runner/work/frontend-shared/frontend-shared/src/components/Modal.js";function Oo({children:e,onCancel:t,...n}){const r=Xr();return Lo(r,!0,(()=>{t&&t()})),so(m,{children:[so("div",{className:"Hyp-Modal__overlay"},void 0,!1,{fileName:zo,lineNumber:39,columnNumber:7}),so("div",{className:"Hyp-Modal",ref:r,children:so(Eo,{onCancel:t,...n,children:e},void 0,!1,{fileName:zo,lineNumber:41,columnNumber:9})},void 0,!1,{fileName:zo,lineNumber:40,columnNumber:7})]},void 0,!0)}function Ro({message:e,confirmAction:t,onConfirm:n,onCancel:r,...o}){return so(Oo,{onCancel:r,buttons:[so(fo,{onClick:n,variant:"primary","data-testid":"confirm-button",children:t},"ok",!1,{fileName:zo,lineNumber:76,columnNumber:9})],...o,children:so("p",{children:e},void 0,!1,{fileName:zo,lineNumber:87,columnNumber:7})},void 0,!1,{fileName:zo,lineNumber:73,columnNumber:5})}var Do="/home/runner/work/frontend-shared/frontend-shared/src/components/Panel.js";const Io=uo("cancel",wo);function Po({children:e,icon:t,onClose:n,title:r}){
|
|
98
|
+
const o=!!n;return so("div",{className:Pr("Hyp-Panel",{"Hyp-Panel--closeable":o}),children:[so("header",{className:"Hyp-Panel__header",children:[t&&so("div",{className:"Hyp-Panel__header-icon",children:so(co,{name:t,title:r},void 0,!1,{fileName:Do,lineNumber:37,columnNumber:13})},void 0,!1,{fileName:Do,lineNumber:36,columnNumber:11}),so("h2",{className:"Hyp-Panel__title",children:r},void 0,!1,{fileName:Do,lineNumber:40,columnNumber:9}),o&&so("div",{className:"Hyp-Panel__close",children:so(mo,{icon:Io,title:"Close",onClick:n},void 0,!1,{fileName:Do,lineNumber:43,columnNumber:13})},void 0,!1,{fileName:Do,lineNumber:42,columnNumber:11})]},void 0,!0,{fileName:Do,lineNumber:34,columnNumber:7}),so("div",{className:"Hyp-Panel__content",children:e},void 0,!1,{fileName:Do,lineNumber:47,columnNumber:7})]},void 0,!0,{fileName:Do,lineNumber:29,columnNumber:5})}
|
|
99
|
+
const Bo=uo("spinner",'<svg viewBox="0 0 64 64">\n <g stroke-width="6" stroke="currentColor" stroke-linecap="round">\n <line y1="16" y2="28" transform="translate(32,32) rotate(180)">\n <animate attributeName="stroke-opacity" dur="750ms" values="0;1;.8;.65;.45;.3;.15;0" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(225)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".15;0;1;.8;.65;.45;.3;.15" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(270)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".3;.15;0;1;.8;.65;.45;.3" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(315)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".45;.3;.15;0;1;.85;.65;.45" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(0)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".65;.45;.3;.15;0;1;.8;.65;" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(45)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".8;.65;.45;.3;.15;0;1;.8" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(90)">\n <animate attributeName="stroke-opacity" dur="750ms" values="1;.85;.6;.45;.3;.15;0;1;" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(135)">\n <animate attributeName="stroke-opacity" dur="750ms" values="0;1;.8;.65;.45;.3;.15;0" repeatCount="indefinite"></animate>\n </line>\n </g>\n</svg>')
|
|
100
|
+
;function Fo({classes:e="",size:t="medium"}){return so(Ao,{name:Bo,containerClasses:Pr(`Hyp-Spinner--${t}`,e)},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Spinner.js",lineNumber:32,columnNumber:5})}var jo="/home/runner/work/frontend-shared/frontend-shared/src/components/TextInput.js";function Uo({classes:e="",inputRef:t,hasError:n=!1,type:r="text",...o}){return so("input",{className:Pr("Hyp-TextInput",{"has-error":n},e),...o,ref:t,type:r},void 0,!1,{fileName:jo,lineNumber:39,columnNumber:5})}function Ho({children:e,classes:t=""}){return so("div",{className:Pr("Hyp-TextInputWithButton",t),children:e},void 0,!1,{fileName:jo,lineNumber:67,columnNumber:5})}
|
|
101
|
+
var qo='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 4l4 4-4 4"></path></g></svg>',$o='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg width="24px" height="28px" viewBox="0 0 24 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <rect fill="#ffffff" stroke="none" width="17.14407" height="16.046612" x="3.8855932" y="3.9449153" />\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <path d="M0,2.00494659 C0,0.897645164 0.897026226,0 2.00494659,0 L21.9950534,0 C23.1023548,0 24,0.897026226 24,2.00494659 L24,21.9950534 C24,23.1023548 23.1029738,24 21.9950534,24 L2.00494659,24 C0.897645164,24 0,23.1029738 0,21.9950534 L0,2.00494659 Z M9,24 L12,28 L15,24 L9,24 Z M7.00811294,4 L4,4 L4,20 L7.00811294,20 L7.00811294,15.0028975 C7.00811294,12.004636 8.16824717,12.0097227 9,12 C10,12.0072451 11.0189302,12.0606714 11.0189302,14.003477 L11.0189302,20 L14.0270431,20 L14.0270431,13.1087862 C14.0270433,10 12,9.00309038 10,9.00309064 C8.01081726,9.00309091 8,9.00309086 7.00811294,11.0019317 L7.00811294,4 Z M19,19.9869002 C20.1045695,19.9869002 21,19.0944022 21,17.9934501 C21,16.892498 20.1045695,16 19,16 C17.8954305,16 17,16.892498 17,17.9934501 C17,19.0944022 17.8954305,19.9869002 19,19.9869002 Z" fill="currentColor"></path>\n </g>\n</svg>\n'
|
|
102
|
+
;const Go={add:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M8.99302964,2.86682521 L9,3 L9,6.999 L13,7 C13.5522847,7 14,7.44771525 14,8 C14,8.51283584 13.6139598,8.93550716 13.1166211,8.99327227 L13,9 L9,9 L9,13 C9,14.2873563 7.13555291,14.3317479 7.00697036,13.1331748 L7,13 L7,9 L3,9 C2.44771525,9 2,8.55228475 2,8 C2,7.48716416 2.38604019,7.06449284 2.88337887,7.00672773 L3,7 L7,7 L7,3 C7,1.71264368 8.86444709,1.66825208 8.99302964,2.86682521 Z"></path></svg>',
|
|
114
103
|
annotate:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">\n <path fill="currentColor" fill-rule="nonzero" d="M15 0c.27 0 .505.099.703.297A.961.961 0 0116 1v15l-4-3H1a.974.974 0 01-.703-.29A.953.953 0 010 12V1C0 .719.096.482.29.29A.966.966 0 011 0h14zM7 3l-.469.063c-.312.041-.656.187-1.031.437-.375.25-.719.646-1.031 1.188C4.156 5.229 4 6 4 7l.002.063.006.062a.896.896 0 01.008.11l-.002.074-.006.066a1.447 1.447 0 00.43 1.188C4.729 8.854 5.082 9 5.5 9c.417 0 .77-.146 1.063-.438C6.854 8.271 7 7.918 7 7.5c0-.417-.146-.77-.438-1.063A1.447 1.447 0 005.5 6c-.073 0-.146.005-.219.016-.073.01-.14.026-.203.046.177-1.03.542-1.632 1.094-1.804L7 4V3zm5 0l-.469.063c-.312.041-.656.187-1.031.437-.375.25-.719.646-1.031 1.188C9.156 5.229 9 6 9 7l.002.063.006.062a.896.896 0 01.008.11l-.002.074-.006.066a1.447 1.447 0 00.43 1.188c.291.291.645.437 1.062.437.417 0 .77-.146 1.063-.438.291-.291.437-.645.437-1.062 0-.417-.146-.77-.438-1.063A1.447 1.447 0 0010.5 6c-.073 0-.146.005-.219.016-.073.01-.14.026-.203.046.177-1.03.542-1.632 1.094-1.804L12 4V3z"/>\n</svg>\n',
|
|
115
|
-
"arrow-left":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 12L3 8l4-4M4 8h9-9z"></path></g></svg>\n',"arrow-right":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 4l4 4-4 4m3-4H3h9z"></path></g></svg>\n',cancel:
|
|
104
|
+
"arrow-left":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 12L3 8l4-4M4 8h9-9z"></path></g></svg>\n',"arrow-right":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 4l4 4-4 4m3-4H3h9z"></path></g></svg>\n',cancel:wo,"caret-right":qo,
|
|
116
105
|
"cc-std":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="currentColor" stroke="none" d="M7.985 0c2.238 0 4.143.781 5.715 2.343a7.694 7.694 0 011.714 2.579C15.804 5.888 16 6.914 16 8a8.164 8.164 0 01-.579 3.078 7.344 7.344 0 01-1.707 2.536 8.222 8.222 0 01-2.657 1.772c-.99.41-2.014.614-3.071.614a7.775 7.775 0 01-3.036-.607 8.047 8.047 0 01-2.6-1.757A7.846 7.846 0 010 8c0-1.057.202-2.074.607-3.05A8.033 8.033 0 012.371 2.33C3.895.777 5.766 0 7.985 0zm.03 1.443c-1.83 0-3.367.638-4.615 1.914a6.878 6.878 0 00-1.45 2.15A6.301 6.301 0 001.443 8c0 .858.168 1.684.507 2.479a6.627 6.627 0 001.45 2.129 6.593 6.593 0 002.129 1.428c.79.329 1.619.493 2.485.493.857 0 1.688-.166 2.494-.5a6.91 6.91 0 002.178-1.442c1.247-1.22 1.871-2.748 1.871-4.586a6.57 6.57 0 00-.486-2.515 6.397 6.397 0 00-1.413-2.114C11.37 2.086 9.824 1.443 8.014 1.443zm-.1 5.229l-1.073.557c-.114-.238-.254-.405-.42-.5a.95.95 0 00-.465-.143c-.714 0-1.072.472-1.072 1.415 0 .428.09.77.271 1.028.181.257.448.386.8.386.467 0 .796-.229.987-.686l.985.5a2.35 2.35 0 01-2.1 1.257c-.714 0-1.29-.218-1.729-.657-.438-.438-.657-1.047-.657-1.828 0-.762.222-1.367.665-1.814.442-.448 1.002-.672 1.678-.672.991 0 1.7.385 2.13 1.157zm4.613 0l-1.057.557c-.114-.238-.255-.405-.421-.5a.972.972 0 00-.479-.143c-.714 0-1.072.472-1.072 1.415 0 .428.091.77.272 1.028.18.257.447.386.8.386.466 0 .795-.229.985-.686l1 .5c-.218.39-.514.698-.885.922a2.308 2.308 0 01-1.214.335c-.724 0-1.302-.218-1.735-.657-.434-.438-.65-1.047-.65-1.828 0-.762.22-1.367.664-1.814.442-.448 1.002-.672 1.678-.672.99 0 1.696.385 2.114 1.157z"></path></g></svg>',
|
|
117
106
|
"cc-zero":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="currentColor" stroke="none" d="M7.983 0c2.238 0 4.148.78 5.72 2.342a7.662 7.662 0 011.715 2.582c.39.962.582 1.99.582 3.076a8.13 8.13 0 01-.583 3.087 7.262 7.262 0 01-1.703 2.526 8.213 8.213 0 01-2.655 1.77c-.99.41-2.018.617-3.076.617a7.902 7.902 0 01-3.042-.6 8.301 8.301 0 01-2.6-1.759A8.087 8.087 0 01.6 11.042 7.84 7.84 0 010 8c0-1.057.2-2.07.6-3.042a8.12 8.12 0 011.77-2.633C3.893.772 5.764 0 7.983 0zm.034 1.44c-1.829 0-3.369.64-4.616 1.915a6.962 6.962 0 00-1.457 2.157 6.388 6.388 0 000 4.969 6.83 6.83 0 003.585 3.558c.79.324 1.62.487 2.488.487.857 0 1.681-.165 2.482-.498a6.88 6.88 0 002.184-1.446C13.931 11.364 14.56 9.838 14.56 8a6.57 6.57 0 00-.487-2.515 6.418 6.418 0 00-1.418-2.118C11.37 2.081 9.826 1.44 8.017 1.44zM8 3.395c2.641 0 3.305 2.492 3.305 4.605 0 2.113-.664 4.605-3.305 4.605S4.694 10.113 4.694 8l.007-.355c.073-2.027.804-4.25 3.299-4.25zm1.316 3.227L7.35 10.017c-.274.412-.083.645.219.774l.135.044c.091.022.19.034.297.034 1.357 0 1.422-1.938 1.422-2.869l-.007-.409a7.282 7.282 0 00-.06-.72l-.04-.25zM8 5.132c-1.258 0-1.406 1.66-1.421 2.646L6.577 8c0 .24.005.544.035.865l.027.244 1.759-3.232c.182-.316.09-.542-.101-.706A1.222 1.222 0 008 5.13z"></path></g></svg>',
|
|
118
|
-
"collapse-menu":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 10l4-4 4 4"></path></g></svg>',collapse:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 11l-4 4 4-4zm-3-1h4v4m9-13l-4 4 4-4zm-1 5h-4V2"></path></g></svg>',collapsed:
|
|
107
|
+
"collapse-menu":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 10l4-4 4 4"></path></g></svg>',collapse:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 11l-4 4 4-4zm-3-1h4v4m9-13l-4 4 4-4zm-1 5h-4V2"></path></g></svg>',collapsed:qo,
|
|
119
108
|
copy:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 15H1V5h3m11-4v10H7V1h8z"></path></g></svg>',edit:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 4l1 1-9 9-2 1 1-2 9-9zm3-3l1 1-1 1-1-1 1-1z"></path></g></svg>\n',
|
|
120
|
-
email:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 3v10h14V3H1zm0 0l7 6 7-6H1z"></path></g></svg>',"expand-menu":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">\n <path fill="currentColor" fill-rule="nonzero" d="M7.456 11.788L1.226 5.92a.695.695 0 0 1 0-1.025l.726-.684a.804.804 0 0 1 1.087-.001L8 8.861l4.961-4.65a.804.804 0 0 1 1.087.001l.727.684c.3.283.3.742 0 1.025l-6.23 5.867a.804.804 0 0 1-1.09 0z"/>\n</svg>',error:
|
|
109
|
+
email:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 3v10h14V3H1zm0 0l7 6 7-6H1z"></path></g></svg>',"expand-menu":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">\n <path fill="currentColor" fill-rule="nonzero" d="M7.456 11.788L1.226 5.92a.695.695 0 0 1 0-1.025l.726-.684a.804.804 0 0 1 1.087-.001L8 8.861l4.961-4.65a.804.804 0 0 1 1.087.001l.727.684c.3.283.3.742 0 1.025l-6.23 5.867a.804.804 0 0 1-1.09 0z"/>\n</svg>',error:wo,
|
|
121
110
|
expand:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2 14l4-4-4 4zm3 1H1v-4m13-9l-4 4 4-4zm-3-1h4v4"></path></g></svg>',external:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 3h6v6m-1-5l-9 9 9-9z"></path></g></svg>',
|
|
122
111
|
facebook:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="currentColor" stroke="none" d="M15.999 8.049c0-4.445-3.582-8.049-8-8.049S0 3.604 0 8.049C0 12.066 2.925 15.396 6.75 16v-5.624H4.717V8.049H6.75V6.276c0-2.018 1.195-3.132 3.022-3.132.875 0 1.79.157 1.79.157v1.981h-1.008c-.994 0-1.304.62-1.304 1.257v1.51h2.219l-.355 2.327H9.25V16c3.825-.604 6.75-3.934 6.75-7.951z"></path></g></svg>',flag:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 9v6V1h12l-4 4 4 4H3z"></path></g></svg>',
|
|
123
112
|
"flag--active":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="currentColor" stroke="none" d="M2 1a1 1 0 01.883-.993L3 0h12c.852 0 1.297.986.783 1.623l-.076.084L12.415 5l3.292 3.293c.575.575.253 1.523-.485 1.684l-.108.017L15 10H4v5a1 1 0 01-1.993.117L2 15V1z"></path></g></svg>',
|
|
@@ -132,7 +121,7 @@ hide:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0
|
|
|
132
121
|
highlight:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15H1h11zm-.5-6v2l-1 1v-2l1-1zm.5-7v6h-2V2h2zm0-1h-2 2zm0 8h-2 2z"></path></g></svg>',image:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 1v14H1V1h14zM1 15l3-8 4 6 3-4 4 6m-4-9a1 1 0 110-2 1 1 0 010 2z"></path></g></svg>',
|
|
133
122
|
leave:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M8,0 C12.0522847,0 16,3.94771525 16,8 C16,12.0522847 12.0522847,16 8,16 C3.94771525,16 0,12.0522847 0,8 C0,3.94771525 3.94771525,0 8,0 Z M8,2 C5.05228475,2 2,5.05228475 2,8 C2,10.9477153 5.05228475,14 8,14 C10.9477153,14 14,10.9477153 14,8 C14,5.05228475 10.9477153,2 8,2 Z M10.7864022,6.62017694 L10.7071068,6.70710678 L9.415,8 L10.7071068,9.29289322 C11.0976311,9.68341751 11.0976311,10.3165825 10.7071068,10.7071068 C10.3466228,11.0675907 9.77939176,11.0953203 9.38710056,10.7902954 L9.29289322,10.7071068 L8,9.415 L6.70710678,10.7071068 C5.79286771,11.6213459 4.43536121,10.3192478 5.21359778,9.37982306 L5.29289322,9.29289322 L6.585,8 L5.29289322,6.70710678 C4.90236893,6.31658249 4.90236893,5.68341751 5.29289322,5.29289322 C5.65337718,4.93240926 6.22060824,4.90467972 6.61289944,5.20970461 L6.70710678,5.29289322 L8,6.585 L9.29289322,5.29289322 C10.2071323,4.37865415 11.5646388,5.68075222 10.7864022,6.62017694 Z"></path></svg>',
|
|
134
123
|
link:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M9.68027557,6.09714063 C10.0850762,6.47284645 10.1086623,7.10557198 9.73295644,7.51037264 C9.35725062,7.9151733 8.72452509,7.93875933 8.31972443,7.56305351 C7.52101725,6.821753 6.4700536,6.81243414 5.66500421,7.53509692 L2.58706553,11.1273971 L2.50815798,11.2094765 C1.81384474,11.8538863 1.84803625,12.885989 2.50815798,13.4986648 C3.17004601,14.1129799 4.31769172,14.1788096 5.06581128,13.6063341 L5.156,13.529 L6.16163376,12.3189006 C6.48720494,11.9265987 7.04943452,11.8464869 7.46827399,12.1138931 L7.56977663,12.1880051 C7.96207853,12.5135762 8.04219031,13.0758058 7.77478412,13.4946453 L7.70067217,13.5961479 L6.64329964,14.8702449 L6.554056,14.9645777 C5.02884562,16.3801643 2.59807851,16.3107974 1.14760683,14.9645777 C-0.293859995,13.6267155 -0.415580233,11.3582822 0.996093014,9.89228498 L1.095,9.794 L4.19491885,6.17921998 L4.2738264,6.09714063 C5.8499647,4.63428646 8.10413728,4.63428646 9.68027557,6.09714063 Z M14.8523932,1.03542234 C16.29386,2.37328448 16.4155802,4.64171776 15.003907,6.10771502 L14.904,6.205 L11.7857496,9.84275726 L11.7261736,9.90285937 C10.1500353,11.3657135 7.89586272,11.3657135 6.31972443,9.90285937 C5.91492376,9.52715355 5.89133773,8.89442802 6.26704356,8.48962736 C6.64274938,8.0848267 7.27547491,8.06124067 7.68027557,8.43694649 C8.47898275,9.178247 9.5299464,9.18756586 10.3349958,8.46490308 L13.4129345,4.87260289 L13.491842,4.79052353 C14.1861553,4.1461137 14.1519637,3.11401104 13.491842,2.50133522 C12.829954,1.88702005 11.6823083,1.82119037 10.9341887,2.39366585 L10.843,2.47 L9.83836624,3.6810994 C9.51279506,4.0734013 8.95056548,4.15351308 8.53172601,3.88610689 L8.43022337,3.81199494 C8.03792147,3.48642376 7.95780969,2.92419418 8.22521588,2.5053547 L8.29932783,2.40385206 L9.35670036,1.12975511 L9.445944,1.03542234 C10.9711544,-0.380164327 13.4019215,-0.310797434 14.8523932,1.03542234 Z"></path></svg>',
|
|
135
|
-
lock:'<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg width="48px" height="56px" viewBox="0 0 48 56" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g fill="currentColor">\n <rect x="0" y="24" width="48" height="32"></rect>\n <path d="M24,0 C24,0 8,0 8,16 L8,32 L16,32 L16,16.0000004 C16,8 24,8 24,8 C24,8 32,8 32,16 L32,32 L40,32 L40,16 C40,0 24,0 24,0 Z"></path>\n </g>\n </g>\n</svg>',logo
|
|
124
|
+
lock:'<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg width="48px" height="56px" viewBox="0 0 48 56" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g fill="currentColor">\n <rect x="0" y="24" width="48" height="32"></rect>\n <path d="M24,0 C24,0 8,0 8,16 L8,32 L16,32 L16,16.0000004 C16,8 24,8 24,8 C24,8 32,8 32,16 L32,32 L40,32 L40,16 C40,0 24,0 24,0 Z"></path>\n </g>\n </g>\n</svg>',logo:$o,pointer:'<svg xmlns="http://www.w3.org/2000/svg" width="15" height="8" viewBox="0 0 15 8" aria-hidden="true" focusable="false"><path d="M0 8 L7 0 L15 8" stroke="currentColor" strokeWidth="2" /></svg>\n',
|
|
136
125
|
profile:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 15c0-2.761 3.134-5 7-5s7 2.239 7 5M8 7a3 3 0 1 1 0-6 3 3 0 0 1 0 6z"></path></g></svg>\n',
|
|
137
126
|
public:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">\n <path fill="currentColor" fill-rule="nonzero" d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zm2.655 11.535c.244-.242.442-.719.442-1.063a1.13 1.13 0 0 0-.288-.696l-.442-.442a1.033 1.033 0 0 0-.73-.302H7.484C7.181 8.88 6.791 8 6.452 8c-.34 0-.674-.08-.978-.231l-.357-.179a.386.386 0 0 1-.213-.345c0-.153.118-.317.263-.366l1.006-.335a.618.618 0 0 1 .163-.026c.106 0 .258.056.338.126l.3.26c.046.04.106.063.169.063h.182a.258.258 0 0 0 .23-.373l-.503-1.006a.306.306 0 0 1-.027-.116c0-.06.035-.143.078-.185l.32-.31a.258.258 0 0 1 .18-.074h.29c.06 0 .141-.034.183-.076l.258-.258c.1-.1.1-.264 0-.364l-.151-.152c-.101-.1-.101-.264 0-.365l.333-.333.151-.151a.516.516 0 0 0 0-.73l-.912-.913a6.45 6.45 0 0 0-.787.078v.365a.516.516 0 0 1-.747.461l-.775-.387a6.487 6.487 0 0 0-3.329 3.287c.32.474.813 1.205 1.116 1.65.138.203.4.503.582.668l.026.023c.308.278.65.516 1.021.702.452.227 1.111.586 1.575.842.328.182.53.527.53.903v1.032c0 .274.11.537.303.73.484.484.785 1.246.73 1.653v.884c.473 0 .932-.055 1.376-.152l.56-1.511c.067-.177.106-.362.155-.544a.771.771 0 0 1 .199-.346l.365-.364zm2.797-2.946l.94.235c.036-.27.06-.544.06-.824a6.4 6.4 0 0 0-.688-2.882l-.419.21a.773.773 0 0 0-.298.263l-.632.947a.908.908 0 0 0-.13.43c0 .13.058.321.13.43l.58.87c.107.16.27.274.457.32z"/>\n</svg>',
|
|
138
127
|
refresh:'<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n \x3c!-- Generator: Sketch 39.1 (31720) - http://www.bohemiancoding.com/sketch --\x3e\n <defs/>\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g fill="currentColor">\n <g>\n <path d="M0,8 C0,12.418278 3.581722,16 8,16 C12.418278,16 16,12.418278 16,8 C16,4.89580324 14.2154684,2.11256098 11.4682644,0.789110134 L10.6002482,2.59092808 C12.661769,3.58405472 14,5.6712248 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,5.65296151 3.35941993,3.55225774 5.44569583,2.56903563 L4.59307587,0.759881355 C1.81273067,2.07020511 0,4.87140735 0,8 Z" />\n <polygon points="7 8.58578644 7 0 9 0 9 8.58578644 10.2928932 7.29289322 11 6.58578644 12.4142136 8 11.7071068 8.70710678 8.70710678 11.7071068 8 12.4142136 7.64644661 12.0606602 7.29289322 11.7071068 4.29289322 8.70710678 3.58578644 8 5 6.58578644 5.70710678 7.29289322"/>\n </g>\n </g>\n </g>\n</svg>',
|
|
@@ -142,86 +131,86 @@ search:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="
|
|
|
142
131
|
share:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M15,9 C15.5128358,9 15.9355072,9.38604019 15.9932723,9.88337887 L16,10 L16,15 C16,15.5128358 15.6139598,15.9355072 15.1166211,15.9932723 L15,16 L1,16 C0.487164161,16 0.0644928393,15.6139598 0.00672773133,15.1166211 L0,15 L0,10 C0,9.44771525 0.44771525,9 1,9 C1.51283584,9 1.93550716,9.38604019 1.99327227,9.88337887 L2,10 L2,14 L14,14 L14,10 C14,9.48716416 14.3860402,9.06449284 14.8833789,9.00672773 L15,9 Z M8.61289944,0.209704612 L8.70710678,0.292893219 L12.7071068,4.29289322 C13.0976311,4.68341751 13.0976311,5.31658249 12.7071068,5.70710678 C12.3466228,6.06759074 11.7793918,6.09532028 11.3871006,5.79029539 L11.2928932,5.70710678 L9,3.415 L9,11 C9,11.5522847 8.55228475,12 8,12 C7.48716416,12 7.06449284,11.6139598 7.00672773,11.1166211 L7,11 L7,3.415 L4.70710678,5.70710678 C4.34662282,6.06759074 3.77939176,6.09532028 3.38710056,5.79029539 L3.29289322,5.70710678 C2.93240926,5.34662282 2.90467972,4.77939176 3.20970461,4.38710056 L3.29289322,4.29289322 L7.29289322,0.292893219 C7.62333685,-0.0375504127 8.12750547,-0.0883878944 8.51140295,0.140380774 L8.61289944,0.209704612 Z"></path></svg>',
|
|
143
132
|
success:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 3L6 13 3 8"></path></g></svg>\n',sort:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false" class="Icon Icon--sort"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 9V2v7zM1 5l4-4 4 4m2 2v7-7zm-4 4l4 4 4-4"></path></g></svg>\n',
|
|
144
133
|
trash:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2 4h12l-2 11H4L2 4zM1 1h14H1z"></path></g></svg>\n',
|
|
145
|
-
twitter:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="currentColor" stroke="none" d="M15.969 3.049c-.59.259-1.22.436-1.884.516a3.305 3.305 0 0 0 1.442-1.815c-.634.37-1.336.64-2.084.79a3.28 3.28 0 0 0-5.59 2.988 9.29 9.29 0 0 1-6.76-3.418A3.214 3.214 0 0 0 .65 3.76c0 1.14.58 2.142 1.459 2.73a3.27 3.27 0 0 1-1.485-.41v.04a3.282 3.282 0 0 0 2.63 3.218 3.33 3.33 0 0 1-1.474.057 3.291 3.291 0 0 0 3.069 2.278A6.578 6.578 0 0 1 .78 13.076c-.26 0-.52-.015-.78-.044a9.33 9.33 0 0 0 5.038 1.472c6.036 0 9.332-4.997 9.332-9.323 0-.14 0-.28-.01-.42.64-.46 1.2-1.04 1.64-1.7l-.031-.012z"></path></g></svg>'};async function
|
|
146
|
-
document.body.appendChild(r),new Promise((o=>{const i=e=>{
|
|
147
|
-
this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}({get(e){throw new Error(`Missing ServiceContext provider to provide "${e}" prop`)}});function
|
|
148
|
-
})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):
|
|
149
|
-
;if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(
|
|
150
|
-
(r={dispatch:
|
|
151
|
-
var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}var
|
|
152
|
-
if("function"==typeof e)return
|
|
153
|
-
activeApiRequests:e.activeApiRequests-1}},ANNOTATION_SAVE_STARTED(e,t){let 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){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})};const
|
|
154
|
-
actionCreators:{annotationFetchStarted:function(){return
|
|
155
|
-
return e===t};function
|
|
156
|
-
|
|
157
|
-
for(var e=[],t=p.length,n=0;n<t;n++)e.push(p[n].apply(null,arguments));return i=m.apply(null,e)}));return Object.assign(f,{resultFunc:l,memoizedResultFunc:m,dependencies:p,lastResult:function(){return i},recomputations:function(){return a},resetRecomputations:function(){return a=0}}),f};return o}var
|
|
158
|
-
return!e.id}function
|
|
159
|
-
function
|
|
160
|
-
t.$tag&&r.add(t.$tag)):(o.push(
|
|
161
|
-
;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
|
|
162
|
-
reducers:
|
|
163
|
-
selectors:{allAnnotations:function(e){return e.annotations},annotationCount:
|
|
164
|
-
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
|
|
165
|
-
clearDirectLinkedGroupFetchFailed:function(){return
|
|
166
|
-
;for(let e=0;e<n.length;e++){const r=n[e];if(r.match(t))return r}return null}function
|
|
167
|
-
CHANGE_FOCUS_MODE_USER:(e,t)=>({focusActive:
|
|
168
|
-
actionCreators:{changeFocusModeUser:function(e){return
|
|
169
|
-
;var u=e[c],
|
|
170
|
-
frames:function(e){return e},mainFrame:
|
|
171
|
-
focusedGroupId:o}},FOCUS_GROUP(e,t){const n=e.groups.find((e=>e.id===t.id));return n?{focusedGroupId:t.id}:(console.error(`Attempted to focus group ${t.id} which is not loaded`),{})},LOAD_GROUPS(e,t){const n=t.groups;let r=e.focusedGroupId;return null!==e.focusedGroupId&&n.find((t=>t.id===e.focusedGroupId))||(r=n.length>0?n[0].id:null),{focusedGroupId:r,groups:t.groups}},CLEAR_GROUPS:()=>({filteredGroupIds:null,focusedGroupId:null,groups:[]})};function
|
|
172
|
-
filteredGroupIds:null,groups:[],focusedGroupId:null},{namespace:"groups",reducers:
|
|
173
|
-
actionCreators:{updateLinks:function(e){return
|
|
174
|
-
pendingUpdates:{},pendingDeletions:{}},{namespace:"realTimeUpdates",reducers:
|
|
175
|
-
;return e.annotations&&!e.query&&(t[e.annotations]=!0),t}const
|
|
176
|
-
let n=e.selectedTab;"orphan"===n&&0===
|
|
177
|
-
selectAnnotations:function(e){return t=>{t(
|
|
178
|
-
namespace:"sidebarPanels",reducers:
|
|
179
|
-
getToastMessages:function(e){return e.messages},hasToastMessage:function(e,t,n){return e.messages.some((e=>e.type===t&&e.message===n))}}})
|
|
180
|
-
;return a===e.getState()&&n.push(new
|
|
181
|
-
return e.children.some((e=>e.visible||
|
|
182
|
-
;if(t.expanded.hasOwnProperty(e.id))n.collapsed=!t.expanded[e.id];else{const r=t.filterFn&&
|
|
183
|
-
const
|
|
184
|
-
;function
|
|
185
|
-
;return e.children.reduce(((e,n)=>e+
|
|
186
|
-
const t=e.selection,n={expanded:t.expanded,forcedVisible:t.forcedVisible,selected:t.selected,sortCompareFn:
|
|
187
|
-
;n.filterFn=t=>function(e,t){const n=(e,t)=>new
|
|
188
|
-
var
|
|
189
|
-
function f(e){var n=e-l;return void 0===l||n>=t||n<0||
|
|
190
|
-
this._listeners.forEach((({eventTarget:e,eventType:t,listener:n})=>{e.removeEventListener(t,n)})),this._listeners.clear()}}const
|
|
191
|
-
function
|
|
192
|
-
label:"Tweet share link",uri:`https://twitter.com/intent/tweet?url=${t}&hashtags=annotated`}),
|
|
193
|
-
}):
|
|
194
|
-
"data-testid":"share-details",children:
|
|
195
|
-
;return
|
|
196
|
-
t.flag(e).catch((()=>o.error("Flagging annotation failed")))}}),
|
|
197
|
-
const n=new ResizeObserver((()=>t(e.clientWidth,e.clientHeight)));return n.observe(e),()=>n.disconnect()}const n=new
|
|
198
|
-
"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"}),m&&r&&
|
|
199
|
-
;for(let[e,o]of n)t.includes(e)&&("t"===e?r.append("start",
|
|
200
|
-
;let n=t[2];const r=new URLSearchParams(e.search);let o=r.get("start"),i=r.get("end");if(!o){const e=n.match(/\/start\/([^/]+)/);e&&(o=e[1],n=n.replace(e[0],""))}if(!i){const e=n.match(/\/end\/([^/]+)/);e&&(i=e[1],n=n.replace(e[0],""))}const a=new URL(`https://archive.org/embed/${n}`);return o&&a.searchParams.append("start",o),i&&a.searchParams.append("end",i),
|
|
201
|
-
return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},
|
|
202
|
-
;if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return
|
|
203
|
-
;var
|
|
204
|
-
var
|
|
205
|
-
return"undefined"==typeof window?null:window},
|
|
206
|
-
var
|
|
207
|
-
})),G=null,V=null,
|
|
208
|
-
ce="ADD_DATA_URI_TAGS"in e?
|
|
209
|
-
e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&($.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),L=L=-1===
|
|
210
|
-
;
|
|
211
|
-
"application/xhtml+xml"===L&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=w?w.createHTML(e):e;if(ge===fe)try{t=(new p).parseFromString(i,L)}catch(e){}if(!t||!t.documentElement){t=S.createDocument(ge,"template",null);try{t.documentElement.innerHTML=ve?"":i}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(o.createTextNode(n),a.childNodes[0]||null),ge===fe?
|
|
212
|
-
},
|
|
213
|
-
e.textContent!==t&&(
|
|
214
|
-
attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:
|
|
215
|
-
if("object"===
|
|
216
|
-
;return Z&&j["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&
|
|
217
|
-
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
|
|
218
|
-
return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},
|
|
134
|
+
twitter:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="currentColor" stroke="none" d="M15.969 3.049c-.59.259-1.22.436-1.884.516a3.305 3.305 0 0 0 1.442-1.815c-.634.37-1.336.64-2.084.79a3.28 3.28 0 0 0-5.59 2.988 9.29 9.29 0 0 1-6.76-3.418A3.214 3.214 0 0 0 .65 3.76c0 1.14.58 2.142 1.459 2.73a3.27 3.27 0 0 1-1.485-.41v.04a3.282 3.282 0 0 0 2.63 3.218 3.33 3.33 0 0 1-1.474.057 3.291 3.291 0 0 0 3.069 2.278A6.578 6.578 0 0 1 .78 13.076c-.26 0-.52-.015-.78-.044a9.33 9.33 0 0 0 5.038 1.472c6.036 0 9.332-4.997 9.332-9.323 0-.14 0-.28-.01-.42.64-.46 1.2-1.04 1.64-1.7l-.031-.012z"></path></g></svg>'};async function Vo({title:e="Confirm",message:t,confirmAction:n="Yes"}){const r=document.createElement("div");return r.setAttribute("data-testid","confirm-container"),r.style.position="relative",r.style.zIndex="10",
|
|
135
|
+
document.body.appendChild(r),new Promise((o=>{const i=e=>{R(null,r),r.remove(),o(e)};R(so(Ro,{title:e,message:t,confirmAction:n,onConfirm:()=>i(!0),onCancel:()=>i(!1)}),r)}))}function Yo(e){if(!e)return null;const t=e.match(/^acct:([^@]+)@(.+)/);return t?{username:t[1],provider:t[2]}:null}function Wo(e){const t=Yo(e);return t?t.username:""}function Ko(e,t){const n=Yo(e);return!!n&&n.provider!==t}const Xo={accentColor:"color",appBackgroundColor:"backgroundColor",ctaBackgroundColor:"backgroundColor",ctaTextColor:"color",selectionFontFamily:"fontFamily",annotationFontFamily:"fontFamily"};function Zo(e,t){const n={};if(!t.branding)return n;const{branding:r}=t;return e.forEach((e=>{const t=Xo[e],o=r[e];t&&o&&(n[t]=o)})),n}const Jo=function(e,t){var n={__c:t="__cC"+s++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(_)},
|
|
136
|
+
this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}({get(e){throw new Error(`Missing ServiceContext provider to provide "${e}" prop`)}});function Qo(e,t){function n(n){const r=Qr(Jo),o={};for(let e of t)e in n||(o[e]=r.get(e));const i={...o,...n};return so(e,{...i})}const r=e.displayName||e.name;return n.displayName=`withServices(${r})`,n}function ei(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ti(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 ni(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ti(Object(n),!0).forEach((function(t){ei(e,t,n[t])
|
|
137
|
+
})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ti(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ri(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 oi="function"==typeof Symbol&&Symbol.observable||"@@observable",ii=function(){return Math.random().toString(36).substring(7).split("").join(".")},ai={INIT:"@@redux/INIT"+ii(),REPLACE:"@@redux/REPLACE"+ii(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ii()}};function si(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function li(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(ri(0))
|
|
138
|
+
;if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(ri(1));return n(li)(e,t)}if("function"!=typeof e)throw new Error(ri(2));var o=e,i=t,a=[],s=a,l=!1;function c(){s===a&&(s=a.slice())}function u(){if(l)throw new Error(ri(3));return i}function h(e){if("function"!=typeof e)throw new Error(ri(4));if(l)throw new Error(ri(5));var t=!0;return c(),s.push(e),function(){if(t){if(l)throw new Error(ri(6));t=!1,c();var n=s.indexOf(e);s.splice(n,1),a=null}}}function d(e){if(!si(e))throw new Error(ri(7));if(void 0===e.type)throw new Error(ri(8));if(l)throw new Error(ri(9));try{l=!0,i=o(i,e)}finally{l=!1}for(var t=a=s,n=0;n<t.length;n++){(0,t[n])()}return e}function p(e){if("function"!=typeof e)throw new Error(ri(10));o=e,d({type:ai.REPLACE})}function m(){var e,t=h;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(ri(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[oi]=function(){return this},e}return d({type:ai.INIT}),
|
|
139
|
+
(r={dispatch:d,subscribe:h,getState:u,replaceReducer:p})[oi]=m,r}function ci(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}var i,a=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:ai.INIT}))throw new Error(ri(12));if(void 0===n(void 0,{type:ai.PROBE_UNKNOWN_ACTION()}))throw new Error(ri(13))}))}(n)}catch(e){i=e}return function(e,t){if(void 0===e&&(e={}),i)throw i;for(var r=!1,o={},s=0;s<a.length;s++){var l=a[s],c=n[l],u=e[l],h=c(u,t);if(void 0===h)throw t&&t.type,new Error(ri(14));o[l]=h,r=r||h!==u}return(r=r||a.length!==Object.keys(e).length)?o:e}}function ui(e,t){return function(){return t(e.apply(this,arguments))}}function hi(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function di(e){return function(t){
|
|
140
|
+
var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}var pi=di();function mi(e){return(t={},n)=>{const r=e[n.type];if(!r)return t;const o=r(t,n);return Array.isArray(o)?o:{...t,...o}}}function fi(e,t){const n={};for(let[r,o]of Object.entries(e))n[r]=(...e)=>o(t(),...e);return n}function gi(e,t){return Object.assign(e,t)}function vi(e,t=[],n=[]){const r={};for(let n of e)r[n.namespace]=n.initialState(...t);const o={};for(let t of e)o[t.namespace]=mi(t.reducers);const i=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error(ri(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=t.map((function(e){return e(o)}));return r=hi.apply(void 0,i)(n.dispatch),ni(ni({},n),{},{dispatch:r})}}}(...[pi],...n);const a=li(ci(o),r,i),s={};for(let t of e)gi(s,t.actionCreators);const l=function(e,t){
|
|
141
|
+
if("function"==typeof e)return ui(e,t);if("object"!=typeof e||null===e)throw new Error(ri(16));var n={};for(var r in e){var o=e[r];"function"==typeof o&&(n[r]=ui(o,t))}return n}(s,a.dispatch);Object.assign(a,l);const c={};for(let t of e){const{namespace:e,selectors:n,rootSelectors:r}=t;if(gi(c,fi(n,(()=>a.getState()[e]))),r){gi(c,fi(r,a.getState))}}return Object.assign(a,c),a}function _i(e,t,n){return{type:t,...n}}function bi(e,t){if(!(e instanceof Function)){const t=e;e=()=>t}return{initialState:e,...t}}function yi(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()}}pi.withExtraArgument=di;const wi={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,
|
|
142
|
+
activeApiRequests:e.activeApiRequests-1}},ANNOTATION_SAVE_STARTED(e,t){let 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){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})};const xi=bi({activeAnnotationSaveRequests:[],activeApiRequests:0,activeAnnotationFetches:0,hasFetchedAnnotations:!1,annotationResultCount:null},{reducers:wi,namespace:"activity",
|
|
143
|
+
actionCreators:{annotationFetchStarted:function(){return _i(0,"ANNOTATION_FETCH_STARTED",void 0)},annotationFetchFinished:function(){return _i(0,"ANNOTATION_FETCH_FINISHED",void 0)},annotationSaveStarted:function(e){return _i(0,"ANNOTATION_SAVE_STARTED",{annotation:e})},annotationSaveFinished:function(e){return _i(0,"ANNOTATION_SAVE_FINISHED",{annotation:e})},apiRequestStarted:function(){return _i(0,"API_REQUEST_STARTED",void 0)},apiRequestFinished:function(){return _i(0,"API_REQUEST_FINISHED",void 0)},setAnnotationResultCount:function(e){return _i(0,"SET_ANNOTATION_RESULT_COUNT",{resultCount:e})}},selectors:{hasFetchedAnnotations:function(e){return e.hasFetchedAnnotations},isLoading:function(e){return e.activeApiRequests>0||!e.hasFetchedAnnotations},isFetchingAnnotations:function(e){return e.activeAnnotationFetches>0},isSavingAnnotation:function(e,t){return!!t.$tag&&e.activeAnnotationSaveRequests.includes(t.$tag)},annotationResultCount:function(e){return e.annotationResultCount}}});var ki=function(e,t){
|
|
144
|
+
return e===t};function Si(e,t){var n,r,o="object"==typeof t?t:{equalityCheck:t},i=o.equalityCheck,a=void 0===i?ki:i,s=o.maxSize,l=void 0===s?1:s,c=o.resultEqualityCheck,u=function(e){return function(t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,o=0;o<r;o++)if(!e(t[o],n[o]))return!1;return!0}}(a),h=1===l?(n=u,{get:function(e){return r&&n(r.key,e)?r.value:"NOT_FOUND"},put:function(e,t){r={key:e,value:t}},getEntries:function(){return r?[r]:[]},clear:function(){r=void 0}}):function(e,t){var n=[];function r(e){var r=n.findIndex((function(n){return t(e,n.key)}));if(r>-1){var o=n[r];return r>0&&(n.splice(r,1),n.unshift(o)),o.value}return"NOT_FOUND"}return{get:r,put:function(t,o){"NOT_FOUND"===r(t)&&(n.unshift({key:t,value:o}),n.length>e&&n.pop())},getEntries:function(){return n},clear:function(){n=[]}}}(l,u);function d(){var t=h.get(arguments);if("NOT_FOUND"===t){if(t=e.apply(null,arguments),c){var n=h.getEntries(),r=n.find((function(e){return c(e.value,t)}));r&&(t=r.value)}
|
|
145
|
+
h.put(arguments,t)}return t}return d.clearCache=function(){return h.clear()},d}function Ci(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var n=t.map((function(e){return"function"==typeof e?"function "+(e.name||"unnamed")+"()":typeof e})).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function Ei(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i,a=0,s={memoizeOptions:void 0},l=r.pop();if("object"==typeof l&&(s=l,l=r.pop()),"function"!=typeof l)throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof l+"]");var c=s,u=c.memoizeOptions,h=void 0===u?n:u,d=Array.isArray(h)?h:[h],p=Ci(r),m=e.apply(void 0,[function(){return a++,l.apply(null,arguments)}].concat(d)),f=e((function(){
|
|
146
|
+
for(var e=[],t=p.length,n=0;n<t;n++)e.push(p[n].apply(null,arguments));return i=m.apply(null,e)}));return Object.assign(f,{resultFunc:l,memoizedResultFunc:m,dependencies:p,lastResult:function(){return i},recomputations:function(){return a},resetRecomputations:function(){return a=0}}),f};return o}var Ai=Ei(Si);function Ti(e){const t=e.uri;let n;try{n=new URL(t).hostname}catch{n=""}"localhost"===n&&(n="");let r=n;return e.document&&e.document.title&&(r=e.document.title[0]),{uri:t,domain:n,title:r}}function Ni(e){let 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 Mi(e){const t=Ti(e);let n="";if(t.uri&&0===t.uri.indexOf("file://")&&t.title){const e=t.uri.split("/"),r=e[e.length-1];r&&(n=r)}else t.domain&&t.domain!==t.title&&(n=t.domain);return n}function Li(e){let t=Ti(e).title;return t.length>30&&(t=t.slice(0,30)+"…"),t}function zi(e){return(e.references||[]).length>0}function Oi(e){return!!e.id}function Ri(e){
|
|
147
|
+
return!e.id}function Di(e){let t=!1;return e.permissions?(e.permissions.read.forEach((e=>{const n=e.split(":");2===n.length&&"group"===n[0]&&(t=!0)})),t):t}function Ii(e){return!!(e.target&&e.target.length>0&&e.target[0].selector)}function Pi(e){return Ii(e)&&void 0===e.$orphan&&!e.$anchorTimeout}function Bi(e){return!!e.hidden}function Fi(e){return!!e.$highlight||!Ri(e)&&!(Ui(e)||zi(e)||e.hidden||e.text||e.tags&&e.tags.length)}function ji(e){return Ii(e)&&!0===e.$orphan}function Ui(e){return!Ii(e)&&!zi(e)}function Hi(e){return!(!Ii(e)||ji(e))}function qi(e){return zi(e)?"Reply":Fi(e)?"Highlight":Ui(e)?"Page note":"Annotation"}function $i(e){if(e){const t=e.target||[];for(let e=0;e<t.length;e++){const n=t[e].selector||[];for(const e of n)if("TextPositionSelector"===e.type)return e.start}}return Number.POSITIVE_INFINITY}function Gi(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}
|
|
148
|
+
function Vi(e,t){return e.reduce(((e,n)=>t(n)?e+1:e),0)}function Yi(e){const t={};return e.forEach((e=>t[e]=!0)),t}function Wi(e){return Object.keys(e).filter((t=>!0===e[t]))}function Ki(e){return Object.entries(e)}const Xi={CHANGE_ROUTE:(e,{name:t,params:n})=>({name:t,params:n})};const Zi=bi({name:null,params:{}},{namespace:"route",reducers:Xi,actionCreators:{changeRoute:function(e,t={}){return _i(0,"CHANGE_ROUTE",{name:e,params:t})}},selectors:{route:function(e){return e.name},routeParams:function(e){return e.params}}});function Ji(e,t){return e.find((e=>e.id===t))}function Qi(e,t){return e.find((e=>e.$tag===t))}function ea(e,t){let n=e.$orphan;return e.id||(n=!1),Object.assign({},e,{$anchorTimeout:!1,$tag:e.$tag||t,$orphan:n})}const ta={ADD_ANNOTATIONS(e,t){const n=new Set,r=new Set,o=[],i=[],a=[];let s=e.nextTag;for(let i of t.annotations){let t;i.id&&(t=Ji(e.annotations,i.id)),!t&&i.$tag&&(t=Qi(e.annotations,i.$tag)),t?(a.push(Object.assign({},t,i)),i.id&&n.add(i.id),
|
|
149
|
+
t.$tag&&r.add(t.$tag)):(o.push(ea(i,"t"+s)),++s)}for(let 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:[],focused:{},highlighted:{}}),FOCUS_ANNOTATIONS:(e,t)=>({focused:Yi(t.focusedTags)}),HIDE_ANNOTATION:(e,t)=>({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(!t.statusUpdates.hasOwnProperty(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
|
|
150
|
+
;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 na(e){return(t,n)=>{const r=function(e,t){const n=new Set,r=new Set;for(let e of t)e.id&&n.add(e.id),e.$tag&&r.add(e.$tag);return e.filter((e=>!(e.id&&n.has(e.id)||e.$tag&&r.has(e.$tag))))}(n().annotations.annotations,e);t(_i(0,"REMOVE_ANNOTATIONS",{annotationsToRemove:e,remainingAnnotations:r}))}}function ra(e){return _i(0,"UPDATE_ANCHOR_STATUS",{statusUpdates:e})}const oa=Ai((e=>e.annotations),(e=>Vi(e,Hi)));const ia=Ai((e=>e.focused),(e=>Wi(e))),aa=Ai((e=>e.highlighted),(e=>Wi(e)));const sa=Ai((e=>e.annotations),(e=>e.some(Pi))),la=Ai((e=>e.annotations),(e=>e.filter((e=>Ri(e)&&!Fi(e))))),ca=Ai((e=>e.annotations),(e=>e.filter((e=>Ri(e)&&Fi(e))))),ua=Ai((e=>e.annotations),(e=>Vi(e,Ui))),ha=Ai((e=>e.annotations),(e=>Vi(e,ji)));const da=bi({annotations:[],focused:{},highlighted:{},nextTag:1},{namespace:"annotations",
|
|
151
|
+
reducers:ta,actionCreators:{addAnnotations:function(e){return function(t,n){const r=e.filter((e=>!e.id||!Ji(n().annotations.annotations,e.id)));if(t(_i(0,"ADD_ANNOTATIONS",{annotations:e,currentAnnotationCount:n().annotations.annotations.length})),"sidebar"!==Zi.selectors.route(n().route))return;const o=r.filter(Pi).map((e=>e.id));o.length>0&&setTimeout((()=>{const e=n().annotations.annotations,r=o.map((t=>t?Ji(e,t):null)).filter((e=>e&&Pi(e))).reduce(((e,t)=>(e[t.$tag]="timeout",e)),{});t(ra(r))}),500)}},clearAnnotations:function(){return _i(0,"CLEAR_ANNOTATIONS",void 0)},focusAnnotations:function(e){return _i(0,"FOCUS_ANNOTATIONS",{focusedTags:e})},hideAnnotation:function(e){return _i(0,"HIDE_ANNOTATION",{id:e})},highlightAnnotations:function(e){return _i(0,"HIGHLIGHT_ANNOTATIONS",{highlighted:Yi(e)})},removeAnnotations:na,unhideAnnotation:function(e){return _i(0,"UNHIDE_ANNOTATION",{id:e})},updateAnchorStatus:ra,updateFlagStatus:function(e,t){return _i(0,"UPDATE_FLAG_STATUS",{id:e,isFlagged:t})}},
|
|
152
|
+
selectors:{allAnnotations:function(e){return e.annotations},annotationCount:oa,annotationExists:function(e,t){return e.annotations.some((e=>e.id===t))},findAnnotationByID:function(e,t){return Ji(e.annotations,t)},findIDsForTags:function(e,t){const n=[];for(let r of t){const t=Qi(e.annotations,r);t&&t.id&&n.push(t.id)}return n},focusedAnnotations:ia,highlightedAnnotations:aa,isAnnotationFocused:function(e,t){return!0===e.focused[t]},isWaitingToAnchorAnnotations:sa,newAnnotations:la,newHighlights:ca,noteCount:ua,orphanCount:ha,savedAnnotations:function(e){return e.annotations.filter((e=>Oi(e)))}}}),pa={SET_DEFAULT:(e,t)=>({[t.defaultKey]:t.value})};const ma=bi({annotationPrivacy:null,focusedGroup:null},{namespace:"defaults",reducers:pa,actionCreators:{setDefault:function(e,t){return _i(0,"SET_DEFAULT",{defaultKey:e,value:t})}},selectors:{getDefault:function(e,t){return e[t]},getDefaults:function(e){return e}}});const fa={UPDATE_DIRECT_LINKED_GROUP_FETCH_FAILED:(e,t)=>({
|
|
153
|
+
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 ga=bi((function(e){return{directLinkedGroupId:e.group||null,directLinkedAnnotationId:e.annotations||null,directLinkedGroupFetchFailed:!1}}),{namespace:"directLinked",reducers:fa,actionCreators:{setDirectLinkedGroupFetchFailed:function(){return _i(0,"UPDATE_DIRECT_LINKED_GROUP_FETCH_FAILED",{directLinkedGroupFetchFailed:!0})},setDirectLinkedGroupId:function(e){return _i(0,"UPDATE_DIRECT_LINKED_GROUP_ID",{directLinkedGroupId:e})},setDirectLinkedAnnotationId:function(e){return _i(0,"UPDATE_DIRECT_LINKED_ANNOTATION_ID",{directLinkedAnnotationId:e})},
|
|
154
|
+
clearDirectLinkedGroupFetchFailed:function(){return _i(0,"UPDATE_DIRECT_LINKED_GROUP_FETCH_FAILED",{directLinkedGroupFetchFailed:!1})},clearDirectLinkedIds:function(){return _i(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 va{constructor(e,t){this.annotation={id:e.id,$tag:e.$tag},this.isPrivate=t.isPrivate,this.tags=t.tags,this.text=t.text}match(e){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}}const _a={DISCARD_ALL_DRAFTS:()=>[],REMOVE_DRAFT:(e,t)=>e.filter((e=>!e.match(t.annotation))),UPDATE_DRAFT(e,t){const n=e.filter((e=>!e.match(t.draft.annotation)));return n.push(t.draft),n}};function ba(e){return _i(0,"REMOVE_DRAFT",{annotation:e})}function ya(e,t){const n=e
|
|
155
|
+
;for(let e=0;e<n.length;e++){const r=n[e];if(r.match(t))return r}return null}function wa(e,t){const n=ya(e,t);return n?n.isEmpty()?null:n:null}const xa=Ai((e=>e),(e=>e.filter((e=>!e.annotation.id)).map((e=>e.annotation)))),ka=bi([],{namespace:"drafts",reducers:_a,actionCreators:{createDraft:function(e,t){return _i(0,"UPDATE_DRAFT",{draft:new va(e,t)})},deleteNewAndEmptyDrafts:function(){return(e,t)=>{const n=t().drafts.filter((e=>!e.annotation.id&&!wa(t().drafts,e.annotation))).map((t=>(e(ba(t.annotation)),t.annotation)));e(na(n))}},discardAllDrafts:function(){return _i(0,"DISCARD_ALL_DRAFTS",void 0)},removeDraft:ba},selectors:{countDrafts:function(e){return e.length},getDraft:ya,getDraftIfNotEmpty:wa,unsavedAnnotations:xa}});function Sa(e){var t,n;return!!(null!==(t=e.user)&&void 0!==t&&t.username||null!==(n=e.user)&&void 0!==n&&n.userid)}function Ca(e){const t=e.user;if(!t||!Sa(e))return{};const n=t.username||t.userid||"";return{user:{value:n,display:t.displayName||n}}}const Ea={
|
|
156
|
+
CHANGE_FOCUS_MODE_USER:(e,t)=>({focusActive:Sa({user:t.user}),focusFilters:Ca({user:t.user})}),SET_FILTER(e,t){var n;const r={...e.filters,[t.filterName]:t.filterOption};return""===(null===(n=t.filterOption)||void 0===n?void 0:n.value)&&delete r[t.filterName],{filters:r}},SET_FILTER_QUERY:(e,t)=>({query:t.query}),SET_FOCUS_MODE(e,t){var n;return{focusActive:null!==(n=t.active)&&void 0!==n?n:!e.focusActive}},CLEAR_SELECTION:()=>({filters:{},focusActive:!1,query:null})};const Aa=Ai((e=>e.focusActive),(e=>e.focusFilters),((e,t)=>{var n;return{active:e,configured:!(null==t||!t.user),displayName:(null==t||null===(n=t.user)||void 0===n?void 0:n.display)||""}})),Ta=Ai((e=>e.filters),(e=>e.focusActive),(e=>e.focusFilters),((e,t,n)=>t?{...n,...e}:{...e}));const Na=Ai((e=>Ta(e)),(e=>{const t={};for(let[n,r]of Object.entries(e))r&&(t[n]=r.value);return t}));const Ma=bi((function(e){const t=e.focus||{};return{filters:{},focusActive:Sa(t),focusFilters:Ca(t),query:e.query||null}}),{namespace:"filters",reducers:Ea,
|
|
157
|
+
actionCreators:{changeFocusModeUser:function(e){return _i(0,"CHANGE_FOCUS_MODE_USER",{user:e})},setFilter:function(e,t){return(n,r)=>{var o;null!==(o=r().filters.focusFilters)&&void 0!==o&&o[e]&&n(_i(0,"SET_FOCUS_MODE",{active:!1})),n(_i(0,"SET_FILTER",{filterName:e,filterOption:t}))}},setFilterQuery:function(e){return _i(0,"SET_FILTER_QUERY",{query:e})},toggleFocusMode:function(e){return _i(0,"SET_FOCUS_MODE",{active:e})}},selectors:{filterQuery:function(e){return e.query},focusState:Aa,getFilter:function(e,t){return Ta(e)[t]},getFilters:Ta,getFilterValues:Na,getFocusFilters:function(e){return e.focusFilters},hasAppliedFilter:function(e){return!(!e.query&&!Object.keys(Ta(e)).length)}}});var La=function(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<i.length;l++){var c=i[l];if(!s(c))return!1
|
|
158
|
+
;var u=e[c],h=t[c];if(!1===(o=n?n.call(r,u,h,c):void 0)||void 0===o&&u!==h)return!1}return!0};const za={CONNECT_FRAME:(e,t)=>[...e,t.frame],DESTROY_FRAME:(e,t)=>e.filter((e=>e!==t.frame)),UPDATE_FRAME_ANNOTATION_FETCH_STATUS:(e,t)=>e.map((e=>e.uri&&e.uri===t.uri?Object.assign({},e,{isAnnotationFetchComplete:t.isAnnotationFetchComplete}):e))};const Oa=Ai((e=>e),(e=>e.find((e=>!e.id))||null));const Ra=Ei(Si,La)((e=>e.reduce(((e,t)=>e.concat(function(e){let t=[e.uri];return e.metadata&&e.metadata.documentFingerprint&&(t=e.metadata.link.map((e=>e.href))),e.metadata&&e.metadata.link&&e.metadata.link.forEach((e=>{e.href.startsWith("doi:")&&t.push(e.href)})),t}(t))),[])),(e=>e)),Da=bi([],{namespace:"frames",reducers:za,actionCreators:{connectFrame:function(e){return _i(0,"CONNECT_FRAME",{frame:e})},destroyFrame:function(e){return _i(0,"DESTROY_FRAME",{frame:e})},updateFrameAnnotationFetchStatus:function(e,t){return _i(0,"UPDATE_FRAME_ANNOTATION_FETCH_STATUS",{uri:e,isAnnotationFetchComplete:t})}},selectors:{
|
|
159
|
+
frames:function(e){return e},mainFrame:Oa,searchUris:Ra}}),Ia={features:{},preferences:{},userid:null};const Pa={UPDATE_PROFILE:(e,t)=>({profile:{...t.profile}})};const Ba=bi((function(e){var t;return{defaultAuthority:null!==(t=null==e?void 0:e.authDomain)&&void 0!==t?t:"",profile:Ia}}),{namespace:"session",reducers:Pa,actionCreators:{updateProfile:function(e){return _i(0,"UPDATE_PROFILE",{profile:e})}},selectors:{defaultAuthority:function(e){return e.defaultAuthority},hasFetchedProfile:function(e){return e.profile!==Ia},isFeatureEnabled:function(e,t){return!!e.profile.features[t]},isLoggedIn:function(e){return null!==e.profile.userid},profile:function(e){return e.profile}}}),Fa={FILTER_GROUPS(e,t){var n;if(null===(n=t.filteredGroupIds)||void 0===n||!n.length)return{filteredGroupIds:null};const r=e.groups.filter((e=>t.filteredGroupIds.includes(e.id)));if(!r.length)return{filteredGroupIds:null};let o=e.focusedGroupId;return o&&t.filteredGroupIds.includes(o)||(o=r[0].id),{filteredGroupIds:t.filteredGroupIds,
|
|
160
|
+
focusedGroupId:o}},FOCUS_GROUP(e,t){const n=e.groups.find((e=>e.id===t.id));return n?{focusedGroupId:t.id}:(console.error(`Attempted to focus group ${t.id} which is not loaded`),{})},LOAD_GROUPS(e,t){const n=t.groups;let r=e.focusedGroupId;return null!==e.focusedGroupId&&n.find((t=>t.id===e.focusedGroupId))||(r=n.length>0?n[0].id:null),{focusedGroupId:r,groups:t.groups}},CLEAR_GROUPS:()=>({filteredGroupIds:null,focusedGroupId:null,groups:[]})};function ja(e){return e.filteredGroupIds?e.groups.filter((t=>{var n;return null===(n=e.filteredGroupIds)||void 0===n?void 0:n.includes(t.id)})):e.groups}function Ua(e,t){return e.groups.find((e=>e.id===t))}const Ha=Ai((e=>ja(e)),(e=>e.filter((e=>!e.isMember&&e.isScopedToUri)))),qa=Ai((e=>ja(e)),(e=>e.filter((e=>e.isScopedToUri)))),$a=Ai((e=>ja(e.groups)),(e=>Ba.selectors.isLoggedIn(e.session)),((e,t)=>t?e.filter((e=>e.isMember)):[])),Ga=Ai((e=>ja(e.groups)),(e=>$a(e)),(e=>Ha(e.groups)),((e,t,n)=>e.filter((e=>!t.includes(e)&&!n.includes(e))))),Va=bi({
|
|
161
|
+
filteredGroupIds:null,groups:[],focusedGroupId:null},{namespace:"groups",reducers:Fa,actionCreators:{filterGroups:function(e){return _i(0,"FILTER_GROUPS",{filteredGroupIds:e})},focusGroup:function(e){return _i(0,"FOCUS_GROUP",{id:e})},loadGroups:function(e){return _i(0,"LOAD_GROUPS",{groups:e})},clearGroups:function(){return _i(0,"CLEAR_GROUPS",void 0)}},selectors:{allGroups:function(e){return e.groups},filteredGroups:ja,filteredGroupIds:function(e){return e.filteredGroupIds},focusedGroup:function(e){return e.focusedGroupId?Ua(e,e.focusedGroupId):null},focusedGroupId:function(e){return e.focusedGroupId},getFeaturedGroups:Ha,getGroup:Ua,getInScopeGroups:qa},rootSelectors:{getCurrentlyViewingGroups:Ga,getMyGroups:$a}});function Ya(e,t){const n={};for(const r in t)if(t.hasOwnProperty(r)){const o=t[r],i=":"+r;-1!==e.indexOf(i)?e=e.replace(i,encodeURIComponent(String(o))):n[r]=o}return{url:e,unusedParams:n}}const Wa={UPDATE_LINKS:(e,t)=>({...t.links})};const Ka=bi(null,{namespace:"links",reducers:Wa,
|
|
162
|
+
actionCreators:{updateLinks:function(e){return _i(0,"UPDATE_LINKS",{links:e})}},selectors:{getLink:function(e,t,n={}){if(!e)return"";const r=e[t];if(!r)throw new Error(`Unknown link "${t}"`);const{url:o,unusedParams:i}=Ya(r,n),a=Object.keys(i);if(a.length>0)throw new Error(`Unused parameters: ${a.join(", ")}`);return o}}}),Xa={RECEIVE_REAL_TIME_UPDATES:(e,t)=>({pendingUpdates:{...t.pendingUpdates},pendingDeletions:{...t.pendingDeletions}}),CLEAR_PENDING_UPDATES:()=>({pendingUpdates:{},pendingDeletions:{}}),ADD_ANNOTATIONS(e,{annotations:t}){const n={...e.pendingUpdates};for(let e of t)e.id&&delete n[e.id];return{pendingUpdates:n}},REMOVE_ANNOTATIONS(e,{annotationsToRemove:t}){const n={...e.pendingUpdates},r={...e.pendingDeletions};for(let e of t)e.id&&(delete n[e.id],delete r[e.id]);return{pendingUpdates:n,pendingDeletions:r}},FOCUS_GROUP:()=>({pendingUpdates:{},pendingDeletions:{}})};const Za=Ai((e=>[e.pendingUpdates,e.pendingDeletions]),(([e,t])=>Object.keys(e).length+Object.keys(t).length));const Ja=bi({
|
|
163
|
+
pendingUpdates:{},pendingDeletions:{}},{namespace:"realTimeUpdates",reducers:Xa,actionCreators:{receiveRealTimeUpdates:function({updatedAnnotations:e=[],deletedAnnotations:t=[]}){return(n,r)=>{const o={...r().realTimeUpdates.pendingUpdates},i={...r().realTimeUpdates.pendingDeletions};e.forEach((e=>{const t=r().groups,n=r().route;e.group!==Va.selectors.focusedGroupId(t)&&"sidebar"===Zi.selectors.route(n)||(o[e.id]=e)})),t.forEach((e=>{const t=e.id;delete o[t];const n=r().annotations;da.selectors.annotationExists(n,t)&&(i[t]=!0)})),n(_i(0,"RECEIVE_REAL_TIME_UPDATES",{pendingUpdates:o,pendingDeletions:i}))}},clearPendingUpdates:function(){return _i(0,"CLEAR_PENDING_UPDATES",void 0)}},selectors:{hasPendingDeletion:function(e,t){return e.pendingDeletions.hasOwnProperty(t)},pendingDeletions:function(e){return e.pendingDeletions},pendingUpdates:function(e){return e.pendingUpdates},pendingUpdateCount:Za}}),Qa={annotation:"Location",note:"Oldest",orphan:"Location"};function es(e){const t={}
|
|
164
|
+
;return e.annotations&&!e.query&&(t[e.annotations]=!0),t}const ts=(e,t)=>t===e?{}:{selectedTab:e,sortKey:Qa[e]},ns={CLEAR_SELECTION:()=>({forcedVisible:{},selected:{}}),SELECT_ANNOTATIONS:(e,t)=>({selected:t.selection}),SELECT_TAB:(e,t)=>ts(t.tab,e.selectedTab),SET_EXPANDED(e,t){const n={...e.expanded};return n[t.id]=t.expanded,{expanded:n}},SET_FORCED_VISIBLE:(e,t)=>({forcedVisible:{...e.forcedVisible,[t.id]:t.visible}}),SET_SORT_KEY:(e,t)=>({sortKey:t.key}),TOGGLE_SELECTED_ANNOTATIONS(e,t){const n={...e.selected};return t.toggleIds.forEach((e=>{n[e]=!n[e]})),{selected:n}},ADD_ANNOTATIONS(e,t){const n=t.annotations.filter((e=>!zi(e))),r=Vi(t.annotations,Ui)===n.length;return 0===t.currentAnnotationCount&&r?ts("note",e.selectedTab):{}},CHANGE_FOCUS_MODE_USER:()=>({forcedVisible:{},selected:{}}),SET_FILTER:()=>({forcedVisible:{},selected:{},expanded:{}}),SET_FILTER_QUERY:()=>({forcedVisible:{},selected:{},expanded:{}}),SET_FOCUS_MODE:()=>({forcedVisible:{},selected:{}}),REMOVE_ANNOTATIONS(e,t){
|
|
165
|
+
let n=e.selectedTab;"orphan"===n&&0===Vi(t.remainingAnnotations,ji)&&(n="annotation");const r=e=>(t.annotationsToRemove.forEach((t=>{t.id&&delete e[t.id],t.$tag&&delete e[t.$tag]})),e);return{...ts(n,e.selectedTab),expanded:r({...e.expanded}),forcedVisible:r({...e.forcedVisible}),selected:r({...e.selected})}}};function rs(){return _i(0,"CLEAR_SELECTION",void 0)}function os(e){return e.expanded}const is=Ai((e=>e.forcedVisible),(e=>Wi(e))),as=Ai((e=>e.selected),(e=>Wi(e).length>0)),ss=Ai((e=>e.selected),(e=>Wi(e)));function ls(e){return e.selectedTab}const cs=Ai((e=>e),(e=>({expanded:os(e),forcedVisible:is(e),selected:ss(e),sortKey:us(e),selectedTab:ls(e)})));function us(e){return e.sortKey}const hs=Ai((e=>e.selectedTab),(e=>{const t=["Newest","Oldest"];return"note"!==e&&t.push("Location"),t})),ds=bi((function(e){return{selected:es(e),expanded:es(e),forcedVisible:{},selectedTab:"annotation",sortKey:Qa.annotation}}),{namespace:"selection",reducers:ns,actionCreators:{clearSelection:rs,
|
|
166
|
+
selectAnnotations:function(e){return t=>{t(rs()),t(_i(0,"SELECT_ANNOTATIONS",{selection:Yi(e)}))}},selectTab:function(e){return _i(0,"SELECT_TAB",{tab:e})},setExpanded:function(e,t){return _i(0,"SET_EXPANDED",{id:e,expanded:t})},setForcedVisible:function(e,t){return _i(0,"SET_FORCED_VISIBLE",{id:e,visible:t})},setSortKey:function(e){return _i(0,"SET_SORT_KEY",{key:e})},toggleSelectedAnnotations:function(e){return _i(0,"TOGGLE_SELECTED_ANNOTATIONS",{toggleIds:e})}},selectors:{expandedMap:os,forcedVisibleThreads:is,hasSelectedAnnotations:as,selectedAnnotations:ss,selectedTab:ls,selectionState:cs,sortKey:us,sortKeys:hs}}),ps={OPEN_SIDEBAR_PANEL:(e,t)=>({activePanelName:t.panelName}),CLOSE_SIDEBAR_PANEL(e,t){let n=e.activePanelName;return t.panelName===n&&(n=null),{activePanelName:n}},TOGGLE_SIDEBAR_PANEL:function(e,t){let n;const r=e.activePanelName===t.panelName,o=void 0!==t.panelState?t.panelState:!r;return n=o?t.panelName:r&&!o?null:e.activePanelName,{activePanelName:n}}};const ms=bi({activePanelName:null},{
|
|
167
|
+
namespace:"sidebarPanels",reducers:ps,actionCreators:{openSidebarPanel:function(e){return _i(0,"OPEN_SIDEBAR_PANEL",{panelName:e})},closeSidebarPanel:function(e){return _i(0,"CLOSE_SIDEBAR_PANEL",{panelName:e})},toggleSidebarPanel:function(e,t){return _i(0,"TOGGLE_SIDEBAR_PANEL",{panelName:e,panelState:t})}},selectors:{isSidebarPanelOpen:function(e,t){return e.activePanelName===t}}}),fs={ADD_MESSAGE:(e,t)=>({messages:e.messages.concat({...t.message})}),REMOVE_MESSAGE:(e,t)=>({messages:e.messages.filter((e=>e.id!==t.id))}),UPDATE_MESSAGE:(e,t)=>({messages:e.messages.map((e=>e.id&&e.id===t.message.id?{...t.message}:e))})};const gs=bi({messages:[]},{namespace:"toastMessages",reducers:fs,actionCreators:{addToastMessage:function(e){return _i(0,"ADD_MESSAGE",{message:e})},removeToastMessage:function(e){return _i(0,"REMOVE_MESSAGE",{id:e})},updateToastMessage:function(e){return _i(0,"UPDATE_MESSAGE",{message:e})}},selectors:{getToastMessage:function(e,t){return e.messages.find((e=>e.id===t))},
|
|
168
|
+
getToastMessages:function(e){return e.messages},hasToastMessage:function(e,t,n){return e.messages.some((e=>e.type===t&&e.message===n))}}}),vs={SET_SIDEBAR_OPENED:(e,t)=>!0===t.opened?{sidebarHasOpened:!0}:{}};const _s=bi({sidebarHasOpened:!1},{namespace:"viewer",reducers:vs,actionCreators:{setSidebarOpened:function(e){return _i(0,"SET_SIDEBAR_OPENED",{opened:e})}},selectors:{hasSidebarOpened:function(e){return e.sidebarHasOpened}}});class bs{constructor(e,t,n,r){this.name=e,this.method=t,this.args=n,this.result=r}matches(e,t){return this.name===e&&this.args.every(((e,n)=>t[n]===e))}}function ys(e){return vi([xi,da,ma,ga,ka,Ma,Da,Ka,Va,Ja,Zi,ds,Ba,ms,gs,_s],[e],[yi])}function ws(){var e;return function(e){const[,t]=Yr((e=>e+1),0),n=Xr([]).current,r=Xr(null);if(!r.current){const t=new Map,o=(e,r)=>{const o=e[r];if("function"!=typeof o)return o;let i=t.get(r);return i||(i=(...t)=>{const i=n.find((e=>e.matches(r,t)));if(i)return i.result;const a=e.getState(),s=o.apply(e,t)
|
|
169
|
+
;return a===e.getState()&&n.push(new bs(r,o,t,s)),s},t.set(r,i),i)};r.current=new Proxy(e,{get:o})}return Wr((()=>e.subscribe((()=>{n.find((t=>t.method.apply(e,t.args)!==t.result))&&(n.splice(0,n.length),t(0))}))),[n,e]),r.current}((e="store",Qr(Jo).get(e)))}ys.$inject=["settings"];const xs={collapsed:!1,depth:0,visible:!0,replyCount:0};function ks(e){return e.id||e.$tag}function Ss(e,t,n){const r=e[n];return!(!r||r.parent===t)&&(!r.parent||Ss(e,t,r.parent))}function Cs(e,t,n=[]){if(e[t].parent||!n.length)return;const r=n[n.length-1];e[r]||(e[r]={...xs,children:[],id:r},Cs(e,r,n.slice(0,-1))),Ss(e,t,r)&&(e[t].parent=r,e[r].children.push(e[t]))}function Es(e,t){return Object.assign({},t(e),{children:e.children.map((e=>Es(e,t)))})}function As(e,t,n){const r=e.children.map((e=>As(e,n,n))).slice().sort(t);return{...e,children:r}}function Ts(e,t){const n=e.children.map((e=>Ts(e,t+1))),r=n.reduce(((e,t)=>e+1+t.replyCount),0);return{...e,children:n,depth:t,replyCount:r}}function Ns(e){
|
|
170
|
+
return e.children.some((e=>e.visible||Ns(e)))}const Ms=(e,t)=>e.annotation&&t.annotation?e.annotation.created<t.annotation.created?-1:e.annotation.created>t.annotation.created?1:0:0;function Ls(e,t){const n=t.selected.length>0,r=t.forcedVisible.length>0;let o=function(e){const t={};e.forEach((e=>{const n=ks(e);t[n]={...xs,children:[],annotation:e,id:n}})),e.forEach((e=>{const n=(e.references||[]).filter((t=>t!==e.id));return Cs(t,ks(e),n)}));const n=[];for(const e in t)t[e].parent||(t[e].collapsed=!0,n.push(t[e]));return{...xs,id:"root",children:n}}(e);return n&&(o.children=o.children.filter((e=>{const n=t.selected.includes(e.id),o=r&&t.forcedVisible.includes(e.id);return n||o}))),t.threadFilterFn&&(o.children=o.children.filter(t.threadFilterFn)),o.visible=!1,o=Es(o,(e=>{let n=e.visible;return t.filterFn&&(n=!(!r||!t.forcedVisible.includes(e.id))||!!e.annotation&&!!t.filterFn(e.annotation)),{...e,visible:n}})),o.children=o.children.filter((e=>e.visible||Ns(e))),o=Es(o,(e=>{const n={collapsed:e.collapsed}
|
|
171
|
+
;if(t.expanded.hasOwnProperty(e.id))n.collapsed=!t.expanded[e.id];else{const r=t.filterFn&&Ns(e);n.collapsed=e.collapsed&&!r}return{...e,...n}})),o=As(o,t.sortCompareFn,Ms),o=Ts(o,-1),o}function zs(e){const t=e.slice(0,e.indexOf(":"));if(!t)return[null,e];if(["group","quote","since","tag","text","uri","user"].includes(t)){return[t,e.slice(t.length+1)]}return[null,e]}function Os(e){if(!e)return[];const t=e=>{const t=e.slice(0,1),n=e.slice(-1);return'"'!==t&&"'"!==t||t!==n||(e=e.slice(1,e.length-1)),e};let n=e.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g)||[];n=n.map(t);for(let e=0;e<n.length;e++){const r=n[e],[o,i]=zs(r);o&&(n[e]=o+":"+t(i))}return n}function Rs(e){const t={},n=e=>"tag"===e?"tags":e;if(e){const r=Os(e);for(const e of r){let[r,o]=zs(e);r||(r="any",o=e);const i=n(r);t[i]?t[i].push(o):t[i]=[o]}}return t}
|
|
172
|
+
const Ds=/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u08FE\u0900-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C01-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C82\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D02\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1DC0-\u1DE6\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE26]/g
|
|
173
|
+
;function Is(e){return function(e){return e.replace(Ds,"")}((t=e,t.normalize("NFKD"))).toLowerCase();var t}class Ps{constructor(e,t){this.term=t.normalize(e),this.matcher=t}matches(e){const t=this.matcher;return t.fieldValues(e).some((e=>t.matches(t.normalize(e),this.term)))}}class Bs{constructor(e,t){this.operator=e,this.filters=t}matches(e){return"and"===this.operator?this.filters.every((t=>t.matches(e))):this.filters.some((t=>t.matches(e)))}}function Fs(e){return{fieldValues:e,matches:(e,t)=>e.includes(t),normalize:Is}}const js={quote:Fs((e=>{var t;return[null!==(t=Gi(e))&&void 0!==t?t:""]})),since:{fieldValues:e=>[new Date(e.updated).valueOf()],matches:(e,t)=>(Date.now()-e)/1e3<=t,normalize:e=>e},tag:Fs((e=>e.tags)),text:Fs((e=>[e.text])),uri:Fs((e=>[e.uri])),user:Fs((e=>{var t,n;return[e.user,null!==(t=null===(n=e.user_info)||void 0===n?void 0:n.display_name)&&void 0!==t?t:""]}))};function Us(e){return ji(e)?"orphan":Ui(e)?"note":"annotation"}function Hs(e,t){const n=e.visible===t
|
|
174
|
+
;return e.children.reduce(((e,n)=>e+Hs(n,t)),n?1:0)}function qs(e){return Hs(e,!1)}function $s(e){return Hs(e,!0)}function Gs(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 Gs(n);throw new Error("Thread contains no annotations")}function Vs(e){return Gs([e]).reduce(((e,t)=>t.created>e?t.created:e),"")}function Ys(e){return Gs([e]).reduce(((e,t)=>(e||(e=t.created),t.created<e?t.created:e)),"")}const Ws={Newest:(e,t)=>{const n=Vs(e),r=Vs(t);return n>r?-1:n<r?1:0},Oldest:(e,t)=>{const n=Ys(e),r=Ys(t);return n<r?-1:n>r?1:0},Location:(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);return n<r?-1:n>r?1:0}};const Ks=function(e){if(1!==e.length)throw new Error("Memoize input must be a function of one argument");let t,n;return function(r){return r===t||(t=r,n=e(r)),n}}((function(e){
|
|
175
|
+
const t=e.selection,n={expanded:t.expanded,forcedVisible:t.forcedVisible,selected:t.selected,sortCompareFn:Ws[t.sortKey]},r=!!t.filterQuery||Object.keys(t.filters).length>0;if(r){const e=function(e,t={}){let n;const r=[],o=[],i=[],a=[],s=[],l=[],c=t.user?[t.user]:[];if(e){n=Os(e);for(const e of n){const t=e.slice(0,e.indexOf(":")),n=e.slice(t.length+1);switch(t){case"quote":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";i.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:r.push(e)}}}return{any:{terms:r,operator:"and"},quote:{terms:o,operator:"and"},since:{terms:i,operator:"and"},tag:{terms:a,operator:"and"},text:{terms:s,operator:"and"},uri:{terms:l,operator:"or"},user:{terms:c,operator:"or"}}}(t.filterQuery||"",t.filters)
|
|
176
|
+
;n.filterFn=t=>function(e,t){const n=(e,t)=>new Ps(t,js[e]),r=Object.entries(t).filter((([,e])=>e.terms.length>0)).map((([e,t])=>{let r;if("any"===e){const e=["quote","text","tag","user"];r=t.terms.map((t=>new Bs("or",e.map((e=>n(e,t))))))}else r=t.terms.map((t=>n(e,t)));return new Bs(t.operator,r)})),o=new Bs("and",r);return e.filter((e=>e.id&&o.matches(e))).map((e=>e.id))}([t],e).length>0}return!r&&"sidebar"===e.route&&(n.threadFilterFn=e=>{return!!e.annotation&&(n=e.annotation,r=t.selectedTab,!Pi(n)&&Us(n)===r);var n,r}),Ls(e.annotations,n)}));function Xs(){const e=ws(),t=e.allAnnotations(),n=e.filterQuery(),r=e.route(),o=e.selectionState(),i=e.getFilterValues(),a=Zr((()=>({annotations:t,route:r,selection:{...o,filterQuery:n,filters:i}})),[t,n,r,o,i]);return Ks(a)}
|
|
177
|
+
var Zs=/^\s+|\s+$/g,Js=/^[-+]0x[0-9a-f]+$/i,Qs=/^0b[01]+$/i,el=/^0o[0-7]+$/i,tl=parseInt,nl="object"==typeof V&&V&&V.Object===Object&&V,rl="object"==typeof self&&self&&self.Object===Object&&self,ol=nl||rl||Function("return this")(),il=Object.prototype.toString,al=Math.max,sl=Math.min,ll=function(){return ol.Date.now()};function cl(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ul(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==il.call(e)}(e))return NaN;if(cl(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=cl(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Zs,"");var n=Qs.test(e);return n||el.test(e)?tl(e.slice(2),n?2:8):Js.test(e)?NaN:+e}var hl=function(e,t,n){var r,o,i,a,s,l,c=0,u=!1,h=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function m(e){return c=e,s=setTimeout(g,t),u?p(e):a}
|
|
178
|
+
function f(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-c>=i}function g(){var e=ll();if(f(e))return v(e);s=setTimeout(g,function(e){var n=t-(e-l);return h?sl(n,i-(e-c)):n}(e))}function v(e){return s=void 0,d&&r?p(e):(r=o=void 0,a)}function _(){var e=ll(),n=f(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return m(l);if(h)return s=setTimeout(g,t),p(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=ul(t)||0,cl(n)&&(u=!!n.leading,i=(h="maxWait"in n)?al(ul(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d),_.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=o=s=void 0},_.flush=function(){return void 0===s?a:v(ll())},_};class dl{constructor(){this._listeners=new Map}add(e,t,n,r){e.addEventListener(t,n,r);const o=Symbol();return this._listeners.set(o,{eventTarget:e,eventType:t,listener:n}),o}remove(e){const t=this._listeners.get(e);if(t){const{eventTarget:n,eventType:r,listener:o}=t;n.removeEventListener(r,o),this._listeners.delete(e)}}removeAll(){
|
|
179
|
+
this._listeners.forEach((({eventTarget:e,eventType:t,listener:n})=>{e.removeEventListener(t,n)})),this._listeners.clear()}}const pl={defaultHeight:200,marginAbove:800,marginBelow:800};function ml(e){const t=window.getComputedStyle(e);return e.getBoundingClientRect().height+(parseFloat(t.marginTop)+parseFloat(t.marginBottom))}function fl(e,t){var n;const r=t.defaultAuthority(),o=Ko(e.user,r);return(t.isFeatureEnabled("client_display_names")||o)&&null!==(n=e.user_info)&&void 0!==n&&n.display_name?e.user_info.display_name:Wo(e.user)}function gl(e,t,n){var r;const o=t.defaultAuthority();return Ko(e.user,o)?null!==(r=n.usernameUrl&&`${n.usernameUrl}${Wo(e.user)}`)&&void 0!==r?r:void 0:t.getLink("user",{user:e.user})}function vl(e){return/^http(s?):/i.test(e)}function _l(e){return{read:[e],update:[e],delete:[e]}}function bl(e,t){return Object.assign(_l(e),{read:["group:"+t]})}function yl(e,t,n){return"private"===function(e){switch(e){case"private":case"shared":return e;default:return"shared"}}(n)&&e?_l(e):bl(e,t)}
|
|
180
|
+
function wl(e){return e.read.some((e=>0===e.indexOf("group:")))}function xl(e){return!wl(e)}function kl(e){const t=document.createElement("textarea");t.value=e,t.setAttribute("data-testid","copy-text"),t.contentEditable="true",document.body.appendChild(t),t.focus();try{const e=document.createRange(),n=document.getSelection();n.removeAllRanges(),e.selectNodeContents(t),n.addRange(e),t.setSelectionRange(0,t.value.length),document.execCommand("copy")}finally{t.remove()}}function Sl({classes:e,direction:t="up"}){return so(Ao,{name:"pointer",classes:Pr("absolute inline z-2 text-grey-3 fill-white",{"rotate-180":"down"===t},e)})}function Cl({label:e,iconName:t,uri:n}){return so("li",{children:so(To,{"aria-label":e,classes:"text-grey-6 hover:text-color-text block",href:n,title:e,target:"_blank",children:so(Ao,{name:t})})})}function El({shareURI:e}){const t=encodeURIComponent(e);return so("ul",{className:"flex flex-row gap-x-4 items-center justify-center border-t pt-2",children:[so(Cl,{iconName:"twitter",
|
|
181
|
+
label:"Tweet share link",uri:`https://twitter.com/intent/tweet?url=${t}&hashtags=annotated`}),so(Cl,{iconName:"facebook",label:"Share on Facebook",uri:`https://www.facebook.com/sharer/sharer.php?u=${t}`}),so(Cl,{iconName:"email",label:"Share via email",uri:`mailto:?subject=${encodeURIComponent("Let's Annotate")}&body=${t}`})]})}function Al(){return((e=window.navigator,t="ontouchend"in document)=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(e.platform)||e.userAgent.includes("Mac")&&t)()}var Tl=Qo((function({annotation:e,toastMessenger:t,group:n,shareUri:r}){const o=xl(e.permissions),i=vl(e.uri),a=Xr(null),s=Xr(null),[l,c]=Vr(!1),u=Xr(l);if(Lo(a,l,(()=>c(!1))),Wr((()=>{var e,t;u.current!==l&&(u.current=l,l&&!Al()&&(null===(e=s.current)||void 0===e||e.focus(),null===(t=s.current)||void 0===t||t.select()))}),[l]),!n)return null;const h=i,d="private"===n.type?so("span",{children:["Only members of the group ",so("em",{children:n.name})," may view this annotation."]
|
|
182
|
+
}):so("span",{children:"Anyone using this link may view this annotation."}),p=o?so("span",{children:"Only you may view this annotation."}):d;return so("div",{className:"relative",ref:a,children:[so(mo,{icon:"share",title:"Share",onClick:()=>c(!l),expanded:l}),l&&so(bo,{classes:Pr("w-96 max-w-[85vw]","absolute bottom-8 right-1 touch:bottom-touch-minimum","space-y-2 p-2","theme-clean:border theme-clean:border-solid theme-clean:border-grey-3"),children:[so("div",{className:"flex items-center",children:so("h2",{className:"text-brand text-lg font-medium",children:"Share this annotation"})}),so("div",{className:Pr("flex w-full text-sm touch:text-base"),children:so(Ho,{children:[so(Uo,{"aria-label":"Use this URL to share this annotation",type:"text",value:r,readOnly:!0,inputRef:s}),so(mo,{icon:"copy",title:"Copy share link to clipboard",onClick:()=>{try{kl(r),t.success("Copied share link to clipboard")}catch(e){t.error("Unable to copy link")}},variant:"dark"})]})}),so("div",{className:"text-base font-normal",
|
|
183
|
+
"data-testid":"share-details",children:so(m,i?{children:p}:{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."})}),h&&so(El,{shareURI:r}),so(Sl,{direction:"down",classes:"bottom-[-12px] right-1 touch:right-[9px]"})]})]})}),["toastMessenger"]);var Nl=Qo((function({annotation:e,annotationsService:t,onReply:n,settings:r,toastMessenger:o}){const i=ws(),a=i.profile(),s=i.getGroup(e.group),l=i.isLoggedIn(),c=t=>function(e,t,n){return-1!==e[t].indexOf(n||"")}(e.permissions,t,a.userid),u=c("delete"),h=c("update"),d=function(e){const t=I(e);return!1!==(null==t?void 0:t.allowFlagging)}(r)&&!!a.userid&&a.userid!==e.user,p=function(e){const t=I(e);return!1!==(null==t?void 0:t.enableShareLinks)}(r)&&function(e){var t,n,r,o,i,a
|
|
184
|
+
;return vl(e.uri)?null!==(t=null!==(n=null===(r=e.links)||void 0===r?void 0:r.incontext)&&void 0!==n?n:null===(o=e.links)||void 0===o?void 0:o.html)&&void 0!==t?t:null:null!==(i=null===(a=e.links)||void 0===a?void 0:a.html)&&void 0!==i?i:null}(e);return so("div",{className:"flex text-xl","data-testid":"annotation-action-bar",children:[h&&so(mo,{icon:"edit",title:"Edit",onClick:()=>{i.createDraft(e,{tags:e.tags,text:e.text,isPrivate:xl(e.permissions)})}}),u&&so(mo,{icon:"trash",title:"Delete",onClick:async()=>{const n=qi(e);if(await Vo({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)}}}),so(mo,{icon:"reply",title:"Reply",onClick:()=>{l?n():i.openSidebarPanel("loginPrompt")}}),p&&so(Tl,{annotation:e,group:s,shareUri:p}),d&&!e.flagged&&so(mo,{icon:"flag",title:"Report this annotation to moderators",onClick:()=>{
|
|
185
|
+
t.flag(e).catch((()=>o.error("Flagging annotation failed")))}}),d&&e.flagged&&so(mo,{pressed:!0,icon:"flag--active",title:"Annotation has been reported to the moderators"})]})}),["annotationsService","settings","toastMessenger"]);function Ml({isCollapsed:e,setCollapsed:t,linkStyle:n={}}){return so("div",{className:Pr("absolute block right-0 bottom-0","w-20 bg-gradient-to-l from-white"),children:so("div",{className:"flex justify-end",children:so(go,{classes:"inline underline",onClick:()=>t(!e),expanded:!e,title:"Toggle visibility of full excerpt text",style:n,variant:"dark",children:e?"More":"Less"})})})}const Ll=()=>{};var zl=Qo((function({children:e,collapse:t=!1,collapsedHeight:n,inlineControls:r=!0,onCollapsibleChanged:o=Ll,onToggleCollapsed:i=Ll,overflowThreshold:a=0,settings:s={}}){const[l,c]=Vr(!0),u=Xr(),[h,d]=Vr(0),p=Jr((()=>{const e=u.current.clientHeight;d(e);o(e>n+a)}),[n,o,a]);Kr((()=>{const e=function(e,t){if("undefined"!=typeof ResizeObserver){
|
|
186
|
+
const n=new ResizeObserver((()=>t(e.clientWidth,e.clientHeight)));return n.observe(e),()=>n.disconnect()}const n=new dl;let r=e.clientWidth,o=e.clientHeight;const i=()=>{r===e.clientWidth&&o===e.clientHeight||(r=e.clientWidth,o=e.clientHeight,t(r,o))};n.add(e,"load",i),n.add(window,"resize",i);const a=new MutationObserver(i);return a.observe(e,{characterData:!0,childList:!0,subtree:!0}),()=>{n.removeAll(),a.disconnect()}}(u.current,p);return p(),e}),[p]);const m=h>n+a,f=m&&(r?l:t),g={};0!==h&&(g["max-height"]=f?n:h);const v=e=>r?c(e):i(e);return so("div",{"data-testid":"excerpt-container",className:Pr("relative overflow-hidden","transition-[max-height] ease-in duration-150"),style:g,children:[so("div",{className:Pr("inline-block w-full"),"data-testid":"excerpt-content",ref:u,children:e}),so("div",{"data-testid":"excerpt-expand",role:"presentation",onClick:()=>v(!1),className:Pr("transition-[opacity] duration-150 ease-linear","absolute w-full bottom-0 h-touch-minimum",{
|
|
187
|
+
"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"}),m&&r&&so(Ml,{isCollapsed:l,setCollapsed:v,linkStyle:Zo(["selectionFontFamily"],s)})]})}),["settings"]);function Ol(e,t=16/9){const n=document.createElement("iframe");return n.src=e,n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",""),function(e,t){e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%";const n=document.createElement("div");return n.style.paddingBottom=1/t*100+"%",n.style.position="relative",n.appendChild(e),n}(n,t)}function Rl(e){const t=/(\d+)([hms]?)/g,n={h:3600,m:60,s:1};let r,o=0;for(;null!==(r=t.exec(e));)if(r[2]){const e=r[2];o+=Number(r[1])*n[e]}else o+=+r[1];return o.toString()}function Dl(e,t){const n=function(e){const t=["end","start","t"],n=new URLSearchParams(e.search),r=new URLSearchParams
|
|
188
|
+
;for(let[e,o]of n)t.includes(e)&&("t"===e?r.append("start",Rl(o)):r.append(e,o));r.sort();let o=r.toString();return o&&(o=`?${o}`),o}(t);return Ol(`https://www.youtube.com/embed/${e}${n}`)}function Il(e,t,n,{aspectRatio:r}={}){return o=>{if(o.hostname!==e)return null;const i=t.exec(o.pathname);if(!i)return null;const a=i[1];return Ol(n(a),r)}}const Pl=[function(e){if("www.youtube.com"!==e.hostname)return null;if(!/\/watch\/?/.test(e.pathname))return null;const t=/[&?]v=([^&#]+)/.exec(e.search);return t?Dl(t[1],e):null},function(e){if("youtu.be"!==e.hostname)return null;const t=/^\/([^/]+)\/?$/.exec(e.pathname);return t?Dl(t[1],e):null},Il("vimeo.com",/^\/([^/?#]+)\/?$/,(e=>`https://player.vimeo.com/video/${e}`)),Il("vimeo.com",/^\/channels\/[^/]+\/([^/?#]+)\/?$/,(e=>`https://player.vimeo.com/video/${e}`)),Il("flipgrid.com",/^\/s\/([^/]+)$/,(e=>`https://flipgrid.com/s/${e}?embed=true`)),function(e){if("archive.org"!==e.hostname)return null;const t=/^\/(embed|details)\/(.+)/.exec(e.pathname);if(!t)return null
|
|
189
|
+
;let n=t[2];const r=new URLSearchParams(e.search);let o=r.get("start"),i=r.get("end");if(!o){const e=n.match(/\/start\/([^/]+)/);e&&(o=e[1],n=n.replace(e[0],""))}if(!i){const e=n.match(/\/end\/([^/]+)/);e&&(i=e[1],n=n.replace(e[0],""))}const a=new URL(`https://archive.org/embed/${n}`);return o&&a.searchParams.append("start",o),i&&a.searchParams.append("end",i),Ol(a.href)},function(e){return e.pathname.endsWith(".mp3")||e.pathname.endsWith(".ogg")||e.pathname.endsWith(".wav")?function(e){const t=document.createElement("audio");return t.controls=!0,t.src=e,t}(e.href):null}];function Bl(e){if(e.href!==e.textContent)try{const t=encodeURI(e.textContent);if(e.href!==t)return null}catch{return null}const t=function(e){let t,n;for(n=0;n<Pl.length;n++)if(t=Pl[n](e),t)return t;return null}(e);return t&&e.parentElement.replaceChild(t,e),t}function Fl(e){return Fl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){
|
|
190
|
+
return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fl(e)}function jl(e,t){return jl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},jl(e,t)}function Ul(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function Hl(e,t,n){return Hl=Ul()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&jl(o,n.prototype),o},Hl.apply(null,arguments)}function ql(e){return function(e){if(Array.isArray(e))return $l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return $l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name)
|
|
191
|
+
;if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $l(e,t)}(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 $l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Gl=Object.hasOwnProperty,Vl=Object.setPrototypeOf,Yl=Object.isFrozen,Wl=Object.getPrototypeOf,Kl=Object.getOwnPropertyDescriptor,Xl=Object.freeze,Zl=Object.seal,Jl=Object.create,Ql="undefined"!=typeof Reflect&&Reflect,ec=Ql.apply,tc=Ql.construct;ec||(ec=function(e,t,n){return e.apply(t,n)}),Xl||(Xl=function(e){return e}),Zl||(Zl=function(e){return e}),tc||(tc=function(e,t){return Hl(e,ql(t))})
|
|
192
|
+
;var nc,rc=pc(Array.prototype.forEach),oc=pc(Array.prototype.pop),ic=pc(Array.prototype.push),ac=pc(String.prototype.toLowerCase),sc=pc(String.prototype.match),lc=pc(String.prototype.replace),cc=pc(String.prototype.indexOf),uc=pc(String.prototype.trim),hc=pc(RegExp.prototype.test),dc=(nc=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return tc(nc,t)});function pc(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return ec(e,t,r)}}function mc(e,t){Vl&&Vl(e,null);for(var n=t.length;n--;){var r=t[n];if("string"==typeof r){var o=ac(r);o!==r&&(Yl(t)||(t[n]=o),r=o)}e[r]=!0}return e}function fc(e){var t,n=Jl(null);for(t in e)ec(Gl,e,[t])&&(n[t]=e[t]);return n}function gc(e,t){for(;null!==e;){var n=Kl(e,t);if(n){if(n.get)return pc(n.get);if("function"==typeof n.value)return pc(n.value)}e=Wl(e)}return function(e){return console.warn("fallback value for",e),null}}
|
|
193
|
+
var vc=Xl(["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"]),_c=Xl(["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"]),bc=Xl(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),yc=Xl(["animate","color-profile","cursor","discard","fedropshadow","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"]),wc=Xl(["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"]),xc=Xl(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),kc=Xl(["#text"]),Sc=Xl(["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","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","xmlns","slot"]),Cc=Xl(["accent-height","accumulate","additive","alignment-baseline","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","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","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","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","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"]),Ec=Xl(["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"]),Ac=Xl(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Tc=Zl(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Nc=Zl(/<%[\w\W]*|[\w\W]*%>/gm),Mc=Zl(/^data-[\-\w.\u00B7-\uFFFF]/),Lc=Zl(/^aria-[\-\w]+$/),zc=Zl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Oc=Zl(/^(?:\w+script|data):/i),Rc=Zl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Dc=Zl(/^html$/i),Ic=function(){
|
|
194
|
+
return"undefined"==typeof window?null:window},Pc=function(e,t){if("object"!==Fl(e)||"function"!=typeof e.createPolicy)return null;var n=null,r="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(r)&&(n=t.currentScript.getAttribute(r));var o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};var Bc=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ic(),n=function(t){return e(t)};if(n.version="2.3.8",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,o=t.document,i=t.DocumentFragment,a=t.HTMLTemplateElement,s=t.Node,l=t.Element,c=t.NodeFilter,u=t.NamedNodeMap,h=void 0===u?t.NamedNodeMap||t.MozNamedAttrMap:u,d=t.HTMLFormElement,p=t.DOMParser,m=t.trustedTypes,f=l.prototype,g=gc(f,"cloneNode"),v=gc(f,"nextSibling"),_=gc(f,"childNodes"),b=gc(f,"parentNode");if("function"==typeof a){
|
|
195
|
+
var y=o.createElement("template");y.content&&y.content.ownerDocument&&(o=y.content.ownerDocument)}var w=Pc(m,r),x=w?w.createHTML(""):"",k=o,S=k.implementation,C=k.createNodeIterator,E=k.createDocumentFragment,A=k.getElementsByTagName,T=r.importNode,N={};try{N=fc(o).documentMode?o.documentMode:{}}catch(e){}var M={};n.isSupported="function"==typeof b&&S&&void 0!==S.createHTMLDocument&&9!==N;var L,z,O=Tc,R=Nc,D=Mc,I=Lc,P=Oc,B=Rc,F=zc,j=null,U=mc({},[].concat(ql(vc),ql(_c),ql(bc),ql(wc),ql(kc))),H=null,q=mc({},[].concat(ql(Sc),ql(Cc),ql(Ec),ql(Ac))),$=Object.seal(Object.create(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}
|
|
196
|
+
})),G=null,V=null,Y=!0,W=!0,K=!1,X=!1,Z=!1,J=!1,Q=!1,ee=!1,te=!1,ne=!1,re=!0,oe=!0,ie=!1,ae={},se=null,le=mc({},["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"]),ce=null,ue=mc({},["audio","video","img","source","image","track"]),he=null,de=mc({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pe="http://www.w3.org/1998/Math/MathML",me="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml",ge=fe,ve=!1,_e=["application/xhtml+xml","text/html"],be="text/html",ye=null,we=o.createElement("form"),xe=function(e){return e instanceof RegExp||e instanceof Function},ke=function(e){ye&&ye===e||(e&&"object"===Fl(e)||(e={}),e=fc(e),j="ALLOWED_TAGS"in e?mc({},e.ALLOWED_TAGS):U,H="ALLOWED_ATTR"in e?mc({},e.ALLOWED_ATTR):q,he="ADD_URI_SAFE_ATTR"in e?mc(fc(de),e.ADD_URI_SAFE_ATTR):de,
|
|
197
|
+
ce="ADD_DATA_URI_TAGS"in e?mc(fc(ue),e.ADD_DATA_URI_TAGS):ue,se="FORBID_CONTENTS"in e?mc({},e.FORBID_CONTENTS):le,G="FORBID_TAGS"in e?mc({},e.FORBID_TAGS):{},V="FORBID_ATTR"in e?mc({},e.FORBID_ATTR):{},ae="USE_PROFILES"in e&&e.USE_PROFILES,Y=!1!==e.ALLOW_ARIA_ATTR,W=!1!==e.ALLOW_DATA_ATTR,K=e.ALLOW_UNKNOWN_PROTOCOLS||!1,X=e.SAFE_FOR_TEMPLATES||!1,Z=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,ne=e.RETURN_TRUSTED_TYPE||!1,Q=e.FORCE_BODY||!1,re=!1!==e.SANITIZE_DOM,oe=!1!==e.KEEP_CONTENT,ie=e.IN_PLACE||!1,F=e.ALLOWED_URI_REGEXP||F,ge=e.NAMESPACE||fe,e.CUSTOM_ELEMENT_HANDLING&&xe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&($.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&xe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&($.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),
|
|
198
|
+
e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&($.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),L=L=-1===_e.indexOf(e.PARSER_MEDIA_TYPE)?be:e.PARSER_MEDIA_TYPE,z="application/xhtml+xml"===L?function(e){return e}:ac,X&&(W=!1),te&&(ee=!0),ae&&(j=mc({},ql(kc)),H=[],!0===ae.html&&(mc(j,vc),mc(H,Sc)),!0===ae.svg&&(mc(j,_c),mc(H,Cc),mc(H,Ac)),!0===ae.svgFilters&&(mc(j,bc),mc(H,Cc),mc(H,Ac)),!0===ae.mathMl&&(mc(j,wc),mc(H,Ec),mc(H,Ac))),e.ADD_TAGS&&(j===U&&(j=fc(j)),mc(j,e.ADD_TAGS)),e.ADD_ATTR&&(H===q&&(H=fc(H)),mc(H,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&mc(he,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(se===le&&(se=fc(se)),mc(se,e.FORBID_CONTENTS)),oe&&(j["#text"]=!0),Z&&mc(j,["html","head","body"]),j.table&&(mc(j,["tbody"]),delete G.tbody),Xl&&Xl(e),ye=e)},Se=mc({},["mi","mo","mn","ms","mtext"]),Ce=mc({},["foreignobject","desc","title","annotation-xml"]),Ee=mc({},["title","style","font","a","script"]),Ae=mc({},_c)
|
|
199
|
+
;mc(Ae,bc),mc(Ae,yc);var Te=mc({},wc);mc(Te,xc);var Ne=function(e){var t=b(e);t&&t.tagName||(t={namespaceURI:fe,tagName:"template"});var n=ac(e.tagName),r=ac(t.tagName);return e.namespaceURI===me?t.namespaceURI===fe?"svg"===n:t.namespaceURI===pe?"svg"===n&&("annotation-xml"===r||Se[r]):Boolean(Ae[n]):e.namespaceURI===pe?t.namespaceURI===fe?"math"===n:t.namespaceURI===me?"math"===n&&Ce[r]:Boolean(Te[n]):e.namespaceURI===fe&&(!(t.namespaceURI===me&&!Ce[r])&&(!(t.namespaceURI===pe&&!Se[r])&&(!Te[n]&&(Ee[n]||!Ae[n]))))},Me=function(e){ic(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=x}catch(t){e.remove()}}},Le=function(e,t){try{ic(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){ic(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!H[e])if(ee||te)try{Me(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ze=function(e){var t,n;if(Q)e="<remove></remove>"+e;else{var r=sc(e,/^[\r\n\t ]+/);n=r&&r[0]}
|
|
200
|
+
"application/xhtml+xml"===L&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=w?w.createHTML(e):e;if(ge===fe)try{t=(new p).parseFromString(i,L)}catch(e){}if(!t||!t.documentElement){t=S.createDocument(ge,"template",null);try{t.documentElement.innerHTML=ve?"":i}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(o.createTextNode(n),a.childNodes[0]||null),ge===fe?A.call(t,Z?"html":"body")[0]:Z?t.documentElement:a},Oe=function(e){return C.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},Re=function(e){return e instanceof d&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof h)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)},De=function(e){return"object"===Fl(s)?e instanceof s:e&&"object"===Fl(e)&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName
|
|
201
|
+
},Ie=function(e,t,r){M[e]&&rc(M[e],(function(e){e.call(n,t,r,ye)}))},Pe=function(e){var t;if(Ie("beforeSanitizeElements",e,null),Re(e))return Me(e),!0;if(hc(/[\u0080-\uFFFF]/,e.nodeName))return Me(e),!0;var r=z(e.nodeName);if(Ie("uponSanitizeElement",e,{tagName:r,allowedTags:j}),e.hasChildNodes()&&!De(e.firstElementChild)&&(!De(e.content)||!De(e.content.firstElementChild))&&hc(/<[/\w]/g,e.innerHTML)&&hc(/<[/\w]/g,e.textContent))return Me(e),!0;if("select"===r&&hc(/<template/i,e.innerHTML))return Me(e),!0;if(!j[r]||G[r]){if(!G[r]&&Fe(r)){if($.tagNameCheck instanceof RegExp&&hc($.tagNameCheck,r))return!1;if($.tagNameCheck instanceof Function&&$.tagNameCheck(r))return!1}if(oe&&!se[r]){var o=b(e)||e.parentNode,i=_(e)||e.childNodes;if(i&&o)for(var a=i.length-1;a>=0;--a)o.insertBefore(g(i[a],!0),v(e))}return Me(e),!0}return e instanceof l&&!Ne(e)?(Me(e),!0):"noscript"!==r&&"noembed"!==r||!hc(/<\/no(script|embed)/i,e.innerHTML)?(X&&3===e.nodeType&&(t=e.textContent,t=lc(t,O," "),t=lc(t,R," "),
|
|
202
|
+
e.textContent!==t&&(ic(n.removed,{element:e.cloneNode()}),e.textContent=t)),Ie("afterSanitizeElements",e,null),!1):(Me(e),!0)},Be=function(e,t,n){if(re&&("id"===t||"name"===t)&&(n in o||n in we))return!1;if(W&&!V[t]&&hc(D,t));else if(Y&&hc(I,t));else if(!H[t]||V[t]){if(!(Fe(e)&&($.tagNameCheck instanceof RegExp&&hc($.tagNameCheck,e)||$.tagNameCheck instanceof Function&&$.tagNameCheck(e))&&($.attributeNameCheck instanceof RegExp&&hc($.attributeNameCheck,t)||$.attributeNameCheck instanceof Function&&$.attributeNameCheck(t))||"is"===t&&$.allowCustomizedBuiltInElements&&($.tagNameCheck instanceof RegExp&&hc($.tagNameCheck,n)||$.tagNameCheck instanceof Function&&$.tagNameCheck(n))))return!1}else if(he[t]);else if(hc(F,lc(n,B,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==cc(n,"data:")||!ce[e]){if(K&&!hc(P,lc(n,B,"")));else if(n)return!1}else;return!0},Fe=function(e){return e.indexOf("-")>0},je=function(e){var t,r,o,i;Ie("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var s={
|
|
203
|
+
attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:H};for(i=a.length;i--;){var l=t=a[i],c=l.name,u=l.namespaceURI;if(r="value"===c?t.value:uc(t.value),o=z(c),s.attrName=o,s.attrValue=r,s.keepAttr=!0,s.forceKeepAttr=void 0,Ie("uponSanitizeAttribute",e,s),r=s.attrValue,!s.forceKeepAttr&&(Le(c,e),s.keepAttr))if(hc(/\/>/i,r))Le(c,e);else{X&&(r=lc(r,O," "),r=lc(r,R," "));var h=z(e.nodeName);if(Be(h,o,r))try{u?e.setAttributeNS(u,c,r):e.setAttribute(c,r),oc(n.removed)}catch(e){}}}Ie("afterSanitizeAttributes",e,null)}},Ue=function e(t){var n,r=Oe(t);for(Ie("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)Ie("uponSanitizeShadowNode",n,null),Pe(n)||(n.content instanceof i&&e(n.content),je(n));Ie("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e,o){var a,l,c,u,h;if((ve=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!De(e)){if("function"!=typeof e.toString)throw dc("toString is not a function");if("string"!=typeof(e=e.toString()))throw dc("dirty is not a string, aborting")}if(!n.isSupported){
|
|
204
|
+
if("object"===Fl(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(De(e))return t.toStaticHTML(e.outerHTML)}return e}if(J||ke(o),n.removed=[],"string"==typeof e&&(ie=!1),ie){if(e.nodeName){var d=z(e.nodeName);if(!j[d]||G[d])throw dc("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof s)1===(l=(a=ze("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?a=l:a.appendChild(l);else{if(!ee&&!X&&!Z&&-1===e.indexOf("<"))return w&&ne?w.createHTML(e):e;if(!(a=ze(e)))return ee?null:ne?x:""}a&&Q&&Me(a.firstChild);for(var p=Oe(ie?e:a);c=p.nextNode();)3===c.nodeType&&c===u||Pe(c)||(c.content instanceof i&&Ue(c.content),je(c),u=c);if(u=null,ie)return e;if(ee){if(te)for(h=E.call(a.ownerDocument);a.firstChild;)h.appendChild(a.firstChild);else h=a;return H.shadowroot&&(h=T.call(r,h,!0)),h}var m=Z?a.outerHTML:a.innerHTML
|
|
205
|
+
;return Z&&j["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&hc(Dc,a.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+a.ownerDocument.doctype.name+">\n"+m),X&&(m=lc(m,O," "),m=lc(m,R," ")),w&&ne?w.createHTML(m):m},n.setConfig=function(e){ke(e),J=!0},n.clearConfig=function(){ye=null,J=!1},n.isValidAttribute=function(e,t,n){ye||ke({});var r=z(e),o=z(t);return Be(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(M[e]=M[e]||[],ic(M[e],t))},n.removeHook=function(e){if(M[e])return oc(M[e])},n.removeHooks=function(e){M[e]&&(M[e]=[])},n.removeAllHooks=function(){M={}},n}(),Fc=/["'&<>]/,jc=function(e){var t,n=""+e,r=Fc.exec(n);if(!r)return n;var o="",i=0,a=0;for(i=r.index;i<n.length;i++){switch(n.charCodeAt(i)){case 34:t=""";break;case 38:t="&";break;case 39:t="'";break;case 60:t="<";break;case 62:t=">";break;default:continue}a!==i&&(o+=n.substring(a,i)),a=i+1,o+=t}return a!==i?o+n.substring(a,i):o};class Uc{constructor(e,t,n){this.lexer=void 0,
|
|
206
|
+
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 Uc(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class Hc{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 Hc(t,Uc.range(this,e))}}class qc{constructor(e,t){this.position=void 0;var n,r="KaTeX parse error: "+e,o=t&&t.loc;if(o&&o.start<=o.end){var i=o.lexer.input;n=o.start;var a=o.end;n===i.length?r+=" at end of input: ":r+=" at position "+(n+1)+": ";var s=i.slice(n,a).replace(/[^]/g,"$&̲");r+=(n>15?"…"+i.slice(n-15,n):i.slice(0,n))+s+(a+15<i.length?i.slice(a,a+15)+"…":i.slice(a))}var l=new Error(r);return l.name="ParseError",l.__proto__=qc.prototype,l.position=n,l}}qc.prototype.__proto__=Error.prototype;var $c=/([A-Z])/g,Gc={"&":"&",">":">","<":"<",'"':""","'":"'"},Vc=/[&><"']/g;var Yc=function e(t){
|
|
207
|
+
return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},Wc={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(Vc,(e=>Gc[e]))},hyphenate:function(e){return e.replace($c,"-$1").toLowerCase()},getBaseElem:Yc,isCharacterBox:function(e){var t=Yc(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},protocolFromUrl:function(e){var t=/^\s*([^\\/#]*?)(?::|�*58|�*3a)/i.exec(e);return null!=t?t[1]:"_relative"}},Kc={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)."
|
|
219
208
|
},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",
|
|
220
209
|
processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,
|
|
221
|
-
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
|
|
222
|
-
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
|
|
223
|
-
;var t="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(t)}}class
|
|
224
|
-
blocks:[[44032,55215]]}];var
|
|
210
|
+
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 Xc(e){if(e.default)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if("string"!=typeof n)return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class Zc{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||{},Kc)if(Kc.hasOwnProperty(t)){var n=Kc[t];this[t]=void 0!==e[t]?n.processor?n.processor(e[t]):e[t]:Xc(n)}}
|
|
211
|
+
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 qc("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n);"warn"===r?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,n){var r=this.strict;if("function"==typeof r)try{r=r(e,t,n)}catch(e){r="error"}return!(!r||"ignore"===r)&&(!0===r||"error"===r||("warn"===r?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),!1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]"),!1)))}isTrusted(e){e.url&&!e.protocol&&(e.protocol=Wc.protocolFromUrl(e.url))
|
|
212
|
+
;var t="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(t)}}class Jc{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 Qc[eu[this.id]]}sub(){return Qc[tu[this.id]]}fracNum(){return Qc[nu[this.id]]}fracDen(){return Qc[ru[this.id]]}cramp(){return Qc[ou[this.id]]}text(){return Qc[iu[this.id]]}isTight(){return this.size>=2}}var Qc=[new Jc(0,0,!1),new Jc(1,0,!0),new Jc(2,1,!1),new Jc(3,1,!0),new Jc(4,2,!1),new Jc(5,2,!0),new Jc(6,3,!1),new Jc(7,3,!0)],eu=[4,5,4,5,6,7,6,7],tu=[5,5,5,5,7,7,7,7],nu=[2,3,4,5,6,7,6,7],ru=[3,3,5,5,7,7,7,7],ou=[1,1,3,3,5,5,7,7],iu=[0,1,2,3,2,3,2,3],au={DISPLAY:Qc[0],TEXT:Qc[2],SCRIPT:Qc[4],SCRIPTSCRIPT:Qc[6]},su=[{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",
|
|
213
|
+
blocks:[[44032,55215]]}];var lu=[];function cu(e){for(var t=0;t<lu.length;t+=2)if(e>=lu[t]&&e<=lu[t+1])return!0;return!1}su.forEach((e=>e.blocks.forEach((e=>lu.push(...e)))));var uu={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",
|
|
225
214
|
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",
|
|
226
215
|
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",
|
|
227
216
|
leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",
|
|
@@ -240,7 +229,7 @@ widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,
|
|
|
240
229
|
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",
|
|
241
230
|
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",
|
|
242
231
|
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",
|
|
243
|
-
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
|
|
232
|
+
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 hu{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 Wc.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 du={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],
|
|
244
233
|
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],
|
|
245
234
|
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],
|
|
246
235
|
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],
|
|
@@ -297,188 +286,188 @@ shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,
|
|
|
297
286
|
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],
|
|
298
287
|
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],
|
|
299
288
|
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],
|
|
300
|
-
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]}},
|
|
301
|
-
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]},
|
|
302
|
-
"а":"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
|
|
303
|
-
this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||
|
|
304
|
-
textSize:e,sizeMultiplier:
|
|
305
|
-
cssEmPerMu:
|
|
306
|
-
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)}},
|
|
307
|
-
this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,
|
|
308
|
-
;for(var t in e.src=this.src,e.alt=this.alt,e.className="mord",this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e="<img src='"+this.src+" 'alt='"+this.alt+"' ",t="";for(var n in this.style)this.style.hasOwnProperty(n)&&(t+=
|
|
309
|
-
/[îïíì]/.test(this.text)&&(this.text=
|
|
310
|
-
var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+"='"+this.attributes[t]+"'");e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</svg>"}}class
|
|
311
|
-
var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+"='"+this.attributes[t]+"'");return e+="/>"}}function
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
var
|
|
331
|
-
|
|
332
|
-
var
|
|
333
|
-
return
|
|
334
|
-
i.maxFontSize>r&&(r=i.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},
|
|
335
|
-
mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},
|
|
336
|
-
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
|
|
337
|
-
var f=m.elem,g=m.wrapperClasses||[],v=m.wrapperStyle||{},
|
|
338
|
-
if(120485===n||120486===n)return[
|
|
339
|
-
;return
|
|
340
|
-
mord:
|
|
341
|
-
},
|
|
342
|
-
var n=
|
|
343
|
-
r=
|
|
344
|
-
var
|
|
345
|
-
;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
|
|
346
|
-
return this.character?this.character:" "}},newDocumentFragment:
|
|
347
|
-
;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
|
|
348
|
-
;if(c instanceof
|
|
349
|
-
},
|
|
289
|
+
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]}},pu={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],
|
|
290
|
+
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]},mu={"Å":"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",
|
|
291
|
+
"а":"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 fu(e,t,n){if(!du[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),o=du[t][r];if(!o&&e[0]in mu&&(r=mu[e[0]].charCodeAt(0),o=du[t][r]),o||"text"!==n||cu(r)&&(o=du[t][77]),o)return{depth:o[0],height:o[1],italic:o[2],skew:o[3],width:o[4]}}var gu={};var vu=[[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]],_u=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],bu=function(e,t){return t.size<2?e:vu[e-1][t.size-1]};class yu{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,
|
|
292
|
+
this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||yu.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=_u[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 yu(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:bu(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,
|
|
293
|
+
textSize:e,sizeMultiplier:_u[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=bu(yu.BASESIZE,e);return this.size===t&&this.textSize===yu.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!==yu.BASESIZE?["sizing","reset-size"+this.size,"size"+yu.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!gu[t=e>=5?0:e>=3?1:2]){var n=gu[t]={
|
|
294
|
+
cssEmPerMu:pu.quad[t]/18};for(var r in pu)pu.hasOwnProperty(r)&&(n[r]=pu[r][t])}return gu[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}yu.BASESIZE=6;var wu={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},xu={ex:!0,em:!0,mu:!0},ku=function(e){return"string"!=typeof e&&(e=e.unit),e in wu||e in xu||"ex"===e},Su=function(e,t){var n;if(e.unit in wu)n=wu[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 qc("Invalid unit: '"+e.unit+"'");n=r.fontMetrics().quad}r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},Cu=function(e){return+e.toFixed(4)+"em"},Eu=function(e){return e.filter((e=>e)).join(" ")},Au=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,
|
|
295
|
+
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)}},Tu=function(e){var t=document.createElement(e);for(var n in t.className=Eu(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},Nu=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+Wc.escape(Eu(this.classes))+'"');var n="";for(var r in this.style)this.style.hasOwnProperty(r)&&(n+=Wc.hyphenate(r)+":"+this.style[r]+";");for(var o in n&&(t+=' style="'+Wc.escape(n)+'"'),this.attributes)this.attributes.hasOwnProperty(o)&&(t+=" "+o+'="'+Wc.escape(this.attributes[o])+'"');t+=">";for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup();return t+="</"+e+">"};class Mu{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,
|
|
296
|
+
this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,Au.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return Wc.contains(this.classes,e)}toNode(){return Tu.call(this,"span")}toMarkup(){return Nu.call(this,"span")}}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.maxFontSize=void 0,this.style=void 0,Au.call(this,t,r),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return Wc.contains(this.classes,e)}toNode(){return Tu.call(this,"a")}toMarkup(){return Nu.call(this,"a")}}class zu{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=n}hasClass(e){return Wc.contains(this.classes,e)}toNode(){var e=document.createElement("img")
|
|
297
|
+
;for(var t in e.src=this.src,e.alt=this.alt,e.className="mord",this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e="<img src='"+this.src+" 'alt='"+this.alt+"' ",t="";for(var n in this.style)this.style.hasOwnProperty(n)&&(t+=Wc.hyphenate(n)+":"+this.style[n]+";");return t&&(e+=' style="'+Wc.escape(t)+'"'),e+="'/>"}}var Ou={"î":"ı̂","ï":"ı̈","í":"ı́","ì":"ı̀"};class Ru{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<su.length;t++)for(var n=su[t],r=0;r<n.blocks.length;r++){var o=n.blocks[r];if(e>=o[0]&&e<=o[1])return n.name}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),
|
|
298
|
+
/[îïíì]/.test(this.text)&&(this.text=Ou[this.text])}hasClass(e){return Wc.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=Cu(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=Eu(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+=Wc.escape(Eu(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+=Wc.hyphenate(r)+":"+this.style[r]+";");n&&(e=!0,t+=' style="'+Wc.escape(n)+'"');var o=Wc.escape(this.text);return e?(t+=">",t+=o,t+="</span>"):o}}class Du{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){
|
|
299
|
+
var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+"='"+this.attributes[t]+"'");e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</svg>"}}class Iu{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",uu[this.pathName]),e}toMarkup(){return this.alternate?"<path d='"+this.alternate+"'/>":"<path d='"+uu[this.pathName]+"'/>"}}class Pu{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){
|
|
300
|
+
var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+"='"+this.attributes[t]+"'");return e+="/>"}}function Bu(e){if(e instanceof Ru)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}var Fu={bin:1,close:1,inner:1,open:1,punct:1,rel:1},ju={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Uu={math:{},text:{}};function Hu(e,t,n,r,o,i){Uu[e][o]={font:t,group:n,replace:r},i&&r&&(Uu[e][r]=Uu[e][o])}var qu="math",$u="text",Gu="main",Vu="ams",Yu="accent-token",Wu="bin",Ku="close",Xu="mathord",Zu="op-token",Ju="open",Qu="rel",eh="textord";Hu(qu,Gu,Qu,"≡","\\equiv",!0),Hu(qu,Gu,Qu,"≺","\\prec",!0),Hu(qu,Gu,Qu,"≻","\\succ",!0),Hu(qu,Gu,Qu,"∼","\\sim",!0),Hu(qu,Gu,Qu,"⊥","\\perp"),Hu(qu,Gu,Qu,"⪯","\\preceq",!0),
|
|
301
|
+
Hu(qu,Gu,Qu,"⪰","\\succeq",!0),Hu(qu,Gu,Qu,"≃","\\simeq",!0),Hu(qu,Gu,Qu,"∣","\\mid",!0),Hu(qu,Gu,Qu,"≪","\\ll",!0),Hu(qu,Gu,Qu,"≫","\\gg",!0),Hu(qu,Gu,Qu,"≍","\\asymp",!0),Hu(qu,Gu,Qu,"∥","\\parallel"),Hu(qu,Gu,Qu,"⋈","\\bowtie",!0),Hu(qu,Gu,Qu,"⌣","\\smile",!0),Hu(qu,Gu,Qu,"⊑","\\sqsubseteq",!0),Hu(qu,Gu,Qu,"⊒","\\sqsupseteq",!0),Hu(qu,Gu,Qu,"≐","\\doteq",!0),Hu(qu,Gu,Qu,"⌢","\\frown",!0),Hu(qu,Gu,Qu,"∋","\\ni",!0),Hu(qu,Gu,Qu,"∝","\\propto",!0),Hu(qu,Gu,Qu,"⊢","\\vdash",!0),Hu(qu,Gu,Qu,"⊣","\\dashv",!0),Hu(qu,Gu,Qu,"∋","\\owns"),Hu(qu,Gu,"punct",".","\\ldotp"),Hu(qu,Gu,"punct","⋅","\\cdotp"),Hu(qu,Gu,eh,"#","\\#"),Hu($u,Gu,eh,"#","\\#"),Hu(qu,Gu,eh,"&","\\&"),Hu($u,Gu,eh,"&","\\&"),Hu(qu,Gu,eh,"ℵ","\\aleph",!0),Hu(qu,Gu,eh,"∀","\\forall",!0),Hu(qu,Gu,eh,"ℏ","\\hbar",!0),Hu(qu,Gu,eh,"∃","\\exists",!0),Hu(qu,Gu,eh,"∇","\\nabla",!0),Hu(qu,Gu,eh,"♭","\\flat",!0),Hu(qu,Gu,eh,"ℓ","\\ell",!0),Hu(qu,Gu,eh,"♮","\\natural",!0),Hu(qu,Gu,eh,"♣","\\clubsuit",!0),Hu(qu,Gu,eh,"℘","\\wp",!0),Hu(qu,Gu,eh,"♯","\\sharp",!0),
|
|
302
|
+
Hu(qu,Gu,eh,"♢","\\diamondsuit",!0),Hu(qu,Gu,eh,"ℜ","\\Re",!0),Hu(qu,Gu,eh,"♡","\\heartsuit",!0),Hu(qu,Gu,eh,"ℑ","\\Im",!0),Hu(qu,Gu,eh,"♠","\\spadesuit",!0),Hu(qu,Gu,eh,"§","\\S",!0),Hu($u,Gu,eh,"§","\\S"),Hu(qu,Gu,eh,"¶","\\P",!0),Hu($u,Gu,eh,"¶","\\P"),Hu(qu,Gu,eh,"†","\\dag"),Hu($u,Gu,eh,"†","\\dag"),Hu($u,Gu,eh,"†","\\textdagger"),Hu(qu,Gu,eh,"‡","\\ddag"),Hu($u,Gu,eh,"‡","\\ddag"),Hu($u,Gu,eh,"‡","\\textdaggerdbl"),Hu(qu,Gu,Ku,"⎱","\\rmoustache",!0),Hu(qu,Gu,Ju,"⎰","\\lmoustache",!0),Hu(qu,Gu,Ku,"⟯","\\rgroup",!0),Hu(qu,Gu,Ju,"⟮","\\lgroup",!0),Hu(qu,Gu,Wu,"∓","\\mp",!0),Hu(qu,Gu,Wu,"⊖","\\ominus",!0),Hu(qu,Gu,Wu,"⊎","\\uplus",!0),Hu(qu,Gu,Wu,"⊓","\\sqcap",!0),Hu(qu,Gu,Wu,"∗","\\ast"),Hu(qu,Gu,Wu,"⊔","\\sqcup",!0),Hu(qu,Gu,Wu,"◯","\\bigcirc",!0),Hu(qu,Gu,Wu,"∙","\\bullet",!0),Hu(qu,Gu,Wu,"‡","\\ddagger"),Hu(qu,Gu,Wu,"≀","\\wr",!0),Hu(qu,Gu,Wu,"⨿","\\amalg"),Hu(qu,Gu,Wu,"&","\\And"),Hu(qu,Gu,Qu,"⟵","\\longleftarrow",!0),Hu(qu,Gu,Qu,"⇐","\\Leftarrow",!0),Hu(qu,Gu,Qu,"⟸","\\Longleftarrow",!0),
|
|
303
|
+
Hu(qu,Gu,Qu,"⟶","\\longrightarrow",!0),Hu(qu,Gu,Qu,"⇒","\\Rightarrow",!0),Hu(qu,Gu,Qu,"⟹","\\Longrightarrow",!0),Hu(qu,Gu,Qu,"↔","\\leftrightarrow",!0),Hu(qu,Gu,Qu,"⟷","\\longleftrightarrow",!0),Hu(qu,Gu,Qu,"⇔","\\Leftrightarrow",!0),Hu(qu,Gu,Qu,"⟺","\\Longleftrightarrow",!0),Hu(qu,Gu,Qu,"↦","\\mapsto",!0),Hu(qu,Gu,Qu,"⟼","\\longmapsto",!0),Hu(qu,Gu,Qu,"↗","\\nearrow",!0),Hu(qu,Gu,Qu,"↩","\\hookleftarrow",!0),Hu(qu,Gu,Qu,"↪","\\hookrightarrow",!0),Hu(qu,Gu,Qu,"↘","\\searrow",!0),Hu(qu,Gu,Qu,"↼","\\leftharpoonup",!0),Hu(qu,Gu,Qu,"⇀","\\rightharpoonup",!0),Hu(qu,Gu,Qu,"↙","\\swarrow",!0),Hu(qu,Gu,Qu,"↽","\\leftharpoondown",!0),Hu(qu,Gu,Qu,"⇁","\\rightharpoondown",!0),Hu(qu,Gu,Qu,"↖","\\nwarrow",!0),Hu(qu,Gu,Qu,"⇌","\\rightleftharpoons",!0),Hu(qu,Vu,Qu,"≮","\\nless",!0),Hu(qu,Vu,Qu,"","\\@nleqslant"),Hu(qu,Vu,Qu,"","\\@nleqq"),Hu(qu,Vu,Qu,"⪇","\\lneq",!0),Hu(qu,Vu,Qu,"≨","\\lneqq",!0),Hu(qu,Vu,Qu,"","\\@lvertneqq"),Hu(qu,Vu,Qu,"⋦","\\lnsim",!0),Hu(qu,Vu,Qu,"⪉","\\lnapprox",!0),Hu(qu,Vu,Qu,"⊀","\\nprec",!0),
|
|
304
|
+
Hu(qu,Vu,Qu,"⋠","\\npreceq",!0),Hu(qu,Vu,Qu,"⋨","\\precnsim",!0),Hu(qu,Vu,Qu,"⪹","\\precnapprox",!0),Hu(qu,Vu,Qu,"≁","\\nsim",!0),Hu(qu,Vu,Qu,"","\\@nshortmid"),Hu(qu,Vu,Qu,"∤","\\nmid",!0),Hu(qu,Vu,Qu,"⊬","\\nvdash",!0),Hu(qu,Vu,Qu,"⊭","\\nvDash",!0),Hu(qu,Vu,Qu,"⋪","\\ntriangleleft"),Hu(qu,Vu,Qu,"⋬","\\ntrianglelefteq",!0),Hu(qu,Vu,Qu,"⊊","\\subsetneq",!0),Hu(qu,Vu,Qu,"","\\@varsubsetneq"),Hu(qu,Vu,Qu,"⫋","\\subsetneqq",!0),Hu(qu,Vu,Qu,"","\\@varsubsetneqq"),Hu(qu,Vu,Qu,"≯","\\ngtr",!0),Hu(qu,Vu,Qu,"","\\@ngeqslant"),Hu(qu,Vu,Qu,"","\\@ngeqq"),Hu(qu,Vu,Qu,"⪈","\\gneq",!0),Hu(qu,Vu,Qu,"≩","\\gneqq",!0),Hu(qu,Vu,Qu,"","\\@gvertneqq"),Hu(qu,Vu,Qu,"⋧","\\gnsim",!0),Hu(qu,Vu,Qu,"⪊","\\gnapprox",!0),Hu(qu,Vu,Qu,"⊁","\\nsucc",!0),Hu(qu,Vu,Qu,"⋡","\\nsucceq",!0),Hu(qu,Vu,Qu,"⋩","\\succnsim",!0),Hu(qu,Vu,Qu,"⪺","\\succnapprox",!0),Hu(qu,Vu,Qu,"≆","\\ncong",!0),Hu(qu,Vu,Qu,"","\\@nshortparallel"),Hu(qu,Vu,Qu,"∦","\\nparallel",!0),Hu(qu,Vu,Qu,"⊯","\\nVDash",!0),Hu(qu,Vu,Qu,"⋫","\\ntriangleright"),
|
|
305
|
+
Hu(qu,Vu,Qu,"⋭","\\ntrianglerighteq",!0),Hu(qu,Vu,Qu,"","\\@nsupseteqq"),Hu(qu,Vu,Qu,"⊋","\\supsetneq",!0),Hu(qu,Vu,Qu,"","\\@varsupsetneq"),Hu(qu,Vu,Qu,"⫌","\\supsetneqq",!0),Hu(qu,Vu,Qu,"","\\@varsupsetneqq"),Hu(qu,Vu,Qu,"⊮","\\nVdash",!0),Hu(qu,Vu,Qu,"⪵","\\precneqq",!0),Hu(qu,Vu,Qu,"⪶","\\succneqq",!0),Hu(qu,Vu,Qu,"","\\@nsubseteqq"),Hu(qu,Vu,Wu,"⊴","\\unlhd"),Hu(qu,Vu,Wu,"⊵","\\unrhd"),Hu(qu,Vu,Qu,"↚","\\nleftarrow",!0),Hu(qu,Vu,Qu,"↛","\\nrightarrow",!0),Hu(qu,Vu,Qu,"⇍","\\nLeftarrow",!0),Hu(qu,Vu,Qu,"⇏","\\nRightarrow",!0),Hu(qu,Vu,Qu,"↮","\\nleftrightarrow",!0),Hu(qu,Vu,Qu,"⇎","\\nLeftrightarrow",!0),Hu(qu,Vu,Qu,"△","\\vartriangle"),Hu(qu,Vu,eh,"ℏ","\\hslash"),Hu(qu,Vu,eh,"▽","\\triangledown"),Hu(qu,Vu,eh,"◊","\\lozenge"),Hu(qu,Vu,eh,"Ⓢ","\\circledS"),Hu(qu,Vu,eh,"®","\\circledR"),Hu($u,Vu,eh,"®","\\circledR"),Hu(qu,Vu,eh,"∡","\\measuredangle",!0),Hu(qu,Vu,eh,"∄","\\nexists"),Hu(qu,Vu,eh,"℧","\\mho"),Hu(qu,Vu,eh,"Ⅎ","\\Finv",!0),Hu(qu,Vu,eh,"⅁","\\Game",!0),Hu(qu,Vu,eh,"‵","\\backprime"),
|
|
306
|
+
Hu(qu,Vu,eh,"▲","\\blacktriangle"),Hu(qu,Vu,eh,"▼","\\blacktriangledown"),Hu(qu,Vu,eh,"■","\\blacksquare"),Hu(qu,Vu,eh,"⧫","\\blacklozenge"),Hu(qu,Vu,eh,"★","\\bigstar"),Hu(qu,Vu,eh,"∢","\\sphericalangle",!0),Hu(qu,Vu,eh,"∁","\\complement",!0),Hu(qu,Vu,eh,"ð","\\eth",!0),Hu($u,Gu,eh,"ð","ð"),Hu(qu,Vu,eh,"╱","\\diagup"),Hu(qu,Vu,eh,"╲","\\diagdown"),Hu(qu,Vu,eh,"□","\\square"),Hu(qu,Vu,eh,"□","\\Box"),Hu(qu,Vu,eh,"◊","\\Diamond"),Hu(qu,Vu,eh,"¥","\\yen",!0),Hu($u,Vu,eh,"¥","\\yen",!0),Hu(qu,Vu,eh,"✓","\\checkmark",!0),Hu($u,Vu,eh,"✓","\\checkmark"),Hu(qu,Vu,eh,"ℶ","\\beth",!0),Hu(qu,Vu,eh,"ℸ","\\daleth",!0),Hu(qu,Vu,eh,"ℷ","\\gimel",!0),Hu(qu,Vu,eh,"ϝ","\\digamma",!0),Hu(qu,Vu,eh,"ϰ","\\varkappa"),Hu(qu,Vu,Ju,"┌","\\@ulcorner",!0),Hu(qu,Vu,Ku,"┐","\\@urcorner",!0),Hu(qu,Vu,Ju,"└","\\@llcorner",!0),Hu(qu,Vu,Ku,"┘","\\@lrcorner",!0),Hu(qu,Vu,Qu,"≦","\\leqq",!0),Hu(qu,Vu,Qu,"⩽","\\leqslant",!0),Hu(qu,Vu,Qu,"⪕","\\eqslantless",!0),Hu(qu,Vu,Qu,"≲","\\lesssim",!0),Hu(qu,Vu,Qu,"⪅","\\lessapprox",!0),
|
|
307
|
+
Hu(qu,Vu,Qu,"≊","\\approxeq",!0),Hu(qu,Vu,Wu,"⋖","\\lessdot"),Hu(qu,Vu,Qu,"⋘","\\lll",!0),Hu(qu,Vu,Qu,"≶","\\lessgtr",!0),Hu(qu,Vu,Qu,"⋚","\\lesseqgtr",!0),Hu(qu,Vu,Qu,"⪋","\\lesseqqgtr",!0),Hu(qu,Vu,Qu,"≑","\\doteqdot"),Hu(qu,Vu,Qu,"≓","\\risingdotseq",!0),Hu(qu,Vu,Qu,"≒","\\fallingdotseq",!0),Hu(qu,Vu,Qu,"∽","\\backsim",!0),Hu(qu,Vu,Qu,"⋍","\\backsimeq",!0),Hu(qu,Vu,Qu,"⫅","\\subseteqq",!0),Hu(qu,Vu,Qu,"⋐","\\Subset",!0),Hu(qu,Vu,Qu,"⊏","\\sqsubset",!0),Hu(qu,Vu,Qu,"≼","\\preccurlyeq",!0),Hu(qu,Vu,Qu,"⋞","\\curlyeqprec",!0),Hu(qu,Vu,Qu,"≾","\\precsim",!0),Hu(qu,Vu,Qu,"⪷","\\precapprox",!0),Hu(qu,Vu,Qu,"⊲","\\vartriangleleft"),Hu(qu,Vu,Qu,"⊴","\\trianglelefteq"),Hu(qu,Vu,Qu,"⊨","\\vDash",!0),Hu(qu,Vu,Qu,"⊪","\\Vvdash",!0),Hu(qu,Vu,Qu,"⌣","\\smallsmile"),Hu(qu,Vu,Qu,"⌢","\\smallfrown"),Hu(qu,Vu,Qu,"≏","\\bumpeq",!0),Hu(qu,Vu,Qu,"≎","\\Bumpeq",!0),Hu(qu,Vu,Qu,"≧","\\geqq",!0),Hu(qu,Vu,Qu,"⩾","\\geqslant",!0),Hu(qu,Vu,Qu,"⪖","\\eqslantgtr",!0),Hu(qu,Vu,Qu,"≳","\\gtrsim",!0),Hu(qu,Vu,Qu,"⪆","\\gtrapprox",!0),
|
|
308
|
+
Hu(qu,Vu,Wu,"⋗","\\gtrdot"),Hu(qu,Vu,Qu,"⋙","\\ggg",!0),Hu(qu,Vu,Qu,"≷","\\gtrless",!0),Hu(qu,Vu,Qu,"⋛","\\gtreqless",!0),Hu(qu,Vu,Qu,"⪌","\\gtreqqless",!0),Hu(qu,Vu,Qu,"≖","\\eqcirc",!0),Hu(qu,Vu,Qu,"≗","\\circeq",!0),Hu(qu,Vu,Qu,"≜","\\triangleq",!0),Hu(qu,Vu,Qu,"∼","\\thicksim"),Hu(qu,Vu,Qu,"≈","\\thickapprox"),Hu(qu,Vu,Qu,"⫆","\\supseteqq",!0),Hu(qu,Vu,Qu,"⋑","\\Supset",!0),Hu(qu,Vu,Qu,"⊐","\\sqsupset",!0),Hu(qu,Vu,Qu,"≽","\\succcurlyeq",!0),Hu(qu,Vu,Qu,"⋟","\\curlyeqsucc",!0),Hu(qu,Vu,Qu,"≿","\\succsim",!0),Hu(qu,Vu,Qu,"⪸","\\succapprox",!0),Hu(qu,Vu,Qu,"⊳","\\vartriangleright"),Hu(qu,Vu,Qu,"⊵","\\trianglerighteq"),Hu(qu,Vu,Qu,"⊩","\\Vdash",!0),Hu(qu,Vu,Qu,"∣","\\shortmid"),Hu(qu,Vu,Qu,"∥","\\shortparallel"),Hu(qu,Vu,Qu,"≬","\\between",!0),Hu(qu,Vu,Qu,"⋔","\\pitchfork",!0),Hu(qu,Vu,Qu,"∝","\\varpropto"),Hu(qu,Vu,Qu,"◀","\\blacktriangleleft"),Hu(qu,Vu,Qu,"∴","\\therefore",!0),Hu(qu,Vu,Qu,"∍","\\backepsilon"),Hu(qu,Vu,Qu,"▶","\\blacktriangleright"),Hu(qu,Vu,Qu,"∵","\\because",!0),
|
|
309
|
+
Hu(qu,Vu,Qu,"⋘","\\llless"),Hu(qu,Vu,Qu,"⋙","\\gggtr"),Hu(qu,Vu,Wu,"⊲","\\lhd"),Hu(qu,Vu,Wu,"⊳","\\rhd"),Hu(qu,Vu,Qu,"≂","\\eqsim",!0),Hu(qu,Gu,Qu,"⋈","\\Join"),Hu(qu,Vu,Qu,"≑","\\Doteq",!0),Hu(qu,Vu,Wu,"∔","\\dotplus",!0),Hu(qu,Vu,Wu,"∖","\\smallsetminus"),Hu(qu,Vu,Wu,"⋒","\\Cap",!0),Hu(qu,Vu,Wu,"⋓","\\Cup",!0),Hu(qu,Vu,Wu,"⩞","\\doublebarwedge",!0),Hu(qu,Vu,Wu,"⊟","\\boxminus",!0),Hu(qu,Vu,Wu,"⊞","\\boxplus",!0),Hu(qu,Vu,Wu,"⋇","\\divideontimes",!0),Hu(qu,Vu,Wu,"⋉","\\ltimes",!0),Hu(qu,Vu,Wu,"⋊","\\rtimes",!0),Hu(qu,Vu,Wu,"⋋","\\leftthreetimes",!0),Hu(qu,Vu,Wu,"⋌","\\rightthreetimes",!0),Hu(qu,Vu,Wu,"⋏","\\curlywedge",!0),Hu(qu,Vu,Wu,"⋎","\\curlyvee",!0),Hu(qu,Vu,Wu,"⊝","\\circleddash",!0),Hu(qu,Vu,Wu,"⊛","\\circledast",!0),Hu(qu,Vu,Wu,"⋅","\\centerdot"),Hu(qu,Vu,Wu,"⊺","\\intercal",!0),Hu(qu,Vu,Wu,"⋒","\\doublecap"),Hu(qu,Vu,Wu,"⋓","\\doublecup"),Hu(qu,Vu,Wu,"⊠","\\boxtimes",!0),Hu(qu,Vu,Qu,"⇢","\\dashrightarrow",!0),Hu(qu,Vu,Qu,"⇠","\\dashleftarrow",!0),Hu(qu,Vu,Qu,"⇇","\\leftleftarrows",!0),
|
|
310
|
+
Hu(qu,Vu,Qu,"⇆","\\leftrightarrows",!0),Hu(qu,Vu,Qu,"⇚","\\Lleftarrow",!0),Hu(qu,Vu,Qu,"↞","\\twoheadleftarrow",!0),Hu(qu,Vu,Qu,"↢","\\leftarrowtail",!0),Hu(qu,Vu,Qu,"↫","\\looparrowleft",!0),Hu(qu,Vu,Qu,"⇋","\\leftrightharpoons",!0),Hu(qu,Vu,Qu,"↶","\\curvearrowleft",!0),Hu(qu,Vu,Qu,"↺","\\circlearrowleft",!0),Hu(qu,Vu,Qu,"↰","\\Lsh",!0),Hu(qu,Vu,Qu,"⇈","\\upuparrows",!0),Hu(qu,Vu,Qu,"↿","\\upharpoonleft",!0),Hu(qu,Vu,Qu,"⇃","\\downharpoonleft",!0),Hu(qu,Gu,Qu,"⊶","\\origof",!0),Hu(qu,Gu,Qu,"⊷","\\imageof",!0),Hu(qu,Vu,Qu,"⊸","\\multimap",!0),Hu(qu,Vu,Qu,"↭","\\leftrightsquigarrow",!0),Hu(qu,Vu,Qu,"⇉","\\rightrightarrows",!0),Hu(qu,Vu,Qu,"⇄","\\rightleftarrows",!0),Hu(qu,Vu,Qu,"↠","\\twoheadrightarrow",!0),Hu(qu,Vu,Qu,"↣","\\rightarrowtail",!0),Hu(qu,Vu,Qu,"↬","\\looparrowright",!0),Hu(qu,Vu,Qu,"↷","\\curvearrowright",!0),Hu(qu,Vu,Qu,"↻","\\circlearrowright",!0),Hu(qu,Vu,Qu,"↱","\\Rsh",!0),Hu(qu,Vu,Qu,"⇊","\\downdownarrows",!0),Hu(qu,Vu,Qu,"↾","\\upharpoonright",!0),Hu(qu,Vu,Qu,"⇂","\\downharpoonright",!0),
|
|
311
|
+
Hu(qu,Vu,Qu,"⇝","\\rightsquigarrow",!0),Hu(qu,Vu,Qu,"⇝","\\leadsto"),Hu(qu,Vu,Qu,"⇛","\\Rrightarrow",!0),Hu(qu,Vu,Qu,"↾","\\restriction"),Hu(qu,Gu,eh,"‘","`"),Hu(qu,Gu,eh,"$","\\$"),Hu($u,Gu,eh,"$","\\$"),Hu($u,Gu,eh,"$","\\textdollar"),Hu(qu,Gu,eh,"%","\\%"),Hu($u,Gu,eh,"%","\\%"),Hu(qu,Gu,eh,"_","\\_"),Hu($u,Gu,eh,"_","\\_"),Hu($u,Gu,eh,"_","\\textunderscore"),Hu(qu,Gu,eh,"∠","\\angle",!0),Hu(qu,Gu,eh,"∞","\\infty",!0),Hu(qu,Gu,eh,"′","\\prime"),Hu(qu,Gu,eh,"△","\\triangle"),Hu(qu,Gu,eh,"Γ","\\Gamma",!0),Hu(qu,Gu,eh,"Δ","\\Delta",!0),Hu(qu,Gu,eh,"Θ","\\Theta",!0),Hu(qu,Gu,eh,"Λ","\\Lambda",!0),Hu(qu,Gu,eh,"Ξ","\\Xi",!0),Hu(qu,Gu,eh,"Π","\\Pi",!0),Hu(qu,Gu,eh,"Σ","\\Sigma",!0),Hu(qu,Gu,eh,"Υ","\\Upsilon",!0),Hu(qu,Gu,eh,"Φ","\\Phi",!0),Hu(qu,Gu,eh,"Ψ","\\Psi",!0),Hu(qu,Gu,eh,"Ω","\\Omega",!0),Hu(qu,Gu,eh,"A","Α"),Hu(qu,Gu,eh,"B","Β"),Hu(qu,Gu,eh,"E","Ε"),Hu(qu,Gu,eh,"Z","Ζ"),Hu(qu,Gu,eh,"H","Η"),Hu(qu,Gu,eh,"I","Ι"),Hu(qu,Gu,eh,"K","Κ"),Hu(qu,Gu,eh,"M","Μ"),Hu(qu,Gu,eh,"N","Ν"),Hu(qu,Gu,eh,"O","Ο"),
|
|
312
|
+
Hu(qu,Gu,eh,"P","Ρ"),Hu(qu,Gu,eh,"T","Τ"),Hu(qu,Gu,eh,"X","Χ"),Hu(qu,Gu,eh,"¬","\\neg",!0),Hu(qu,Gu,eh,"¬","\\lnot"),Hu(qu,Gu,eh,"⊤","\\top"),Hu(qu,Gu,eh,"⊥","\\bot"),Hu(qu,Gu,eh,"∅","\\emptyset"),Hu(qu,Vu,eh,"∅","\\varnothing"),Hu(qu,Gu,Xu,"α","\\alpha",!0),Hu(qu,Gu,Xu,"β","\\beta",!0),Hu(qu,Gu,Xu,"γ","\\gamma",!0),Hu(qu,Gu,Xu,"δ","\\delta",!0),Hu(qu,Gu,Xu,"ϵ","\\epsilon",!0),Hu(qu,Gu,Xu,"ζ","\\zeta",!0),Hu(qu,Gu,Xu,"η","\\eta",!0),Hu(qu,Gu,Xu,"θ","\\theta",!0),Hu(qu,Gu,Xu,"ι","\\iota",!0),Hu(qu,Gu,Xu,"κ","\\kappa",!0),Hu(qu,Gu,Xu,"λ","\\lambda",!0),Hu(qu,Gu,Xu,"μ","\\mu",!0),Hu(qu,Gu,Xu,"ν","\\nu",!0),Hu(qu,Gu,Xu,"ξ","\\xi",!0),Hu(qu,Gu,Xu,"ο","\\omicron",!0),Hu(qu,Gu,Xu,"π","\\pi",!0),Hu(qu,Gu,Xu,"ρ","\\rho",!0),Hu(qu,Gu,Xu,"σ","\\sigma",!0),Hu(qu,Gu,Xu,"τ","\\tau",!0),Hu(qu,Gu,Xu,"υ","\\upsilon",!0),Hu(qu,Gu,Xu,"ϕ","\\phi",!0),Hu(qu,Gu,Xu,"χ","\\chi",!0),Hu(qu,Gu,Xu,"ψ","\\psi",!0),Hu(qu,Gu,Xu,"ω","\\omega",!0),Hu(qu,Gu,Xu,"ε","\\varepsilon",!0),Hu(qu,Gu,Xu,"ϑ","\\vartheta",!0),
|
|
313
|
+
Hu(qu,Gu,Xu,"ϖ","\\varpi",!0),Hu(qu,Gu,Xu,"ϱ","\\varrho",!0),Hu(qu,Gu,Xu,"ς","\\varsigma",!0),Hu(qu,Gu,Xu,"φ","\\varphi",!0),Hu(qu,Gu,Wu,"∗","*",!0),Hu(qu,Gu,Wu,"+","+"),Hu(qu,Gu,Wu,"−","-",!0),Hu(qu,Gu,Wu,"⋅","\\cdot",!0),Hu(qu,Gu,Wu,"∘","\\circ",!0),Hu(qu,Gu,Wu,"÷","\\div",!0),Hu(qu,Gu,Wu,"±","\\pm",!0),Hu(qu,Gu,Wu,"×","\\times",!0),Hu(qu,Gu,Wu,"∩","\\cap",!0),Hu(qu,Gu,Wu,"∪","\\cup",!0),Hu(qu,Gu,Wu,"∖","\\setminus",!0),Hu(qu,Gu,Wu,"∧","\\land"),Hu(qu,Gu,Wu,"∨","\\lor"),Hu(qu,Gu,Wu,"∧","\\wedge",!0),Hu(qu,Gu,Wu,"∨","\\vee",!0),Hu(qu,Gu,eh,"√","\\surd"),Hu(qu,Gu,Ju,"⟨","\\langle",!0),Hu(qu,Gu,Ju,"∣","\\lvert"),Hu(qu,Gu,Ju,"∥","\\lVert"),Hu(qu,Gu,Ku,"?","?"),Hu(qu,Gu,Ku,"!","!"),Hu(qu,Gu,Ku,"⟩","\\rangle",!0),Hu(qu,Gu,Ku,"∣","\\rvert"),Hu(qu,Gu,Ku,"∥","\\rVert"),Hu(qu,Gu,Qu,"=","="),Hu(qu,Gu,Qu,":",":"),Hu(qu,Gu,Qu,"≈","\\approx",!0),Hu(qu,Gu,Qu,"≅","\\cong",!0),Hu(qu,Gu,Qu,"≥","\\ge"),Hu(qu,Gu,Qu,"≥","\\geq",!0),Hu(qu,Gu,Qu,"←","\\gets"),Hu(qu,Gu,Qu,">","\\gt",!0),Hu(qu,Gu,Qu,"∈","\\in",!0),
|
|
314
|
+
Hu(qu,Gu,Qu,"","\\@not"),Hu(qu,Gu,Qu,"⊂","\\subset",!0),Hu(qu,Gu,Qu,"⊃","\\supset",!0),Hu(qu,Gu,Qu,"⊆","\\subseteq",!0),Hu(qu,Gu,Qu,"⊇","\\supseteq",!0),Hu(qu,Vu,Qu,"⊈","\\nsubseteq",!0),Hu(qu,Vu,Qu,"⊉","\\nsupseteq",!0),Hu(qu,Gu,Qu,"⊨","\\models"),Hu(qu,Gu,Qu,"←","\\leftarrow",!0),Hu(qu,Gu,Qu,"≤","\\le"),Hu(qu,Gu,Qu,"≤","\\leq",!0),Hu(qu,Gu,Qu,"<","\\lt",!0),Hu(qu,Gu,Qu,"→","\\rightarrow",!0),Hu(qu,Gu,Qu,"→","\\to"),Hu(qu,Vu,Qu,"≱","\\ngeq",!0),Hu(qu,Vu,Qu,"≰","\\nleq",!0),Hu(qu,Gu,"spacing"," ","\\ "),Hu(qu,Gu,"spacing"," ","\\space"),Hu(qu,Gu,"spacing"," ","\\nobreakspace"),Hu($u,Gu,"spacing"," ","\\ "),Hu($u,Gu,"spacing"," "," "),Hu($u,Gu,"spacing"," ","\\space"),Hu($u,Gu,"spacing"," ","\\nobreakspace"),Hu(qu,Gu,"spacing",null,"\\nobreak"),Hu(qu,Gu,"spacing",null,"\\allowbreak"),Hu(qu,Gu,"punct",",",","),Hu(qu,Gu,"punct",";",";"),Hu(qu,Vu,Wu,"⊼","\\barwedge",!0),Hu(qu,Vu,Wu,"⊻","\\veebar",!0),Hu(qu,Gu,Wu,"⊙","\\odot",!0),Hu(qu,Gu,Wu,"⊕","\\oplus",!0),Hu(qu,Gu,Wu,"⊗","\\otimes",!0),
|
|
315
|
+
Hu(qu,Gu,eh,"∂","\\partial",!0),Hu(qu,Gu,Wu,"⊘","\\oslash",!0),Hu(qu,Vu,Wu,"⊚","\\circledcirc",!0),Hu(qu,Vu,Wu,"⊡","\\boxdot",!0),Hu(qu,Gu,Wu,"△","\\bigtriangleup"),Hu(qu,Gu,Wu,"▽","\\bigtriangledown"),Hu(qu,Gu,Wu,"†","\\dagger"),Hu(qu,Gu,Wu,"⋄","\\diamond"),Hu(qu,Gu,Wu,"⋆","\\star"),Hu(qu,Gu,Wu,"◃","\\triangleleft"),Hu(qu,Gu,Wu,"▹","\\triangleright"),Hu(qu,Gu,Ju,"{","\\{"),Hu($u,Gu,eh,"{","\\{"),Hu($u,Gu,eh,"{","\\textbraceleft"),Hu(qu,Gu,Ku,"}","\\}"),Hu($u,Gu,eh,"}","\\}"),Hu($u,Gu,eh,"}","\\textbraceright"),Hu(qu,Gu,Ju,"{","\\lbrace"),Hu(qu,Gu,Ku,"}","\\rbrace"),Hu(qu,Gu,Ju,"[","\\lbrack",!0),Hu($u,Gu,eh,"[","\\lbrack",!0),Hu(qu,Gu,Ku,"]","\\rbrack",!0),Hu($u,Gu,eh,"]","\\rbrack",!0),Hu(qu,Gu,Ju,"(","\\lparen",!0),Hu(qu,Gu,Ku,")","\\rparen",!0),Hu($u,Gu,eh,"<","\\textless",!0),Hu($u,Gu,eh,">","\\textgreater",!0),Hu(qu,Gu,Ju,"⌊","\\lfloor",!0),Hu(qu,Gu,Ku,"⌋","\\rfloor",!0),Hu(qu,Gu,Ju,"⌈","\\lceil",!0),Hu(qu,Gu,Ku,"⌉","\\rceil",!0),Hu(qu,Gu,eh,"\\","\\backslash"),Hu(qu,Gu,eh,"∣","|"),
|
|
316
|
+
Hu(qu,Gu,eh,"∣","\\vert"),Hu($u,Gu,eh,"|","\\textbar",!0),Hu(qu,Gu,eh,"∥","\\|"),Hu(qu,Gu,eh,"∥","\\Vert"),Hu($u,Gu,eh,"∥","\\textbardbl"),Hu($u,Gu,eh,"~","\\textasciitilde"),Hu($u,Gu,eh,"\\","\\textbackslash"),Hu($u,Gu,eh,"^","\\textasciicircum"),Hu(qu,Gu,Qu,"↑","\\uparrow",!0),Hu(qu,Gu,Qu,"⇑","\\Uparrow",!0),Hu(qu,Gu,Qu,"↓","\\downarrow",!0),Hu(qu,Gu,Qu,"⇓","\\Downarrow",!0),Hu(qu,Gu,Qu,"↕","\\updownarrow",!0),Hu(qu,Gu,Qu,"⇕","\\Updownarrow",!0),Hu(qu,Gu,Zu,"∐","\\coprod"),Hu(qu,Gu,Zu,"⋁","\\bigvee"),Hu(qu,Gu,Zu,"⋀","\\bigwedge"),Hu(qu,Gu,Zu,"⨄","\\biguplus"),Hu(qu,Gu,Zu,"⋂","\\bigcap"),Hu(qu,Gu,Zu,"⋃","\\bigcup"),Hu(qu,Gu,Zu,"∫","\\int"),Hu(qu,Gu,Zu,"∫","\\intop"),Hu(qu,Gu,Zu,"∬","\\iint"),Hu(qu,Gu,Zu,"∭","\\iiint"),Hu(qu,Gu,Zu,"∏","\\prod"),Hu(qu,Gu,Zu,"∑","\\sum"),Hu(qu,Gu,Zu,"⨂","\\bigotimes"),Hu(qu,Gu,Zu,"⨁","\\bigoplus"),Hu(qu,Gu,Zu,"⨀","\\bigodot"),Hu(qu,Gu,Zu,"∮","\\oint"),Hu(qu,Gu,Zu,"∯","\\oiint"),Hu(qu,Gu,Zu,"∰","\\oiiint"),Hu(qu,Gu,Zu,"⨆","\\bigsqcup"),Hu(qu,Gu,Zu,"∫","\\smallint"),
|
|
317
|
+
Hu($u,Gu,"inner","…","\\textellipsis"),Hu(qu,Gu,"inner","…","\\mathellipsis"),Hu($u,Gu,"inner","…","\\ldots",!0),Hu(qu,Gu,"inner","…","\\ldots",!0),Hu(qu,Gu,"inner","⋯","\\@cdots",!0),Hu(qu,Gu,"inner","⋱","\\ddots",!0),Hu(qu,Gu,eh,"⋮","\\varvdots"),Hu(qu,Gu,Yu,"ˊ","\\acute"),Hu(qu,Gu,Yu,"ˋ","\\grave"),Hu(qu,Gu,Yu,"¨","\\ddot"),Hu(qu,Gu,Yu,"~","\\tilde"),Hu(qu,Gu,Yu,"ˉ","\\bar"),Hu(qu,Gu,Yu,"˘","\\breve"),Hu(qu,Gu,Yu,"ˇ","\\check"),Hu(qu,Gu,Yu,"^","\\hat"),Hu(qu,Gu,Yu,"⃗","\\vec"),Hu(qu,Gu,Yu,"˙","\\dot"),Hu(qu,Gu,Yu,"˚","\\mathring"),Hu(qu,Gu,Xu,"","\\@imath"),Hu(qu,Gu,Xu,"","\\@jmath"),Hu(qu,Gu,eh,"ı","ı"),Hu(qu,Gu,eh,"ȷ","ȷ"),Hu($u,Gu,eh,"ı","\\i",!0),Hu($u,Gu,eh,"ȷ","\\j",!0),Hu($u,Gu,eh,"ß","\\ss",!0),Hu($u,Gu,eh,"æ","\\ae",!0),Hu($u,Gu,eh,"œ","\\oe",!0),Hu($u,Gu,eh,"ø","\\o",!0),Hu($u,Gu,eh,"Æ","\\AE",!0),Hu($u,Gu,eh,"Œ","\\OE",!0),Hu($u,Gu,eh,"Ø","\\O",!0),Hu($u,Gu,Yu,"ˊ","\\'"),Hu($u,Gu,Yu,"ˋ","\\`"),Hu($u,Gu,Yu,"ˆ","\\^"),Hu($u,Gu,Yu,"˜","\\~"),Hu($u,Gu,Yu,"ˉ","\\="),Hu($u,Gu,Yu,"˘","\\u"),
|
|
318
|
+
Hu($u,Gu,Yu,"˙","\\."),Hu($u,Gu,Yu,"¸","\\c"),Hu($u,Gu,Yu,"˚","\\r"),Hu($u,Gu,Yu,"ˇ","\\v"),Hu($u,Gu,Yu,"¨",'\\"'),Hu($u,Gu,Yu,"˝","\\H"),Hu($u,Gu,Yu,"◯","\\textcircled");var th={"--":!0,"---":!0,"``":!0,"''":!0};Hu($u,Gu,eh,"–","--",!0),Hu($u,Gu,eh,"–","\\textendash"),Hu($u,Gu,eh,"—","---",!0),Hu($u,Gu,eh,"—","\\textemdash"),Hu($u,Gu,eh,"‘","`",!0),Hu($u,Gu,eh,"‘","\\textquoteleft"),Hu($u,Gu,eh,"’","'",!0),Hu($u,Gu,eh,"’","\\textquoteright"),Hu($u,Gu,eh,"“","``",!0),Hu($u,Gu,eh,"“","\\textquotedblleft"),Hu($u,Gu,eh,"”","''",!0),Hu($u,Gu,eh,"”","\\textquotedblright"),Hu(qu,Gu,eh,"°","\\degree",!0),Hu($u,Gu,eh,"°","\\degree"),Hu($u,Gu,eh,"°","\\textdegree",!0),Hu(qu,Gu,eh,"£","\\pounds"),Hu(qu,Gu,eh,"£","\\mathsterling",!0),Hu($u,Gu,eh,"£","\\pounds"),Hu($u,Gu,eh,"£","\\textsterling",!0),Hu(qu,Vu,eh,"✠","\\maltese"),Hu($u,Vu,eh,"✠","\\maltese");for(var nh=0;nh<'0123456789/@."'.length;nh++){var rh='0123456789/@."'.charAt(nh);Hu(qu,Gu,eh,rh,rh)}for(var oh=0;oh<'0123456789!@*()-=+";:?/.,'.length;oh++){
|
|
319
|
+
var ih='0123456789!@*()-=+";:?/.,'.charAt(oh);Hu($u,Gu,eh,ih,ih)}for(var ah="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",sh=0;sh<ah.length;sh++){var lh=ah.charAt(sh);Hu(qu,Gu,Xu,lh,lh),Hu($u,Gu,eh,lh,lh)}Hu(qu,Vu,eh,"C","ℂ"),Hu($u,Vu,eh,"C","ℂ"),Hu(qu,Vu,eh,"H","ℍ"),Hu($u,Vu,eh,"H","ℍ"),Hu(qu,Vu,eh,"N","ℕ"),Hu($u,Vu,eh,"N","ℕ"),Hu(qu,Vu,eh,"P","ℙ"),Hu($u,Vu,eh,"P","ℙ"),Hu(qu,Vu,eh,"Q","ℚ"),Hu($u,Vu,eh,"Q","ℚ"),Hu(qu,Vu,eh,"R","ℝ"),Hu($u,Vu,eh,"R","ℝ"),Hu(qu,Vu,eh,"Z","ℤ"),Hu($u,Vu,eh,"Z","ℤ"),Hu(qu,Gu,Xu,"h","ℎ"),Hu($u,Gu,Xu,"h","ℎ");for(var ch="",uh=0;uh<ah.length;uh++){var hh=ah.charAt(uh);Hu(qu,Gu,Xu,hh,ch=String.fromCharCode(55349,56320+uh)),Hu($u,Gu,eh,hh,ch),Hu(qu,Gu,Xu,hh,ch=String.fromCharCode(55349,56372+uh)),Hu($u,Gu,eh,hh,ch),Hu(qu,Gu,Xu,hh,ch=String.fromCharCode(55349,56424+uh)),Hu($u,Gu,eh,hh,ch),Hu(qu,Gu,Xu,hh,ch=String.fromCharCode(55349,56580+uh)),Hu($u,Gu,eh,hh,ch),Hu(qu,Gu,Xu,hh,ch=String.fromCharCode(55349,56736+uh)),Hu($u,Gu,eh,hh,ch),
|
|
320
|
+
Hu(qu,Gu,Xu,hh,ch=String.fromCharCode(55349,56788+uh)),Hu($u,Gu,eh,hh,ch),Hu(qu,Gu,Xu,hh,ch=String.fromCharCode(55349,56840+uh)),Hu($u,Gu,eh,hh,ch),Hu(qu,Gu,Xu,hh,ch=String.fromCharCode(55349,56944+uh)),Hu($u,Gu,eh,hh,ch),uh<26&&(Hu(qu,Gu,Xu,hh,ch=String.fromCharCode(55349,56632+uh)),Hu($u,Gu,eh,hh,ch),Hu(qu,Gu,Xu,hh,ch=String.fromCharCode(55349,56476+uh)),Hu($u,Gu,eh,hh,ch))}Hu(qu,Gu,Xu,"k",ch=String.fromCharCode(55349,56668)),Hu($u,Gu,eh,"k",ch);for(var dh=0;dh<10;dh++){var ph=dh.toString();Hu(qu,Gu,Xu,ph,ch=String.fromCharCode(55349,57294+dh)),Hu($u,Gu,eh,ph,ch),Hu(qu,Gu,Xu,ph,ch=String.fromCharCode(55349,57314+dh)),Hu($u,Gu,eh,ph,ch),Hu(qu,Gu,Xu,ph,ch=String.fromCharCode(55349,57324+dh)),Hu($u,Gu,eh,ph,ch),Hu(qu,Gu,Xu,ph,ch=String.fromCharCode(55349,57334+dh)),Hu($u,Gu,eh,ph,ch)}for(var mh=0;mh<"ÐÞþ".length;mh++){var fh="ÐÞþ".charAt(mh);Hu(qu,Gu,Xu,fh,fh),Hu($u,Gu,eh,fh,fh)}
|
|
321
|
+
var gh=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["","",""],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],vh=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],_h=function(e,t,n){
|
|
322
|
+
return Uu[n][e]&&Uu[n][e].replace&&(e=Uu[n][e].replace),{value:e,metrics:fu(e,t,n)}},bh=function(e,t,n,r,o){var i,a=_h(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 Ru(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 Ru(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},yh=(e,t)=>{if(Eu(e.classes)!==Eu(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},wh=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),
|
|
323
|
+
i.maxFontSize>r&&(r=i.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},xh=function(e,t,n,r){var o=new Mu(e,t,n,r);return wh(o),o},kh=(e,t,n,r)=>new Mu(e,t,n,r),Sh=function(e){var t=new hu(e);return wh(t),t},Ch=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")},Eh={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},
|
|
324
|
+
mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Ah={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Th={fontMap:Eh,makeSymbol:bh,mathsym:function(e,t,n,r){return void 0===r&&(r=[]),"boldsymbol"===n.font&&_h(e,"Main-Bold",t).metrics?bh(e,"Main-Bold",t,n,r.concat(["mathbf"])):"\\"===e||"main"===Uu[t][e].font?bh(e,"Main-Regular",t,n,r):bh(e,"AMS-Regular",t,n,r.concat(["amsrm"]))},makeSpan:xh,makeSvgSpan:kh,makeLineSpan:function(e,t,n){var r=xh([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=Cu(r.height),r.maxFontSize=1,r},makeAnchor:function(e,t,n,r){var o=new Lu(e,t,n,r);return wh(o),o},makeFragment:Sh,wrapFragment:function(e,t){return e instanceof hu?xh([],[e],t):e},makeVList:function(e,t){for(var{children:n,depth:r}=function(e){if("individualShift"===e.positionType){
|
|
325
|
+
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 h=e.children[u];c-="kern"===h.type?h.size:h.elem.height+h.elem.depth}l=c}else if("bottom"===e.positionType)l=-e.positionData;else{var d=e.children[0];if("elem"!==d.type)throw new Error('First child must have type "elem".');if("shift"===e.positionType)l=-d.elem.depth-e.positionData;else{if("firstBaseline"!==e.positionType)throw new Error("Invalid positionType "+e.positionType+".");l=-d.elem.depth}}return{children:e.children,depth:l}}(e),o=0,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=xh(["pstrut"],[]);l.style.height=Cu(o);for(var c=[],u=r,h=r,d=r,p=0;p<n.length;p++){var m=n[p];if("kern"===m.type)d+=m.size;else{
|
|
326
|
+
var f=m.elem,g=m.wrapperClasses||[],v=m.wrapperStyle||{},_=xh(g,[l,f],void 0,v);_.style.top=Cu(-o-d-f.depth),m.marginLeft&&(_.style.marginLeft=m.marginLeft),m.marginRight&&(_.style.marginRight=m.marginRight),c.push(_),d+=f.height+f.depth}u=Math.min(u,d),h=Math.max(h,d)}var b,y=xh(["vlist"],c);if(y.style.height=Cu(h),u<0){var w=xh([],[]),x=xh(["vlist"],[w]);x.style.height=Cu(-u);var k=xh(["vlist-s"],[new Ru("")]);b=[xh(["vlist-r"],[y,k]),xh(["vlist-r"],[x])]}else b=[xh(["vlist-r"],[y])];var S=xh(["vlist-t"],b);return 2===b.length&&S.classes.push("vlist-t2"),S.height=h,S.depth=-u,S},makeOrd:function(e,t,n){var r=e.mode,o=e.text,i=["mord"],a="math"===r||"text"===r&&t.font,s=a?t.font:t.fontFamily;if(55349===o.charCodeAt(0)){var[l,c]=function(e,t){var n=1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536,r="math"===t?0:1;if(119808<=n&&n<120484){var o=Math.floor((n-119808)/26);return[gh[o][2],gh[o][r]]}if(120782<=n&&n<=120831){var i=Math.floor((n-120782)/10);return[vh[i][2],vh[i][r]]}
|
|
327
|
+
if(120485===n||120486===n)return[gh[0][2],gh[0][r]];if(120486<n&&n<120782)return["",""];throw new qc("Unsupported character: "+e)}(o,r);return bh(o,l,r,t,i.concat(c))}if(s){var u,h;if("boldsymbol"===s){var d=function(e,t,n,r,o){return"textord"!==o&&_h(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(o,r,0,0,n);u=d.fontName,h=[d.fontClass]}else a?(u=Eh[s].fontName,h=[s]):(u=Ch(s,t.fontWeight,t.fontShape),h=[s,t.fontWeight,t.fontShape]);if(_h(o,u,r).metrics)return bh(o,u,r,t,i.concat(h));if(th.hasOwnProperty(o)&&"Typewriter"===u.substr(0,10)){for(var p=[],m=0;m<o.length;m++)p.push(bh(o[m],u,r,t,i.concat(h)));return Sh(p)}}if("mathord"===n)return bh(o,"Math-Italic",r,t,i.concat(["mathnormal"]));if("textord"===n){var f=Uu[r][o]&&Uu[r][o].font;if("ams"===f){var g=Ch("amsrm",t.fontWeight,t.fontShape);return bh(o,g,r,t,i.concat("amsrm",t.fontWeight,t.fontShape))}if("main"!==f&&f){var v=Ch(f,t.fontWeight,t.fontShape)
|
|
328
|
+
;return bh(o,v,r,t,i.concat(v,t.fontWeight,t.fontShape))}var _=Ch("textrm",t.fontWeight,t.fontShape);return bh(o,_,r,t,i.concat(t.fontWeight,t.fontShape))}throw new Error("unexpected type: "+n+" in makeOrd")},makeGlue:(e,t)=>{var n=xh(["mspace"],[],t),r=Su(e,t);return n.style.marginRight=Cu(r),n},staticSvg:function(e,t){var[n,r,o]=Ah[e],i=new Iu(n),a=new Du([i],{width:Cu(r),height:Cu(o),style:"width:"+Cu(r),viewBox:"0 0 "+1e3*r+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),s=kh(["overlay"],[a],t);return s.height=o,s.style.height=Cu(o),s.style.width=Cu(r),s},svgData:Ah,tryCombineChars:e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof Ru&&r instanceof Ru&&yh(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}},Nh={number:3,unit:"mu"},Mh={number:4,unit:"mu"},Lh={number:5,unit:"mu"},zh={mord:{mop:Nh,mbin:Mh,mrel:Lh,minner:Nh},mop:{mord:Nh,mop:Nh,mrel:Lh,minner:Nh},mbin:{mord:Mh,mop:Mh,mopen:Mh,minner:Mh},mrel:{
|
|
329
|
+
mord:Lh,mop:Lh,mopen:Lh,minner:Lh},mopen:{},mclose:{mop:Nh,mbin:Mh,mrel:Lh,minner:Nh},mpunct:{mord:Nh,mop:Nh,mrel:Lh,mopen:Nh,mclose:Nh,mpunct:Nh,minner:Nh},minner:{mord:Nh,mop:Nh,mbin:Mh,mrel:Lh,mopen:Nh,mpunct:Nh,minner:Nh}},Oh={mord:{mop:Nh},mop:{mord:Nh,mop:Nh},mbin:{},mrel:{},mopen:{},mclose:{mop:Nh},mpunct:{},minner:{mop:Nh}},Rh={},Dh={},Ih={};function Ph(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)Rh[n[l]]=s;t&&(i&&(Dh[t]=i),a&&(Ih[t]=a))}function Bh(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;Ph({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var Fh=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e
|
|
330
|
+
},jh=function(e){return"ordgroup"===e.type?e.body:[e]},Uh=Th.makeSpan,Hh=["leftmost","mbin","mopen","mrel","mop","mpunct"],qh=["rightmost","mrel","mclose","mpunct"],$h={display:au.DISPLAY,text:au.TEXT,script:au.SCRIPT,scriptscript:au.SCRIPTSCRIPT},Gh={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Vh=function(e,t,n,r){void 0===r&&(r=[null,null]);for(var o=[],i=0;i<e.length;i++){var a=Jh(e[i],t);if(a instanceof hu){var s=a.children;o.push(...s)}else o.push(a)}if(Th.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($h[c.style]))}var u=Uh([r[0]||"leftmost"],[],t),h=Uh([r[1]||"rightmost"],[],t),d="root"===n;return Yh(o,((e,t)=>{var n=t.classes[0],r=e.classes[0];"mbin"===n&&Wc.contains(qh,r)?t.classes[0]="mord":"mbin"===r&&Wc.contains(Hh,n)&&(e.classes[0]="mord")}),{node:u},h,d),Yh(o,((e,t)=>{
|
|
331
|
+
var n=Xh(t),r=Xh(e),o=n&&r?e.hasClass("mtight")?Oh[n][r]:zh[n][r]:null;if(o)return Th.makeGlue(o,l)}),{node:u},h,d),o},Yh=function e(t,n,r,o,i){o&&t.push(o);for(var a=0;a<t.length;a++){var s=t[a],l=Wh(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=Uh(["leftmost"])),r.insertAfter=(e=>n=>{t.splice(e+1,0,n),a++})(a)}}o&&t.pop()},Wh=function(e){return e instanceof hu||e instanceof Lu||e instanceof Mu&&e.hasClass("enclosing")?e:null},Kh=function e(t,n){var r=Wh(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},Xh=function(e,t){return e?(t&&(e=Kh(e,t)),Gh[e.classes[0]]||null):null},Zh=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Uh(t.concat(n))},Jh=function(e,t,n){if(!e)return Uh();if(Dh[e.type]){var r=Dh[e.type](e,t);if(n&&t.size!==n.size){
|
|
332
|
+
r=Uh(t.sizingClasses(n),[r],t);var o=t.sizeMultiplier/n.sizeMultiplier;r.height*=o,r.depth*=o}return r}throw new qc("Got group of unknown type: '"+e.type+"'")};function Qh(e,t){var n=Uh(["base"],e,t),r=Uh(["strut"]);return r.style.height=Cu(n.height+n.depth),n.depth&&(r.style.verticalAlign=Cu(-n.depth)),n.children.unshift(r),n}function ed(e,t){var n=null;1===e.length&&"tag"===e[0].type&&(n=e[0].tag,e=e[0].body);var r,o=Vh(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(Qh(s,t)),s=[])}else o[l].hasClass("newline")&&(s.pop(),s.length>0&&(a.push(Qh(s,t)),s=[]),a.push(o[l]));s.length>0&&a.push(Qh(s,t)),n?((i=Qh(Vh(n,t,!0))).classes=["tag"],a.push(i)):r&&a.push(r);var u=Uh(["katex-html"],a);if(u.setAttribute("aria-hidden","true"),i){
|
|
333
|
+
var h=i.children[0];h.style.height=Cu(u.height+u.depth),u.depth&&(h.style.verticalAlign=Cu(-u.depth))}return u}function td(e){return new hu(e)}class nd{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=Eu(this.classes));for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=Wc.escape(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+Wc.escape(Eu(this.classes))+'"'),e+=">"
|
|
334
|
+
;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 rd{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Wc.escape(this.toText())}toText(){return this.text}}var od={MathNode:nd,TextNode:rd,SpaceNode:class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?" ":e>=.1666&&e<=.1667?" ":e>=.2222&&e<=.2223?" ":e>=.2777&&e<=.2778?" ":e>=-.05556&&e<=-.05555?" ":e>=-.1667&&e<=-.1666?" ":e>=-.2223&&e<=-.2222?" ":e>=-.2778&&e<=-.2777?" ":null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Cu(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Cu(this.width)+'"/>'}toText(){
|
|
335
|
+
return this.character?this.character:" "}},newDocumentFragment:td},id=function(e,t,n){return!Uu[t][e]||!Uu[t][e].replace||55349===e.charCodeAt(0)||th.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.substr(4,2)||n.font&&"tt"===n.font.substr(4,2))||(e=Uu[t][e].replace),new od.TextNode(e)},ad=function(e){return 1===e.length?e[0]:new od.MathNode("mrow",e)},sd=function(e,t){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";var n=t.font;if(!n||"mathnormal"===n)return null;var r=e.mode;if("mathit"===n)return"italic";if("boldsymbol"===n)return"textord"===e.type?"bold":"bold-italic";if("mathbf"===n)return"bold";if("mathbb"===n)return"double-struck"
|
|
336
|
+
;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 Wc.contains(["\\imath","\\jmath"],o)?null:(Uu[r][o]&&Uu[r][o].replace&&(o=Uu[r][o].replace),fu(o,Th.fontMap[n].fontName,r)?Th.fontMap[n].variant:null)},ld=function(e,t,n){if(1===e.length){var r=ud(e[0],t);return n&&r instanceof nd&&"mo"===r.type&&(r.setAttribute("lspace","0em"),r.setAttribute("rspace","0em")),[r]}for(var o,i=[],a=0;a<e.length;a++){var s=ud(e[a],t);if(s instanceof nd&&o instanceof nd){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("mi"===s.type&&1===s.children.length&&"mn"===o.type){var l=s.children[0];if(l instanceof rd&&"."===l.text){o.children.push(...s.children);continue}}else if("mi"===o.type&&1===o.children.length){var c=o.children[0]
|
|
337
|
+
;if(c instanceof rd&&"̸"===c.text&&("mo"===s.type||"mi"===s.type||"mn"===s.type)){var u=s.children[0];u instanceof rd&&u.text.length>0&&(u.text=u.text.slice(0,1)+"̸"+u.text.slice(1),i.pop())}}}i.push(s),o=s}return i},cd=function(e,t,n){return ad(ld(e,t,n))},ud=function(e,t){if(!e)return new od.MathNode("mrow");if(Ih[e.type])return Ih[e.type](e,t);throw new qc("Got group of unknown type: '"+e.type+"'")};function hd(e,t,n,r,o){var i,a=ld(e,n);i=1===a.length&&a[0]instanceof nd&&Wc.contains(["mrow","mtable"],a[0].type)?a[0]:new od.MathNode("mrow",a);var s=new od.MathNode("annotation",[new od.TextNode(t)]);s.setAttribute("encoding","application/x-tex");var l=new od.MathNode("semantics",[i,s]),c=new od.MathNode("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block");var u=o?"katex":"katex-mathml";return Th.makeSpan([u],[c])}var dd=function(e){return new yu({style:e.displayMode?au.DISPLAY:au.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})
|
|
338
|
+
},pd=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=Th.makeSpan(n,[e])}return e},md={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},fd={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],
|
|
350
339
|
underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],
|
|
351
340
|
xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],
|
|
352
|
-
xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},
|
|
353
|
-
;if(
|
|
354
|
-
for(var w=0;w<
|
|
355
|
-
;if(r.isShifty&&
|
|
356
|
-
o.height=Math.max(f.height,o.height),o.classes[0]="mord",o):f},
|
|
357
|
-
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:
|
|
358
|
-
mathmlBuilder:(e,t)=>{var n
|
|
359
|
-
var n,r=t.style,o=t.havingStyle(r.sup()),i=
|
|
360
|
-
var i=
|
|
361
|
-
}}
|
|
362
|
-
type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=
|
|
363
|
-
argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,o=
|
|
364
|
-
"\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},
|
|
365
|
-
;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
|
|
366
|
-
;return
|
|
367
|
-
return
|
|
368
|
-
;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
|
|
369
|
-
u="Size4-Regular"):"\\lfloor"===e||"⌊"===e?(l=a="⎢",c="⎣",u="Size4-Regular"):"\\lceil"===e||"⌈"===e?(a="⎡",l=c="⎢",u="Size4-Regular"):"\\rfloor"===e||"⌋"===e?(l=a="⎥",c="⎦",u="Size4-Regular"):"\\rceil"===e||"⌉"===e?(a="⎤",l=c="⎥",u="Size4-Regular"):"("===e||"\\lparen"===e?(a="⎛",l="⎜",c="⎝",u="Size4-Regular"):")"===e||"\\rparen"===e?(a="⎞",l="⎟",c="⎠",u="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(a="⎧",s="⎨",c="⎩",l="⎪",u="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(a="⎫",s="⎬",c="⎭",l="⎪",u="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(a="⎧",c="⎩",l="⎪",u="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(a="⎫",c="⎭",l="⎪",u="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(a="⎧",c="⎭",l="⎪",u="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(a="⎫",c="⎩",l="⎪",u="Size4-Regular");var
|
|
370
|
-
;n&&(x*=r.sizeMultiplier);var k=w/2-x,S=[];if(S.push(
|
|
341
|
+
xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},gd=function(e,t,n,r,o){var i,a=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(i=Th.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 Pu({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new Pu({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new Du(l,{width:"100%",height:Cu(a)});i=Th.makeSvgSpan([],[c],o)}return i.height=a,i.style.height=Cu(a),i},vd=function(e){var t=new od.MathNode("mo",[new od.TextNode(md[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},_d=function(e,t){var{span:n,minWidth:r,height:o}=function(){var n=4e5,r=e.label.substr(1)
|
|
342
|
+
;if(Wc.contains(["widehat","widecheck","widetilde","utilde"],r)){var o,i,a,s="ordgroup"===(p=e.base).type?p.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 Iu(i),u=new Du([c],{width:"100%",height:Cu(a),viewBox:"0 0 "+n+" "+o,preserveAspectRatio:"none"});return{span:Th.makeSvgSpan([],[u],t),minWidth:0,height:a}}var h,d,p,m=[],f=fd[r],[g,v,_]=f,b=_/1e3,y=g.length;if(1===y)h=["hide-tail"],d=[f[3]];else if(2===y)h=["halfarrow-left","halfarrow-right"],d=["xMinYMin","xMaxYMin"];else{if(3!==y)throw new Error("Correct katexImagesData or update code here to support\n "+y+" children.");h=["brace-left","brace-center","brace-right"],d=["xMinYMin","xMidYMin","xMaxYMin"]}
|
|
343
|
+
for(var w=0;w<y;w++){var x=new Iu(g[w]),k=new Du([x],{width:"400em",height:Cu(b),viewBox:"0 0 "+n+" "+_,preserveAspectRatio:d[w]+" slice"}),S=Th.makeSvgSpan([h[w]],[k],t);if(1===y)return{span:S,minWidth:v,height:b};S.style.height=Cu(b),m.push(S)}return{span:Th.makeSpan(["stretchy"],m,t),minWidth:v,height:b}}();return n.height=o,n.style.height=Cu(o),r>0&&(n.style.minWidth=Cu(r)),n};function bd(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 yd(e){var t=wd(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 wd(e){return e&&("atom"===e.type||ju.hasOwnProperty(e.type))?e:null}var xd=(e,t)=>{var n,r,o;e&&"supsub"===e.type?(n=(r=bd(e.base,"accent")).base,e.base=n,o=function(e){if(e instanceof Mu)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(Jh(e,t)),e.base=r):n=(r=bd(e,"accent")).base;var i=Jh(n,t.havingCrampedStyle()),a=0
|
|
344
|
+
;if(r.isShifty&&Wc.isCharacterBox(n)){var s=Wc.getBaseElem(n);a=Bu(Jh(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=_d(r,t),l=Th.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:l,wrapperClasses:["svg-align"],wrapperStyle:a>0?{width:"calc(100% - "+Cu(2*a)+")",marginLeft:Cu(2*a)}:void 0}]},t);else{var h,d;"\\vec"===r.label?(h=Th.staticSvg("vec",t),d=Th.svgData.vec[1]):((h=Bu(h=Th.makeOrd({mode:r.mode,text:r.label},t,"textord"))).italic=0,d=h.width,c&&(u+=h.depth)),l=Th.makeSpan(["accent-body"],[h]);var p="\\textcircled"===r.label;p&&(l.classes.push("accent-full"),u=i.height);var m=a;p||(m-=d/2),l.style.left=Cu(m),"\\textcircled"===r.label&&(l.style.top=".2em"),l=Th.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-u},{type:"elem",elem:l}]},t)}var f=Th.makeSpan(["mord","accent"],[l],t);return o?(o.children[0]=f,
|
|
345
|
+
o.height=Math.max(f.height,o.height),o.classes[0]="mord",o):f},kd=(e,t)=>{var n=e.isStretchy?vd(e.label):new od.MathNode("mo",[id(e.label,e.mode)]),r=new od.MathNode("mover",[ud(e.base,t),n]);return r.setAttribute("accent","true"),r},Sd=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map((e=>"\\"+e)).join("|"));Ph({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=Fh(t[0]),r=!Sd.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:xd,mathmlBuilder:kd}),Ph({type:"accent",
|
|
346
|
+
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:xd,mathmlBuilder:kd}),Ph({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:o}},htmlBuilder:(e,t)=>{var n=Jh(e.base,t),r=_d(e,t),o="\\utilde"===e.label?.12:0,i=Th.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:o},{type:"elem",elem:n}]},t);return Th.makeSpan(["mord","accentunder"],[i],t)},
|
|
347
|
+
mathmlBuilder:(e,t)=>{var n=vd(e.label),r=new od.MathNode("munder",[ud(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var Cd=e=>{var t=new od.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Ph({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:o}=e;return{type:"xArrow",mode:r.mode,label:o,body:t[0],below:n[0]}},htmlBuilder(e,t){
|
|
348
|
+
var n,r=t.style,o=t.havingStyle(r.sup()),i=Th.wrapFragment(Jh(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=Th.wrapFragment(Jh(e.below,o,t),t)).classes.push(a+"-arrow-pad"));var s,l=_d(e,t),c=-t.fontMetrics().axisHeight+.5*l.height,u=-t.fontMetrics().axisHeight-.5*l.height-.111;if((i.depth>.25||"\\xleftequilibrium"===e.label)&&(u-=i.depth),n){var h=-t.fontMetrics().axisHeight+n.height+.5*l.height+.111;s=Th.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:l,shift:c},{type:"elem",elem:n,shift:h}]},t)}else s=Th.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"),Th.makeSpan(["mrel","x-arrow"],[s],t)},mathmlBuilder(e,t){var n,r=vd(e.label);if(r.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var o=Cd(ud(e.body,t));if(e.below){
|
|
349
|
+
var i=Cd(ud(e.below,t));n=new od.MathNode("munderover",[r,i,o])}else n=new od.MathNode("mover",[r,o])}else if(e.below){var a=Cd(ud(e.below,t));n=new od.MathNode("munder",[r,a])}else n=Cd(),n=new od.MathNode("mover",[r,n]);return n}});var Ed={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Ad=e=>"textord"===e.type&&"@"===e.text;function Td(e,t,n){var r=Ed[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"}
|
|
350
|
+
}}Ph({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=Th.wrapFragment(Jh(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=Cu(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new od.MathNode("mrow",[ud(e.label,t)]);return(n=new od.MathNode("mpadded",[n])).setAttribute("width","0"),"left"===e.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),(n=new od.MathNode("mstyle",[n])).setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),Ph({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=Th.wrapFragment(Jh(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder:(e,t)=>new od.MathNode("mrow",[ud(e.fragment,t)])}),Ph({
|
|
351
|
+
type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=bd(t[0],"ordgroup").body,o="",i=0;i<r.length;i++){o+=bd(r[i],"textord").text}var a,s=parseInt(o);if(isNaN(s))throw new qc("\\@char has non-numeric argument "+o);if(s<0||s>=1114111)throw new qc("\\@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 Nd=(e,t)=>{var n=Vh(e.body,t.withColor(e.color),!1);return Th.makeFragment(n)},Md=(e,t)=>{var n=ld(e.body,t.withColor(e.color)),r=new od.MathNode("mstyle",n);return r.setAttribute("mathcolor",e.color),r};Ph({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=bd(t[0],"color-token").color,o=t[1];return{type:"color",mode:n.mode,color:r,body:jh(o)}},htmlBuilder:Nd,mathmlBuilder:Md}),Ph({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,
|
|
352
|
+
argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,o=bd(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:Nd,mathmlBuilder:Md}),Ph({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:1,argTypes:["size"],allowedInText:!0},handler(e,t,n){var{parser:r}=e,o=n[0],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&&bd(o,"size").value}},htmlBuilder(e,t){var n=Th.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=Cu(Su(e.size,t)))),n},mathmlBuilder(e,t){var n=new od.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",Cu(Su(e.size,t)))),n}});var Ld={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef",
|
|
353
|
+
"\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},zd=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new qc("Expected a control sequence",e);return t},Od=(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)};Ph({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(Ld[r.text])return"\\global"!==n&&"\\\\globallong"!==n||(r.text=Ld[r.text]),bd(t.parseFunction(),"internal");throw new qc("Invalid token after macro prefix",r)}}),Ph({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 qc("Expected a control sequence",r)
|
|
354
|
+
;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 qc('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==a+1)throw new qc('Argument number "'+r.text+'" out of order');a++,s.push([])}else{if("EOF"===r.text)throw new qc("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===Ld[n]),{type:"internal",mode:t.mode}}}),Ph({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=zd(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)
|
|
355
|
+
;return Od(t,r,o,"\\\\globallet"===n),{type:"internal",mode:t.mode}}}),Ph({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=zd(t.gullet.popToken()),o=t.gullet.popToken(),i=t.gullet.popToken();return Od(t,r,i,"\\\\globalfuture"===n),t.gullet.pushToken(i),t.gullet.pushToken(o),{type:"internal",mode:t.mode}}});var Rd=function(e,t,n){var r=fu(Uu.math[e]&&Uu.math[e].replace||e,t,n);if(!r)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return r},Dd=function(e,t,n,r){var o=n.havingBaseStyle(t),i=Th.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},Id=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=Cu(o),e.height-=o,e.depth+=o},Pd=function(e,t,n,r,o,i){var a=function(e,t,n,r){
|
|
356
|
+
return Th.makeSymbol(e,"Size"+t+"-Regular",n,r)}(e,t,o,r),s=Dd(Th.makeSpan(["delimsizing","size"+t],[a],r),au.TEXT,r,i);return n&&Id(s,r,au.TEXT),s},Bd=function(e,t,n){var r;return r="Size1-Regular"===t?"delim-size1":"delim-size4",{type:"elem",elem:Th.makeSpan(["delimsizinginner",r],[Th.makeSpan([],[Th.makeSymbol(e,t,n)])])}},Fd=function(e,t,n){var r=du["Size4-Regular"][e.charCodeAt(0)]?du["Size4-Regular"][e.charCodeAt(0)][4]:du["Size1-Regular"][e.charCodeAt(0)][4],o=new Iu("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"
|
|
357
|
+
;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 Du([o],{width:Cu(r),height:Cu(t),style:"width:"+Cu(r),viewBox:"0 0 "+1e3*r+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),a=Th.makeSvgSpan([],[i],n);return a.height=t,a.style.height=Cu(t),a.style.width=Cu(r),{type:"elem",elem:a}},jd={type:"kern",size:-.008},Ud=["|","\\lvert","\\rvert","\\vert"],Hd=["\\|","\\lVert","\\rVert","\\Vert"],qd=function(e,t,n,r,o,i){var a,s,l,c;a=l=c=e,s=null;var u="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"):Wc.contains(Ud,e)?l="∣":Wc.contains(Hd,e)?l="∥":"["===e||"\\lbrack"===e?(a="⎡",l="⎢",c="⎣",u="Size4-Regular"):"]"===e||"\\rbrack"===e?(a="⎤",l="⎥",c="⎦",
|
|
358
|
+
u="Size4-Regular"):"\\lfloor"===e||"⌊"===e?(l=a="⎢",c="⎣",u="Size4-Regular"):"\\lceil"===e||"⌈"===e?(a="⎡",l=c="⎢",u="Size4-Regular"):"\\rfloor"===e||"⌋"===e?(l=a="⎥",c="⎦",u="Size4-Regular"):"\\rceil"===e||"⌉"===e?(a="⎤",l=c="⎥",u="Size4-Regular"):"("===e||"\\lparen"===e?(a="⎛",l="⎜",c="⎝",u="Size4-Regular"):")"===e||"\\rparen"===e?(a="⎞",l="⎟",c="⎠",u="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(a="⎧",s="⎨",c="⎩",l="⎪",u="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(a="⎫",s="⎬",c="⎭",l="⎪",u="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(a="⎧",c="⎩",l="⎪",u="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(a="⎫",c="⎭",l="⎪",u="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(a="⎧",c="⎭",l="⎪",u="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(a="⎫",c="⎩",l="⎪",u="Size4-Regular");var h=Rd(a,u,o),d=h.height+h.depth,p=Rd(l,u,o),m=p.height+p.depth,f=Rd(c,u,o),g=f.height+f.depth,v=0,_=1;if(null!==s){var b=Rd(s,u,o);v=b.height+b.depth,_=2}var y=d+g+v,w=y+Math.max(0,Math.ceil((t-y)/(_*m)))*_*m,x=r.fontMetrics().axisHeight
|
|
359
|
+
;n&&(x*=r.sizeMultiplier);var k=w/2-x,S=[];if(S.push(Bd(c,u,o)),S.push(jd),null===s){var C=w-d-g+.016;S.push(Fd(l,C,r))}else{var E=(w-d-g-v)/2+.016;S.push(Fd(l,E,r)),S.push(jd),S.push(Bd(s,u,o)),S.push(jd),S.push(Fd(l,E,r))}S.push(jd),S.push(Bd(a,u,o));var A=r.havingBaseStyle(au.TEXT),T=Th.makeVList({positionType:"bottom",positionData:k,children:S},A);return Dd(Th.makeSpan(["delimsizing","mult"],[T],A),au.TEXT,r,i)},$d=function(e,t,n,r,o){var i=function(e,t,n){t*=1e3;var r="";switch(e){case"sqrtMain":r=function(e,t){
|
|
371
360
|
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,80);break;case"sqrtSize1":r=function(e,t){
|
|
372
361
|
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,80);break;case"sqrtSize2":r=function(e,t){
|
|
373
362
|
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,80);break;case"sqrtSize3":r=function(e,t){
|
|
374
363
|
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,80);break;case"sqrtSize4":r=function(e,t){
|
|
375
|
-
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,80);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,80,n)}return r}(e,r,n),a=new
|
|
376
|
-
;return
|
|
377
|
-
type:"stack"}],
|
|
378
|
-
var n,r,o=t.havingBaseSizing(),i=
|
|
379
|
-
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
|
|
380
|
-
},
|
|
381
|
-
mode:e.parser.mode,size:
|
|
382
|
-
;--r.leftrightDepth,r.expect("\\right",!1);var i=
|
|
383
|
-
;o.setAttribute("fence","true"),e.rightColor&&o.setAttribute("mathcolor",e.rightColor),n.push(o)}return
|
|
384
|
-
number:.6,unit:"pt"},t),u=
|
|
385
|
-
s=o.depth+g,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)r=
|
|
386
|
-
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};
|
|
387
|
-
argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:o}=e,i=
|
|
388
|
-
handler:o},l=0;l<n.length;++l)
|
|
389
|
-
|
|
390
|
-
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:
|
|
391
|
-
x.depth=w,v+=
|
|
392
|
-
;(r>0||e.hskipBeforeAndAfter)&&0!==(
|
|
393
|
-
},
|
|
394
|
-
for(var b=e.cols||[],
|
|
395
|
-
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+=
|
|
396
|
-
;throw new
|
|
397
|
-
type:"leftright",mode:e.mode,body:[i],left:t[0],right:t[1],rightColor:void 0}:i},htmlBuilder
|
|
398
|
-
type:"align",align:"l",pregap:0,postgap:0}]},
|
|
399
|
-
;return
|
|
400
|
-
}if(
|
|
401
|
-
argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];if("ordgroup"!==o.type)throw new
|
|
402
|
-
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}
|
|
403
|
-
props:{numArgs:2},handler(e,t){var n,{parser:r,funcName:o}=e,i=t[1],a=t[0];n="\\stackrel"!==o?
|
|
404
|
-
htmlBuilder:
|
|
405
|
-
;a.height=a.height<s?s:a.height,a.depth=a.depth<l?l:a.depth}n=t.havingStyle(i);var c,u,d,
|
|
406
|
-
return n=t.havingStyle(r),f.height*=n.sizeMultiplier/t.sizeMultiplier,f.depth*=n.sizeMultiplier/t.sizeMultiplier,g=r.size===
|
|
407
|
-
if(null!=e.leftDelim||null!=e.rightDelim){var a=[];if(null!=e.leftDelim){var s=new
|
|
408
|
-
return{type:"genfrac",mode:r.mode,continued:!1,numer:i,denom:a,hasBarLine:n,leftDelim:s,rightDelim:l,size:c,barSize:null}},htmlBuilder:
|
|
409
|
-
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=
|
|
410
|
-
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}(
|
|
411
|
-
var l=
|
|
412
|
-
htmlBuilder:(e,t)=>{var n=
|
|
413
|
-
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=
|
|
414
|
-
;e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var o=
|
|
415
|
-
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=
|
|
416
|
-
var n=new
|
|
417
|
-
;return new
|
|
418
|
-
;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}}}),
|
|
419
|
-
kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-
|
|
420
|
-
type:"elem",elem:l.elem,marginLeft:
|
|
421
|
-
;1===p.length&&p[0]instanceof
|
|
422
|
-
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=
|
|
423
|
-
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:
|
|
424
|
-
var u=l[c];u instanceof
|
|
425
|
-
case"mspace":case"mtext":break;case"mo":var a=i.children[0];1===i.children.length&&a instanceof
|
|
426
|
-
children:[{type:"elem",elem:n},{type:"kern",size:3*o},{type:"elem",elem:r},{type:"kern",size:o}]},t);return
|
|
427
|
-
;return n=
|
|
428
|
-
;return
|
|
429
|
-
var n=
|
|
430
|
-
numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,o=!1,i=!1,a=n[0]&&
|
|
431
|
-
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=
|
|
432
|
-
var{body:n,index:r}=e;return r?new
|
|
433
|
-
;return n?"op"===n.type?n.limits&&(t.style.size===
|
|
434
|
-
;var w=4*u.defaultRuleThickness;if(
|
|
435
|
-
;if(e.sub&&i.push(
|
|
436
|
-
}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var
|
|
437
|
-
;if("text"===e.mode){var r=
|
|
438
|
-
;return n?
|
|
439
|
-
},mathmlBuilder(e,t){var n=new
|
|
440
|
-
return
|
|
441
|
-
;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
|
|
442
|
-
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
|
|
443
|
-
|
|
444
|
-
;if(i&&!t)throw new
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
"\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
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
|
|
463
|
-
}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
|
|
464
|
-
if(0===a)throw new
|
|
465
|
-
;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
|
|
466
|
-
"⁹":"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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"})
|
|
364
|
+
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,80);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,80,n)}return r}(e,r,n),a=new Iu(e,i),s=new Du([a],{width:"400em",height:Cu(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"})
|
|
365
|
+
;return Th.makeSvgSpan(["hide-tail"],[s],o)},Gd=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],Vd=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],Yd=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Wd=[0,1.2,1.8,2.4,3],Kd=[{type:"small",style:au.SCRIPTSCRIPT},{type:"small",style:au.SCRIPT},{type:"small",style:au.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Xd=[{type:"small",style:au.SCRIPTSCRIPT},{type:"small",style:au.SCRIPT},{type:"small",style:au.TEXT},{type:"stack"}],Zd=[{type:"small",style:au.SCRIPTSCRIPT},{type:"small",style:au.SCRIPT},{type:"small",style:au.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{
|
|
366
|
+
type:"stack"}],Jd=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.")},Qd=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=Rd(e,Jd(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]},ep=function(e,t,n,r,o,i){var a;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),a=Wc.contains(Yd,e)?Kd:Wc.contains(Gd,e)?Zd:Xd;var s=Qd(e,t,a,r);return"small"===s.type?function(e,t,n,r,o,i){var a=Th.makeSymbol(e,"Main-Regular",o,r),s=Dd(a,t,r,i);return n&&Id(s,r,t),s}(e,s.style,n,r,o,i):"large"===s.type?Pd(e,s.size,n,r,o,i):qd(e,t,n,r,o,i)},tp={sqrtImage:function(e,t){
|
|
367
|
+
var n,r,o=t.havingBaseSizing(),i=Qd("\\surd",e*o.sizeMultiplier,Zd,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=$d("sqrtMain",l=(1+s+.08)/a,u=1e3+1e3*s+80,s,t)).style.minWidth="0.853em",r=.833/a):"large"===i.type?(u=1080*Wd[i.size],c=(Wd[i.size]+s)/a,l=(Wd[i.size]+s+.08)/a,(n=$d("sqrtSize"+i.size,l,u,s,t)).style.minWidth="1.02em",r=1/a):(l=e+s+.08,c=e+s,u=Math.floor(1e3*e+s)+80,(n=$d("sqrtTall",l,u,s,t)).style.minWidth="0.742em",r=1.056),n.height=c,n.style.height=Cu(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"),Wc.contains(Gd,e)||Wc.contains(Yd,e))return Pd(e,t,!1,n,r,o);if(Wc.contains(Vd,e))return qd(e,Wd[t],!1,n,r,o);throw new qc("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:Wd,customSizedDelim:ep,leftRightDelim:function(e,t,n,r,o,i){
|
|
368
|
+
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 ep(e,c,!0,r,o,i)}},np={"\\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}
|
|
369
|
+
},rp=["(","\\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 op(e,t){var n=wd(e);if(n&&Wc.contains(rp,n.text))return n;throw new qc(n?"Invalid delimiter '"+n.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function ip(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Ph({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=op(t[0],e);return{type:"delimsizing",
|
|
370
|
+
mode:e.parser.mode,size:np[e.funcName].size,mclass:np[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?Th.makeSpan([e.mclass]):tp.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(id(e.delim,e.mode));var n=new od.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=Cu(tp.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}}),Ph({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 qc("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:op(t[0],e).text,color:n}}}),Ph({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=op(t[0],e),r=e.parser;++r.leftrightDepth;var o=r.parseExpression(!1)
|
|
371
|
+
;--r.leftrightDepth,r.expect("\\right",!1);var i=bd(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:o,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,t)=>{ip(e);for(var n,r,o=Vh(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?Zh(t,["mopen"]):tp.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]=tp.leftRightDelim(u.delim,i,a,u.options,e.mode,[]))}if("."===e.right)r=Zh(t,["mclose"]);else{var h=e.rightColor?t.withColor(e.rightColor):t;r=tp.leftRightDelim(e.right,i,a,h,e.mode,["mclose"])}return o.push(r),Th.makeSpan(["minner"],o,t)},mathmlBuilder:(e,t)=>{ip(e);var n=ld(e.body,t);if("."!==e.left){var r=new od.MathNode("mo",[id(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if("."!==e.right){var o=new od.MathNode("mo",[id(e.right,e.mode)])
|
|
372
|
+
;o.setAttribute("fence","true"),e.rightColor&&o.setAttribute("mathcolor",e.rightColor),n.push(o)}return ad(n)}}),Ph({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=op(t[0],e);if(!e.parser.leftrightDepth)throw new qc("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if("."===e.delim)n=Zh(t,[]);else{n=tp.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?id("|","text"):id(e.delim,e.mode),r=new od.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var ap=(e,t)=>{var n,r,o=Th.wrapFragment(Jh(e.body,t),t),i=e.label.substr(1),a=t.sizeMultiplier,s=0,l=Wc.isCharacterBox(e.body);if("sout"===i)(n=Th.makeSpan(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/a,s=-.5*t.fontMetrics().xHeight;else if("phase"===i){var c=Su({
|
|
373
|
+
number:.6,unit:"pt"},t),u=Su({number:.35,unit:"ex"},t);a/=t.havingBaseSizing().sizeMultiplier;var h=o.height+o.depth+c+u;o.style.paddingLeft=Cu(h/2+c);var d=Math.floor(1e3*h*a),p=function(e){return"M400000 "+e+" H0 L"+e/2+" 0 l65 45 L145 "+(e-80)+" H400000z"}(d),m=new Du([new Iu("phase",p)],{width:"400em",height:Cu(d/1e3),viewBox:"0 0 400000 "+d,preserveAspectRatio:"xMinYMin slice"});(n=Th.makeSvgSpan(["hide-tail"],[m],t)).style.height=Cu(h),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=gd(o,i,f,g,t),/fbox|boxed|fcolorbox/.test(i)?(n.style.borderStyle="solid",n.style.borderWidth=Cu(v)):"angl"===i&&.049!==v&&(n.style.borderTopWidth=Cu(v),n.style.borderRightWidth=Cu(v)),
|
|
374
|
+
s=o.depth+g,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)r=Th.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:s},{type:"elem",elem:o,shift:0}]},t);else{var _=/cancel|phase/.test(i)?["svg-align"]:[];r=Th.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:n,shift:s,wrapperClasses:_}]},t)}return/cancel/.test(i)&&(r.height=o.height,r.depth=o.depth),/cancel/.test(i)&&!l?Th.makeSpan(["mord","cancel-lap"],[r],t):Th.makeSpan(["mord"],[r],t)},sp=(e,t)=>{var n=0,r=new od.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[ud(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":
|
|
375
|
+
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};Ph({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:r,funcName:o}=e,i=bd(t[0],"color-token").color,a=t[1];return{type:"enclose",mode:r.mode,label:o,backgroundColor:i,body:a}},htmlBuilder:ap,mathmlBuilder:sp}),Ph({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,
|
|
376
|
+
argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:o}=e,i=bd(t[0],"color-token").color,a=bd(t[1],"color-token").color,s=t[2];return{type:"enclose",mode:r.mode,label:o,backgroundColor:a,borderColor:i,body:s}},htmlBuilder:ap,mathmlBuilder:sp}),Ph({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]}}}),Ph({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:ap,mathmlBuilder:sp}),Ph({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 lp={};function cp(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,
|
|
377
|
+
handler:o},l=0;l<n.length;++l)lp[n[l]]=s;i&&(Dh[t]=i),a&&(Ih[t]=a)}var up={};function hp(e,t){up[e]=t}function dp(e){var t=[];e.consumeSpaces();for(var n=e.fetch().text;"\\hline"===n||"\\hdashline"===n;)e.consume(),t.push("\\hdashline"===n),e.consumeSpaces(),n=e.fetch().text;return t}var pp=e=>{if(!e.parser.settings.displayMode)throw new qc("{"+e.envName+"} can be used only in display mode.")};function mp(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function fp(e,t,n){var{hskipBeforeAndAfter:r,addJot:o,cols:i,arraystretch:a,colSeparationType:s,autoTag:l,singleRow:c,emptySingleRow:u,maxNumCols:h,leqno:d}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var p=e.gullet.expandMacroAsText("\\arraystretch");if(null==p)a=1;else if(!(a=parseFloat(p))||a<0)throw new qc("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var m=[],f=[m],g=[],v=[],_=null!=l?[]:void 0;function b(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function y(){
|
|
378
|
+
_&&(e.gullet.macros.get("\\df@tag")?(_.push(e.subparse([new Hc("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):_.push(Boolean(l)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(b(),v.push(dp(e));;){var w=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),w={type:"ordgroup",mode:e.mode,body:w},n&&(w={type:"styling",mode:e.mode,style:n,body:[w]}),m.push(w);var x=e.fetch().text;if("&"===x){if(h&&m.length===h){if(c||s)throw new qc("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){y(),1===m.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 qc("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),y(),v.push(dp(e)),m=[],f.push(m),b()}}return e.gullet.endGroup(),
|
|
379
|
+
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:_,leqno:d}}function gp(e){return"d"===e.substr(0,1)?"display":"text"}var vp=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,h=5*u;e.colSeparationType&&"small"===e.colSeparationType&&(h=t.havingStyle(au.SCRIPT).sizeMultiplier/t.sizeMultiplier*.2778);var d="CD"===e.colSeparationType?Su({number:3,unit:"ex"},t):12*u,p=3*u,m=e.arraystretch*d,f=.7*m,g=.3*m,v=0;function _(e){for(var t=0;t<e.length;++t)t>0&&(v+=.25),l.push({pos:v,isDashed:e[t]})}for(_(i[0]),n=0;n<e.body.length;++n){var b=e.body[n],y=f,w=g;a<b.length&&(a=b.length);var x=new Array(b.length);for(r=0;r<b.length;++r){var k=Jh(b[r],t);w<k.depth&&(w=k.depth),y<k.height&&(y=k.height),x[r]=k}var S=e.rowGaps[n],C=0;S&&(C=Su(S,t))>0&&(w<(C+=g)&&(w=C),C=0),e.addJot&&(w+=p),x.height=y,
|
|
380
|
+
x.depth=w,v+=y,x.pos=v,v+=w+C,s[n]=x,_(i[n+1])}var E,A,T=v/2+t.fontMetrics().axisHeight,N=e.cols||[],M=[],L=[];if(e.tags&&e.tags.some((e=>e)))for(n=0;n<o;++n){var z=s[n],O=z.pos-T,R=e.tags[n],D=void 0;(D=!0===R?Th.makeSpan(["eqn-num"],[],t):!1===R?Th.makeSpan([],[],t):Th.makeSpan([],Vh(R,t,!0),t)).depth=z.depth,D.height=z.height,L.push({type:"elem",elem:D,shift:O})}for(r=0,A=0;r<a||A<N.length;++r,++A){for(var I=N[A]||{},P=!0;"separator"===I.type;){if(P||((E=Th.makeSpan(["arraycolsep"],[])).style.width=Cu(t.fontMetrics().doubleRuleSep),M.push(E)),"|"!==I.separator&&":"!==I.separator)throw new qc("Invalid separator type: "+I.separator);var B="|"===I.separator?"solid":"dashed",F=Th.makeSpan(["vertical-separator"],[],t);F.style.height=Cu(v),F.style.borderRightWidth=Cu(c),F.style.borderRightStyle=B,F.style.margin="0 "+Cu(-c/2);var j=v-T;j&&(F.style.verticalAlign=Cu(-j)),M.push(F),I=N[++A]||{},P=!1}if(!(r>=a)){var U=void 0
|
|
381
|
+
;(r>0||e.hskipBeforeAndAfter)&&0!==(U=Wc.deflt(I.pregap,h))&&((E=Th.makeSpan(["arraycolsep"],[])).style.width=Cu(U),M.push(E));var H=[];for(n=0;n<o;++n){var q=s[n],$=q[r];if($){var G=q.pos-T;$.depth=q.depth,$.height=q.height,H.push({type:"elem",elem:$,shift:G})}}H=Th.makeVList({positionType:"individualShift",children:H},t),H=Th.makeSpan(["col-align-"+(I.align||"c")],[H]),M.push(H),(r<a-1||e.hskipBeforeAndAfter)&&0!==(U=Wc.deflt(I.postgap,h))&&((E=Th.makeSpan(["arraycolsep"],[])).style.width=Cu(U),M.push(E))}}if(s=Th.makeSpan(["mtable"],M),l.length>0){for(var V=Th.makeLineSpan("hline",t,c),Y=Th.makeLineSpan("hdashline",t,c),W=[{type:"elem",elem:s,shift:0}];l.length>0;){var K=l.pop(),X=K.pos-T;K.isDashed?W.push({type:"elem",elem:Y,shift:X}):W.push({type:"elem",elem:V,shift:X})}s=Th.makeVList({positionType:"individualShift",children:W},t)}if(0===L.length)return Th.makeSpan(["mord"],[s],t);var Z=Th.makeVList({positionType:"individualShift",children:L},t);return Z=Th.makeSpan(["tag"],[Z],t),Th.makeFragment([s,Z])
|
|
382
|
+
},_p={c:"center ",l:"left ",r:"right "},bp=function(e,t){for(var n=[],r=new od.MathNode("mtd",[],["mtr-glue"]),o=new od.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 od.MathNode("mtd",[ud(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 od.MathNode("mtr",s))}var c=new od.MathNode("mtable",n),u=.5===e.arraystretch?.1:.16+e.arraystretch-1+(e.addJot?.09:0);c.setAttribute("rowspacing",Cu(u));var h="",d="";if(e.cols&&e.cols.length>0){var p=e.cols,m="",f=!1,g=0,v=p.length;"separator"===p[0].type&&(h+="top ",g=1),"separator"===p[p.length-1].type&&(h+="bottom ",v-=1);for(var _=g;_<v;_++)"align"===p[_].type?(d+=_p[p[_].align],f&&(m+="none "),f=!0):"separator"===p[_].type&&f&&(m+="|"===p[_].separator?"solid ":"dashed ",f=!1);c.setAttribute("columnalign",d.trim()),/[sd]/.test(m)&&c.setAttribute("columnlines",m.trim())}if("align"===e.colSeparationType){
|
|
383
|
+
for(var b=e.cols||[],y="",w=1;w<b.length;w++)y+=w%2?"0em ":"1em ";c.setAttribute("columnspacing",y.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;h+=k[0].length>0?"left ":"",h+=k[k.length-1].length>0?"right ":"";for(var S=1;S<k.length-1;S++)x+=0===k[S].length?"none ":k[S][0]?"dashed ":"solid ";return/[sd]/.test(x)&&c.setAttribute("rowlines",x.trim()),""!==h&&(c=new od.MathNode("menclose",[c])).setAttribute("notation",h.trim()),e.arraystretch&&e.arraystretch<1&&(c=new od.MathNode("mstyle",[c])).setAttribute("scriptlevel","1"),c},yp=function(e,t){-1===e.envName.indexOf("ed")&&pp(e);var n,r=[],o=e.envName.indexOf("at")>-1?"alignat":"align",i="split"===e.envName,a=fp(e.parser,{cols:r,addJot:!0,autoTag:i?void 0:mp(e.envName),emptySingleRow:!0,
|
|
384
|
+
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+=bd(t[0].body[u],"textord").text}n=Number(c),s=2*n}var h=!s;a.body.forEach((function(e){for(var t=1;t<e.length;t+=2){var r=bd(e[t],"styling");bd(r.body[0],"ordgroup").body.unshift(l)}if(h)s<e.length&&(s=e.length);else{var o=e.length/2;if(n<o)throw new qc("Too many math in a row: expected "+n+", but got "+o,e[0])}}));for(var d=0;d<s;++d){var p="r",m=0;d%2==1?p="l":d>0&&h&&(m=1),r[d]={type:"align",align:p,pregap:m,postgap:0}}return a.colSeparationType=h?"align":"alignat",a};cp({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=(wd(t[0])?[t[0]]:bd(t[0],"ordgroup").body).map((function(e){var t=yd(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"}
|
|
385
|
+
;throw new qc("Unknown column alignment: "+t,e)})),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return fp(e.parser,r,gp(e.envName))},htmlBuilder:vp,mathmlBuilder:bp}),cp({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 qc("Expected l or c or r",o.nextToken);o.consume(),o.consumeSpaces(),o.expect("]"),o.consume(),r.cols=[{type:"align",align:n}]}}var i=fp(e.parser,r,gp(e.envName)),a=Math.max(0,...i.body.map((e=>e.length)));return i.cols=new Array(a).fill({type:"align",align:n}),t?{
|
|
386
|
+
type:"leftright",mode:e.mode,body:[i],left:t[0],right:t[1],rightColor:void 0}:i},htmlBuilder:vp,mathmlBuilder:bp}),cp({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t=fp(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:vp,mathmlBuilder:bp}),cp({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=(wd(t[0])?[t[0]]:bd(t[0],"ordgroup").body).map((function(e){var t=yd(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new qc("Unknown column alignment: "+t,e)}));if(n.length>1)throw new qc("{subarray} can contain only one column");var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if((r=fp(e.parser,r,"script")).body.length>0&&r.body[0].length>1)throw new qc("{subarray} can contain only one column");return r},htmlBuilder:vp,mathmlBuilder:bp}),cp({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=fp(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{
|
|
387
|
+
type:"align",align:"l",pregap:0,postgap:0}]},gp(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:vp,mathmlBuilder:bp}),cp({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:yp,htmlBuilder:vp,mathmlBuilder:bp}),cp({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){Wc.contains(["gather","gather*"],e.envName)&&pp(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:mp(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return fp(e.parser,t,"display")},htmlBuilder:vp,mathmlBuilder:bp}),cp({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:yp,htmlBuilder:vp,mathmlBuilder:bp}),cp({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){pp(e);var t={autoTag:mp(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno}
|
|
388
|
+
;return fp(e.parser,t,"display")},htmlBuilder:vp,mathmlBuilder:bp}),cp({type:"array",names:["CD"],props:{numArgs:0},handler:e=>(pp(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 qc("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(Ad(l[u])){i.push(c);var h=yd(l[u+=1]).text,d=new Array(2);if(d[0]={type:"ordgroup",mode:"math",body:[]},d[1]={type:"ordgroup",mode:"math",body:[]},"=|.".indexOf(h)>-1);else{if(!("<>AV".indexOf(h)>-1))throw new qc('Expected one of "<>AV=|." after @',l[u]);for(var p=0;p<2;p++){for(var m=!0,f=u+1;f<l.length;f++){if(o=h,("mathord"===(r=l[f]).type||"atom"===r.type)&&r.text===o){m=!1,u=f;break
|
|
389
|
+
}if(Ad(l[f]))throw new qc("Missing a "+h+" character to complete a CD arrow.",l[f]);d[p].body.push(l[f])}if(m)throw new qc("Missing a "+h+" character to complete a CD arrow.",l[u])}}var g={type:"styling",body:[Td(h,d,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:vp,mathmlBuilder:bp}),hp("\\nonumber","\\gdef\\@eqnsw{0}"),hp("\\notag","\\nonumber"),Ph({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new qc(e.funcName+" valid only within array environment")}});var wp=lp;Ph({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,
|
|
390
|
+
argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];if("ordgroup"!==o.type)throw new qc("Invalid environment name",o);for(var i="",a=0;a<o.body.length;++a)i+=bd(o.body[a],"textord").text;if("\\begin"===r){if(!wp.hasOwnProperty(i))throw new qc("No such environment: "+i,o);var s=wp[i],{args:l,optArgs:c}=n.parseArguments("\\begin{"+i+"}",s),u={mode:n.mode,envName:i,parser:n},h=s.handler(u,l,c);n.expect("\\end",!1);var d=n.nextToken,p=bd(n.parseFunction(),"environment");if(p.name!==i)throw new qc("Mismatch: \\begin{"+i+"} matched by \\end{"+p.name+"}",d);return h}return{type:"environment",mode:n.mode,name:i,nameGroup:o}}});var xp=Th.makeSpan;function kp(e,t){var n=Vh(e.body,t,!0);return xp([e.mclass],n,t)}function Sp(e,t){var n,r=ld(e.body,t);return"minner"===e.mclass?n=new od.MathNode("mpadded",r):"mord"===e.mclass?e.isCharacterBox?(n=r[0]).type="mi":n=new od.MathNode("mi",r):(e.isCharacterBox?(n=r[0]).type="mo":n=new od.MathNode("mo",r),"mbin"===e.mclass?(n.attributes.lspace="0.22em",
|
|
391
|
+
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}Ph({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.substr(5),body:jh(o),isCharacterBox:Wc.isCharacterBox(o)}},htmlBuilder:kp,mathmlBuilder:Sp});var Cp=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};Ph({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Cp(t[0]),body:jh(t[1]),isCharacterBox:Wc.isCharacterBox(t[1])}}}),Ph({type:"mclass",names:["\\stackrel","\\overset","\\underset"],
|
|
392
|
+
props:{numArgs:2},handler(e,t){var n,{parser:r,funcName:o}=e,i=t[1],a=t[0];n="\\stackrel"!==o?Cp(i):"mrel";var s={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==o,body:jh(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:Wc.isCharacterBox(l)}},htmlBuilder:kp,mathmlBuilder:Sp});var Ep=(e,t)=>{var n=e.font,r=t.withFont(n);return Jh(e.body,r)},Ap=(e,t)=>{var n=e.font,r=t.withFont(n);return ud(e.body,r)},Tp={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Ph({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=Fh(t[0]),i=r;return i in Tp&&(i=Tp[i]),{type:"font",mode:n.mode,font:i.slice(1),body:o}},
|
|
393
|
+
htmlBuilder:Ep,mathmlBuilder:Ap}),Ph({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0],o=Wc.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:Cp(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:o}}}),Ph({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:Ep,mathmlBuilder:Ap});var Np=(e,t)=>{var n=t;return"display"===e?n=n.id>=au.SCRIPT.id?n.text():au.DISPLAY:"text"===e&&n.size===au.DISPLAY.size?n=au.TEXT:"script"===e?n=au.SCRIPT:"scriptscript"===e&&(n=au.SCRIPTSCRIPT),n},Mp=(e,t)=>{var n,r=Np(e.size,t.style),o=r.fracNum(),i=r.fracDen();n=t.havingStyle(o);var a=Jh(e.numer,n,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm
|
|
394
|
+
;a.height=a.height<s?s:a.height,a.depth=a.depth<l?l:a.depth}n=t.havingStyle(i);var c,u,h,d,p,m,f,g,v,_,b=Jh(e.denom,n,t);if(e.hasBarLine?(e.barSize?(u=Su(e.barSize,t),c=Th.makeLineSpan("frac-line",t,u)):c=Th.makeLineSpan("frac-line",t),u=c.height,h=c.height):(c=null,u=0,h=t.fontMetrics().defaultRuleThickness),r.size===au.DISPLAY.size||"display"===e.size?(d=t.fontMetrics().num1,p=u>0?3*h:7*h,m=t.fontMetrics().denom1):(u>0?(d=t.fontMetrics().num2,p=h):(d=t.fontMetrics().num3,p=3*h),m=t.fontMetrics().denom2),c){var y=t.fontMetrics().axisHeight;d-a.depth-(y+.5*u)<p&&(d+=p-(d-a.depth-(y+.5*u))),y-.5*u-(b.height-m)<p&&(m+=p-(y-.5*u-(b.height-m)));var w=-(y-.5*u);f=Th.makeVList({positionType:"individualShift",children:[{type:"elem",elem:b,shift:m},{type:"elem",elem:c,shift:w},{type:"elem",elem:a,shift:-d}]},t)}else{var x=d-a.depth-(b.height-m);x<p&&(d+=.5*(p-x),m+=.5*(p-x)),f=Th.makeVList({positionType:"individualShift",children:[{type:"elem",elem:b,shift:m},{type:"elem",elem:a,shift:-d}]},t)}
|
|
395
|
+
return n=t.havingStyle(r),f.height*=n.sizeMultiplier/t.sizeMultiplier,f.depth*=n.sizeMultiplier/t.sizeMultiplier,g=r.size===au.DISPLAY.size?t.fontMetrics().delim1:r.size===au.SCRIPTSCRIPT.size?t.havingStyle(au.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,v=null==e.leftDelim?Zh(t,["mopen"]):tp.customSizedDelim(e.leftDelim,g,!0,t.havingStyle(r),e.mode,["mopen"]),_=e.continued?Th.makeSpan([]):null==e.rightDelim?Zh(t,["mclose"]):tp.customSizedDelim(e.rightDelim,g,!0,t.havingStyle(r),e.mode,["mclose"]),Th.makeSpan(["mord"].concat(n.sizingClasses(t)),[v,Th.makeSpan(["mfrac"],[f]),_],t)},Lp=(e,t)=>{var n=new od.MathNode("mfrac",[ud(e.numer,t),ud(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var r=Su(e.barSize,t);n.setAttribute("linethickness",Cu(r))}}else n.setAttribute("linethickness","0px");var o=Np(e.size,t.style);if(o.size!==t.style.size){n=new od.MathNode("mstyle",[n]);var i=o.size===au.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",i),n.setAttribute("scriptlevel","0")}
|
|
396
|
+
if(null!=e.leftDelim||null!=e.rightDelim){var a=[];if(null!=e.leftDelim){var s=new od.MathNode("mo",[new od.TextNode(e.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),a.push(s)}if(a.push(n),null!=e.rightDelim){var l=new od.MathNode("mo",[new od.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),a.push(l)}return ad(a)}return n};Ph({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;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"}
|
|
397
|
+
return{type:"genfrac",mode:r.mode,continued:!1,numer:i,denom:a,hasBarLine:n,leftDelim:s,rightDelim:l,size:c,barSize:null}},htmlBuilder:Mp,mathmlBuilder:Lp}),Ph({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}}}),Ph({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var t,{parser:n,funcName:r,token:o}=e;switch(r){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:t,token:o}}});var zp=["display","text","script","scriptscript"],Op=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};Ph({type:"genfrac",names:["\\genfrac"],
|
|
398
|
+
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=Fh(t[0]),s="atom"===a.type&&"open"===a.family?Op(a.text):null,l=Fh(t[1]),c="atom"===l.type&&"close"===l.family?Op(l.text):null,u=bd(t[2],"size"),h=null;n=!!u.isBlank||(h=u.value).number>0;var d="auto",p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var m=bd(p.body[0],"textord");d=zp[Number(m.text)]}}else p=bd(p,"textord"),d=zp[Number(p.text)];return{type:"genfrac",mode:r.mode,numer:o,denom:i,continued:!1,hasBarLine:n,barSize:h,leftDelim:s,rightDelim:c,size:d}},htmlBuilder:Mp,mathmlBuilder:Lp}),Ph({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:o}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:bd(t[0],"size").value,token:o}}}),Ph({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{
|
|
399
|
+
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}(bd(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:Mp,mathmlBuilder:Lp});var Rp=(e,t)=>{var n,r,o=t.style;"supsub"===e.type?(n=e.sup?Jh(e.sup,t.havingStyle(o.sup()),t):Jh(e.sub,t.havingStyle(o.sub()),t),r=bd(e.base,"horizBrace")):r=bd(e,"horizBrace");var i,a=Jh(r.base,t.havingBaseStyle(au.DISPLAY)),s=_d(r,t);if(r.isOver?(i=Th.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s}]},t)).children[0].children[0].children[1].classes.push("svg-align"):(i=Th.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){
|
|
400
|
+
var l=Th.makeSpan(["mord",r.isOver?"mover":"munder"],[i],t);i=r.isOver?Th.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},t):Th.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 Th.makeSpan(["mord",r.isOver?"mover":"munder"],[i],t)};Ph({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:Rp,mathmlBuilder:(e,t)=>{var n=vd(e.label);return new od.MathNode(e.isOver?"mover":"munder",[ud(e.base,t),n])}}),Ph({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],o=bd(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:o})?{type:"href",mode:n.mode,href:o,body:jh(r)}:n.formatUnsupportedCmd("\\href")},
|
|
401
|
+
htmlBuilder:(e,t)=>{var n=Vh(e.body,t,!1);return Th.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=cd(e.body,t);return n instanceof nd||(n=new nd("mrow",[n])),n.setAttribute("href",e.href),n}}),Ph({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=bd(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:jh(s)}}}),Ph({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:jh(t[0])}},htmlBuilder(e,t){var n=Vh(e.body,t,!1);return Th.makeFragment(n)},mathmlBuilder:(e,t)=>new od.MathNode("mrow",ld(e.body,t))}),Ph({type:"html",
|
|
402
|
+
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=bd(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 h=c[u].split("=");if(2!==h.length)throw new qc("Error parsing key-value for \\htmlData");l["data-"+h[0].trim()]=h[1].trim()}n={command:"\\htmlData",attributes:l};break;default:throw new Error("Unrecognized html command")}return r.settings.isTrusted(n)?{type:"html",mode:r.mode,attributes:l,body:jh(s)}:r.formatUnsupportedCmd(o)},htmlBuilder:(e,t)=>{var n=Vh(e.body,t,!1),r=["enclosing"]
|
|
403
|
+
;e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var o=Th.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)=>cd(e.body,t)}),Ph({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:jh(t[0]),mathml:jh(t[1])}},htmlBuilder:(e,t)=>{var n=Vh(e.html,t,!1);return Th.makeFragment(n)},mathmlBuilder:(e,t)=>cd(e.mathml,t)});var Dp=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 qc("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!ku(n))throw new qc("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};Ph({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{
|
|
404
|
+
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=bd(n[0],"raw").string.split(","),c=0;c<l.length;c++){var u=l[c].split("=");if(2===u.length){var h=u[1].trim();switch(u[0].trim()){case"alt":s=h;break;case"width":o=Dp(h);break;case"height":i=Dp(h);break;case"totalheight":a=Dp(h);break;default:throw new qc("Invalid key: '"+u[0]+"' in \\includegraphics.")}}}var d=bd(t[0],"url").url;return""===s&&(s=(s=(s=d).replace(/^.*[\\/]/,"")).substring(0,s.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:d})?{type:"includegraphics",mode:r.mode,alt:s,width:o,height:i,totalheight:a,src:d}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=Su(e.height,t),r=0;e.totalheight.number>0&&(r=Su(e.totalheight,t)-n);var o=0;e.width.number>0&&(o=Su(e.width,t));var i={height:Cu(n+r)};o>0&&(i.width=Cu(o)),r>0&&(i.verticalAlign=Cu(-r));var a=new zu(e.src,e.alt,i);return a.height=n,a.depth=r,a},mathmlBuilder:(e,t)=>{
|
|
405
|
+
var n=new od.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var r=Su(e.height,t),o=0;if(e.totalheight.number>0&&(o=Su(e.totalheight,t)-r,n.setAttribute("valign",Cu(-o))),n.setAttribute("height",Cu(r+o)),e.width.number>0){var i=Su(e.width,t);n.setAttribute("width",Cu(i))}return n.setAttribute("src",e.src),n}}),Ph({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=bd(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"),"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)=>Th.makeGlue(e.dimension,t),mathmlBuilder(e,t){var n=Su(e.dimension,t)
|
|
406
|
+
;return new od.SpaceNode(n)}}),Ph({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=Th.makeSpan([],[Jh(e.body,t)]),n=Th.makeSpan(["inner"],[n],t)):n=Th.makeSpan(["inner"],[Jh(e.body,t)]);var r=Th.makeSpan(["fix"],[]),o=Th.makeSpan([e.alignment],[n,r],t),i=Th.makeSpan(["strut"]);return i.style.height=Cu(o.height+o.depth),o.depth&&(i.style.verticalAlign=Cu(-o.depth)),o.children.unshift(i),o=Th.makeSpan(["thinbox"],[o],t),Th.makeSpan(["mord","vbox"],[o],t)},mathmlBuilder:(e,t)=>{var n=new od.MathNode("mpadded",[ud(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}}),Ph({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,o=r.mode
|
|
407
|
+
;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}}}),Ph({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new qc("Mismatched "+e.funcName)}});var Ip=(e,t)=>{switch(t.style.size){case au.DISPLAY.size:return e.display;case au.TEXT.size:return e.text;case au.SCRIPT.size:return e.script;case au.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Ph({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:jh(t[0]),text:jh(t[1]),script:jh(t[2]),scriptscript:jh(t[3])}},htmlBuilder:(e,t)=>{var n=Ip(e,t),r=Vh(n,t,!1);return Th.makeFragment(r)},mathmlBuilder:(e,t)=>{var n=Ip(e,t);return cd(n,t)}});var Pp=(e,t,n,r,o,i,a)=>{e=Th.makeSpan([],[e]);var s,l,c,u=n&&Wc.isCharacterBox(n);if(t){var h=Jh(t,r.havingStyle(o.sup()),r);l={elem:h,
|
|
408
|
+
kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-h.depth)}}if(n){var d=Jh(n,r.havingStyle(o.sub()),r);s={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}if(l&&s){var p=r.fontMetrics().bigOpSpacing5+s.elem.height+s.elem.depth+s.kern+e.depth+a;c=Th.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:Cu(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:Cu(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(s){var m=e.height-a;c=Th.makeVList({positionType:"top",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:Cu(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e}]},r)}else{if(!l)return e;var f=e.depth+a;c=Th.makeVList({positionType:"bottom",positionData:f,children:[{type:"elem",elem:e},{type:"kern",size:l.kern},{
|
|
409
|
+
type:"elem",elem:l.elem,marginLeft:Cu(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}var g=[c];if(s&&0!==i&&!u){var v=Th.makeSpan(["mspace"],[],r);v.style.marginRight=Cu(i),g.unshift(v)}return Th.makeSpan(["mop","op-limits"],g,r)},Bp=["\\smallint"],Fp=(e,t)=>{var n,r,o,i=!1;"supsub"===e.type?(n=e.sup,r=e.sub,o=bd(e.base,"op"),i=!0):o=bd(e,"op");var a,s=t.style,l=!1;if(s.size===au.DISPLAY.size&&o.symbol&&!Wc.contains(Bp,o.name)&&(l=!0),o.symbol){var c=l?"Size2-Regular":"Size1-Regular",u="";if("\\oiint"!==o.name&&"\\oiiint"!==o.name||(u=o.name.substr(1),o.name="oiint"===u?"\\iint":"\\iiint"),a=Th.makeSymbol(o.name,c,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),u.length>0){var h=a.italic,d=Th.staticSvg(u+"Size"+(l?"2":"1"),t);a=Th.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:0},{type:"elem",elem:d,shift:l?.08:0}]},t),o.name="\\"+u,a.classes.unshift("mop"),a.italic=h}}else if(o.body){var p=Vh(o.body,t,!0)
|
|
410
|
+
;1===p.length&&p[0]instanceof Ru?(a=p[0]).classes[0]="mop":a=Th.makeSpan(["mop"],p,t)}else{for(var m=[],f=1;f<o.name.length;f++)m.push(Th.mathsym(o.name[f],o.mode,t));a=Th.makeSpan(["mop"],m,t)}var g=0,v=0;return(a instanceof Ru||"\\oiint"===o.name||"\\oiiint"===o.name)&&!o.suppressBaseShift&&(g=(a.height-a.depth)/2-t.fontMetrics().axisHeight,v=a.italic),i?Pp(a,n,r,t,s,v,g):(g&&(a.style.position="relative",a.style.top=Cu(g)),a)},jp=(e,t)=>{var n;if(e.symbol)n=new nd("mo",[id(e.name,e.mode)]),Wc.contains(Bp,e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new nd("mo",ld(e.body,t));else{n=new nd("mi",[new rd(e.name.slice(1))]);var r=new nd("mo",[id("","text")]);n=e.parentIsSupSub?new nd("mrow",[n,r]):td([n,r])}return n},Up={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Ph({type:"op",
|
|
411
|
+
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=Up[o]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:o}},htmlBuilder:Fp,mathmlBuilder:jp}),Ph({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:jh(r)}},htmlBuilder:Fp,mathmlBuilder:jp});var Hp={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Ph({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],
|
|
412
|
+
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:Fp,mathmlBuilder:jp}),Ph({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:Fp,mathmlBuilder:jp}),Ph({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=Hp[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Fp,mathmlBuilder:jp});var qp=(e,t)=>{var n,r,o,i,a=!1;if("supsub"===e.type?(n=e.sup,r=e.sub,o=bd(e.base,"operatorname"),a=!0):o=bd(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=Vh(s,t.withFont("mathrm"),!0),c=0;c<l.length;c++){
|
|
413
|
+
var u=l[c];u instanceof Ru&&(u.text=u.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}i=Th.makeSpan(["mop"],l,t)}else i=Th.makeSpan(["mop"],[],t);return a?Pp(i,n,r,t,t.style,0,0):i};function $p(e,t,n){for(var r=Vh(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 Th.makeFragment(r)}Ph({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:jh(o),alwaysHandleSupSub:"\\operatornamewithlimits"===r,limits:!1,parentIsSupSub:!1}},htmlBuilder:qp,mathmlBuilder:(e,t)=>{for(var n=ld(e.body,t.withFont("mathrm")),r=!0,o=0;o<n.length;o++){var i=n[o];if(i instanceof od.SpaceNode);else if(i instanceof od.MathNode)switch(i.type){case"mi":case"mn":case"ms":
|
|
414
|
+
case"mspace":case"mtext":break;case"mo":var a=i.children[0];1===i.children.length&&a instanceof od.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 od.TextNode(s)]}var l=new od.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new od.MathNode("mo",[id("","text")]);return e.parentIsSupSub?new od.MathNode("mrow",[l,c]):od.newDocumentFragment([l,c])}}),hp("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),Bh({type:"ordgroup",htmlBuilder:(e,t)=>e.semisimple?Th.makeFragment(Vh(e.body,t,!1)):Th.makeSpan(["mord"],Vh(e.body,t,!0),t),mathmlBuilder:(e,t)=>cd(e.body,t,!0)}),Ph({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=Jh(e.body,t.havingCrampedStyle()),r=Th.makeLineSpan("overline-line",t),o=t.fontMetrics().defaultRuleThickness,i=Th.makeVList({positionType:"firstBaseline",
|
|
415
|
+
children:[{type:"elem",elem:n},{type:"kern",size:3*o},{type:"elem",elem:r},{type:"kern",size:o}]},t);return Th.makeSpan(["mord","overline"],[i],t)},mathmlBuilder(e,t){var n=new od.MathNode("mo",[new od.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new od.MathNode("mover",[ud(e.body,t),n]);return r.setAttribute("accent","true"),r}}),Ph({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:jh(r)}},htmlBuilder:(e,t)=>{var n=Vh(e.body,t.withPhantom(),!1);return Th.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=ld(e.body,t);return new od.MathNode("mphantom",n)}}),Ph({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=Th.makeSpan([],[Jh(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
|
|
416
|
+
;return n=Th.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t),Th.makeSpan(["mord"],[n],t)},mathmlBuilder:(e,t)=>{var n=ld(jh(e.body),t),r=new od.MathNode("mphantom",n),o=new od.MathNode("mpadded",[r]);return o.setAttribute("height","0px"),o.setAttribute("depth","0px"),o}}),Ph({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=Th.makeSpan(["inner"],[Jh(e.body,t.withPhantom())]),r=Th.makeSpan(["fix"],[]);return Th.makeSpan(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=ld(jh(e.body),t),r=new od.MathNode("mphantom",n),o=new od.MathNode("mpadded",[r]);return o.setAttribute("width","0px"),o}}),Ph({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=bd(t[0],"size").value,o=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:o}},htmlBuilder(e,t){var n=Jh(e.body,t),r=Su(e.dy,t)
|
|
417
|
+
;return Th.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new od.MathNode("mpadded",[ud(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}}),Ph({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),Ph({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,o=n[0],i=bd(t[0],"size"),a=bd(t[1],"size");return{type:"rule",mode:r.mode,shift:o&&bd(o,"size").value,width:i.value,height:a.value}},htmlBuilder(e,t){var n=Th.makeSpan(["mord","rule"],[],t),r=Su(e.width,t),o=Su(e.height,t),i=e.shift?Su(e.shift,t):0;return n.style.borderRightWidth=Cu(r),n.style.borderTopWidth=Cu(o),n.style.bottom=Cu(i),n.width=r,n.height=o+i,n.depth=-i,n.maxFontSize=1.125*o*t.sizeMultiplier,n},mathmlBuilder(e,t){
|
|
418
|
+
var n=Su(e.width,t),r=Su(e.height,t),o=e.shift?Su(e.shift,t):0,i=t.color&&t.getColor()||"black",a=new od.MathNode("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",Cu(n)),a.setAttribute("height",Cu(r));var s=new od.MathNode("mpadded",[a]);return o>=0?s.setAttribute("height",Cu(o)):(s.setAttribute("height",Cu(o)),s.setAttribute("depth",Cu(-o))),s.setAttribute("voffset",Cu(o)),s}});var Gp=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];Ph({type:"sizing",names:Gp,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:Gp.indexOf(r)+1,body:i}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return $p(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=ld(e.body,n),o=new od.MathNode("mstyle",r);return o.setAttribute("mathsize",Cu(n.sizeMultiplier)),o}}),Ph({type:"smash",names:["\\smash"],props:{
|
|
419
|
+
numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,o=!1,i=!1,a=n[0]&&bd(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=Th.makeSpan([],[Jh(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=Th.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t);return Th.makeSpan(["mord"],[i],t)},mathmlBuilder:(e,t)=>{var n=new od.MathNode("mpadded",[ud(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),Ph({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){
|
|
420
|
+
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=Jh(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=Th.wrapFragment(n,t);var r=t.fontMetrics().defaultRuleThickness,o=r;t.style.id<au.TEXT.id&&(o=t.fontMetrics().xHeight);var i=r+o/4,a=n.height+n.depth+i+r,{span:s,ruleWidth:l,advanceWidth:c}=tp.sqrtImage(a,t),u=s.height-l;u>n.height+n.depth+i&&(i=(i+u-n.height-n.depth)/2);var h=s.height-n.height-i-l;n.style.paddingLeft=Cu(c);var d=Th.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+h)},{type:"elem",elem:s},{type:"kern",size:l}]},t);if(e.index){var p=t.havingStyle(au.SCRIPTSCRIPT),m=Jh(e.index,p,t),f=.6*(d.height-d.depth),g=Th.makeVList({positionType:"shift",positionData:-f,children:[{type:"elem",elem:m}]},t),v=Th.makeSpan(["root"],[g]);return Th.makeSpan(["mord","sqrt"],[v,d],t)}return Th.makeSpan(["mord","sqrt"],[d],t)},mathmlBuilder(e,t){
|
|
421
|
+
var{body:n,index:r}=e;return r?new od.MathNode("mroot",[ud(n,t),ud(r,t)]):new od.MathNode("msqrt",[ud(n,t)])}});var Vp={display:au.DISPLAY,text:au.TEXT,script:au.SCRIPT,scriptscript:au.SCRIPTSCRIPT};Ph({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=Vp[e.style],r=t.havingStyle(n).withFont("");return $p(e.body,r,t)},mathmlBuilder(e,t){var n=Vp[e.style],r=t.havingStyle(n),o=ld(e.body,r),i=new od.MathNode("mstyle",o),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return i.setAttribute("scriptlevel",a[0]),i.setAttribute("displaystyle",a[1]),i}});Bh({type:"supsub",htmlBuilder(e,t){var n=function(e,t){var n=e.base
|
|
422
|
+
;return n?"op"===n.type?n.limits&&(t.style.size===au.DISPLAY.size||n.alwaysHandleSupSub)?Fp:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(t.style.size===au.DISPLAY.size||n.limits)?qp:null:"accent"===n.type?Wc.isCharacterBox(n.base)?xd:null:"horizBrace"===n.type&&!e.sub===n.isOver?Rp:null:null}(e,t);if(n)return n(e,t);var r,o,i,{base:a,sup:s,sub:l}=e,c=Jh(a,t),u=t.fontMetrics(),h=0,d=0,p=a&&Wc.isCharacterBox(a);if(s){var m=t.havingStyle(t.style.sup());r=Jh(s,m,t),p||(h=c.height-m.fontMetrics().supDrop*m.sizeMultiplier/t.sizeMultiplier)}if(l){var f=t.havingStyle(t.style.sub());o=Jh(l,f,t),p||(d=c.depth+f.fontMetrics().subDrop*f.sizeMultiplier/t.sizeMultiplier)}i=t.style===au.DISPLAY?u.sup1:t.style.cramped?u.sup3:u.sup2;var g,v=t.sizeMultiplier,_=Cu(.5/u.ptPerEm/v),b=null;if(o){var y=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof Ru||y)&&(b=Cu(-c.italic))}if(r&&o){h=Math.max(h,i,r.depth+.25*u.xHeight),d=Math.max(d,u.sub2)
|
|
423
|
+
;var w=4*u.defaultRuleThickness;if(h-r.depth-(o.height-d)<w){d=w-(h-r.depth)+o.height;var x=.8*u.xHeight-(h-r.depth);x>0&&(h+=x,d-=x)}var k=[{type:"elem",elem:o,shift:d,marginRight:_,marginLeft:b},{type:"elem",elem:r,shift:-h,marginRight:_}];g=Th.makeVList({positionType:"individualShift",children:k},t)}else if(o){d=Math.max(d,u.sub1,o.height-.8*u.xHeight);var S=[{type:"elem",elem:o,marginLeft:b,marginRight:_}];g=Th.makeVList({positionType:"shift",positionData:d,children:S},t)}else{if(!r)throw new Error("supsub must have either sup or sub.");h=Math.max(h,i,r.depth+.25*u.xHeight),g=Th.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:r,marginRight:_}]},t)}var C=Xh(c,"right")||"mord";return Th.makeSpan([C],[c,Th.makeSpan(["msupsub"],[g])],t)},mathmlBuilder(e,t){var n,r=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(r=!0,n=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var o,i=[ud(e.base,t)]
|
|
424
|
+
;if(e.sub&&i.push(ud(e.sub,t)),e.sup&&i.push(ud(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===au.DISPLAY||a&&"operatorname"===a.type&&a.alwaysHandleSupSub&&(t.style===au.DISPLAY||a.limits)?"munderover":"msubsup"}else{var s=e.base;o=s&&"op"===s.type&&s.limits&&(t.style===au.DISPLAY||s.alwaysHandleSupSub)||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(s.limits||t.style===au.DISPLAY)?"munder":"msub"}else{var l=e.base;o=l&&"op"===l.type&&l.limits&&(t.style===au.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===au.DISPLAY)?"mover":"msup"}return new od.MathNode(o,i)}}),Bh({type:"atom",htmlBuilder:(e,t)=>Th.mathsym(e.text,e.mode,t,["m"+e.family]),mathmlBuilder(e,t){var n=new od.MathNode("mo",[id(e.text,e.mode)]);if("bin"===e.family){var r=sd(e,t);"bold-italic"===r&&n.setAttribute("mathvariant",r)
|
|
425
|
+
}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var Yp={mi:"italic",mn:"normal",mtext:"normal"};Bh({type:"mathord",htmlBuilder:(e,t)=>Th.makeOrd(e,t,"mathord"),mathmlBuilder(e,t){var n=new od.MathNode("mi",[id(e.text,e.mode,t)]),r=sd(e,t)||"italic";return r!==Yp[n.type]&&n.setAttribute("mathvariant",r),n}}),Bh({type:"textord",htmlBuilder:(e,t)=>Th.makeOrd(e,t,"textord"),mathmlBuilder(e,t){var n,r=id(e.text,e.mode,t),o=sd(e,t)||"normal";return n="text"===e.mode?new od.MathNode("mtext",[r]):/[0-9]/.test(e.text)?new od.MathNode("mn",[r]):"\\prime"===e.text?new od.MathNode("mo",[r]):new od.MathNode("mi",[r]),o!==Yp[n.type]&&n.setAttribute("mathvariant",o),n}});var Wp={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Kp={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Bh({type:"spacing",htmlBuilder(e,t){if(Kp.hasOwnProperty(e.text)){var n=Kp[e.text].className||""
|
|
426
|
+
;if("text"===e.mode){var r=Th.makeOrd(e,t,"textord");return r.classes.push(n),r}return Th.makeSpan(["mspace",n],[Th.mathsym(e.text,e.mode,t)],t)}if(Wp.hasOwnProperty(e.text))return Th.makeSpan(["mspace",Wp[e.text]],[],t);throw new qc('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){if(!Kp.hasOwnProperty(e.text)){if(Wp.hasOwnProperty(e.text))return new od.MathNode("mspace");throw new qc('Unknown type of space "'+e.text+'"')}return new od.MathNode("mtext",[new od.TextNode(" ")])}});var Xp=()=>{var e=new od.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};Bh({type:"tag",mathmlBuilder(e,t){var n=new od.MathNode("mtable",[new od.MathNode("mtr",[Xp(),new od.MathNode("mtd",[cd(e.body,t)]),Xp(),new od.MathNode("mtd",[cd(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var Zp={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Jp={"\\textbf":"textbf","\\textmd":"textmd"},Qp={"\\textit":"textit","\\textup":"textup"},em=(e,t)=>{var n=e.font
|
|
427
|
+
;return n?Zp[n]?t.withTextFontFamily(Zp[n]):Jp[n]?t.withTextFontWeight(Jp[n]):t.withTextFontShape(Qp[n]):t};Ph({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];return{type:"text",mode:n.mode,body:jh(o),font:r}},htmlBuilder(e,t){var n=em(e,t),r=Vh(e.body,n,!0);return Th.makeSpan(["mord","text"],r,n)},mathmlBuilder(e,t){var n=em(e,t);return cd(e.body,n)}}),Ph({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Jh(e.body,t),r=Th.makeLineSpan("underline-line",t),o=t.fontMetrics().defaultRuleThickness,i=Th.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 Th.makeSpan(["mord","underline"],[i],t)
|
|
428
|
+
},mathmlBuilder(e,t){var n=new od.MathNode("mo",[new od.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new od.MathNode("munder",[ud(e.body,t),n]);return r.setAttribute("accentunder","true"),r}}),Ph({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=Jh(e.body,t),r=t.fontMetrics().axisHeight,o=.5*(n.height-r-(n.depth+r));return Th.makeVList({positionType:"shift",positionData:o,children:[{type:"elem",elem:n}]},t)},mathmlBuilder:(e,t)=>new od.MathNode("mpadded",[ud(e.body,t)],["vcenter"])}),Ph({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new qc("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=tm(e),r=[],o=t.havingStyle(t.style.text()),i=0;i<n.length;i++){var a=n[i];"~"===a&&(a="\\textasciitilde"),r.push(Th.makeSymbol(a,"Typewriter-Regular",e.mode,o,["mord","texttt"]))}
|
|
429
|
+
return Th.makeSpan(["mord","text"].concat(o.sizingClasses(t)),Th.tryCombineChars(r),o)},mathmlBuilder(e,t){var n=new od.TextNode(tm(e)),r=new od.MathNode("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var tm=e=>e.body.replace(/ /g,e.star?"␣":" "),nm=Rh,rm=new RegExp("[̀-ͯ]+$");class om{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp("([ \r\n\t]+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧-豈-][̀-ͯ]*|[\ud800-\udbff][\udc00-\udfff][̀-ͯ]*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|(\\\\[a-zA-Z@]+)[ \r\n\t]*|\\\\[^\ud800-\udfff])","g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new Hc("EOF",new Uc(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new qc("Unexpected character: '"+e[t]+"'",new Hc(e[t],new Uc(this,t,t+1)));var r=n[6]||n[3]||(n[2]?"\\ ":" ")
|
|
430
|
+
;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 Hc(r,new Uc(this,t,this.tokenRegex.lastIndex))}}class im{constructor(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new qc("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){
|
|
431
|
+
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 am=up;hp("\\noexpand",(function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}})),hp("\\expandafter",(function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}})),hp("\\@firstoftwo",(function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}})),hp("\\@secondoftwo",(function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}})),hp("\\@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}})),
|
|
432
|
+
hp("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),hp("\\TextOrMath",(function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}}));var sm={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};hp("\\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 qc("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(null==(r=sm[n.text])||r>=t)throw new qc("Invalid base-"+t+" digit "+n.text);for(var o;null!=(o=sm[e.future().text])&&o<t;)r*=t,r+=o,e.popToken()}return"\\@char{"+r+"}"}));var lm=(e,t,n)=>{var r=e.consumeArg().tokens;if(1!==r.length)throw new qc("\\newcommand's first argument must be a macro name");var o=r[0].text,i=e.isDefined(o)
|
|
433
|
+
;if(i&&!t)throw new qc("\\newcommand{"+o+"} attempting to redefine "+o+"; use \\renewcommand");if(!i&&!n)throw new qc("\\renewcommand{"+o+"} when command "+o+" does not yet exist; use \\newcommand");var a=0;if(1===(r=e.consumeArg().tokens).length&&"["===r[0].text){for(var s="",l=e.expandNextToken();"]"!==l.text&&"EOF"!==l.text;)s+=l.text,l=e.expandNextToken();if(!s.match(/^\s*[0-9]+\s*$/))throw new qc("Invalid number of arguments: "+s);a=parseInt(s),r=e.consumeArg().tokens}return e.macros.set(o,{tokens:r,numArgs:a}),""};hp("\\newcommand",(e=>lm(e,!1,!0))),hp("\\renewcommand",(e=>lm(e,!0,!1))),hp("\\providecommand",(e=>lm(e,!0,!0))),hp("\\message",(e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map((e=>e.text)).join("")),""})),hp("\\errmessage",(e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map((e=>e.text)).join("")),""})),hp("\\show",(e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),nm[n],Uu.math[n],Uu.text[n]),""})),hp("\\bgroup","{"),hp("\\egroup","}"),
|
|
434
|
+
hp("~","\\nobreakspace"),hp("\\lq","`"),hp("\\rq","'"),hp("\\aa","\\r a"),hp("\\AA","\\r A"),hp("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),hp("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),hp("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),hp("ℬ","\\mathscr{B}"),hp("ℰ","\\mathscr{E}"),hp("ℱ","\\mathscr{F}"),hp("ℋ","\\mathscr{H}"),hp("ℐ","\\mathscr{I}"),hp("ℒ","\\mathscr{L}"),hp("ℳ","\\mathscr{M}"),hp("ℛ","\\mathscr{R}"),hp("ℭ","\\mathfrak{C}"),hp("ℌ","\\mathfrak{H}"),hp("ℨ","\\mathfrak{Z}"),hp("\\Bbbk","\\Bbb{k}"),hp("·","\\cdotp"),hp("\\llap","\\mathllap{\\textrm{#1}}"),hp("\\rlap","\\mathrlap{\\textrm{#1}}"),hp("\\clap","\\mathclap{\\textrm{#1}}"),hp("\\mathstrut","\\vphantom{(}"),hp("\\underbar","\\underline{\\text{#1}}"),hp("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),hp("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),hp("\\ne","\\neq"),hp("≠","\\neq"),
|
|
435
|
+
hp("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),hp("∉","\\notin"),hp("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),hp("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),hp("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),hp("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),hp("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),hp("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),hp("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),hp("⟂","\\perp"),hp("‼","\\mathclose{!\\mkern-0.8mu!}"),hp("∌","\\notni"),hp("⌜","\\ulcorner"),hp("⌝","\\urcorner"),hp("⌞","\\llcorner"),hp("⌟","\\lrcorner"),hp("©","\\copyright"),hp("®","\\textregistered"),hp("️","\\textregistered"),hp("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),
|
|
436
|
+
hp("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),hp("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),hp("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),hp("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),hp("⋮","\\vdots"),hp("\\varGamma","\\mathit{\\Gamma}"),hp("\\varDelta","\\mathit{\\Delta}"),hp("\\varTheta","\\mathit{\\Theta}"),hp("\\varLambda","\\mathit{\\Lambda}"),hp("\\varXi","\\mathit{\\Xi}"),hp("\\varPi","\\mathit{\\Pi}"),hp("\\varSigma","\\mathit{\\Sigma}"),hp("\\varUpsilon","\\mathit{\\Upsilon}"),hp("\\varPhi","\\mathit{\\Phi}"),hp("\\varPsi","\\mathit{\\Psi}"),hp("\\varOmega","\\mathit{\\Omega}"),hp("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),hp("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),hp("\\boxed","\\fbox{$\\displaystyle{#1}$}"),hp("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),hp("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),
|
|
437
|
+
hp("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var cm={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi",
|
|
438
|
+
"\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};hp("\\dots",(function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in cm?t=cm[n]:("\\not"===n.substr(0,4)||n in Uu.math&&Wc.contains(["bin","rel"],Uu.math[n].group))&&(t="\\dotsb"),t}));var um={")":!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};hp("\\dotso",(function(e){return e.future().text in um?"\\ldots\\,":"\\ldots"})),hp("\\dotsc",(function(e){var t=e.future().text;return t in um&&","!==t?"\\ldots\\,":"\\ldots"})),hp("\\cdots",(function(e){return e.future().text in um?"\\@cdots\\,":"\\@cdots"})),hp("\\dotsb","\\cdots"),hp("\\dotsm","\\cdots"),hp("\\dotsi","\\!\\cdots"),hp("\\dotsx","\\ldots\\,"),hp("\\DOTSI","\\relax"),hp("\\DOTSB","\\relax"),hp("\\DOTSX","\\relax"),hp("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),hp("\\,","\\tmspace+{3mu}{.1667em}"),hp("\\thinspace","\\,"),
|
|
439
|
+
hp("\\>","\\mskip{4mu}"),hp("\\:","\\tmspace+{4mu}{.2222em}"),hp("\\medspace","\\:"),hp("\\;","\\tmspace+{5mu}{.2777em}"),hp("\\thickspace","\\;"),hp("\\!","\\tmspace-{3mu}{.1667em}"),hp("\\negthinspace","\\!"),hp("\\negmedspace","\\tmspace-{4mu}{.2222em}"),hp("\\negthickspace","\\tmspace-{5mu}{.277em}"),hp("\\enspace","\\kern.5em "),hp("\\enskip","\\hskip.5em\\relax"),hp("\\quad","\\hskip1em\\relax"),hp("\\qquad","\\hskip2em\\relax"),hp("\\tag","\\@ifstar\\tag@literal\\tag@paren"),hp("\\tag@paren","\\tag@literal{({#1})}"),hp("\\tag@literal",(e=>{if(e.macros.get("\\df@tag"))throw new qc("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"})),hp("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),hp("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),hp("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),
|
|
440
|
+
hp("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),hp("\\pmb","\\html@mathml{\\@binrel{#1}{\\mathrlap{#1}\\kern0.5px#1}}{\\mathbf{#1}}"),hp("\\newline","\\\\\\relax"),hp("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var hm=Cu(du["Main-Regular"]["T".charCodeAt(0)][1]-.7*du["Main-Regular"]["A".charCodeAt(0)][1]);hp("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+hm+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),hp("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+hm+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),hp("\\hspace","\\@ifstar\\@hspacer\\@hspace"),hp("\\@hspace","\\hskip #1\\relax"),hp("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),hp("\\ordinarycolon",":"),hp("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),hp("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),
|
|
441
|
+
hp("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),hp("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),hp("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),hp("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),hp("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),hp("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),hp("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),hp("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),
|
|
442
|
+
hp("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),hp("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),hp("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),hp("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),hp("∷","\\dblcolon"),hp("∹","\\eqcolon"),hp("≔","\\coloneqq"),hp("≕","\\eqqcolon"),hp("⩴","\\Coloneqq"),hp("\\ratio","\\vcentcolon"),hp("\\coloncolon","\\dblcolon"),hp("\\colonequals","\\coloneqq"),hp("\\coloncolonequals","\\Coloneqq"),hp("\\equalscolon","\\eqqcolon"),hp("\\equalscoloncolon","\\Eqqcolon"),hp("\\colonminus","\\coloneq"),hp("\\coloncolonminus","\\Coloneq"),hp("\\minuscolon","\\eqcolon"),hp("\\minuscoloncolon","\\Eqcolon"),hp("\\coloncolonapprox","\\Colonapprox"),hp("\\coloncolonsim","\\Colonsim"),
|
|
443
|
+
hp("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),hp("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),hp("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),hp("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),hp("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),hp("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),hp("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),hp("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),hp("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),hp("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),hp("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),hp("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),hp("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),hp("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),hp("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),hp("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),
|
|
444
|
+
hp("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),hp("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),hp("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),hp("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),hp("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),hp("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),hp("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),hp("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),hp("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),hp("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),hp("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),hp("\\imath","\\html@mathml{\\@imath}{ı}"),hp("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),hp("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),hp("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),hp("⟦","\\llbracket"),hp("⟧","\\rrbracket"),hp("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),
|
|
445
|
+
hp("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),hp("⦃","\\lBrace"),hp("⦄","\\rBrace"),hp("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),hp("⦵","\\minuso"),hp("\\darr","\\downarrow"),hp("\\dArr","\\Downarrow"),hp("\\Darr","\\Downarrow"),hp("\\lang","\\langle"),hp("\\rang","\\rangle"),hp("\\uarr","\\uparrow"),hp("\\uArr","\\Uparrow"),hp("\\Uarr","\\Uparrow"),hp("\\N","\\mathbb{N}"),hp("\\R","\\mathbb{R}"),hp("\\Z","\\mathbb{Z}"),hp("\\alef","\\aleph"),hp("\\alefsym","\\aleph"),hp("\\Alpha","\\mathrm{A}"),hp("\\Beta","\\mathrm{B}"),hp("\\bull","\\bullet"),hp("\\Chi","\\mathrm{X}"),hp("\\clubs","\\clubsuit"),hp("\\cnums","\\mathbb{C}"),hp("\\Complex","\\mathbb{C}"),hp("\\Dagger","\\ddagger"),hp("\\diamonds","\\diamondsuit"),hp("\\empty","\\emptyset"),hp("\\Epsilon","\\mathrm{E}"),hp("\\Eta","\\mathrm{H}"),hp("\\exist","\\exists"),hp("\\harr","\\leftrightarrow"),
|
|
446
|
+
hp("\\hArr","\\Leftrightarrow"),hp("\\Harr","\\Leftrightarrow"),hp("\\hearts","\\heartsuit"),hp("\\image","\\Im"),hp("\\infin","\\infty"),hp("\\Iota","\\mathrm{I}"),hp("\\isin","\\in"),hp("\\Kappa","\\mathrm{K}"),hp("\\larr","\\leftarrow"),hp("\\lArr","\\Leftarrow"),hp("\\Larr","\\Leftarrow"),hp("\\lrarr","\\leftrightarrow"),hp("\\lrArr","\\Leftrightarrow"),hp("\\Lrarr","\\Leftrightarrow"),hp("\\Mu","\\mathrm{M}"),hp("\\natnums","\\mathbb{N}"),hp("\\Nu","\\mathrm{N}"),hp("\\Omicron","\\mathrm{O}"),hp("\\plusmn","\\pm"),hp("\\rarr","\\rightarrow"),hp("\\rArr","\\Rightarrow"),hp("\\Rarr","\\Rightarrow"),hp("\\real","\\Re"),hp("\\reals","\\mathbb{R}"),hp("\\Reals","\\mathbb{R}"),hp("\\Rho","\\mathrm{P}"),hp("\\sdot","\\cdot"),hp("\\sect","\\S"),hp("\\spades","\\spadesuit"),hp("\\sub","\\subset"),hp("\\sube","\\subseteq"),hp("\\supe","\\supseteq"),hp("\\Tau","\\mathrm{T}"),hp("\\thetasym","\\vartheta"),hp("\\weierp","\\wp"),hp("\\Zeta","\\mathrm{Z}"),hp("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),
|
|
447
|
+
hp("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),hp("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),hp("\\bra","\\mathinner{\\langle{#1}|}"),hp("\\ket","\\mathinner{|{#1}\\rangle}"),hp("\\braket","\\mathinner{\\langle{#1}\\rangle}"),hp("\\Bra","\\left\\langle#1\\right|"),hp("\\Ket","\\left|#1\\right\\rangle");var dm=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]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};hp("\\bra@ket",dm(!1)),hp("\\bra@set",dm(!0)),hp("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),
|
|
448
|
+
hp("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),hp("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),hp("\\angln","{\\angl n}"),hp("\\blue","\\textcolor{##6495ed}{#1}"),hp("\\orange","\\textcolor{##ffa500}{#1}"),hp("\\pink","\\textcolor{##ff00af}{#1}"),hp("\\red","\\textcolor{##df0030}{#1}"),hp("\\green","\\textcolor{##28ae7b}{#1}"),hp("\\gray","\\textcolor{gray}{#1}"),hp("\\purple","\\textcolor{##9d38bd}{#1}"),hp("\\blueA","\\textcolor{##ccfaff}{#1}"),hp("\\blueB","\\textcolor{##80f6ff}{#1}"),hp("\\blueC","\\textcolor{##63d9ea}{#1}"),hp("\\blueD","\\textcolor{##11accd}{#1}"),hp("\\blueE","\\textcolor{##0c7f99}{#1}"),hp("\\tealA","\\textcolor{##94fff5}{#1}"),hp("\\tealB","\\textcolor{##26edd5}{#1}"),hp("\\tealC","\\textcolor{##01d1c1}{#1}"),hp("\\tealD","\\textcolor{##01a995}{#1}"),hp("\\tealE","\\textcolor{##208170}{#1}"),hp("\\greenA","\\textcolor{##b6ffb0}{#1}"),hp("\\greenB","\\textcolor{##8af281}{#1}"),hp("\\greenC","\\textcolor{##74cf70}{#1}"),
|
|
449
|
+
hp("\\greenD","\\textcolor{##1fab54}{#1}"),hp("\\greenE","\\textcolor{##0d923f}{#1}"),hp("\\goldA","\\textcolor{##ffd0a9}{#1}"),hp("\\goldB","\\textcolor{##ffbb71}{#1}"),hp("\\goldC","\\textcolor{##ff9c39}{#1}"),hp("\\goldD","\\textcolor{##e07d10}{#1}"),hp("\\goldE","\\textcolor{##a75a05}{#1}"),hp("\\redA","\\textcolor{##fca9a9}{#1}"),hp("\\redB","\\textcolor{##ff8482}{#1}"),hp("\\redC","\\textcolor{##f9685d}{#1}"),hp("\\redD","\\textcolor{##e84d39}{#1}"),hp("\\redE","\\textcolor{##bc2612}{#1}"),hp("\\maroonA","\\textcolor{##ffbde0}{#1}"),hp("\\maroonB","\\textcolor{##ff92c6}{#1}"),hp("\\maroonC","\\textcolor{##ed5fa6}{#1}"),hp("\\maroonD","\\textcolor{##ca337c}{#1}"),hp("\\maroonE","\\textcolor{##9e034e}{#1}"),hp("\\purpleA","\\textcolor{##ddd7ff}{#1}"),hp("\\purpleB","\\textcolor{##c6b9fc}{#1}"),hp("\\purpleC","\\textcolor{##aa87ff}{#1}"),hp("\\purpleD","\\textcolor{##7854ab}{#1}"),hp("\\purpleE","\\textcolor{##543b78}{#1}"),hp("\\mintA","\\textcolor{##f5f9e8}{#1}"),
|
|
450
|
+
hp("\\mintB","\\textcolor{##edf2df}{#1}"),hp("\\mintC","\\textcolor{##e0e5cc}{#1}"),hp("\\grayA","\\textcolor{##f6f7f7}{#1}"),hp("\\grayB","\\textcolor{##f0f1f2}{#1}"),hp("\\grayC","\\textcolor{##e3e5e6}{#1}"),hp("\\grayD","\\textcolor{##d6d8da}{#1}"),hp("\\grayE","\\textcolor{##babec2}{#1}"),hp("\\grayF","\\textcolor{##888d93}{#1}"),hp("\\grayG","\\textcolor{##626569}{#1}"),hp("\\grayH","\\textcolor{##3b3e40}{#1}"),hp("\\grayI","\\textcolor{##21242c}{#1}"),hp("\\kaBlue","\\textcolor{##314453}{#1}"),hp("\\kaGreen","\\textcolor{##71B307}{#1}");var pm={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class mm{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 im(am,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new om(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){
|
|
451
|
+
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 Hc("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 qc("Extra }",r)}else if("EOF"===r.text)throw new qc("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
|
|
452
|
+
}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 qc("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 qc("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}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(null==r||e&&r.unexpandable){if(e&&null==r&&"\\"===n[0]&&!this.isDefined(n))throw new qc("Undefined control sequence: "+n);return this.pushToken(t),t}if(this.expansionCount++,this.expansionCount>this.settings.maxExpand)throw new qc("Too many expansions: infinite loop or need to increase maxExpand setting");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){
|
|
453
|
+
if(0===a)throw new qc("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 qc("Not a valid argument number",s);o.splice(a,2,...i[+s.text-1])}}}return this.pushTokens(o),o}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;){var e=this.expandOnce();if(e instanceof Hc)return e.treatAsRelax&&(e.text="\\relax"),this.stack.pop()}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Hc(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;){var r=this.expandOnce(!0);r instanceof Hc&&(r.treatAsRelax&&(r.noexpand=!1,r.treatAsRelax=!1),t.push(this.stack.pop()))}return t}expandMacroAsText(e){var t=this.expandMacro(e);return t?t.map((e=>e.text)).join(""):t}_getExpansion(e){var t=this.macros.get(e);if(null==t)return t;if(1===e.length){var n=this.lexer.catcodes[e];if(null!=n&&13!==n)return}var r="function"==typeof t?t(this):t
|
|
454
|
+
;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 om(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)||nm.hasOwnProperty(e)||Uu.math.hasOwnProperty(e)||Uu.text.hasOwnProperty(e)||pm.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:nm.hasOwnProperty(e)&&!nm[e].primitive}}var fm=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,gm=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8",
|
|
455
|
+
"⁹":"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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),vm={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},_m={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","ḉ":"ḉ","č":"č","ĉ":"ĉ","ċ":"ċ","ç":"ç","ď":"ď",
|
|
467
456
|
"ḋ":"ḋ","ḑ":"ḑ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ḝ":"ḝ","ě":"ě","ê":"ê","ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ȩ":"ȩ","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ģ":"ģ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","ḩ":"ḩ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ķ":"ķ","ĺ":"ĺ","ľ":"ľ","ļ":"ļ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ņ":"ņ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ","ŏ":"ŏ","ǒ":"ǒ","ô":"ô","ố":"ố","ồ":"ồ","ỗ":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","ṕ":"ṕ","ṗ":"ṗ","ŕ":"ŕ","ř":"ř","ṙ":"ṙ","ŗ":"ŗ","ś":"ś","ṥ":"ṥ","š":"š","ṧ":"ṧ","ŝ":"ŝ","ṡ":"ṡ","ş":"ş","ẗ":"ẗ","ť":"ť","ṫ":"ṫ","ţ":"ţ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","ṹ":"ṹ","ū":"ū","ṻ":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","ṽ":"ṽ","ẃ":"ẃ",
|
|
468
457
|
"ẁ":"ẁ","ẅ":"ẅ","ŵ":"ŵ","ẇ":"ẇ","ẘ":"ẘ","ẍ":"ẍ","ẋ":"ẋ","ý":"ý","ỳ":"ỳ","ÿ":"ÿ","ỹ":"ỹ","ȳ":"ȳ","ŷ":"ŷ","ẏ":"ẏ","ẙ":"ẙ","ź":"ź","ž":"ž","ẑ":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","Ắ":"Ắ","Ằ":"Ằ","Ẵ":"Ẵ","Ǎ":"Ǎ","Â":"Â","Ấ":"Ấ","Ầ":"Ầ","Ẫ":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","Ḃ":"Ḃ","Ć":"Ć","Ḉ":"Ḉ","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ç":"Ç","Ď":"Ď","Ḋ":"Ḋ","Ḑ":"Ḑ","É":"É","È":"È","Ë":"Ë","Ẽ":"Ẽ","Ē":"Ē","Ḗ":"Ḗ","Ḕ":"Ḕ","Ĕ":"Ĕ","Ḝ":"Ḝ","Ě":"Ě","Ê":"Ê","Ế":"Ế","Ề":"Ề","Ễ":"Ễ","Ė":"Ė","Ȩ":"Ȩ","Ḟ":"Ḟ","Ǵ":"Ǵ","Ḡ":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","Ģ":"Ģ","Ḧ":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","Ḣ":"Ḣ","Ḩ":"Ḩ","Í":"Í","Ì":"Ì","Ï":"Ï","Ḯ":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","Ḱ":"Ḱ","Ǩ":"Ǩ","Ķ":"Ķ","Ĺ":"Ĺ","Ľ":"Ľ","Ļ":"Ļ","Ḿ":"Ḿ","Ṁ":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","Ṅ":"Ṅ","Ņ":"Ņ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","Ṍ":"Ṍ","Ṏ":"Ṏ","Ȭ":"Ȭ","Ō":"Ō",
|
|
469
|
-
"Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ","Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ŗ":"Ŗ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ş":"Ş","Ť":"Ť","Ṫ":"Ṫ","Ţ":"Ţ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"};class
|
|
470
|
-
this.gullet=new
|
|
471
|
-
;if(t&&r.text===t)break;if(e&&
|
|
472
|
-
;return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t,n,r=this.parseGroup("atom",e);if("text"===this.mode)return r;for(;;){this.consumeSpaces();var o=this.fetch();if("\\limits"===o.text||"\\nolimits"===o.text){if(r&&"op"===r.type){var i="\\limits"===o.text;r.limits=i,r.alwaysHandleSupSub=!0}else{if(!r||"operatorname"!==r.type)throw new
|
|
473
|
-
if(!
|
|
474
|
-
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
|
|
475
|
-
;if(null==i)throw new
|
|
476
|
-
!(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
|
|
477
|
-
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:
|
|
478
|
-
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
|
|
479
|
-
type:s,mode:this.mode,loc:l,text:t};o=a}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(
|
|
480
|
-
;if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new
|
|
481
|
-
return
|
|
458
|
+
"Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ","Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ŗ":"Ŗ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ş":"Ş","Ť":"Ť","Ṫ":"Ṫ","Ţ":"Ţ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"};class bm{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",
|
|
459
|
+
this.gullet=new mm(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 qc("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Hc("}")),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!==bm.endOfExpression.indexOf(r.text))break
|
|
460
|
+
;if(t&&r.text===t)break;if(e&&nm[r.text]&&nm[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 qc("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){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var r=this.parseGroup(e);if(!r)throw new qc("Expected group after '"+n+"'",t);return r}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var r={type:"text",mode:this.mode,body:t}
|
|
461
|
+
;return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t,n,r=this.parseGroup("atom",e);if("text"===this.mode)return r;for(;;){this.consumeSpaces();var o=this.fetch();if("\\limits"===o.text||"\\nolimits"===o.text){if(r&&"op"===r.type){var i="\\limits"===o.text;r.limits=i,r.alwaysHandleSupSub=!0}else{if(!r||"operatorname"!==r.type)throw new qc("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 qc("Double superscript",o);t=this.handleSupSubscript("superscript")}else if("_"===o.text){if(n)throw new qc("Double subscript",o);n=this.handleSupSubscript("subscript")}else if("'"===o.text){if(t)throw new qc("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{
|
|
462
|
+
if(!gm[o.text])break;var l=gm[o.text],c=fm.test(o.text);for(this.consume();;){var u=this.fetch().text;if(!gm[u])break;if(fm.test(u)!==c)break;this.consume(),l+=gm[u]}var h=new bm(l,this.settings).parse();c?n={type:"ordgroup",mode:"math",body:h}:t={type:"ordgroup",mode:"math",body:h}}}return t||n?{type:"supsub",mode:this.mode,base:r,sup:t,sub:n}:r}parseFunction(e,t){var n=this.fetch(),r=n.text,o=nm[r];if(!o)return null;if(this.consume(),t&&"atom"!==t&&!o.allowedInArgument)throw new qc("Got function '"+r+"' with no arguments"+(t?" as "+t:""),n);if("text"===this.mode&&!o.allowedInText)throw new qc("Can't use function '"+r+"' in text mode",n);if("math"===this.mode&&!1===o.allowedInMath)throw new qc("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=nm[e];if(a&&a.handler)return a.handler(i,t,n);throw new qc("No function handler for "+e)}
|
|
463
|
+
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 qc("Null argument, please report this as a bug");r.push(l)}}return{args:r,optArgs:o}}parseGroupOfType(e,t,n){switch(t){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":var r=this.parseArgumentGroup(n,"text");return null!=r?{type:"styling",mode:r.mode,body:[r],style:"text"}:null;case"raw":var o=this.parseStringGroup("raw",n);return null!=o?{type:"raw",mode:"text",string:o.text}:null;case"primitive":if(n)throw new qc("A primitive argument cannot be optional");var i=this.parseGroup(e)
|
|
464
|
+
;if(null==i)throw new qc("Expected group as "+e,this.fetch());return i;case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new qc("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();if(""===i)throw new qc("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 qc("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(),
|
|
465
|
+
!(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 qc("Invalid size: '"+t.text+"'",t);var o={number:+(r[1]+r[2]),unit:r[3]};if(!ku(o))throw new qc("Invalid unit: '"+o.unit+"'",t);return{type:"size",mode:this.mode,value:o,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==t)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(null==n)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var o=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var i={type:"ordgroup",
|
|
466
|
+
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:Uc.range(r,s),body:a,semisimple:"\\begingroup"===o||void 0}}else if(null==(n=this.parseFunction(t,e)||this.parseSymbol())&&"\\"===o[0]&&!pm.hasOwnProperty(o)){if(this.settings.throwOnError)throw new qc("Undefined control sequence: "+o,r);n=this.formatUnsupportedCmd(o),this.consume()}return n}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n],o=r.text;"-"===o&&"-"===e[n+1].text&&(n+1<t&&"-"===e[n+2].text?(e.splice(n,3,{type:"textord",mode:"text",loc:Uc.range(r,e[n+2]),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:Uc.range(r,e[n+1]),text:"--"}),t-=1)),"'"!==o&&"`"!==o||e[n+1].text!==o||(e.splice(n,2,{type:"textord",mode:"text",loc:Uc.range(r,e[n+1]),
|
|
467
|
+
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 qc("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:n=n.slice(1,-1),star:r}}_m.hasOwnProperty(t[0])&&!Uu[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=_m[t[0]]+t.substr(1));var o,i=rm.exec(t);if(i&&("i"===(t=t.substring(0,i.index))?t="ı":"j"===t&&(t="ȷ")),Uu[this.mode][t]){this.settings.strict&&"math"===this.mode&&"ÐÞþ".indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var a,s=Uu[this.mode][t].group,l=Uc.range(e);if(Fu.hasOwnProperty(s)){var c=s;a={type:"atom",mode:this.mode,family:c,loc:l,text:t}}else a={
|
|
468
|
+
type:s,mode:this.mode,loc:l,text:t};o=a}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(cu(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:Uc.range(e),text:t}}if(this.consume(),i)for(var u=0;u<i[0].length;u++){var h=i[0][u];if(!vm[h])throw new qc("Unknown accent ' "+h+"'",e);var d=vm[h][this.mode]||vm[h].text;if(!d)throw new qc("Accent "+h+" unsupported in "+this.mode+" mode",e);o={type:"accent",mode:this.mode,loc:Uc.range(e),label:d,isStretchy:!1,isShifty:!0,base:o}}return o}}bm.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var ym=function(e,t){if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new bm(e,t);delete n.gullet.macros.current["\\df@tag"];var r=n.parse()
|
|
469
|
+
;if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new qc("\\tag works only in display equations");r=[{type:"tag",mode:"text",body:r,tag:n.subparse([new Hc("\\df@tag")])}]}return 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."));var wm=function(e,t,n){if(n.throwOnError||!(e instanceof qc))throw e;var r=Th.makeSpan(["katex-error"],[new Ru(t)]);return r.setAttribute("title",e.toString()),r.setAttribute("style","color:"+n.errorColor),r},xm=function(e,t){var n=new Zc(t);try{return function(e,t,n){var r,o=dd(n);if("mathml"===n.output)return hd(e,t,o,n.displayMode,!0);if("html"===n.output){var i=ed(e,o);r=Th.makeSpan(["katex"],[i])}else{var a=hd(e,t,o,n.displayMode,!1),s=ed(e,o);r=Th.makeSpan(["katex"],[a,s])}return pd(r,n)}(ym(e,n),e,n)}catch(t){
|
|
470
|
+
return wm(t,e,n)}},km=function(e,t){return xm(e,t).toMarkup()},Sm={exports:{}};!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,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,
|
|
482
471
|
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:{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"},
|
|
483
472
|
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"},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:{
|
|
484
473
|
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,describe:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,describe:"Support for HTML Tag escaping. ex: <div>foo</div>",type:"boolean"},emoji:{defaultValue:!1,describe:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,describe:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`",type:"boolean"},ellipsis:{defaultValue:!0,describe:"Replaces three dots with the ellipsis unicode character",type:"boolean"},completeHTMLDocument:{
|
|
@@ -488,8 +477,8 @@ o.error=a+"type "+l+' is not recognized. Valid values: "lang/language", "output/
|
|
|
488
477
|
if(n.helper.isString(s.regex)&&(s.regex=new RegExp(s.regex,"g")),!(s.regex instanceof RegExp))return o.valid=!1,o.error=a+'"regex" property must either be a string or a RegExp object, but '+typeof s.regex+" given",o;if(n.helper.isUndefined(s.replace))return o.valid=!1,o.error=a+'"regex" extensions must implement a replace string or function',o}}return o}function c(e,t){return"¨E"+t.charCodeAt(0)+"E"}n.helper={},n.extensions={},n.setOption=function(e,t){return i[e]=t,this},n.getOption=function(e){return i[e]},n.getOptions=function(){return i},n.resetOptions=function(){i=t(!0)},n.setFlavor=function(e){if(!s.hasOwnProperty(e))throw Error(e+" flavor was not found");n.resetOptions();var t=s[e];for(var r in a=e,t)t.hasOwnProperty(r)&&(i[r]=t[r])},n.getFlavor=function(){return a},n.getFlavorOptions=function(e){if(s.hasOwnProperty(e))return s[e]},n.getDefaultOptions=function(e){return t(e)},n.subParser=function(e,t){if(n.helper.isString(e)){if(void 0===t){if(r.hasOwnProperty(e))return r[e]
|
|
489
478
|
;throw Error("SubParser named "+e+" not registered!")}r[e]=t}},n.extension=function(e,t){if(!n.helper.isString(e))throw Error("Extension 'name' must be a string");if(e=n.helper.stdExtName(e),n.helper.isUndefined(t)){if(!o.hasOwnProperty(e))throw Error("Extension named "+e+" is not registered!");return o[e]}"function"==typeof t&&(t=t()),n.helper.isArray(t)||(t=[t]);var r=l(t,e);if(!r.valid)throw Error(r.error);o[e]=t},n.getAllExtensions=function(){return o},n.removeExtension=function(e){delete o[e]},n.resetExtensions=function(){o={}},n.validateExtension=function(e){var t=l(e,null);return!!t.valid||(console.warn(t.error),!1)},n.hasOwnProperty("helper")||(n.helper={}),n.helper.isString=function(e){return"string"==typeof e||e instanceof String},n.helper.isFunction=function(e){return e&&"[object Function]"==={}.toString.call(e)},n.helper.isArray=function(e){return Array.isArray(e)},n.helper.isUndefined=function(e){return void 0===e},n.helper.forEach=function(e,t){
|
|
490
479
|
if(n.helper.isUndefined(e))throw new Error("obj param is required");if(n.helper.isUndefined(t))throw new Error("callback param is required");if(!n.helper.isFunction(t))throw new Error("callback param must be a function/closure");if("function"==typeof e.forEach)e.forEach(t);else if(n.helper.isArray(e))for(var r=0;r<e.length;r++)t(e[r],r,e);else{if("object"!=typeof e)throw new Error("obj does not seem to be an array or an iterable object");for(var o in e)e.hasOwnProperty(o)&&t(e[o],o,e)}},n.helper.stdExtName=function(e){return e.replace(/[_?*+\/\\.^-]/g,"").replace(/\s/g,"").toLowerCase()},n.helper.escapeCharactersCallback=c,n.helper.escapeCharacters=function(e,t,n){var r="(["+t.replace(/([\[\]\\])/g,"\\$1")+"])";n&&(r="\\\\"+r);var o=new RegExp(r,"g");return e=e.replace(o,c)},n.helper.unescapeHTMLEntities=function(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")};var u=function(e,t,n,r){
|
|
491
|
-
var o,i,a,s,l,c=r||"",u=c.indexOf("g")>-1,
|
|
492
|
-
;for(var
|
|
480
|
+
var o,i,a,s,l,c=r||"",u=c.indexOf("g")>-1,h=new RegExp(t+"|"+n,"g"+c.replace(/g/g,"")),d=new RegExp(t,c.replace(/g/g,"")),p=[];do{for(o=0;a=h.exec(e);)if(d.test(a[0]))o++||(s=(i=h.lastIndex)-a[0].length);else if(o&&!--o){l=a.index+a[0].length;var m={left:{start:s,end:i},match:{start:i,end:a.index},right:{start:a.index,end:l},wholeMatch:{start:s,end:l}};if(p.push(m),!u)return p}}while(o&&(h.lastIndex=i));return p};n.helper.matchRecursiveRegExp=function(e,t,n,r){for(var o=u(e,t,n,r),i=[],a=0;a<o.length;++a)i.push([e.slice(o[a].wholeMatch.start,o[a].wholeMatch.end),e.slice(o[a].match.start,o[a].match.end),e.slice(o[a].left.start,o[a].left.end),e.slice(o[a].right.start,o[a].right.end)]);return i},n.helper.replaceRecursiveRegExp=function(e,t,r,o,i){if(!n.helper.isFunction(t)){var a=t;t=function(){return a}}var s=u(e,r,o,i),l=e,c=s.length;if(c>0){var h=[];0!==s[0].wholeMatch.start&&h.push(e.slice(0,s[0].wholeMatch.start))
|
|
481
|
+
;for(var d=0;d<c;++d)h.push(t(e.slice(s[d].wholeMatch.start,s[d].wholeMatch.end),e.slice(s[d].match.start,s[d].match.end),e.slice(s[d].left.start,s[d].left.end),e.slice(s[d].right.start,s[d].right.end))),d<c-1&&h.push(e.slice(s[d].wholeMatch.end,s[d+1].wholeMatch.start));s[c-1].wholeMatch.end<e.length&&h.push(e.slice(s[c-1].wholeMatch.end)),l=h.join("")}return l},n.helper.regexIndexOf=function(e,t,r){if(!n.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";if(t instanceof RegExp==!1)throw"InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp";var o=e.substring(r||0).search(t);return o>=0?o+(r||0):o},n.helper.splitAtIndex=function(e,t){if(!n.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[e.substring(0,t),e.substring(t)]},n.helper.encodeEmailAddress=function(e){var t=[function(e){
|
|
493
482
|
return"&#"+e.charCodeAt(0)+";"},function(e){return"&#x"+e.charCodeAt(0).toString(16)+";"},function(e){return e}];return e=e.replace(/./g,(function(e){if("@"===e)e=t[Math.floor(2*Math.random())](e);else{var n=Math.random();e=n>.9?t[2](e):n>.45?t[1](e):t[0](e)}return e})),e},n.helper.padEnd=function(e,t,n){return t>>=0,n=String(n||" "),e.length>t?String(e):((t-=e.length)>n.length&&(n+=n.repeat(t/n.length)),String(e)+n.slice(0,t))},"undefined"==typeof console&&(console={warn:function(e){alert(e)},log:function(e){alert(e)},error:function(e){throw e}}),n.helper.regexes={asteriskDashAndColon:/([*_:~])/g},n.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",
|
|
494
483
|
arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",
|
|
495
484
|
beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴‍♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱‍♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇‍♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",
|
|
@@ -510,16 +499,16 @@ shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",si
|
|
|
510
499
|
star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄‍♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊‍♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁‍♂️",tired_face:"😫",
|
|
511
500
|
tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶‍♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",
|
|
512
501
|
wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️‍♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩‍🎨",woman_astronaut:"👩‍🚀",woman_cartwheeling:"🤸‍♀️",woman_cook:"👩‍🍳",woman_facepalming:"🤦‍♀️",woman_factory_worker:"👩‍🏭",woman_farmer:"👩‍🌾",woman_firefighter:"👩‍🚒",woman_health_worker:"👩‍⚕️",woman_judge:"👩‍⚖️",woman_juggling:"🤹‍♀️",woman_mechanic:"👩‍🔧",woman_office_worker:"👩‍💼",woman_pilot:"👩‍✈️",woman_playing_handball:"🤾‍♀️",
|
|
513
|
-
woman_playing_water_polo:"🤽‍♀️",woman_scientist:"👩‍🔬",woman_shrugging:"🤷‍♀️",woman_singer:"👩‍🎤",woman_student:"👩‍🎓",woman_teacher:"👩‍🏫",woman_technologist:"👩‍💻",woman_with_turban:"👳‍♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼‍♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:'<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',showdown:"<span style=\"font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;\">S</span>"},n.Converter=function(e){var t={},r=[],c=[],u={},
|
|
502
|
+
woman_playing_water_polo:"🤽‍♀️",woman_scientist:"👩‍🔬",woman_shrugging:"🤷‍♀️",woman_singer:"👩‍🎤",woman_student:"👩‍🎓",woman_teacher:"👩‍🏫",woman_technologist:"👩‍💻",woman_with_turban:"👳‍♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼‍♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:'<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',showdown:"<span style=\"font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;\">S</span>"},n.Converter=function(e){var t={},r=[],c=[],u={},h=a,d={parsed:{},raw:"",format:""};function p(e,t){if(t=t||null,n.helper.isString(e)){if(t=e=n.helper.stdExtName(e),
|
|
514
503
|
n.extensions[e])return console.warn("DEPRECATION WARNING: "+e+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),void function(e,t){"function"==typeof e&&(e=e(new n.Converter));n.helper.isArray(e)||(e=[e]);var o=l(e,t);if(!o.valid)throw Error(o.error);for(var i=0;i<e.length;++i)switch(e[i].type){case"lang":r.push(e[i]);break;case"output":c.push(e[i]);break;default:throw Error("Extension loader error: Type unrecognized!!!")}}(n.extensions[e],e);if(n.helper.isUndefined(o[e]))throw Error('Extension "'+e+'" could not be loaded. It was either not found or is not a valid extension.');e=o[e]}"function"==typeof e&&(e=e()),n.helper.isArray(e)||(e=[e]);var i=l(e,t);if(!i.valid)throw Error(i.error);for(var a=0;a<e.length;++a){switch(e[a].type){case"lang":r.push(e[a]);break;case"output":c.push(e[a])}if(e[a].hasOwnProperty("listeners"))for(var s in e[a].listeners)e[a].listeners.hasOwnProperty(s)&&m(s,e[a].listeners[s])}}function m(e,t){
|
|
515
504
|
if(!n.helper.isString(e))throw Error("Invalid argument in converter.listen() method: name must be a string, but "+typeof e+" given");if("function"!=typeof t)throw Error("Invalid argument in converter.listen() method: callback must be a function, but "+typeof t+" given");u.hasOwnProperty(e)||(u[e]=[]),u[e].push(t)}!function(){for(var r in e=e||{},i)i.hasOwnProperty(r)&&(t[r]=i[r]);if("object"!=typeof e)throw Error("Converter expects the passed parameter to be an object, but "+typeof e+" was passed instead.");for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.extensions&&n.helper.forEach(t.extensions,p)}(),this._dispatch=function(e,t,n,r){if(u.hasOwnProperty(e))for(var o=0;o<u[e].length;++o){var i=u[e][o](e,t,this,n,r);i&&void 0!==i&&(t=i)}return t},this.listen=function(e,t){return m(e,t),this},this.makeHtml=function(e){if(!e)return e;var o={gHtmlBlocks:[],gHtmlMdBlocks:[],gHtmlSpans:[],gUrls:{},gTitles:{},gDimensions:{},gListLevel:0,hashLinkCounts:{},langExtensions:r,outputModifiers:c,converter:this,
|
|
516
|
-
ghCodeBlocks:[],metadata:{parsed:{},raw:"",format:""}};return e=(e=(e=(e=(e=e.replace(/¨/g,"¨T")).replace(/\$/g,"¨D")).replace(/\r\n/g,"\n")).replace(/\r/g,"\n")).replace(/\u00A0/g," "),t.smartIndentationFix&&(e=function(e){var t=e.match(/^\s*/)[0].length,n=new RegExp("^\\s{0,"+t+"}","gm");return e.replace(n,"")}(e)),e="\n\n"+e+"\n\n",e=(e=n.subParser("detab")(e,t,o)).replace(/^[ \t]+$/gm,""),n.helper.forEach(r,(function(r){e=n.subParser("runExtension")(r,e,t,o)})),e=n.subParser("metadata")(e,t,o),e=n.subParser("hashPreCodeTags")(e,t,o),e=n.subParser("githubCodeBlocks")(e,t,o),e=n.subParser("hashHTMLBlocks")(e,t,o),e=n.subParser("hashCodeTags")(e,t,o),e=n.subParser("stripLinkDefinitions")(e,t,o),e=n.subParser("blockGamut")(e,t,o),e=n.subParser("unhashHTMLSpans")(e,t,o),e=(e=(e=n.subParser("unescapeSpecialChars")(e,t,o)).replace(/¨D/g,"$$")).replace(/¨T/g,"¨"),e=n.subParser("completeHTMLDocument")(e,t,o),n.helper.forEach(c,(function(r){e=n.subParser("runExtension")(r,e,t,o)})),
|
|
505
|
+
ghCodeBlocks:[],metadata:{parsed:{},raw:"",format:""}};return e=(e=(e=(e=(e=e.replace(/¨/g,"¨T")).replace(/\$/g,"¨D")).replace(/\r\n/g,"\n")).replace(/\r/g,"\n")).replace(/\u00A0/g," "),t.smartIndentationFix&&(e=function(e){var t=e.match(/^\s*/)[0].length,n=new RegExp("^\\s{0,"+t+"}","gm");return e.replace(n,"")}(e)),e="\n\n"+e+"\n\n",e=(e=n.subParser("detab")(e,t,o)).replace(/^[ \t]+$/gm,""),n.helper.forEach(r,(function(r){e=n.subParser("runExtension")(r,e,t,o)})),e=n.subParser("metadata")(e,t,o),e=n.subParser("hashPreCodeTags")(e,t,o),e=n.subParser("githubCodeBlocks")(e,t,o),e=n.subParser("hashHTMLBlocks")(e,t,o),e=n.subParser("hashCodeTags")(e,t,o),e=n.subParser("stripLinkDefinitions")(e,t,o),e=n.subParser("blockGamut")(e,t,o),e=n.subParser("unhashHTMLSpans")(e,t,o),e=(e=(e=n.subParser("unescapeSpecialChars")(e,t,o)).replace(/¨D/g,"$$")).replace(/¨T/g,"¨"),e=n.subParser("completeHTMLDocument")(e,t,o),n.helper.forEach(c,(function(r){e=n.subParser("runExtension")(r,e,t,o)})),d=o.metadata,e},
|
|
517
506
|
this.makeMarkdown=this.makeMd=function(e,t){if(e=(e=(e=e.replace(/\r\n/g,"\n")).replace(/\r/g,"\n")).replace(/>[ \t]+</,">¨NBSP;<"),!t){if(!window||!window.document)throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");t=window.document}var r=t.createElement("div");r.innerHTML=e;var o={preList:function(e){for(var t=e.querySelectorAll("pre"),r=[],o=0;o<t.length;++o)if(1===t[o].childElementCount&&"code"===t[o].firstChild.tagName.toLowerCase()){var i=t[o].firstChild.innerHTML.trim(),a=t[o].firstChild.getAttribute("data-language")||"";if(""===a)for(var s=t[o].firstChild.className.split(" "),l=0;l<s.length;++l){var c=s[l].match(/^language-(.+)$/);if(null!==c){a=c[1];break}}i=n.helper.unescapeHTMLEntities(i),r.push(i),t[o].outerHTML='<precode language="'+a+'" precodenum="'+o.toString()+'"></precode>'}else r.push(t[o].innerHTML),t[o].innerHTML="",t[o].setAttribute("prenum",o.toString());return r}(r)};!function e(t){
|
|
518
|
-
for(var n=0;n<t.childNodes.length;++n){var r=t.childNodes[n];3===r.nodeType?/\S/.test(r.nodeValue)||/^[ ]+$/.test(r.nodeValue)?(r.nodeValue=r.nodeValue.split("\n").join(" "),r.nodeValue=r.nodeValue.replace(/(\s)+/g,"$1")):(t.removeChild(r),--n):1===r.nodeType&&e(r)}}(r);for(var i=r.childNodes,a="",s=0;s<i.length;s++)a+=n.subParser("makeMarkdown.node")(i[s],o);return a},this.setOption=function(e,n){t[e]=n},this.getOption=function(e){return t[e]},this.getOptions=function(){return t},this.addExtension=function(e,t){p(e,t=t||null)},this.useExtension=function(e){p(e)},this.setFlavor=function(e){if(!s.hasOwnProperty(e))throw Error(e+" flavor was not found");var n=s[e];for(var r in
|
|
519
|
-
this.getMetadata=function(e){return e?
|
|
507
|
+
for(var n=0;n<t.childNodes.length;++n){var r=t.childNodes[n];3===r.nodeType?/\S/.test(r.nodeValue)||/^[ ]+$/.test(r.nodeValue)?(r.nodeValue=r.nodeValue.split("\n").join(" "),r.nodeValue=r.nodeValue.replace(/(\s)+/g,"$1")):(t.removeChild(r),--n):1===r.nodeType&&e(r)}}(r);for(var i=r.childNodes,a="",s=0;s<i.length;s++)a+=n.subParser("makeMarkdown.node")(i[s],o);return a},this.setOption=function(e,n){t[e]=n},this.getOption=function(e){return t[e]},this.getOptions=function(){return t},this.addExtension=function(e,t){p(e,t=t||null)},this.useExtension=function(e){p(e)},this.setFlavor=function(e){if(!s.hasOwnProperty(e))throw Error(e+" flavor was not found");var n=s[e];for(var r in h=e,n)n.hasOwnProperty(r)&&(t[r]=n[r])},this.getFlavor=function(){return h},this.removeExtension=function(e){n.helper.isArray(e)||(e=[e]);for(var t=0;t<e.length;++t){for(var o=e[t],i=0;i<r.length;++i)r[i]===o&&r.splice(i,1);for(var a=0;a<c.length;++a)c[a]===o&&c.splice(a,1)}},this.getAllExtensions=function(){return{language:r,output:c}},
|
|
508
|
+
this.getMetadata=function(e){return e?d.raw:d.parsed},this.getMetadataFormat=function(){return d.format},this._setMetadataPair=function(e,t){d.parsed[e]=t},this._setMetadataFormat=function(e){d.format=e},this._setMetadataRaw=function(e){d.raw=e}},n.subParser("anchors",(function(e,t,r){var o=function(e,o,i,a,s,l,c){if(n.helper.isUndefined(c)&&(c=""),i=i.toLowerCase(),e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)a="";else if(!a){if(i||(i=o.toLowerCase().replace(/ ?\n/g," ")),a="#"+i,n.helper.isUndefined(r.gUrls[i]))return e;a=r.gUrls[i],n.helper.isUndefined(r.gTitles[i])||(c=r.gTitles[i])}var u='<a href="'+(a=a.replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback))+'"';return""!==c&&null!==c&&(u+=' title="'+(c=(c=c.replace(/"/g,""")).replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback))+'"'),t.openLinksInNewWindow&&!/^#/.test(a)&&(u+=' rel="noopener noreferrer" target="¨E95Eblank"'),u+=">"+o+"</a>"}
|
|
520
509
|
;return e=(e=(e=(e=(e=r.converter._dispatch("anchors.before",e,t,r)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,o)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,o)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,o)).replace(/\[([^\[\]]+)]()()()()()/g,o),t.ghMentions&&(e=e.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gim,(function(e,r,o,i,a){if("\\"===o)return r+i;if(!n.helper.isString(t.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var s=t.ghMentionsLink.replace(/\{u}/g,a),l="";return t.openLinksInNewWindow&&(l=' rel="noopener noreferrer" target="¨E95Eblank"'),r+'<a href="'+s+'"'+l+">"+i+"</a>"}))),e=r.converter._dispatch("anchors.after",e,t,r)}))
|
|
521
|
-
;var
|
|
522
|
-
i=n.helper.encodeEmailAddress(i)):a+=i,o+'<a href="'+a+'">'+i+"</a>"}};n.subParser("autoLinks",(function(e,t,n){return e=(e=(e=n.converter._dispatch("autoLinks.before",e,t,n)).replace(p,g(t))).replace(f,v(t,n)),e=n.converter._dispatch("autoLinks.after",e,t,n)})),n.subParser("simplifiedAutoLinks",(function(e,t,n){return t.simplifiedAutoLink?(e=n.converter._dispatch("simplifiedAutoLinks.before",e,t,n),e=(e=t.excludeTrailingPunctuationFromURLs?e.replace(
|
|
510
|
+
;var h=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,d=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,p=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,m=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gim,f=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,g=function(e){return function(t,r,o,i,a,s,l){var c=o=o.replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback),u="",h="",d=r||"",p=l||"";return/^www\./i.test(o)&&(o=o.replace(/^www\./i,"http://www.")),e.excludeTrailingPunctuationFromURLs&&s&&(u=s),e.openLinksInNewWindow&&(h=' rel="noopener noreferrer" target="¨E95Eblank"'),d+'<a href="'+o+'"'+h+">"+c+"</a>"+u+p}},v=function(e,t){return function(r,o,i){var a="mailto:";return o=o||"",i=n.subParser("unescapeSpecialChars")(i,e,t),e.encodeEmails?(a=n.helper.encodeEmailAddress(a+i),
|
|
511
|
+
i=n.helper.encodeEmailAddress(i)):a+=i,o+'<a href="'+a+'">'+i+"</a>"}};n.subParser("autoLinks",(function(e,t,n){return e=(e=(e=n.converter._dispatch("autoLinks.before",e,t,n)).replace(p,g(t))).replace(f,v(t,n)),e=n.converter._dispatch("autoLinks.after",e,t,n)})),n.subParser("simplifiedAutoLinks",(function(e,t,n){return t.simplifiedAutoLink?(e=n.converter._dispatch("simplifiedAutoLinks.before",e,t,n),e=(e=t.excludeTrailingPunctuationFromURLs?e.replace(d,g(t)):e.replace(h,g(t))).replace(m,v(t,n)),e=n.converter._dispatch("simplifiedAutoLinks.after",e,t,n)):e})),n.subParser("blockGamut",(function(e,t,r){return e=r.converter._dispatch("blockGamut.before",e,t,r),e=n.subParser("blockQuotes")(e,t,r),e=n.subParser("headers")(e,t,r),e=n.subParser("horizontalRule")(e,t,r),e=n.subParser("lists")(e,t,r),e=n.subParser("codeBlocks")(e,t,r),e=n.subParser("tables")(e,t,r),e=n.subParser("hashHTMLBlocks")(e,t,r),e=n.subParser("paragraphs")(e,t,r),e=r.converter._dispatch("blockGamut.after",e,t,r)})),
|
|
523
512
|
n.subParser("blockQuotes",(function(e,t,r){e=r.converter._dispatch("blockQuotes.before",e,t,r),e+="\n\n";var o=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return t.splitAdjacentBlockquotes&&(o=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),e=e.replace(o,(function(e){return e=(e=(e=e.replace(/^[ \t]*>[ \t]?/gm,"")).replace(/¨0/g,"")).replace(/^[ \t]+$/gm,""),e=n.subParser("githubCodeBlocks")(e,t,r),e=(e=(e=n.subParser("blockGamut")(e,t,r)).replace(/(^|\n)/g,"$1 ")).replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,(function(e,t){var n=t;return n=(n=n.replace(/^ /gm,"¨0")).replace(/¨0/g,"")})),n.subParser("hashBlock")("<blockquote>\n"+e+"\n</blockquote>",t,r)})),e=r.converter._dispatch("blockQuotes.after",e,t,r)})),n.subParser("codeBlocks",(function(e,t,r){e=r.converter._dispatch("codeBlocks.before",e,t,r);return e=(e=(e+="¨0").replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g,(function(e,o,i){var a=o,s=i,l="\n";return a=n.subParser("outdent")(a,t,r),a=n.subParser("encodeCode")(a,t,r),
|
|
524
513
|
a=(a=(a=n.subParser("detab")(a,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,""),t.omitExtraWLInCodeBlocks&&(l=""),a="<pre><code>"+a+l+"</code></pre>",n.subParser("hashBlock")(a,t,r)+s}))).replace(/¨0/,""),e=r.converter._dispatch("codeBlocks.after",e,t,r)})),n.subParser("codeSpans",(function(e,t,r){return void 0===(e=r.converter._dispatch("codeSpans.before",e,t,r))&&(e=""),e=e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,(function(e,o,i,a){var s=a;return s=(s=s.replace(/^([ \t]*)/g,"")).replace(/[ \t]*$/g,""),s=o+"<code>"+(s=n.subParser("encodeCode")(s,t,r))+"</code>",s=n.subParser("hashHTMLSpans")(s,t,r)})),e=r.converter._dispatch("codeSpans.after",e,t,r)})),n.subParser("completeHTMLDocument",(function(e,t,n){if(!t.completeHTMLDocument)return e;e=n.converter._dispatch("completeHTMLDocument.before",e,t,n);var r="html",o="<!DOCTYPE HTML>\n",i="",a='<meta charset="utf-8">\n',s="",l="";for(var c in void 0!==n.metadata.parsed.doctype&&(o="<!DOCTYPE "+n.metadata.parsed.doctype+">\n",
|
|
525
514
|
"html"!==(r=n.metadata.parsed.doctype.toString().toLowerCase())&&"html5"!==r||(a='<meta charset="utf-8">')),n.metadata.parsed)if(n.metadata.parsed.hasOwnProperty(c))switch(c.toLowerCase()){case"doctype":break;case"title":i="<title>"+n.metadata.parsed.title+"</title>\n";break;case"charset":a="html"===r||"html5"===r?'<meta charset="'+n.metadata.parsed.charset+'">\n':'<meta name="charset" content="'+n.metadata.parsed.charset+'">\n';break;case"language":case"lang":s=' lang="'+n.metadata.parsed[c]+'"',l+='<meta name="'+c+'" content="'+n.metadata.parsed[c]+'">\n';break;default:l+='<meta name="'+c+'" content="'+n.metadata.parsed[c]+'">\n'}return e=o+"<html"+s+">\n<head>\n"+i+a+l+"</head>\n<body>\n"+e.trim()+"\n</body>\n</html>",e=n.converter._dispatch("completeHTMLDocument.after",e,t,n)})),n.subParser("detab",(function(e,t,n){return e=(e=(e=(e=n.converter._dispatch("detab.before",e,t,n)).replace(/\t(?=\t)/g," ")).replace(/\t/g,"¨A¨B")).replace(/¨B(.+?)¨A/g,(function(e,t){
|
|
@@ -527,140 +516,140 @@ for(var n=t,r=4-n.length%4,o=0;o<r;o++)n+=" ";return n})),e=(e=e.replace(/¨A/g,
|
|
|
527
516
|
return e=(e=(e=r.converter._dispatch("encodeBackslashEscapes.before",e,t,r)).replace(/\\(\\)/g,n.helper.escapeCharactersCallback)).replace(/\\([`*_{}\[\]()>#+.!~=|:-])/g,n.helper.escapeCharactersCallback),e=r.converter._dispatch("encodeBackslashEscapes.after",e,t,r)})),n.subParser("encodeCode",(function(e,t,r){return e=(e=r.converter._dispatch("encodeCode.before",e,t,r)).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/([*_{}\[\]\\=~-])/g,n.helper.escapeCharactersCallback),e=r.converter._dispatch("encodeCode.after",e,t,r)})),n.subParser("escapeSpecialCharsWithinTagAttributes",(function(e,t,r){return e=(e=(e=r.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",e,t,r)).replace(/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,(function(e){return e.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,n.helper.escapeCharactersCallback)}))).replace(/<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi,(function(e){return e.replace(/([\\`*_~=|])/g,n.helper.escapeCharactersCallback)})),
|
|
528
517
|
e=r.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",e,t,r)})),n.subParser("githubCodeBlocks",(function(e,t,r){return t.ghCodeBlocks?(e=r.converter._dispatch("githubCodeBlocks.before",e,t,r),e=(e=(e+="¨0").replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,(function(e,o,i,a){var s=t.omitExtraWLInCodeBlocks?"":"\n";return a=n.subParser("encodeCode")(a,t,r),a="<pre><code"+(i?' class="'+i+" language-"+i+'"':"")+">"+(a=(a=(a=n.subParser("detab")(a,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,""))+s+"</code></pre>",a=n.subParser("hashBlock")(a,t,r),"\n\n¨G"+(r.ghCodeBlocks.push({text:e,codeblock:a})-1)+"G\n\n"}))).replace(/¨0/,""),r.converter._dispatch("githubCodeBlocks.after",e,t,r)):e})),n.subParser("hashBlock",(function(e,t,n){return e=(e=n.converter._dispatch("hashBlock.before",e,t,n)).replace(/(^\n+|\n+$)/g,""),e="\n\n¨K"+(n.gHtmlBlocks.push(e)-1)+"K\n\n",e=n.converter._dispatch("hashBlock.after",e,t,n)})),n.subParser("hashCodeTags",(function(e,t,r){
|
|
529
518
|
e=r.converter._dispatch("hashCodeTags.before",e,t,r);return e=n.helper.replaceRecursiveRegExp(e,(function(e,o,i,a){var s=i+n.subParser("encodeCode")(o,t,r)+a;return"¨C"+(r.gHtmlSpans.push(s)-1)+"C"}),"<code\\b[^>]*>","</code>","gim"),e=r.converter._dispatch("hashCodeTags.after",e,t,r)})),n.subParser("hashElement",(function(e,t,n){return function(e,t){var r=t;return r=(r=(r=r.replace(/\n\n/g,"\n")).replace(/^\n/,"")).replace(/\n+$/g,""),r="\n\n¨K"+(n.gHtmlBlocks.push(r)-1)+"K\n\n"}})),n.subParser("hashHTMLBlocks",(function(e,t,r){e=r.converter._dispatch("hashHTMLBlocks.before",e,t,r);var o=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],i=function(e,t,n,o){var i=e;return-1!==n.search(/\bmarkdown\b/)&&(i=n+r.converter.makeHtml(t)+o),"\n\n¨K"+(r.gHtmlBlocks.push(i)-1)+"K\n\n"}
|
|
530
|
-
;t.backslashEscapesHTMLTags&&(e=e.replace(/\\<(\/?[^>]+?)>/g,(function(e,t){return"<"+t+">"})));for(var a=0;a<o.length;++a)for(var s,l=new RegExp("^ {0,3}(<"+o[a]+"\\b[^>]*>)","im"),c="<"+o[a]+"\\b[^>]*>",u="</"+o[a]+">";-1!==(s=n.helper.regexIndexOf(e,l));){var
|
|
519
|
+
;t.backslashEscapesHTMLTags&&(e=e.replace(/\\<(\/?[^>]+?)>/g,(function(e,t){return"<"+t+">"})));for(var a=0;a<o.length;++a)for(var s,l=new RegExp("^ {0,3}(<"+o[a]+"\\b[^>]*>)","im"),c="<"+o[a]+"\\b[^>]*>",u="</"+o[a]+">";-1!==(s=n.helper.regexIndexOf(e,l));){var h=n.helper.splitAtIndex(e,s),d=n.helper.replaceRecursiveRegExp(h[1],i,c,u,"im");if(d===h[1])break;e=h[0].concat(d)}return e=e.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,n.subParser("hashElement")(e,t,r)),e=(e=n.helper.replaceRecursiveRegExp(e,(function(e){return"\n\n¨K"+(r.gHtmlBlocks.push(e)-1)+"K\n\n"}),"^ {0,3}\x3c!--","--\x3e","gm")).replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,n.subParser("hashElement")(e,t,r)),e=r.converter._dispatch("hashHTMLBlocks.after",e,t,r)})),n.subParser("hashHTMLSpans",(function(e,t,n){function r(e){return"¨C"+(n.gHtmlSpans.push(e)-1)+"C"}return e=(e=(e=(e=(e=n.converter._dispatch("hashHTMLSpans.before",e,t,n)).replace(/<[^>]+?\/>/gi,(function(e){return r(e)
|
|
531
520
|
}))).replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,(function(e){return r(e)}))).replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,(function(e){return r(e)}))).replace(/<[^>]+?>/gi,(function(e){return r(e)})),e=n.converter._dispatch("hashHTMLSpans.after",e,t,n)})),n.subParser("unhashHTMLSpans",(function(e,t,n){e=n.converter._dispatch("unhashHTMLSpans.before",e,t,n);for(var r=0;r<n.gHtmlSpans.length;++r){for(var o=n.gHtmlSpans[r],i=0;/¨C(\d+)C/.test(o);){var a=RegExp.$1;if(o=o.replace("¨C"+a+"C",n.gHtmlSpans[a]),10===i){console.error("maximum nesting of 10 spans reached!!!");break}++i}e=e.replace("¨C"+r+"C",o)}return e=n.converter._dispatch("unhashHTMLSpans.after",e,t,n)})),n.subParser("hashPreCodeTags",(function(e,t,r){e=r.converter._dispatch("hashPreCodeTags.before",e,t,r);return e=n.helper.replaceRecursiveRegExp(e,(function(e,o,i,a){var s=i+n.subParser("encodeCode")(o,t,r)+a;return"\n\n¨G"+(r.ghCodeBlocks.push({text:e,codeblock:s})-1)+"G\n\n"}),"^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>","^ {0,3}</code>\\s*</pre>","gim"),
|
|
532
521
|
e=r.converter._dispatch("hashPreCodeTags.after",e,t,r)})),n.subParser("headers",(function(e,t,r){e=r.converter._dispatch("headers.before",e,t,r);var o=isNaN(parseInt(t.headerLevelStart))?1:parseInt(t.headerLevelStart),i=t.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,a=t.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;e=(e=e.replace(i,(function(e,i){var a=n.subParser("spanGamut")(i,t,r),s=t.noHeaderId?"":' id="'+l(i)+'"',c="<h"+o+s+">"+a+"</h"+o+">";return n.subParser("hashBlock")(c,t,r)}))).replace(a,(function(e,i){var a=n.subParser("spanGamut")(i,t,r),s=t.noHeaderId?"":' id="'+l(i)+'"',c=o+1,u="<h"+c+s+">"+a+"</h"+c+">";return n.subParser("hashBlock")(u,t,r)}));var s=t.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;function l(e){var o,i;if(t.customizedHeaderId){var a=e.match(/\{([^{]+?)}\s*$/);a&&a[1]&&(e=a[1])}return o=e,
|
|
533
|
-
i=n.helper.isString(t.prefixHeaderId)?t.prefixHeaderId:!0===t.prefixHeaderId?"section-":"",t.rawPrefixHeaderId||(o=i+o),o=t.ghCompatibleHeaderId?o.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():t.rawHeaderId?o.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():o.replace(/[^\w]/g,"").toLowerCase(),t.rawPrefixHeaderId&&(o=i+o),r.hashLinkCounts[o]?o=o+"-"+r.hashLinkCounts[o]++:r.hashLinkCounts[o]=1,o}return e=e.replace(s,(function(e,i,a){var s=a;t.customizedHeaderId&&(s=a.replace(/\s?\{([^{]+?)}\s*$/,""));var c=n.subParser("spanGamut")(s,t,r),u=t.noHeaderId?"":' id="'+l(a)+'"',
|
|
534
|
-
;return e=(e=(e=e.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,o)).replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,o)).replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,o),e=r.converter._dispatch("horizontalRule.after",e,t,r)})),n.subParser("images",(function(e,t,r){function o(e,t,o,i,a,s,l,c){var u=r.gUrls,
|
|
522
|
+
i=n.helper.isString(t.prefixHeaderId)?t.prefixHeaderId:!0===t.prefixHeaderId?"section-":"",t.rawPrefixHeaderId||(o=i+o),o=t.ghCompatibleHeaderId?o.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():t.rawHeaderId?o.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():o.replace(/[^\w]/g,"").toLowerCase(),t.rawPrefixHeaderId&&(o=i+o),r.hashLinkCounts[o]?o=o+"-"+r.hashLinkCounts[o]++:r.hashLinkCounts[o]=1,o}return e=e.replace(s,(function(e,i,a){var s=a;t.customizedHeaderId&&(s=a.replace(/\s?\{([^{]+?)}\s*$/,""));var c=n.subParser("spanGamut")(s,t,r),u=t.noHeaderId?"":' id="'+l(a)+'"',h=o-1+i.length,d="<h"+h+u+">"+c+"</h"+h+">";return n.subParser("hashBlock")(d,t,r)})),e=r.converter._dispatch("headers.after",e,t,r)})),n.subParser("horizontalRule",(function(e,t,r){e=r.converter._dispatch("horizontalRule.before",e,t,r);var o=n.subParser("hashBlock")("<hr />",t,r)
|
|
523
|
+
;return e=(e=(e=e.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,o)).replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,o)).replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,o),e=r.converter._dispatch("horizontalRule.after",e,t,r)})),n.subParser("images",(function(e,t,r){function o(e,t,o,i,a,s,l,c){var u=r.gUrls,h=r.gTitles,d=r.gDimensions;if(o=o.toLowerCase(),c||(c=""),e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)i="";else if(""===i||null===i){if(""!==o&&null!==o||(o=t.toLowerCase().replace(/ ?\n/g," ")),i="#"+o,n.helper.isUndefined(u[o]))return e;i=u[o],n.helper.isUndefined(h[o])||(c=h[o]),n.helper.isUndefined(d[o])||(a=d[o].width,s=d[o].height)}t=t.replace(/"/g,""").replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback);var p='<img src="'+(i=i.replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback))+'" alt="'+t+'"';return c&&n.helper.isString(c)&&(p+=' title="'+(c=c.replace(/"/g,""").replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback))+'"'),
|
|
535
524
|
a&&s&&(p+=' width="'+(a="*"===a?"auto":a)+'"',p+=' height="'+(s="*"===s?"auto":s)+'"'),p+=" />"}return e=(e=(e=(e=(e=(e=r.converter._dispatch("images.before",e,t,r)).replace(/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,o)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,(function(e,t,n,r,i,a,s,l){return o(e,t,n,r=r.replace(/\s/g,""),i,a,s,l)}))).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,o)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,o)).replace(/!\[([^\[\]]+)]()()()()()/g,o),e=r.converter._dispatch("images.after",e,t,r)})),n.subParser("italicsAndBold",(function(e,t,n){function r(e,t,n){return t+e+n}return e=n.converter._dispatch("italicsAndBold.before",e,t,n),
|
|
536
525
|
t.literalMidWordUnderscores?e=(e=(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,(function(e,t){return r(t,"<strong><em>","</em></strong>")}))).replace(/\b__(\S[\s\S]*?)__\b/g,(function(e,t){return r(t,"<strong>","</strong>")}))).replace(/\b_(\S[\s\S]*?)_\b/g,(function(e,t){return r(t,"<em>","</em>")})):(e=e.replace(/___(\S[\s\S]*?)___/g,(function(e,t){return/\S$/.test(t)?r(t,"<strong><em>","</em></strong>"):e})),e=e.replace(/__(\S[\s\S]*?)__/g,(function(e,t){return/\S$/.test(t)?r(t,"<strong>","</strong>"):e})),e=e.replace(/_([^\s_][\s\S]*?)_/g,(function(e,t){return/\S$/.test(t)?r(t,"<em>","</em>"):e}))),t.literalMidWordAsterisks?e=(e=(e=e.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,(function(e,t,n){return r(n,t+"<strong><em>","</em></strong>")}))).replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,(function(e,t,n){return r(n,t+"<strong>","</strong>")}))).replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,(function(e,t,n){return r(n,t+"<em>","</em>")})):(e=e.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,(function(e,t){
|
|
537
|
-
return/\S$/.test(t)?r(t,"<strong><em>","</em></strong>"):e})),e=e.replace(/\*\*(\S[\s\S]*?)\*\*/g,(function(e,t){return/\S$/.test(t)?r(t,"<strong>","</strong>"):e})),e=e.replace(/\*([^\s*][\s\S]*?)\*/g,(function(e,t){return/\S$/.test(t)?r(t,"<em>","</em>"):e}))),e=n.converter._dispatch("italicsAndBold.after",e,t,n)})),n.subParser("lists",(function(e,t,r){function o(e,o){r.gListLevel++,e=e.replace(/\n{2,}$/,"\n");var i=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,a=/\n[ \t]*\n(?!¨0)/.test(e+="¨0");return t.disableForced4SpacesIndentedSublists&&(i=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),e=(e=e.replace(i,(function(e,o,i,s,l,c,u){u=u&&""!==u.trim();var
|
|
538
|
-
var e='<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';return u&&(e+=" checked"),e+=">"}))),
|
|
539
|
-
;-1!==
|
|
540
|
-
return e=(e=(e=n.converter._dispatch("metadata.before",e,t,n)).replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,(function(e,t,n){return r(n),"¨M"}))).replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,(function(e,t,o){return t&&(n.metadata.format=t),r(o),"¨M"})),e=e.replace(/¨M/g,""),e=n.converter._dispatch("metadata.after",e,t,n)})),n.subParser("outdent",(function(e,t,n){return e=(e=(e=n.converter._dispatch("outdent.before",e,t,n)).replace(/^(\t|[ ]{1,4})/gm,"¨0")).replace(/¨0/g,""),e=n.converter._dispatch("outdent.after",e,t,n)})),n.subParser("paragraphs",(function(e,t,r){for(var o=(e=(e=(e=r.converter._dispatch("paragraphs.before",e,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,"")).split(/\n{2,}/g),i=[],a=o.length,s=0;s<a;s++){var l=o[s];l.search(/¨(K|G)(\d+)\1/g)>=0?i.push(l):l.search(/\S/)>=0&&(l=(l=n.subParser("spanGamut")(l,t,r)).replace(/^([ \t]*)/g,"<p>"),l+="</p>",i.push(l))}for(a=i.length,s=0;s<a;s++){for(var c="",u=i[s],
|
|
541
|
-
;c=(c="K"===
|
|
526
|
+
return/\S$/.test(t)?r(t,"<strong><em>","</em></strong>"):e})),e=e.replace(/\*\*(\S[\s\S]*?)\*\*/g,(function(e,t){return/\S$/.test(t)?r(t,"<strong>","</strong>"):e})),e=e.replace(/\*([^\s*][\s\S]*?)\*/g,(function(e,t){return/\S$/.test(t)?r(t,"<em>","</em>"):e}))),e=n.converter._dispatch("italicsAndBold.after",e,t,n)})),n.subParser("lists",(function(e,t,r){function o(e,o){r.gListLevel++,e=e.replace(/\n{2,}$/,"\n");var i=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,a=/\n[ \t]*\n(?!¨0)/.test(e+="¨0");return t.disableForced4SpacesIndentedSublists&&(i=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),e=(e=e.replace(i,(function(e,o,i,s,l,c,u){u=u&&""!==u.trim();var h=n.subParser("outdent")(l,t,r),d="";return c&&t.tasklists&&(d=' class="task-list-item" style="list-style-type: none;"',h=h.replace(/^[ \t]*\[(x|X| )?]/m,(function(){
|
|
527
|
+
var e='<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';return u&&(e+=" checked"),e+=">"}))),h=h.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g,(function(e){return"¨A"+e})),o||h.search(/\n{2,}/)>-1?(h=n.subParser("githubCodeBlocks")(h,t,r),h=n.subParser("blockGamut")(h,t,r)):(h=(h=n.subParser("lists")(h,t,r)).replace(/\n$/,""),h=(h=n.subParser("hashHTMLBlocks")(h,t,r)).replace(/\n\n+/g,"\n\n"),h=a?n.subParser("paragraphs")(h,t,r):n.subParser("spanGamut")(h,t,r)),h="<li"+d+">"+(h=h.replace("¨A",""))+"</li>\n"}))).replace(/¨0/g,""),r.gListLevel--,o&&(e=e.replace(/\s+$/,"")),e}function i(e,t){if("ol"===t){var n=e.match(/^ *(\d+)\./);if(n&&"1"!==n[1])return' start="'+n[1]+'"'}return""}function a(e,n,r){var a=t.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,s=t.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,l="ul"===n?a:s,c="";if(-1!==e.search(l))!function t(u){var h=u.search(l),d=i(e,n)
|
|
528
|
+
;-1!==h?(c+="\n\n<"+n+d+">\n"+o(u.slice(0,h),!!r)+"</"+n+">\n",l="ul"===(n="ul"===n?"ol":"ul")?a:s,t(u.slice(h))):c+="\n\n<"+n+d+">\n"+o(u,!!r)+"</"+n+">\n"}(e);else{var u=i(e,n);c="\n\n<"+n+u+">\n"+o(e,!!r)+"</"+n+">\n"}return c}return e=r.converter._dispatch("lists.before",e,t,r),e+="¨0",e=(e=r.gListLevel?e.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,(function(e,t,n){return a(t,n.search(/[*+-]/g)>-1?"ul":"ol",!0)})):e.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,(function(e,t,n,r){return a(n,r.search(/[*+-]/g)>-1?"ul":"ol",!1)}))).replace(/¨0/,""),e=r.converter._dispatch("lists.after",e,t,r)})),n.subParser("metadata",(function(e,t,n){if(!t.metadata)return e;function r(e){n.metadata.raw=e,(e=(e=e.replace(/&/g,"&").replace(/"/g,""")).replace(/\n {4}/g," ")).replace(/^([\S ]+): +([\s\S]+?)$/gm,(function(e,t,r){return n.metadata.parsed[t]=r,""}))}
|
|
529
|
+
return e=(e=(e=n.converter._dispatch("metadata.before",e,t,n)).replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,(function(e,t,n){return r(n),"¨M"}))).replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,(function(e,t,o){return t&&(n.metadata.format=t),r(o),"¨M"})),e=e.replace(/¨M/g,""),e=n.converter._dispatch("metadata.after",e,t,n)})),n.subParser("outdent",(function(e,t,n){return e=(e=(e=n.converter._dispatch("outdent.before",e,t,n)).replace(/^(\t|[ ]{1,4})/gm,"¨0")).replace(/¨0/g,""),e=n.converter._dispatch("outdent.after",e,t,n)})),n.subParser("paragraphs",(function(e,t,r){for(var o=(e=(e=(e=r.converter._dispatch("paragraphs.before",e,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,"")).split(/\n{2,}/g),i=[],a=o.length,s=0;s<a;s++){var l=o[s];l.search(/¨(K|G)(\d+)\1/g)>=0?i.push(l):l.search(/\S/)>=0&&(l=(l=n.subParser("spanGamut")(l,t,r)).replace(/^([ \t]*)/g,"<p>"),l+="</p>",i.push(l))}for(a=i.length,s=0;s<a;s++){for(var c="",u=i[s],h=!1;/¨(K|G)(\d+)\1/.test(u);){var d=RegExp.$1,p=RegExp.$2
|
|
530
|
+
;c=(c="K"===d?r.gHtmlBlocks[p]:h?n.subParser("encodeCode")(r.ghCodeBlocks[p].text,t,r):r.ghCodeBlocks[p].codeblock).replace(/\$/g,"$$$$"),u=u.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/,c),/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(u)&&(h=!0)}i[s]=u}return e=(e=(e=i.join("\n")).replace(/^\n+/g,"")).replace(/\n+$/g,""),r.converter._dispatch("paragraphs.after",e,t,r)})),n.subParser("runExtension",(function(e,t,n,r){if(e.filter)t=e.filter(t,r.converter,n);else if(e.regex){var o=e.regex;o instanceof RegExp||(o=new RegExp(o,"g")),t=t.replace(o,e.replace)}return t})),n.subParser("spanGamut",(function(e,t,r){return e=r.converter._dispatch("spanGamut.before",e,t,r),e=n.subParser("codeSpans")(e,t,r),e=n.subParser("escapeSpecialCharsWithinTagAttributes")(e,t,r),e=n.subParser("encodeBackslashEscapes")(e,t,r),e=n.subParser("images")(e,t,r),e=n.subParser("anchors")(e,t,r),e=n.subParser("autoLinks")(e,t,r),e=n.subParser("simplifiedAutoLinks")(e,t,r),e=n.subParser("emoji")(e,t,r),e=n.subParser("underline")(e,t,r),
|
|
542
531
|
e=n.subParser("italicsAndBold")(e,t,r),e=n.subParser("strikethrough")(e,t,r),e=n.subParser("ellipsis")(e,t,r),e=n.subParser("hashHTMLSpans")(e,t,r),e=n.subParser("encodeAmpsAndAngles")(e,t,r),t.simpleLineBreaks?/\n\n¨K/.test(e)||(e=e.replace(/\n+/g,"<br />\n")):e=e.replace(/ +\n/g,"<br />\n"),e=r.converter._dispatch("spanGamut.after",e,t,r)})),n.subParser("strikethrough",(function(e,t,r){return t.strikethrough&&(e=(e=r.converter._dispatch("strikethrough.before",e,t,r)).replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,(function(e,o){return function(e){return t.simplifiedAutoLink&&(e=n.subParser("simplifiedAutoLinks")(e,t,r)),"<del>"+e+"</del>"}(o)})),e=r.converter._dispatch("strikethrough.after",e,t,r)),e})),n.subParser("stripLinkDefinitions",(function(e,t,r){var o=function(o,i,a,s,l,c,u){return i=i.toLowerCase(),e.toLowerCase().split(i).length-1<2?o:(a.match(/^data:.+?\/.+?;base64,/)?r.gUrls[i]=a.replace(/\s/g,""):r.gUrls[i]=n.subParser("encodeAmpsAndAngles")(a,t,r),c?c+u:(u&&(r.gTitles[i]=u.replace(/"|'/g,""")),
|
|
543
|
-
t.parseImgDimensions&&s&&l&&(r.gDimensions[i]={width:s,height:l}),""))};return e=(e=(e=(e+="¨0").replace(/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm,o)).replace(/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,o)).replace(/¨0/,"")})),n.subParser("tables",(function(e,t,r){if(!t.tables)return e;function o(e,o){return"<td"+o+">"+n.subParser("spanGamut")(e,t,r)+"</td>\n"}function i(e){var i,a=e.split("\n");for(i=0;i<a.length;++i)/^ {0,3}\|/.test(a[i])&&(a[i]=a[i].replace(/^ {0,3}\|/,"")),/\|[ \t]*$/.test(a[i])&&(a[i]=a[i].replace(/\|[ \t]*$/,"")),a[i]=n.subParser("codeSpans")(a[i],t,r);var s,l,c,u,
|
|
544
|
-
a.shift(),i=0;i<a.length;++i)""!==a[i].trim()&&p.push(a[i].split("|").map((function(e){return e.trim()})));if(
|
|
532
|
+
t.parseImgDimensions&&s&&l&&(r.gDimensions[i]={width:s,height:l}),""))};return e=(e=(e=(e+="¨0").replace(/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm,o)).replace(/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,o)).replace(/¨0/,"")})),n.subParser("tables",(function(e,t,r){if(!t.tables)return e;function o(e,o){return"<td"+o+">"+n.subParser("spanGamut")(e,t,r)+"</td>\n"}function i(e){var i,a=e.split("\n");for(i=0;i<a.length;++i)/^ {0,3}\|/.test(a[i])&&(a[i]=a[i].replace(/^ {0,3}\|/,"")),/\|[ \t]*$/.test(a[i])&&(a[i]=a[i].replace(/\|[ \t]*$/,"")),a[i]=n.subParser("codeSpans")(a[i],t,r);var s,l,c,u,h=a[0].split("|").map((function(e){return e.trim()})),d=a[1].split("|").map((function(e){return e.trim()})),p=[],m=[],f=[],g=[];for(a.shift(),
|
|
533
|
+
a.shift(),i=0;i<a.length;++i)""!==a[i].trim()&&p.push(a[i].split("|").map((function(e){return e.trim()})));if(h.length<d.length)return e;for(i=0;i<d.length;++i)f.push((s=d[i],/^:[ \t]*--*$/.test(s)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(s)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(s)?' style="text-align:center;"':""));for(i=0;i<h.length;++i)n.helper.isUndefined(f[i])&&(f[i]=""),m.push((l=h[i],c=f[i],u=void 0,u="",l=l.trim(),(t.tablesHeaderId||t.tableHeaderId)&&(u=' id="'+l.replace(/ /g,"_").toLowerCase()+'"'),"<th"+u+c+">"+(l=n.subParser("spanGamut")(l,t,r))+"</th>\n"));for(i=0;i<p.length;++i){for(var v=[],_=0;_<m.length;++_)n.helper.isUndefined(p[i][_]),v.push(o(p[i][_],f[_]));g.push(v)}return function(e,t){for(var n="<table>\n<thead>\n<tr>\n",r=e.length,o=0;o<r;++o)n+=e[o];for(n+="</tr>\n</thead>\n<tbody>\n",o=0;o<t.length;++o){n+="<tr>\n";for(var i=0;i<r;++i)n+=t[o][i];n+="</tr>\n"}return n+"</tbody>\n</table>\n"}(m,g)}
|
|
545
534
|
return e=(e=(e=(e=r.converter._dispatch("tables.before",e,t,r)).replace(/\\(\|)/g,n.helper.escapeCharactersCallback)).replace(/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,i)).replace(/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm,i),e=r.converter._dispatch("tables.after",e,t,r)})),n.subParser("underline",(function(e,t,r){return t.underline?(e=r.converter._dispatch("underline.before",e,t,r),t.literalMidWordUnderscores?e=(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,(function(e,t){return"<u>"+t+"</u>"}))).replace(/\b__(\S[\s\S]*?)__\b/g,(function(e,t){return"<u>"+t+"</u>"})):(e=e.replace(/___(\S[\s\S]*?)___/g,(function(e,t){return/\S$/.test(t)?"<u>"+t+"</u>":e})),e=e.replace(/__(\S[\s\S]*?)__/g,(function(e,t){return/\S$/.test(t)?"<u>"+t+"</u>":e}))),e=e.replace(/(_)/g,n.helper.escapeCharactersCallback),e=r.converter._dispatch("underline.after",e,t,r)):e})),
|
|
546
535
|
n.subParser("unescapeSpecialChars",(function(e,t,n){return e=(e=n.converter._dispatch("unescapeSpecialChars.before",e,t,n)).replace(/¨E(\d+)E/g,(function(e,t){var n=parseInt(t);return String.fromCharCode(n)})),e=n.converter._dispatch("unescapeSpecialChars.after",e,t,n)})),n.subParser("makeMarkdown.blockquote",(function(e,t){var r="";if(e.hasChildNodes())for(var o=e.childNodes,i=o.length,a=0;a<i;++a){var s=n.subParser("makeMarkdown.node")(o[a],t);""!==s&&(r+=s)}return r="> "+(r=r.trim()).split("\n").join("\n> ")})),n.subParser("makeMarkdown.codeBlock",(function(e,t){var n=e.getAttribute("language"),r=e.getAttribute("precodenum");return"```"+n+"\n"+t.preList[r]+"\n```"})),n.subParser("makeMarkdown.codeSpan",(function(e){return"`"+e.innerHTML+"`"})),n.subParser("makeMarkdown.emphasis",(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.header",(function(e,t,r){
|
|
547
536
|
var o=new Array(r+1).join("#"),i="";if(e.hasChildNodes()){i=o+" ";for(var a=e.childNodes,s=a.length,l=0;l<s;++l)i+=n.subParser("makeMarkdown.node")(a[l],t)}return i})),n.subParser("makeMarkdown.hr",(function(){return"---"})),n.subParser("makeMarkdown.image",(function(e){var t="";return e.hasAttribute("src")&&(t+="+">",e.hasAttribute("width")&&e.hasAttribute("height")&&(t+=" ="+e.getAttribute("width")+"x"+e.getAttribute("height")),e.hasAttribute("title")&&(t+=' "'+e.getAttribute("title")+'"'),t+=")"),t})),n.subParser("makeMarkdown.links",(function(e,t){var r="";if(e.hasChildNodes()&&e.hasAttribute("href")){var o=e.childNodes,i=o.length;r="[";for(var a=0;a<i;++a)r+=n.subParser("makeMarkdown.node")(o[a],t);r+="](",r+="<"+e.getAttribute("href")+">",e.hasAttribute("title")&&(r+=' "'+e.getAttribute("title")+'"'),r+=")"}return r})),n.subParser("makeMarkdown.list",(function(e,t,r){var o="";if(!e.hasChildNodes())return""
|
|
548
537
|
;for(var i=e.childNodes,a=i.length,s=e.getAttribute("start")||1,l=0;l<a;++l)if(void 0!==i[l].tagName&&"li"===i[l].tagName.toLowerCase()){o+=("ol"===r?s.toString()+". ":"- ")+n.subParser("makeMarkdown.listItem")(i[l],t),++s}return(o+="\n\x3c!-- --\x3e\n").trim()})),n.subParser("makeMarkdown.listItem",(function(e,t){for(var r="",o=e.childNodes,i=o.length,a=0;a<i;++a)r+=n.subParser("makeMarkdown.node")(o[a],t);return/\n$/.test(r)?r=r.split("\n").join("\n ").replace(/^ {4}$/gm,"").replace(/\n\n+/g,"\n\n"):r+="\n",r})),n.subParser("makeMarkdown.node",(function(e,t,r){r=r||!1;var o="";if(3===e.nodeType)return n.subParser("makeMarkdown.txt")(e,t);if(8===e.nodeType)return"\x3c!--"+e.data+"--\x3e\n\n";if(1!==e.nodeType)return"";switch(e.tagName.toLowerCase()){case"h1":r||(o=n.subParser("makeMarkdown.header")(e,t,1)+"\n\n");break;case"h2":r||(o=n.subParser("makeMarkdown.header")(e,t,2)+"\n\n");break;case"h3":r||(o=n.subParser("makeMarkdown.header")(e,t,3)+"\n\n");break;case"h4":
|
|
549
538
|
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":
|
|
550
539
|
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){
|
|
551
|
-
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
|
|
552
|
-
;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(V)}(
|
|
553
|
-
;if(-1!==e&&(-1===o||e<o)?(i=e,a=r.indexOf("$$",i+2)):(i=o,a=r.indexOf("\\)",i+2)),-1===a)break;a+=2;const s=t.length+1,l=
|
|
554
|
-
;n&&(t?n.className=t:n.style.width="350px")}}(o.current,{className:"w-full md:w-[380px]"})}),[e]),
|
|
555
|
-
className:
|
|
556
|
-
;const[o,i]=
|
|
557
|
-
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
|
|
558
|
-
o===t&&i===n?(a=
|
|
559
|
-
classes:"text-tiny touch:text-base",name:t})})}function
|
|
560
|
-
return null!==e.offsetParent&&!("boolean"==typeof(t=e).disabled&&t.disabled);var t})),s=(e=a(),t=-1,n=!1)=>{t<0&&(t=e.findIndex((e=>0===e.tabIndex)))<0&&(t=0);for(let[r,o]of e.entries())o.tabIndex=r===t?0:-1,r===t&&n&&o.focus()};s(a(),0,t);const l=new
|
|
561
|
-
className:
|
|
562
|
-
iconName:"format-list-unordered",onClick:()=>t("list"),shortcutKey:
|
|
563
|
-
;break;case"italic":n((e=>
|
|
564
|
-
const s=
|
|
565
|
-
},v=t=>{e(t)&&(
|
|
566
|
-
placeholder:"Add new tags",type:"text",autoComplete:"off","aria-autocomplete":"list","aria-activedescendant":b,"aria-controls":`${
|
|
567
|
-
children:"Annotations can be freely reused by anyone for any purpose."})]})})}function
|
|
568
|
-
;function
|
|
569
|
-
className:"flex items-center gap-x-1",children:[a,c&&
|
|
570
|
-
overflow:"auto"===r?"visible":"hidden",transition:"height 0.15s ease-in"},children:e})}function
|
|
571
|
-
}):
|
|
572
|
-
role:"menuitem",onKeyDown:b,children:S}):
|
|
573
|
-
className:
|
|
574
|
-
}),[m,
|
|
575
|
-
className:"flex gap-x-1",children:[
|
|
576
|
-
test:(e,t)=>
|
|
577
|
-
year:"numeric",month:"short",day:"2-digit",weekday:"long",hour:"2-digit",minute:"2-digit"},t)}function
|
|
578
|
-
target:"_blank",children:n}):
|
|
579
|
-
displayName:s}),n>0&&c&&
|
|
580
|
-
const r=`${n?"Show replies":"Hide replies"} (${t})`;return
|
|
581
|
-
children:[n&&
|
|
582
|
-
name:e.hidden?"hide":"flag"})}),
|
|
583
|
-
children:
|
|
584
|
-
threadIsCollapsed:t.collapsed,onToggleReplies:c}),
|
|
585
|
-
"data-testid":"thread-card",onClick:e=>{var t;(t=e.target).closest("button")||t.closest("a")||!i||l(i)},onMouseEnter:()=>s(null!=i?i:null),onMouseLeave:()=>s(null),children:c},t.id)}),["frameSync"]);function
|
|
586
|
-
offscreenLowerHeight:
|
|
587
|
-
title:"annotation"===e?"Annotation unavailable":"Group unavailable",children:[
|
|
588
|
-
t.id!==r&&n.highlightAnnotations([r]))})).catch((()=>{s(!0)}))}),[r,i,e,n]),
|
|
589
|
-
const e=
|
|
590
|
-
focusDisplayName:"selection"!==l&&i.active?i.displayName:"",resultCount:c})}),l&&
|
|
591
|
-
e.self===e?e.scrollTo(t,n):(e.scrollLeft=t,e.scrollTop=n)}function
|
|
592
|
-
y:o,differenceX:i,differenceY:a}}(t,e),o=Date.now()-t.startTime,i=Math.min(1/t.time*o,1);if(t.endIterations>=n)return
|
|
593
|
-
t.time=isNaN(t.time)?1e3:t.time,t.ease=t.ease||function(e){return 1-Math.pow(1-e,e/2)},t.align=t.align||{};var r=
|
|
594
|
-
maxSynchronousAlignments:
|
|
595
|
-
function
|
|
596
|
-
isWaitingToAnchor:l,isSelected:"note"===o,label:"Page notes",onSelect:()=>c("note"),children:"Page Notes"}),s>0&&
|
|
597
|
-
;var
|
|
598
|
-
}),
|
|
599
|
-
this.fingerprint=null!==(r=null===(o=t[0])||void 0===o||null===(i=o.metadata)||void 0===i?void 0:i.documentFingerprint)&&void 0!==r?r:a,this.account=s,this.timestamp=(new Date).toString()}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())}}function
|
|
600
|
-
children:["To create a highlight (",
|
|
601
|
-
var
|
|
602
|
-
children:
|
|
603
|
-
children:"Getting started"}),"tutorial"===a&&
|
|
604
|
-
;var
|
|
605
|
-
;this._incremental?this.emit("results",i):this._results=this._results.concat(i);const a=i.length===r,s=i.length>0?i[i.length-1][this._sortBy]:null;a&&s?this._getPage(e,s,n+1):(this._incremental||this.emit("results",this._results),this.emit("end"))}catch(e){if(this._canceled)return;this.emit("error",e),this.emit("end")}}get(e){this._results=[],this._resultCount=null,this._getPage(e)}cancel(){this._canceled=!0,this.emit("end")}}function
|
|
606
|
-
const e=
|
|
607
|
-
children:[c," ",1===c?"thread":"threads"]})]}),s&&
|
|
608
|
-
children:null===t?
|
|
609
|
-
;const r=
|
|
610
|
-
"data-testid":"notebook-group-name",children:
|
|
611
|
-
currentPage:f,isLoading:l,onChangePage:w,threads:
|
|
612
|
-
onClick:()=>{try{
|
|
613
|
-
;return
|
|
614
|
-
"motion-safe:animate-slide-in-from-right lg:animate-fade-in":!t.isDismissed,"motion-reduce:animate-fade-in":!t.isDismissed,"animate-fade-out":t.isDismissed}),children:
|
|
615
|
-
className:"border-b",children:x(t).map((e=>
|
|
616
|
-
isSubmenuItem:!0,label:"Leave group",onClick:async()=>{const e=`Are you sure you want to leave the group "${t.name}"?`;await
|
|
617
|
-
className:
|
|
618
|
-
onSubmit:e=>{e.preventDefault(),(o.current.value||i)&&n(o.current.value)},children:[
|
|
619
|
-
query:
|
|
620
|
-
}),["frameSync","settings"]);var
|
|
621
|
-
title:"Share annotations on this page"})]}),
|
|
622
|
-
displayName:n,userid:e.userid,username:t.username}}return{status:"logged-out"}}(s):{status:"unknown"}),[a,s]),u=
|
|
623
|
-
;if(0===e)return!0;let t="";return 1===e?t="You have an unsaved annotation.\nDo you really want to discard this draft?":e>1&&(t="You have "+e+" unsaved annotations.\nDo you really want to discard these drafts?"),
|
|
624
|
-
const t={},n=this._store.getDraft(e);return n&&(t.tags=n.tags,t.text=n.text,t.permissions=n.isPrivate?
|
|
625
|
-
createPageNote(){const e=this._store.mainFrame();if(!this._store.isLoggedIn())return void this._store.openSidebarPanel("loginPrompt");if(!e)return;const t={target:[],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)}reply(e,t){const n={group:e.group,permissions:
|
|
626
|
-
return this._store.removeDraft(e),this._store.addAnnotations([o]),o}}
|
|
627
|
-
throw new
|
|
628
|
-
method:c.method})}finally{i()}}}class
|
|
629
|
-
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))}var
|
|
630
|
-
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},
|
|
631
|
-
;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},function(e){var t=
|
|
632
|
-
;for(var i=0;i<r.length;i++){var a=r[i],s=t[a];t[a]=function(r){var o=e.operation(n),i=Array.prototype.slice.call(arguments,1),a=i.pop();i.push((function(e){o.retry(e)||(e&&(arguments[0]=o.mainError()),a.apply(this,arguments))})),o.attempt((function(){r.apply(t,i)}))}.bind(t,s),t[a].options=n}}}(
|
|
633
|
-
this.tokenEndpoint=e.tokenEndpoint,this.authorizationEndpoint=e.authorizationEndpoint,this.revokeEndpoint=e.revokeEndpoint}exchangeAuthCode(e){return this._getAccessToken({client_id:this.clientId,grant_type:"authorization_code",code:e})}exchangeGrantToken(e){return this._getAccessToken({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:e})}refreshToken(e){return this._getAccessToken({grant_type:"refresh_token",refresh_token:e})}async revokeToken(e){try{await this._formPost(this.revokeEndpoint,{token:e})}catch(e){throw new
|
|
634
|
-
r.searchParams.set("origin",e.location.origin),r.searchParams.set("response_mode","web_message"),r.searchParams.set("response_type","code"),r.searchParams.set("state",t);const o=`left=${e.screen.width/2-237.5},top=${e.screen.height/2-215},width=475,height=430`;if(!e.open(r.toString(),"Log in to Hypothesis",o))throw new Error("Failed to open login window");return n.then((e=>e.code))}async _formPost(e,t){const n=new URLSearchParams;for(let[e,r]of Object.entries(t))n.set(e,r);n.sort();return
|
|
635
|
-
;return e=e.replace(/\./g,"%2E"),`hypothesis.oauth.${e}.token`}function
|
|
636
|
-
const e=m();return a=(async(e,t)=>{const n=await p();let r;try{if(r=await n.refreshToken(e),Date.now()>r.expiresAt)throw new Error("Refreshed token expired in the past")}catch{return null}return t.persist&&
|
|
637
|
-
|
|
638
|
-
this._hostFrame.postMessage({frame1:this._source,frame2:e,type:"request",requestId:n},"*")},i=setInterval(o,250),a=setTimeout((()=>{clearInterval(i),r(new Error(`Unable to establish ${this._source}-${e} communication channel`))}),2e4),s=this._listeners.add(window,"message",(r=>{const{data:o,ports:l}=r;
|
|
639
|
-
this._receivedCloseEvent=!1}on(e,t){if(this._port)throw new Error("Cannot add a method handler after a port is connected");this._methods.set(e,t)}connect(e){this._port=e,this._listeners.add(e,"message",(e=>this._handle(e))),e.start(),
|
|
640
|
-
;const r=(...e)=>{const r={arguments:e,protocol:"frame-rpc",response:t.sequence,version:"1.0.0"};n.postMessage(r)};e(...t.arguments,r)}else if("response"in t){const e=this._callbacks.get(t.response);this._callbacks.delete(t.response),e&&e(...t.arguments)}}}function
|
|
641
|
-
|
|
642
|
-
metadata:e.metadata,uri:e.uri})})),t.on("close",(()=>{const e=this._store.frames().find((e=>e.id===n));e&&this._store.destroyFrame(e),t.destroy(),this._guestRPC.delete(n)})),t.on("createAnnotation",(e=>{if(!this._store.isLoggedIn())return this._hostRPC.call("openSidebar"),this._store.openSidebarPanel("loginPrompt"),void this._guestRPC.forEach((t=>t.call("deleteAnnotation",e.$tag)));this._inFrame.add(e.$tag),e.$highlight||this._hostRPC.call("openSidebar"),this._hostRPC.call("showHighlights"),this._annotationsService.create(e)}));let r={};const o=
|
|
643
|
-
t.on("openSidebar",(()=>{this._hostRPC.call("openSidebar")})),t.on("closeSidebar",(()=>{this._hostRPC.call("closeSidebar")})),t.connect(e),t.call("setHighlightsVisible",this._highlightsVisible),t.call("featureFlagsUpdated",this._store.profile().features)}_setupHostEvents(){this._hostRPC.on("sidebarOpened",(()=>{this._store.setSidebarOpened(!0)})),this._hostRPC.on("setHighlightsVisible",(e=>{this._highlightsVisible=e,this._guestRPC.forEach((t=>t.call("setHighlightsVisible",e)))}))}_setupFeatureFlagSync(){const e=()=>this._store.profile().features,t=e=>{this._hostRPC.call("featureFlagsUpdated",e);for(let t of this._guestRPC.values())t.call("featureFlagsUpdated",e)};t(e()),
|
|
644
|
-
this._store.focusAnnotations(e),this._guestRPC.forEach((t=>t.call("focusAnnotations",e)))}scrollToAnnotation(e){this._guestRPC.forEach((t=>t.call("scrollToAnnotation",e)))}destroy(){this._portFinder.destroy(),this._listeners.removeAll()}}
|
|
645
|
-
;return o?"__world__"===r||"__world__"===n?e:e.filter((e=>"__world__"!==e.id)):e}_setupAutoReload(){this._reloadSetUp||(this._reloadSetUp=!0,
|
|
646
|
-
this._setupAutoReload();const r=this._store.directLinkedAnnotationId();let o=null;r&&(o=this._api.annotation.get({id:r}).catch((()=>null)));const i=this._store.directLinkedGroupId();let a=null;i&&(a=this._fetchGroup(i).then((e=>(this._store.clearDirectLinkedGroupFetchFailed(),e))).catch((()=>(this._store.setDirectLinkedGroupFetchFailed(),null))));const s={expand:
|
|
647
|
-
async _loadServiceSpecifiedGroups(e){const t=await this._api.profile.groups.read({expand:
|
|
648
|
-
;e.length&&this._store.addAnnotations(e),this._store.setDefault("focusedGroup",n)}}leave(e){return this._api.group.member.delete({pubid:e,userid:"me"})}}
|
|
649
|
-
this._searchClient.on("resultCount",(e=>{this._store.setAnnotationResultCount(e)})),this._searchClient.on("results",(e=>{e.length&&this._store.addAnnotations(e)})),this._searchClient.on("error",(e=>{"function"==typeof n?n(e):console.error(e)})),this._searchClient.on("end",(()=>{this._searchClient=null,t&&t.length>0&&this._store.frames().forEach((e=>{t.indexOf(e.uri)>=0&&this._store.updateFrameAnnotationFetchStatus(e.uri,!0)})),this._store.annotationFetchFinished()})),this._store.annotationFetchStarted(),this._searchClient.get({group:e,uri:t})}async loadThread(e){let t,n;this._store.clearAnnotations();try{this._store.annotationFetchStarted(),t=await this._api.annotation.get({id:e}),
|
|
650
|
-
this._streamer.setConfig("filter",{filter:this._streamFilter.getFilter()}),this._streamer.connect()}return r}}
|
|
651
|
-
const n=this._storage.getItem(t);this._store.setDefault(e,n)}
|
|
652
|
-
i.set(e,t);return o&&(n+="?"+i.toString()),n}sync(){const{route:e,params:t}=this.currentRoute();this._store.changeRoute(e,t),this._didRegisterPopstateListener||(this._window.addEventListener("popstate",(()=>{this.sync()})),this._didRegisterPopstateListener=!0)}navigate(e,t){this._window.history.pushState({},"",this.routeUrl(e,t)),this.sync()}}
|
|
653
|
-
return(!this._lastLoad||!this._lastLoadTime||Date.now()-this._lastLoadTime>3e5)&&(this._lastLoadTime=Date.now(),this._lastLoad=
|
|
654
|
-
clauses:[],actions:{create:!0,update:!0,delete:!0}}}addClause(e,t,n,r=!1){return this._filter.clauses.push({field:e,operator:t,value:n,case_sensitive:r}),this}getFilter(){return this._filter}resetFilter(){return this._filter={match_policy:"include_any",clauses:[],actions:{create:!0,update:!0,delete:!0}},this}}class
|
|
655
|
-
this._websocketURL=t.links().then((e=>e.websocket)),this.clientId=
|
|
656
|
-
this._updateImmediately&&this.applyPendingUpdates()}else if("session-change"===t.type)this._session.update(t.model),this._groups.load();else if("whoyouare"===t.type){const e=this._store.profile().userid;t.userid!==e&&console.warn('WebSocket user ID "%s" does not match logged-in ID "%s"',t.userid,e)}else G("Received unsupported notification",t.type)}_sendClientConfig(e){Object.keys(this._configMessages).forEach((t=>{this._configMessages[t]&&e.send(this._configMessages[t])}))}setConfig(e,t){var n;this._configMessages[e]=t,null!==(n=this._socket)&&void 0!==n&&n.isConnected()&&this._socket.send(t)}async _reconnect(){var e;const t=await this._websocketURL;if(!t)return;let n,r;null===(e=this._socket)||void 0===e||e.close();try{n=await this._auth.getAccessToken()}catch(e){throw console.error("Failed to fetch token for WebSocket authentication",e),e}if(n){const e=new URL(t);e.searchParams.set("access_token",n),r=e.toString()}else r=t;const o=new
|
|
657
|
-
this._sendClientConfig(o)})),o.on("disconnect",(()=>{if(++this._reconnectionAttempts,this._reconnectionAttempts<10){const e=1e3*2**this._reconnectionAttempts;setTimeout((()=>this._reconnect()),e)}else console.error("Gave up trying to reconnect to Hypothesis real time update service")})),o.on("error",(e=>this._handleSocketError(t,e))),o.on("message",(e=>this._handleSocketMessage(e))),this._socket=o,this.setConfig("client-id",{messageType:"client_id",value:this.clientId}),this.setConfig("auth-check",{type:"whoami",id:1})}async connect(e={}){var t;this._updateImmediately=null===(t=e.applyUpdatesImmediately)||void 0===t||t,this._reconnectSetUp||(this._reconnectSetUp=!0,
|
|
658
|
-
if(null!==t&&r>=t)return!1;const o=n.split(/\W+/),i=new RegExp(`^${
|
|
659
|
-
_addMessage(e,t,{autoDismiss:n=!0,moreInfoURL:r="",visuallyHidden:o=!1}={}){if(this._store.hasToastMessage(e,t))return;const i=
|
|
660
|
-
const r=new Error(`Failed to construct dependency "${t}" of "${e}": ${n.message}`);throw r.cause=n,r}let o;if(t.class)o=new t.class(...n);else{o=(0,t.factory)(...n)}return this._instances.set(e,o),o}finally{this._constructing.delete(e)}}register(e,t){if("function"==typeof t)t={class:t};else if(!function(e){return"object"==typeof e&&null!==e&&("value"in e||"function"==typeof e.class||"function"==typeof e.factory)}(t))throw new Error(`Invalid provider for "${e}"`);return this._providers.set(e,t),this}run(e){const t="Injector.run";this.register(t,{factory:e});try{return this.get(t)}finally{this._instances.delete(t),this._providers.delete(t)}}}const
|
|
661
|
-
;return"1.
|
|
662
|
-
;n instanceof Event&&(e.extra||(e.extra={}),Object.assign(e.extra,{type:n.type,detail:n.detail,isTrusted:n.isTrusted}))}catch(e){}return e}});try{
|
|
663
|
-
;const
|
|
664
|
-
const e=await async function(e,t){return{...await
|
|
665
|
-
;n.register("annotationsService",
|
|
540
|
+
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 h=a.push([])-1,d=l[r].getElementsByTagName("td");for(o=0;o<s.length;++o){var p=" ";void 0!==d[o]&&(p=n.subParser("makeMarkdown.tableCell")(d[o],t)),a[h].push(p)}}var m=3;for(r=0;r<a.length;++r)for(o=0;o<a[r].length;++o){var f=a[r][o].length;f>m&&(m=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),m-1,"-")+":":a[r][o]=n.helper.padEnd(a[r][o],m,"-"):a[r][o]=n.helper.padEnd(a[r][o],m);i+="| "+a[r].join(" | ")+" |\n"}return i.trim()})),n.subParser("makeMarkdown.tableCell",(function(e,t){var r=""
|
|
541
|
+
;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(V)}(Sm);var Cm=Sm.exports;const Em=Bc(window);function Am(){return[{type:"output",filter:function(e){return e.replace(/<a href=/g,'<a target="_blank" href=')}}]}let Tm;function Nm(e){return"{math:"+e.toString()+"}"}function Mm(e){const t=function(e){const t=[];let n=0,r=e;for(;;){const e=r.indexOf("$$",n),o=r.indexOf("\\(",n);if(-1===e&&-1===o)break;let i,a
|
|
542
|
+
;if(-1!==e&&(-1===o||e<o)?(i=e,a=r.indexOf("$$",i+2)):(i=o,a=r.indexOf("\\)",i+2)),-1===a)break;a+=2;const s=t.length+1,l=Nm(s);let c;t.push({id:s,expression:r.slice(i+2,a-2),inline:-1!==o}),c=-1!==o?l:"\n\n"+l+"\n\n",r=r.slice(0,i)+c+r.slice(a),n=i+c.length}return{mathBlocks:t,content:r}}(e),n=Em.sanitize(function(e){return Tm||(Tm=new Cm.Converter({extensions:[Am],simplifiedAutoLink:!0,literalMidWordUnderscores:!0,strikethrough:!0})),Tm.makeHtml(e)}(t.content)),r=function(e,t){return t.reduce(((e,t)=>{let n;try{n=t.inline?km(t.expression):km(t.expression,{displayMode:!0})}catch(e){n=jc(t.expression)}return e.replace(Nm(t.id),n)}),e)}(n,t.mathBlocks);return r}function Lm({children:e,classes:t,...n}){return so("div",{dir:"auto",lang:"",className:Pr("StyledText",t),...n,children:e})}function zm({markdown:e,classes:t,style:n}){const r=Zr((()=>e?Mm(e):""),[e]),o=Xr();return Wr((()=>{!function(e,{className:t}={}){const n=Array.from(e.getElementsByTagName("a"));for(let e of n){const n=Bl(e)
|
|
543
|
+
;n&&(t?n.className=t:n.style.width="350px")}}(o.current,{className:"w-full md:w-[380px]"})}),[e]),so("div",{className:"w-full break-words cursor-text",children:so(Lm,{children:so("div",{className:t,"data-testid":"markdown-text",ref:o,dangerouslySetInnerHTML:{__html:r},style:n})})})}function Om({children:e}){return so("ul",{className:"flex flex-wrap gap-2 leading-none","aria-label":"Annotation tags",children:e})}function Rm({href:e,onRemoveTag:t,tag:n}){return so("li",{className:"flex items-center border rounded-sm bg-grey-0",children:[so("div",{className:"grow px-1.5 py-1 touch:p-2",children:e?so(To,{classes:"text-color-text-light hover:text-brand",href:e,lang:"",target:"_blank","aria-label":`Tag: ${n}`,title:`View annotations with tag: ${n}`,children:n}):so("span",{className:"text-color-text-light cursor-default","aria-label":`Tag: ${n}`,lang:"",children:n})}),t&&so("button",{
|
|
544
|
+
className:Pr("px-1.5 py-1 touch:p-2","border-l rounded-sm rounded-l-none","text-grey-6 hover:text-color-text hover:bg-grey-2","transition-colors duration-200","u-outline-on-keyboard-focus--inset"),onClick:()=>{t(n)},title:`Remove tag: ${n}`,children:so(Ao,{classes:"font-base",name:"cancel",title:`Remove ${n}`})})]})}function Dm({classes:e,setCollapsed:t,collapsed:n}){const r=n?"More":"Less";return so(fo,{classes:Pr("text-grey-7 font-normal",e),expanded:!n,onClick:()=>t(!n),title:`Toggle visibility of full annotation text: Show ${r}`,children:so("div",{className:"flex items-center gap-x-2",children:[so(Ao,{classes:Pr("!text-tiny"),name:n?"expand":"collapse",title:n?"expand":"collapse"}),so("div",{children:r})]})})}Em.addHook("afterSanitizeAttributes",(e=>{"target"in e&&e.setAttribute("target","_blank")}));var Im=Qo((function({annotation:e,settings:t}){var n,r
|
|
545
|
+
;const[o,i]=Vr(!0),[a,s]=Vr(!1),l=ws(),c=l.defaultAuthority(),u=l.getDraft(e),h=null!==(n=null==u?void 0:u.tags)&&void 0!==n?n:e.tags,d=null!==(r=null==u?void 0:u.text)&&void 0!==r?r:e.text,p=d.length>0,m=h.length>0,f=Zo(["annotationFontFamily"],t),g=Zr((()=>e&&!Ko(null==e?void 0:e.user,c)),[e,c]),v=e=>l.getLink("search.tag",{tag:e});return so("div",{className:"space-y-4",children:[p&&so(zl,{collapse:o,collapsedHeight:400,inlineControls:!1,onCollapsibleChanged:s,onToggleCollapsed:i,overflowThreshold:20,children:so(zm,{markdown:d,classes:Pr({"p-redacted-text":Bi(e)}),style:f})}),(a||m)&&so("div",{className:"flex flex-row gap-x-2",children:[so("div",{className:"grow",children:m&&so(Om,{children:h.map((e=>so(Rm,{tag:e,href:g?v(e):void 0},e)))})}),a&&so("div",{children:so(Dm,{classes:Pr("-mt-3"),collapsed:o,setCollapsed:i})})]})]})}),["settings"]);const Pm=0,Bm=1;function Fm(e,t,n,r){let o=e.selectionStart,i=e.selectionEnd;return o>=t+n?(o+=r.length-n,
|
|
546
|
+
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 jm(e,t=Pm){const n=e.text.slice(e.selectionStart,e.selectionEnd);let r,o="";if(t===Bm&&(o="!"),n.match(/[a-z]+:\/\/.*/)){const t="Description";return r=Fm(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";return r=Fm(e,e.selectionStart,n.length,t+i+")"),r.selectionStart=e.selectionStart+t.length,r.selectionEnd=r.selectionStart+i.length,r}}function Um(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=Fm(e,e.selectionStart,0,r),a.selectionStart=a.selectionEnd-r.length),
|
|
547
|
+
o===t&&i===n?(a=Fm(a,a.selectionStart-t.length,t.length,""),a=Fm(a,a.selectionEnd,n.length,"")):(a=Fm(a,a.selectionStart,0,t),a=Fm(a,a.selectionEnd,0,n)),a}function Hm(e,t){const n=e.indexOf("\n",t);return n<0?e.length:n}function qm(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=Hm(e.text,t);for(;i<=Hm(e.text,n);){const t=i===e.text.length,a=i-o,s=Hm((e=r(e,o,i)).text,o)-o;if(n+=s-a,t)break;o=o+s+1,i=Hm(e.text,o)}return e}function $m(e,t){const n=e.selectionStart,r=e.selectionEnd;let o=!0;return qm(e,n,r,((e,n)=>(e.text.slice(n,n+t.length)!==t&&(o=!1),e))),qm(e,n,r,o?(e,n)=>Fm(e,n,t.length,""):(e,n)=>e.text.slice(n,n+t.length)===t?e:Fm(e,n,0,t))}const Gm={bold:"b",image:"g",italic:"i",link:"l",list:"u",math:"m",numlist:"o",quote:"q"};function Vm({classes:e,icon:t,linkRef:n,...r}){return so(To,{classes:Pr("flex justify-center items-center","text-grey-7 hover:!text-grey-7","touch:h-touch-minimum touch:w-touch-minimum",e),linkRef:n,...r,children:so(Ao,{
|
|
548
|
+
classes:"text-tiny touch:text-base",name:t})})}function Ym({disabled:e=!1,iconName:t="",label:n,onClick:r,shortcutKey:o,title:i=""}){const a=Zr((()=>((e=window.navigator.userAgent)=>e.indexOf("Mac OS")>=0)()?"Cmd":"Ctrl"),[]);let s=i;o&&(s+=` (${a}-${o.toUpperCase()})`);const l={disabled:e,icon:t,onClick:r,title:s};return n?so(fo,{classes:Pr("font-normal bg-transparent","hover:!bg-transparent"),...l,children:n}):so(mo,{classes:"px-2 py-2.5 text-tiny touch:text-base",...l})}function Wm({classes:e,containerRef:t,...n}){return so("textarea",{className:Pr("border rounded-sm p-2","text-color-text-light bg-grey-0","focus:bg-white focus:outline-none focus:shadow-focus-inner",e),...n,ref:t})}function Km({isPreviewing:e,onCommand:t,onTogglePreview:n}){const r=Xr(null);return function(e,{autofocus:t=!1,horizontal:n=!0,vertical:r=!0,selector:o="a,button"}={}){Wr((()=>{if(!e.current)throw new Error("Container ref not set");const i=e.current,a=()=>Array.from(i.querySelectorAll(o)).filter((e=>{
|
|
549
|
+
return null!==e.offsetParent&&!("boolean"==typeof(t=e).disabled&&t.disabled);var t})),s=(e=a(),t=-1,n=!1)=>{t<0&&(t=e.findIndex((e=>0===e.tabIndex)))<0&&(t=0);for(let[r,o]of e.entries())o.tabIndex=r===t?0:-1,r===t&&n&&o.focus()};s(a(),0,t);const l=new dl;l.add(i,"focusin",(e=>{const t=a(),n=t.indexOf(e.target);n>=0&&s(t,n)})),l.add(i,"keydown",(e=>{const t=a();let o=t.findIndex((e=>0===e.tabIndex)),i=!1;n&&"ArrowLeft"===e.key||r&&"ArrowUp"===e.key?(0===o?o=t.length-1:--o,i=!0):n&&"ArrowRight"===e.key||r&&"ArrowDown"===e.key?(o===t.length-1?o=0:++o,i=!0):"Home"===e.key?(o=0,i=!0):"End"===e.key&&(o=t.length-1,i=!0),i&&(s(t,o,!0),e.preventDefault(),e.stopPropagation())}));const c=new MutationObserver((()=>{s()}));return c.observe(i,{subtree:!0,attributes:!0,attributeFilter:["disabled"],childList:!0}),()=>{l.removeAll(),c.disconnect()}}),[t,e,n,o,r])}(r),so("div",{
|
|
550
|
+
className:Pr("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:r,children:[so(Ym,{disabled:e,iconName:"format-bold",onClick:()=>t("bold"),shortcutKey:Gm.bold,title:"Bold"}),so(Ym,{disabled:e,iconName:"format-italic",onClick:()=>t("italic"),shortcutKey:Gm.italic,title:"Italic"}),so(Ym,{disabled:e,iconName:"format-quote",onClick:()=>t("quote"),shortcutKey:Gm.quote,title:"Quote"}),so(Ym,{disabled:e,iconName:"link",onClick:()=>t("link"),shortcutKey:Gm.link,title:"Insert link"}),so(Ym,{disabled:e,iconName:"image",onClick:()=>t("image"),shortcutKey:Gm.image,title:"Insert image"}),so(Ym,{disabled:e,iconName:"format-functions",onClick:()=>t("math"),title:"Insert math (LaTeX is supported)"}),so(Ym,{disabled:e,iconName:"format-list-numbered",onClick:()=>t("numlist"),shortcutKey:Gm.numlist,title:"Numbered list"}),so(Ym,{disabled:e,
|
|
551
|
+
iconName:"format-list-unordered",onClick:()=>t("list"),shortcutKey:Gm.list,title:"Bulleted list"}),so("div",{className:"grow flex justify-end",children:[so(Vm,{classes:Pr("px-2 py-2.5"),href:"https://web.hypothes.is/help/formatting-annotations-with-markdown/",icon:"help",target:"_blank",title:"Formatting help","aria-label":"Formatting help"}),so(Ym,{label:e?"Write":"Preview",onClick:n})]})]})}function Xm({label:e="",onEditText:t=(()=>{}),text:n="",textStyle:r={}}){const[o,i]=Vr(!1),a=Xr(null);Wr((()=>{var e;o||(null===(e=a.current)||void 0===e||e.focus())}),[o]);const s=e=>{a.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)?Um(e,"$$","$$","Insert LaTeX"):Um(e,"\\(","\\)","Insert LaTeX")};switch(e){case"bold":n((e=>Um(e,"**","**","Bold")))
|
|
552
|
+
;break;case"italic":n((e=>Um(e,"*","*","Italic")));break;case"quote":n((e=>$m(e,"> ")));break;case"link":n((e=>jm(e)));break;case"image":n((e=>jm(e,Bm)));break;case"math":n(r);break;case"numlist":n((e=>$m(e,"1. ")));break;case"list":n((e=>$m(e,"* ")));break;default:throw new Error(`Unknown toolbar command "${e}"`)}}(e,a.current),t(a.current.value))};return so("div",{className:"leading-none",children:[so(Km,{onCommand:s,isPreviewing:o,onTogglePreview:()=>i(!o)}),o?so(zm,{markdown:n,classes:"border bg-grey-1 p-2",style:r}):so(Wm,{"aria-label":e,dir:"auto",classes:Pr("w-full min-h-[8em] resize-y","rounded-t-none","text-base touch:text-touch-base"),containerRef:a,onClick:e=>e.stopPropagation(),onKeyDown:e=>{if(e.ctrlKey||e.metaKey)for(let[t,n]of Object.entries(Gm))n===No(e.key)&&(e.stopPropagation(),e.preventDefault(),s(t))},onInput:e=>t(e.target.value),value:n,style:r})]})}const Zm=e=>e;function Jm({activeItem:e=-1,id:t,itemPrefixId:n,list:r,listFormatter:o=Zm,onSelectItem:i,open:a=!1}){
|
|
553
|
+
const s=Zr((()=>r.map(((t,r)=>{const a=n?{id:`${n}${r}`}:{};return so("li",{role:"option","aria-selected":(e===r).toString(),className:Pr("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 so("div",{className:"relative",children:so(bo,{classes:Pr({hidden:c},"absolute top-[3px] z-3","w-auto min-w-[10em] theme-clean:border p-0"),children:[so("ul",{tabIndex:-1,"aria-label":"Suggestions",role:"listbox",...l,children:s}),so(Sl,{direction:"up",classes:"top-[-10px] left-[3px]"})]})})}let Qm=0;var ef=Qo((function({onAddTag:e,onRemoveTag:t,onTagInput:n,tagList:r,tags:o}){const i=Xr(),[a,s]=Vr([]),[l,c]=Vr(-1),[u,h]=Vr(!1),[d]=Vr((()=>(++Qm,`TagEditor-${Qm}`))),p=Xr();Lo(p,u,(()=>{h(!1)}));const m=()=>i.current.value.trim(),f=()=>m()&&m().length>0,g=()=>{i.current.value="",null==n||n("")
|
|
554
|
+
},v=t=>{e(t)&&(h(!1),c(-1),g(),i.current.focus())},_=e=>{let t=l+e;t<-1?t=a.length-1:t>=a.length&&(t=-1),c(t)},b=l>=0?`${d}-AutocompleteList-item-${l}`:"";return so("div",{className:"space-y-4",children:[so(Om,{children:r.map((e=>so(Rm,{onRemoveTag:t,tag:e},e)))}),so("div",{id:d,"data-testid":"combobox-container",ref:p,role:"combobox","aria-expanded":u.toString(),"aria-owns":`${d}-AutocompleteList`,"aria-haspopup":"listbox",children:[so(Uo,{classes:"w-full",onInput:()=>{null==n||n(m()),(()=>{if(f()){const e=o.filter(m());s(((e,t)=>{const n=[];for(let r of e)t.indexOf(r)<0&&n.push(r);return n.sort()})(e,r)),h(e.length>0)}else h(!1);c(-1)})()},onKeyDown:e=>{switch(No(e.key)){case"ArrowUp":_(-1),e.preventDefault();break;case"ArrowDown":_(1),e.preventDefault();break;case"Escape":g(),e.preventDefault();break;case"Enter":case",":v(-1===l?m():a[l]),e.preventDefault();break;case"Tab":if(!f())break;-1!==l?v(a[l]):1===a.length?v(a[0]):v(m()),e.preventDefault()}},onFocus:()=>{f()&&h(!0)},inputRef:i,
|
|
555
|
+
placeholder:"Add new tags",type:"text",autoComplete:"off","aria-autocomplete":"list","aria-activedescendant":b,"aria-controls":`${d}-AutocompleteList`,dir:"auto"}),so(Jm,{id:`${d}-AutocompleteList`,list:a,listFormatter:e=>{const t=m().toLowerCase(),n=e.toLowerCase().indexOf(t);if(-1===n)return so("span",{children:e});const r=e.slice(0,n),o=e.slice(n,n+t.length),i=e.slice(n+t.length);return so("span",{children:[so("strong",{children:r}),o,so("strong",{children:i})]})},open:u,onSelectItem:e=>{e&&v(e)},itemPrefixId:`${d}-AutocompleteList-item-`,activeItem:l})]})]})}),["tags"]);function tf(){return so("div",{className:"pt-2 border-t text-sm leading-none",children:so(To,{classes:"flex items-center text-color-text-light",href:"http://creativecommons.org/publicdomain/zero/1.0/",target:"_blank",title:"View more information about the Creative Commons Public Domain dedication",children:[so(Ao,{name:"cc-std",classes:"text-tiny"}),so(Ao,{name:"cc-zero",classes:"ml-px text-tiny"}),so("div",{className:"ml-1",
|
|
556
|
+
children:"Annotations can be freely reused by anyone for any purpose."})]})})}function nf(e){return null!==e.offsetParent}function rf({className:e,closeMenu:t,children:n,visible:r}){const o=Xr();Wr((()=>{let e;return r&&(e=setTimeout((()=>{const e=o.current.querySelector('[role^="menuitem"]');e&&e.focus()}))),()=>{clearTimeout(e)}}),[r]);return so("div",{role:"menu",className:e,ref:o,onKeyDown:e=>{const n=Array.from(o.current.querySelectorAll('[role^="menuitem"]')).filter(nf);let r=n.findIndex((e=>e.contains(document.activeElement))),i=!1;switch(No(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 of=!1;const af=()=>{}
|
|
557
|
+
;function sf({align:e="left",arrowClass:t="",children:n,containerPositioned:r=!0,contentClass:o,defaultOpen:i=!1,label:a,open:s,onOpenChanged:l,menuIndicator:c=!0,title:u}){let[h,d]=Vr(i);"boolean"==typeof s&&(h=s,d=l||af);const p=Xr(h);Wr((()=>{"function"==typeof l&&p.current!==h&&(p.current=h,l(h))}),[h,l]);const f=e=>{if("mousedown"===e.type)of=!0;else if("click"===e.type&&of)return of=!1,e.stopPropagation(),void e.preventDefault();d(!h)},g=Jr((()=>d(!1)),[d]),v=Xr();Lo(v,h,g);const _=e=>e.stopPropagation();return so("div",{className:"relative","data-testid":"menu-container",ref:v,style:{position:r?"relative":"static"},onClick:_,onMouseDown:_,children:[so("button",{"aria-expanded":h?"true":"false","aria-haspopup":!0,className:Pr("u-outline-on-keyboard-focus","flex items-center justify-center rounded-sm transition-colors",{"text-grey-7 hover:text-grey-9":!h,"text-brand":h}),"data-testid":"menu-toggle-button",onMouseDown:f,onClick:f,"aria-label":u,title:u,children:so("span",{
|
|
558
|
+
className:"flex items-center gap-x-1",children:[a,c&&so("span",{className:Pr({"rotate-180 text-color-text":h}),children:so(Ao,{name:"expand-menu",classes:"w-2.5 h-2.5"})})]})}),h&&so(m,{children:[so(Sl,{direction:"up",classes:Pr("right-0 top-[calc(100%-6px)] w-[15px]",t)}),so("div",{className:Pr("u-outline-on-keyboard-focus","absolute top-[calc(100%+5px)] z-1 border shadow","bg-white text-lg",{"left-0":"left"===e,"right-0":"right"===e},o),"data-testid":"menu-content",role:"menu",tabIndex:-1,onClick:g,onKeyDown:e=>{const t=No(e.key);"Enter"!==t&&" "!==t||setTimeout((()=>{g()}))},children:so(rf,{visible:!0,children:n})})]})]})}function lf({children:e,visible:t}){const n=Xr(),[r,o]=Vr(t?"auto":0),[i,a]=Vr(t);Wr((()=>{if(t===(0!==r))return;const e=n.current;t?(e.style.display="",a(!0),o(e.scrollHeight)):(e.style.height=`${e.scrollHeight}px`,e.getBoundingClientRect(),o(0))}),[r,t]);return so("div",{ontransitionend:Jr((()=>{t?o("auto"):a(!1)}),[o,t]),ref:n,style:{display:i?"":"none",height:r,
|
|
559
|
+
overflow:"auto"===r?"visible":"hidden",transition:"height 0.15s ease-in"},children:e})}function cf({title:e,isExpanded:t,onToggleSubmenu:n}){return so("div",{"data-testid":"submenu-toggle",role:"none",className:Pr("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:so(Ao,{name:t?"collapse-menu":"expand-menu",classes:"w-3 h-3"})})}function uf({href:e,icon:t,iconAlt:n,isDisabled:r,isExpanded:o,isSelected:i,isSubmenuItem:a,isSubmenuVisible:s,label:l,onClick:c,onToggleSubmenu:u,submenu:h}){const d=t&&-1!==t.indexOf("/"),p=Xr();let f,g;const v="boolean"==typeof s,_="boolean"==typeof i;Wr((()=>()=>{clearTimeout(f)}),[]);const b=e=>{switch(No(e.key)){case"ArrowRight":u&&(e.stopPropagation(),e.preventDefault(),u(e));break;case"Enter":case" ":c&&c(e)}};let y=null;t&&"blank"!==t&&(y=d?so("img",{className:"w-4 h-4",alt:n,src:t
|
|
560
|
+
}):so(Ao,{name:t,classes:"h-3 w-3"}));const w=a?null:y,x=a?y:null,k=x&&a,S=so(m,{children:[(w||a||"blank"===t)&&so("div",{className:"w-7 flex items-center justify-center","data-testid":"left-item-container",children:w}),so("span",{className:"flex items-center grow whitespace-nowrap px-1",children:l}),k&&so("div",{className:"w-8 flex items-center justify-center","data-testid":"right-item-container",children:x}),v&&so(cf,{title:`Show actions for ${l}`,isExpanded:s,onToggleSubmenu:u})]}),C=Pr("u-outline-on-keyboard-focus--inset","w-full min-w-[150px] flex items-center select-none","border-b","group",{"min-h-[30px] font-normal":a,"min-h-[40px] font-medium":!a,"bg-grey-1 hover:bg-grey-3":a||o,"bg-white hover:bg-grey-1":!a&&!o,"pr-1":!v},{"border-l-[4px] border-l-brand":i,"pl-[4px]":!i,"border-b-grey-3":o,"border-b-transparent":!o,"text-color-text-light":r,"text-color-text":!r});return g=e?so("a",{ref:p,className:C,"data-testid":"menu-item",href:e,target:"_blank",tabIndex:-1,rel:"noopener noreferrer",
|
|
561
|
+
role:"menuitem",onKeyDown:b,children:S}):so("div",{ref:p,className:C,"data-testid":"menu-item",tabIndex:-1,onKeyDown:b,onClick:c,role:_?"menuitemradio":"menuitem","aria-checked":_?i:void 0,"aria-haspopup":v,"aria-expanded":v?s:void 0,children:S}),so(m,{children:[g,v&&so(lf,{visible:s,children:so(rf,{closeMenu:e=>{u&&u(e),f=setTimeout((()=>{p.current.focus()}))},visible:s,className:"border-b",children:h})})]})}var hf=Qo((function({group:e,isDisabled:t,isPrivate:n,onCancel:r,onSave:o,onSetPrivate:i,settings:a}){const s=Zo(["ctaTextColor","ctaBackgroundColor"],a),l=so("div",{className:"w-9 h-9 flex items-center justify-center text-color-text-inverted",style:s,children:so(Ao,{name:"expand-menu",classes:"w-4 h-4"})});return so("div",{className:"flex flex-row gap-x-3",children:[so("div",{className:"flex relative",children:[so(fo,{classes:Pr("rounded-r-none"),"data-testid":"publish-control-button",style:s,onClick:o,disabled:t,size:"large",variant:"primary",children:["Post to ",n?"Only Me":e.name]}),so("div",{
|
|
562
|
+
className:Pr("flex flex-row rounded-r-sm bg-grey-7 hover:bg-grey-8"),style:s,children:so(sf,{arrowClass:Pr("right-[10px]"),containerPositioned:!1,contentClass:Pr("min-w-full"),label:l,menuIndicator:!1,title:"Change annotation sharing setting",align:"left",children:[so(uf,{icon:"open"===e.type?"public":"groups",label:e.name,isSelected:!n,onClick:()=>i(!1)}),so(uf,{icon:"lock",label:"Only Me",isSelected:n,onClick:()=>i(!0)})]})})]}),so("div",{children:so(fo,{classes:"p-2.5",icon:"cancel",onClick:r,size:"large",children:"Cancel"})})]})}),["settings"]);var df=Qo((function({annotation:e,draft:t,annotationsService:n,settings:r,tags:o,toastMessenger:i}){const[a,s]=Vr(null),l=ws(),c=l.getGroup(e.group),u=!t.isPrivate&&c&&"private"!==c.type,h=t.tags,d=t.text,p=!d&&!h.length,m=Jr((e=>{l.createDraft(t.annotation,{...t,tags:e})}),[t,l]),f=Jr((e=>{if(!e||h.indexOf(e)>=0)return!1;const t=[...h,e];return o.store(t),m(t),!0}),[m,h,o]),g=Jr((e=>{const t=[...h],n=t.indexOf(e);return n>=0&&(t.splice(n,1),m(t),!0)
|
|
563
|
+
}),[m,h]),v=Jr((e=>{l.createDraft(t.annotation,{...t,text:e})}),[t,l]),_=Jr((n=>{l.createDraft(e,{...t,isPrivate:n}),zi(e)||l.setDefault("annotationPrivacy",n?"private":"shared")}),[e,t,l]),b=async()=>{a&&f(a);const t=`${qi(e)} ${Oi(e)?"updated":"saved"}`;try{await n.save(e),i.success(t,{visuallyHidden:!0})}catch(e){i.error("Saving annotation failed")}},y=Jr((()=>{l.removeDraft(e),Oi(e)||l.removeAnnotations([e])}),[e,l]);return so("div",{"data-testid":"annotation-editor",className:"space-y-4",onKeyDown:e=>{const t=No(e.key);p||(e.metaKey||e.ctrlKey)&&"Enter"===t&&(e.stopPropagation(),e.preventDefault(),b())},children:[so(Xm,{textStyle:Zo(["annotationFontFamily"],r),label:"Annotation body",text:d,onEditText:v}),so(ef,{onAddTag:f,onRemoveTag:g,onTagInput:s,tagList:h}),c&&so(hf,{group:c,isDisabled:p,isPrivate:t.isPrivate,onCancel:y,onSave:b,onSetPrivate:_}),u&&so(tf,{})]})}),["annotationsService","settings","tags","toastMessenger"]);function pf({domain:e,link:t,title:n}){return so("div",{
|
|
564
|
+
className:"flex gap-x-1",children:[so("div",{className:"text-color-text-light",children:['on "',t?so(To,{href:t,target:"_blank",children:n}):so("span",{children:n}),'"']}),e&&so("span",{className:"text-color-text-light",children:["(",e,")"]})]})}function mf({group:e,isPrivate:t}){const n=null==e?void 0:e.links.html;return so(m,{children:[e&&n&&so(To,{classes:Pr("flex items-baseline gap-x-1","p-muted-link"),href:e.links.html,target:"_blank",children:[so(Ao,{classes:"text-tiny",name:"open"===e.type?"public":"groups"}),so("span",{children:e.name})]}),t&&!n&&so("div",{className:"text-color-text-light","data-testid":"private-info",children:"Only me"})]})}let ff={};function gf(e,t){return t-e}function vf(e,t,n=window.Intl){const r=JSON.stringify(t);let o=ff[r];return o||(o=ff[r]=new n.DateTimeFormat(void 0,t)),o.format(e)}const _f=[{test:(e,t)=>gf(e,t)<3e4,formatter:()=>"Just now",nextUpdate:1e3},{test:(e,t)=>gf(e,t)<6e4,formatter:function(e,t){return`${Math.floor(gf(e,t)/1e3)} secs ago`},nextUpdate:1e3},{
|
|
565
|
+
test:(e,t)=>gf(e,t)<36e5,formatter:function(e,t){const n=Math.floor(gf(e,t)/6e4);return`${n} min${n>1?"s":""} ago`},nextUpdate:6e4},{test:(e,t)=>gf(e,t)<864e5,formatter:function(e,t){const n=Math.floor(gf(e,t)/36e5);return`${n} hr${n>1?"s":""} ago`},nextUpdate:36e5},{test:(e,t)=>e.getFullYear()===t.getFullYear(),formatter:function(e,t,n){return vf(e,{month:"short",day:"numeric"},n)},nextUpdate:null}],bf={test:()=>!0,formatter:function(e,t,n){return vf(e,{day:"numeric",month:"short",year:"numeric"},n)},nextUpdate:null};function yf(e,t){for(let n of _f)if(n.test(e,t))return n;return bf}function wf(e){return!isNaN(e.valueOf())}function xf(e,t){let n;const r=new Date(e),o=()=>{const e=function(e,t){if(!e||!wf(e)||!wf(t))return null;let n=yf(e,t).nextUpdate;return null===n?null:(n=Math.max(n,5e3),n=Math.min(n,20736e5),n)}(r,new Date);if(null===e)return;n=setTimeout((()=>{t(),o()}),e+500)};return o(),()=>clearTimeout(n)}function kf(e,t,n){return e?yf(e,t).formatter(e,t,n):""}function Sf(e,t){return vf(e,{
|
|
566
|
+
year:"numeric",month:"short",day:"2-digit",weekday:"long",hour:"2-digit",minute:"2-digit"},t)}function Cf({annotationCreated:e,annotationUpdated:t,annotationUrl:n,withEditedTimestamp:r}){const[o,i]=Vr((()=>new Date)),a=Zr((()=>new Date(e)),[e]),s=Zr((()=>r&&new Date(t)),[t,r]),l=Zr((()=>({absolute:Sf(a),relative:kf(a,o)})),[a,o]),c=Zr((()=>s?{absolute:Sf(s),relative:kf(s,o)}:{}),[s,o]);Wr((()=>xf(s?t:e,(()=>i(new Date)))),[e,t,a,s,o]);const u=c&&c.relative!==l.relative?`edited ${c.relative}`:"edited";return so("div",{children:[r&&so("span",{className:"text-color-text-light text-sm italic","data-testid":"timestamp-edited",title:c.absolute,children:["(",u,")"," "]}),n?so(To,{classes:"p-muted-link",target:"_blank",title:l.absolute,href:n,children:l.relative}):so("span",{className:"color-text-color-light","data-testid":"timestamp-created",title:l.absolute,children:l.relative})]})}function Ef({authorLink:e,displayName:t}){const n=so("h3",{className:"text-color-text font-bold",children:t});return e?so(To,{href:e,
|
|
567
|
+
target:"_blank",children:n}):so("div",{children:n})}function Af({children:e}){return so("div",{className:"flex gap-x-1 items-baseline flex-wrap-reverse",children:e})}var Tf=Qo((function({annotation:e,isEditing:t,replyCount:n,threadIsCollapsed:r,settings:o}){var i;const a=ws(),{authorDisplayName:s,authorLink:l}=Zr((()=>function(e,t,n){return{authorDisplayName:fl(e,t),authorLink:gl(e,t,n)}}(e,a,o)),[e,a,o]),c=zi(e)&&r,u=(null===(i=e.links)||void 0===i?void 0:i.html)||"",h=Zr((()=>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)&&!c),[e,c]),d=function(e){return{domain:Mi(e),titleText:Li(e),titleLink:Ni(e)}}(e),p=u&&d.titleLink?d.titleLink:"",m="sidebar"!==a.route()&&d.titleText,f=a.getGroup(e.group);return so("header",{children:[so(Af,{children:[xl(e.permissions)&&!t&&so(Ao,{classes:"text-tiny",name:"lock",title:"This annotation is visible only to you"}),so(Ef,{authorLink:l,
|
|
568
|
+
displayName:s}),n>0&&c&&so(go,{onClick:()=>a.setExpanded(e.id,!0),title:"Expand replies",children:`${n} ${n>1?"replies":"reply"}`}),!t&&e.created&&so("div",{className:"flex justify-end grow",children:so(Cf,{annotationCreated:e.created,annotationUpdated:e.updated,annotationUrl:u,withEditedTimestamp:h})})]}),!zi(e)&&so(Af,{children:[f&&so(mf,{group:f,isPrivate:xl(e.permissions)}),!t&&Fi(e)&&so(Ao,{name:"highlight",title:"This is a highlight. Click 'edit' to add a note or tag.",classes:"text-tiny text-color-text-light"}),m&&so(pf,{domain:d.domain,link:p,title:d.titleText})]})]})}),["settings"]);var Nf=Qo((function({quote:e,isFocused:t,isOrphan:n,settings:r}){return so(zl,{collapsedHeight:35,inlineControls:!0,overflowThreshold:20,children:so(Lm,{classes:Pr({"p-redacted-text":n}),children:so("blockquote",{className:Pr("hover:border-l-blue-quote",{"border-l-blue-quote":t}),style:Zo(["selectionFontFamily"],r),children:e})})})}),["settings"]);function Mf({onToggleReplies:e,replyCount:t,threadIsCollapsed:n}){
|
|
569
|
+
const r=`${n?"Show replies":"Hide replies"} (${t})`;return so(go,{onClick:e,title:r,children:r})}function Lf(){return so("div",{className:Pr("flex grow justify-end items-center gap-x-1","h-8 touch:h-touch-minimum"),"data-testid":"saving-message",children:[so(Fo,{classes:Pr("text-xl","animate-fade-in-slow"),size:"small"}),so("div",{className:"text-color-text-light font-medium",children:"Saving..."})]})}var zf=Qo((function({annotation:e,isReply:t,onToggleReplies:n,replyCount:r,threadIsCollapsed:o,annotationsService:i}){const a=ws(),s=Gi(e),l=a.getDraft(e),c=a.profile().userid,u=a.isAnnotationFocused(e.$tag),h=a.isSavingAnnotation(e),d=!!l&&!h,p=t&&o,m=!h&&!d&&Oi(e),f=Zr((()=>fl(e,a)),[e,a]);return so("article",{className:"space-y-4","aria-label":`${qi(e)} by ${f}`,children:[so(Tf,{annotation:e,isEditing:d,replyCount:r,threadIsCollapsed:o}),s&&so(Nf,{quote:s,isFocused:u,isOrphan:ji(e)}),!p&&!d&&so(Im,{annotation:e}),d&&so(df,{annotation:e,draft:l}),!p&&so("footer",{className:"flex items-center",
|
|
570
|
+
children:[n&&so(Mf,{onToggleReplies:n,replyCount:r,threadIsCollapsed:o}),h&&so(Lf,{}),m&&so(yo,{classes:"grow",children:so(Nl,{annotation:e,onReply:()=>{Oi(e)&&c&&i.reply(e,c)}})})]})]})}),["annotationsService"]);function Of({isReply:e,replyCount:t,threadIsCollapsed:n,onToggleReplies:r}){return so("article",{className:"space-y-4","aria-label":(e?"Reply":"Annotation")+" with unavailable content",children:[so("div",{children:so("em",{children:"Message not available."})}),r&&so("footer",{className:"flex items-center",children:so(Mf,{onToggleReplies:r,replyCount:t,threadIsCollapsed:n})})]})}var Rf=Qo((function({annotation:e,api:t,toastMessenger:n}){const r=ws(),o=function(e){return e.moderation?e.moderation.flagCount:null}(e);return null!==o&&(o>0||e.hidden)?so("div",{className:Pr("flex gap-x-3 bg-grey-1 text-color-text font-semibold","mb-2 ",{"-mt-3 -ml-3 -mr-3":!zi(e),"-mr-3":zi(e)}),children:[so("div",{className:Pr("p-3 text-white",{"bg-red-error":!e.hidden,"bg-grey-6":e.hidden}),children:so(Ao,{
|
|
571
|
+
name:e.hidden?"hide":"flag"})}),so("div",{className:"self-center grow",children:[!e.hidden&&so("span",{children:["Flagged for review by ",o," ",1===o?"user":"users"]}),e.hidden&&so("span",{children:"Hidden from users"})]}),so("div",{className:"self-center pr-2",children:so(fo,{classes:"py-1 bg-slate-1",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 annotationn from non-moderators",variant:"dark",children:e.hidden?"Unhide":"Hide"})})]}):null}),["api","toastMessenger"]);function Df({threadIsCollapsed:e,onToggleReplies:t}){const n=e?"collapsed":"expand-menu",r=e?"Expand replies":"Collapse replies";return so("div",{className:Pr("cursor-auto",{"bg-thread-line":!e}),"data-testid":"thread-collapse-channel",
|
|
572
|
+
children:so("div",{className:Pr("bg-white"),children:so(mo,{classes:Pr("-mt-1 touch:min-w-[auto] touch:min-h-[auto]"),expanded:!e,icon:n,title:r,onClick:t,size:"medium",variant:"light"})})})}var If=Qo((function e({thread:t,threadsService:n}){const r=!!t.parent,o=t.children.filter((e=>$s(e)>0)),i=ws(),a=i.hasAppliedFilter(),s=t.annotation&&i.isSavingAnnotation(t.annotation),l=t.annotation&&!!i.getDraft(t.annotation)&&!s,c=Jr((()=>i.setExpanded(t.id,!!t.collapsed)),[i,t.id,t.collapsed]),u=!r&&!l&&!a&&t.replyCount>0,h=Zr((()=>t.visible&&so(m,{children:t.annotation?so(m,{children:[so(Rf,{annotation:t.annotation}),so(zf,{annotation:t.annotation,isReply:r,onToggleReplies:u?c:void 0,replyCount:t.replyCount,threadIsCollapsed:t.collapsed})]}):so(Of,{isReply:r,onToggleReplies:u?c:void 0,replyCount:t.replyCount,threadIsCollapsed:t.collapsed})})),[r,c,u,t.annotation,t.replyCount,t.collapsed,t.visible]);return so("section",{className:"flex","data-testid":"thread-container",children:[r&&so(Df,{
|
|
573
|
+
threadIsCollapsed:t.collapsed,onToggleReplies:c}),so("div",{className:Pr("grow max-w-full"),"data-testid":"thread-content",children:[h,qs(t)>0&&so("div",{className:"space-y-2",children:[!t.parent&&t.annotation&&so(Tf,{annotation:t.annotation,isEditing:l,replyCount:t.replyCount,threadIsCollapsed:t.collapsed}),so("div",{children:so(fo,{onClick:()=>n.forceVisible(t),children:["Show ",qs(t)," more in conversation"]})})]}),!t.collapsed&&so("ul",{className:Pr("-ml-3"),"data-testid":"thread-children",children:o.map((t=>so("li",{className:"mt-2",children:so(e,{thread:t,threadsService:n})},t.id)))})]})]})}),["threadsService"]);var Pf=Qo((function({frameSync:e,thread:t}){var n,r;const o=ws(),i=null!==(n=null===(r=t.annotation)||void 0===r?void 0:r.$tag)&&void 0!==n?n:null,a=i&&o.isAnnotationFocused(i),s=Zr((()=>hl((t=>{const n=t?[t]:[];e.focusAnnotations(n)}),10)),[e]),l=Jr((t=>{e.scrollToAnnotation(t)}),[e]),c=Zr((()=>so(If,{thread:t})),[t]);return so(bo,{classes:Pr("p-3 cursor-pointer",{"is-focused":a}),
|
|
574
|
+
"data-testid":"thread-card",onClick:e=>{var t;(t=e.target).closest("button")||t.closest("a")||!i||l(i)},onMouseEnter:()=>s(null!=i?i:null),onMouseLeave:()=>s(null),children:c},t.id)}),["frameSync"]);function Bf(){const e=document.querySelector(".js-thread-list-scroll-root");if(!e)throw new Error("Scroll container is missing");return e}function Ff(e){return Math.max(e-e%50,0)}function jf({threads:e}){const[t,n]=Vr(0),[r,o]=Vr(0);Kr((()=>{const e=new dl,t=Bf();n(t.clientHeight),o(Ff(t.scrollTop));const r=hl((()=>{n(t.clientHeight),o(Ff(t.scrollTop))}),10,{maxWait:100});return e.add(t,"scroll",r),e.add(window,"resize",r),()=>{e.removeAll(),r.cancel()}}),[]);const[i,a]=Vr((()=>new Map)),[s,l]=Vr(null),c=e,{offscreenLowerHeight:u,offscreenUpperHeight:h,visibleThreads:d}=Zr((()=>function(e,t,n,r,o=pl){const{defaultHeight:i,marginAbove:a,marginBelow:s}=o,l=[];let c=0,u=0,h=0;return e.forEach((e=>{const o=t.get(e.id)||i;c+o<n-a?u+=o:c<n+r+s?l.push(e):h+=o,c+=o})),{visibleThreads:l,offscreenUpperHeight:u,
|
|
575
|
+
offscreenLowerHeight:h}}(c,i,r,t)),[c,i,r,t]),p=ws(),m=(()=>{const e=p.unsavedAnnotations();return e.length?e[e.length-1].$tag:null})();return Wr((()=>{m&&(p.setForcedVisible(m,!0),l(m))}),[p,m]),Wr((()=>{if(!s)return;const e=c.findIndex((e=>e.id===s));if(-1===e)return;l(null);const t=c.slice(0,e).reduce(((e,t)=>e+(e=>i.get(e.id)||pl.defaultHeight)(t)),0);Bf().scrollTop=t}),[s,c,i]),Wr((()=>{a((e=>{const t=new Map;for(let{id:n}of d){const r=document.getElementById(n);if(!r)return console.warn("ThreadList could not measure thread. Element not found."),e;const o=ml(r);o!==e.get(n)&&t.set(n,o)}return 0===t.size?e:new Map([...e,...t])}))}),[d]),so("div",{children:[so("div",{style:{height:h}}),d.map((e=>so("div",{className:Pr("mb-3"),"data-testid":"thread-card-container",id:e.id,children:so(Pf,{thread:e})},e.id))),so("div",{style:{height:u}})]})}function Uf({errorType:e,onLoginRequest:t,showClearSelection:n=!1}){const r=ws(),o=r.isLoggedIn();return so("div",{className:"mb-4",children:so(Po,{icon:"restricted",
|
|
576
|
+
title:"annotation"===e?"Annotation unavailable":"Group unavailable",children:[so("p",{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.`}),so("div",{className:"flex justify-end space-x-2",children:[n&&so(fo,{variant:o?"primary":void 0,onClick:()=>r.clearSelection(),children:"Show all annotations"}),!o&&so(fo,{variant:"primary",onClick:t,children:"Log in"})]})]})})}var Hf=Qo((function({loadAnnotationsService:e,onLogin:t}){const n=ws(),r=n.routeParams().id,o=Xs(),i=n.profile().userid,[a,s]=Vr(!1);return Wr((()=>{s(!1),n.clearAnnotations(),e.loadThread(r).then((e=>{const t=e.filter((e=>0===(e.references||[]).length))[0];t&&(e.forEach((e=>n.setExpanded(e.id,!0))),
|
|
577
|
+
t.id!==r&&n.highlightAnnotations([r]))})).catch((()=>{s(!0)}))}),[r,i,e,n]),so(m,{children:[a&&so(Uf,{errorType:"annotation",onLoginRequest:t}),so(jf,{threads:o.children})]})}),["loadAnnotationsService"]);function qf({additionalCount:e=0,entitySingular:t="annotation",entityPlural:n="annotations",filterQuery:r,focusDisplayName:o,resultCount:i}){return so(m,{children:[i>0&&so("span",{children:"Showing "}),so("span",{className:"whitespace-nowrap font-bold",children:[i>0?i:"No"," ",1===i?t:n]}),r&&so("span",{children:[" ","for ",so("span",{className:"break-words",children:`'${r}'`})]}),o&&so("span",{children:[" ","by"," ",so("span",{className:"whitespace-nowrap font-bold",children:o})]}),e>0&&so("span",{className:"whitespace-nowrap italic text-color-text-light",children:[" ","(and ",e," more)"]})]})}function $f(){
|
|
578
|
+
const e=ws(),t=Xs(),n=e.annotationCount(),r=e.directLinkedAnnotationId(),o=e.filterQuery(),i=e.focusState(),a=e.forcedVisibleThreads().length,s=e.selectedAnnotations().length,l=Zr((()=>s>0?"selection":o?"query":i.configured?"focus":null),[s,o,i]),c=Zr((()=>"selection"===l?s:$s(t)-a),[l,s,t,a]),u=Zr((()=>{if("selection"===l){return(t.children||[]).filter((e=>e.annotation&&e.visible)).length-s}return a}),[l,a,t.children,s]),h=Zr((()=>{if("selection"===l){return!i.configured&&!r?`Show all (${n})`:"Show all"}return"focus"===l?a>0?"Reset filters":i.active?"Show all":`Show only ${i.displayName}`:"Clear search"}),[n,r,i,l,a]);return so(bo,{classes:Pr("mb-3 p-3",{"sr-only":!l}),children:so("div",{className:"flex items-center justify-center space-x-1",children:e.isLoading()?so(Fo,{}):so(m,{children:[so("div",{className:Pr("grow min-w-[0]"),role:"status",children:l&&so(qf,{additionalCount:u,entitySingular:"query"===l?"result":"annotation",entityPlural:"query"===l?"results":"annotations",filterQuery:o,
|
|
579
|
+
focusDisplayName:"selection"!==l&&i.active?i.displayName:"",resultCount:c})}),l&&so(fo,{icon:"focus"===l?void 0:"cancel",onClick:"focus"!==l||a?()=>e.clearSelection():()=>e.toggleFocusMode(),title:h,variant:"primary",children:h})]})})})}function Gf({onLogin:e}){const t=ws();return so("div",{className:"flex flex-col items-center m-6 space-y-6",children:[so("span",{className:"text-center",children:["This is a public annotation created with Hypothesis. ",so("br",{}),"To reply or make your own annotations on this document,"," ",so(To,{classes:"inline text-color-text underline hover:underline",href:t.getLink("signup"),target:"_blank",children:"create a free account"})," ","or"," ",so(go,{classes:"inline underline",onClick:e,variant:"dark",children:"log in"}),"."]}),so("div",{children:so(To,{href:"https://hypothes.is","aria-label":"Hypothesis homepage",target:"_blank",title:"Hypothesis homepage",children:so(Ao,{name:"logo",classes:"w-16 h-16 text-grey-7"})})})]})}function Vf(e,t,n){
|
|
580
|
+
e.self===e?e.scrollTo(t,n):(e.scrollLeft=t,e.scrollTop=n)}function Yf(e){var t=e._scrollSettings;if(t){var n=t.maxSynchronousAlignments,r=function(e,t){var n,r,o,i,a,s,l,c=e.align,u=e.target.getBoundingClientRect(),h=c&&null!=c.left?c.left:.5,d=c&&null!=c.top?c.top:.5,p=c&&null!=c.leftOffset?c.leftOffset:0,m=c&&null!=c.topOffset?c.topOffset:0,f=h,g=d;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-=p,o-=m,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),_=u.top-(n.top-t.scrollTop);r=v+s*f-t.clientWidth*f,o=_+l*g-t.clientHeight*g,r-=p,o-=m,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,
|
|
581
|
+
y:o,differenceX:i,differenceY:a}}(t,e),o=Date.now()-t.startTime,i=Math.min(1/t.time*o,1);if(t.endIterations>=n)return Vf(e,r.x,r.y),e._scrollSettings=null,t.end("complete");var a=1-t.ease(i);if(Vf(e,r.x-r.differenceX*a,r.y-r.differenceY*a),o>=t.time)return t.endIterations++,t.scrollAncestor&&Yf(t.scrollAncestor),void Yf(e);!function(e){if("requestAnimationFrame"in window)return window.requestAnimationFrame(e);setTimeout(e,16)}(Yf.bind(null,e))}}function Wf(e){return e.self===e}function Kf(e){return"pageXOffset"in e||(e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth)&&"hidden"!==getComputedStyle(e).overflow}function Xf(){return!0}function Zf(e){if(e.assignedSlot)return Zf(e.assignedSlot);if(e.parentElement)return"BODY"===e.parentElement.tagName?e.parentElement.ownerDocument.defaultView||e.parentElement.ownerDocument.ownerWindow:e.parentElement;if(e.getRootNode){var t=e.getRootNode();if(11===t.nodeType)return t.host}}var Jf=function(e,t,n){if(e){"function"==typeof t&&(n=t,t=null),t||(t={}),
|
|
582
|
+
t.time=isNaN(t.time)?1e3:t.time,t.ease=t.ease||function(e){return 1-Math.pow(1-e,e/2)},t.align=t.align||{};var r=Zf(e),o=1,i=t.validTarget||Xf,a=t.isScrollable;t.debug&&(console.log("About to scroll to",e),r||console.error("Target did not have a parent, is it mounted in the DOM?"));for(var s=[];r;)if(t.debug&&console.log("Scrolling parent node",r),i(r,o)&&(a?a(r,Kf):Kf(r))&&(o++,s.push(r)),!(r=Zf(r))){l("complete");break}return s.reduce(((n,r,o)=>function(e,t,n,r,o){var i,a=!t._scrollSettings,s=t._scrollSettings,l=Date.now(),c={passive:!0};function u(e){t._scrollSettings=null,t.parentElement&&t.parentElement._scrollSettings&&t.parentElement._scrollSettings.end(e),n.debug&&console.log("Scrolling ended with type",e,"for",t),o(e),i&&(t.removeEventListener("touchstart",i,c),t.removeEventListener("wheel",i,c))}s&&s.end("canceled");var h=n.maxSynchronousAlignments;return null==h&&(h=3),t._scrollSettings={startTime:l,endIterations:0,target:e,time:n.time,ease:n.ease,align:n.align,isWindow:n.isWindow||Wf,
|
|
583
|
+
maxSynchronousAlignments:h,end:u,scrollAncestor:r},"cancellable"in n&&!n.cancellable||(i=u.bind(null,"canceled"),t.addEventListener("touchstart",i,c),t.addEventListener("wheel",i,c)),a&&Yf(t),i}(e,r,t,s[o+1],l)),null)}function l(e){--o||n&&n(e)}};function Qf({children:e,icon:t="",panelName:n,title:r,onActiveChanged:o}){const i=ws(),a=i.isSidebarPanelOpen(n),s=Xr(null),l=Xr(a);Wr((()=>{l.current!==a&&(l.current=a,a&&s.current&&Jf(s.current),"function"==typeof o&&o(a))}),[a,o]);const c=Jr((()=>{i.toggleSidebarPanel(n,!1)}),[i,n]);return so(lf,{visible:a,children:so("div",{ref:s,className:"mb-4",children:so(Po,{title:r,icon:t,onClose:c,children:e})})})}function eg({onLogin:e,onSignUp:t}){return ws().isLoggedIn()?null:so(Qf,{icon:"restricted",title:"Login needed",panelName:"loginPrompt",children:[so("p",{children:"Please log in to create annotations or highlights."}),so(yo,{children:[so(fo,{title:"Sign up",onClick:t,children:"Sign up"}),so(fo,{title:"Log in",variant:"primary",onClick:e,children:"Log in"})]})]})}
|
|
584
|
+
function tg({children:e,count:t,isWaitingToAnchor:n,isSelected:r,label:o,onSelect:i}){const a=()=>{r||i()},s=t>0?`${o} (${t} available)`:o;return so(go,{classes:Pr("inline bg-transparent min-w-[5.25rem] text-color-text hover:!no-underline",{"font-bold":r}),onClick:a,onMouseDown:a,pressed:!!r,role:"tab",tabIndex:0,title:s,children:so(m,{children:[e,t>0&&!n&&so("span",{className:"relative bottom-[3px] left-[2px] text-tiny",children:t})]})})}var ng=Qo((function({annotationsService:e,isLoading:t,settings:n}){const r=ws(),o=r.selectedTab(),i=r.noteCount(),a=r.annotationCount(),s=r.orphanCount(),l=r.isWaitingToAnchorAnnotations(),c=e=>{r.clearSelection(),r.selectTab(e)},u="annotation"===o&&0===a&&!l,h="note"===o&&0===i;return so("div",{className:Pr("space-y-3 pb-[9px]"),children:[so("div",{className:"flex gap-x-6 theme-clean:ml-[15px]",role:"tablist",children:[so(tg,{count:a,isWaitingToAnchor:l,isSelected:"annotation"===o,label:"Annotations",onSelect:()=>c("annotation"),children:"Annotations"}),so(tg,{count:i,
|
|
585
|
+
isWaitingToAnchor:l,isSelected:"note"===o,label:"Page notes",onSelect:()=>c("note"),children:"Page Notes"}),s>0&&so(tg,{count:s,isWaitingToAnchor:l,isSelected:"orphan"===o,label:"Orphans",onSelect:()=>c("orphan"),children:"Orphans"})]}),"note"===o&&n.enableExperimentalNewNoteButton&&so("div",{className:"flex justify-end",children:so(fo,{"data-testid":"new-note-button",icon:"add",onClick:()=>e.createPageNote(),variant:"primary",style:Zo(["ctaBackgroundColor"],n),children:"New note"})}),!t&&h&&so(_o,{classes:"text-center",children:so("span",{"data-testid":"notes-unavailable-message",children:"There are no page notes in this group."})}),!t&&u&&so(_o,{classes:"text-center",children:so("span",{"data-testid":"annotations-unavailable-message",children:["There are no annotations in this group.",so("br",{}),"Create one by selecting some text and clicking the"," ",so(Ao,{classes:"inline m-0.5 -mt-0.5",name:"annotate",title:"Annotate"})," ","button."]})})]})}),["annotationsService","settings"])
|
|
586
|
+
;var rg=Qo((function({frameSync:e,onLogin:t,onSignUp:n,loadAnnotationsService:r,streamer:o}){const i=Xs(),a=ws(),s=a.focusedGroupId(),l=a.hasAppliedFilter()||a.hasSelectedAnnotations(),c=a.isLoading(),u=a.isLoggedIn(),h=a.directLinkedAnnotationId(),d=h?a.findAnnotationByID(h):void 0,p=d?Us(d):"annotation",m=a.searchUris(),f=a.hasSidebarOpened(),g=a.profile().userid,v=d&&!1===d.$orphan?d.$tag:null,_=!(c||!h)&&!d,b=a.directLinkedGroupFetchFailed(),y=_||b,w=!y,x=!y&&!l,k=h&&!u&&!_&&!c,S=Xr(s);Wr((()=>{if(!S.current||S.current!==s){if(S.current){let e=a.focusState().active;a.clearSelection(),e&&a.toggleFocusMode(!0)}S.current=s}s&&m.length&&r.load({groupId:s,uris:m})}),[a,r,s,g,m]),Wr((()=>{v?(e.focusAnnotations([v]),e.scrollToAnnotation(v),a.selectTab(p)):d&&a.selectTab(p)}),[p,e,d,v,a]);const C=a.hasFetchedProfile();return Wr((()=>{C&&(f||u)&&o.connect({applyUpdatesImmediately:!1})}),[C,u,f,o]),so("div",{children:[so("h2",{className:"sr-only",children:"Annotations"}),w&&so($f,{}),so(eg,{onLogin:t,onSignUp:n
|
|
587
|
+
}),_&&so(Uf,{errorType:"annotation",onLoginRequest:t,showClearSelection:!0}),b&&so(Uf,{errorType:"group",onLoginRequest:t}),x&&so(ng,{isLoading:c}),so(jf,{threads:i.children}),k&&so(Gf,{onLogin:t})]})}),["frameSync","loadAnnotationsService","streamer"]);var og=Qo((function({api:e,toastMessenger:t}){const n=ws(),r=n.routeParams().q,o=Jr((async t=>{const r={_separate_replies:!0,offset:0,limit:20,...Rs(t)};try{n.annotationFetchStarted();const t=await e.search(r);n.addAnnotations([...t.rows,...t.replies])}finally{n.annotationFetchFinished()}}),[e,n]);return Wr((()=>{n.setSortKey("Newest"),n.clearAnnotations(),o(r).catch((e=>{t.error(`Unable to fetch annotations: ${e.message}`)}))}),[r,o,n,t]),so(jf,{threads:Xs().children})}),["api","toastMessenger"]);class ig{constructor(e,t,n=window){var r,o,i;const a="N/A";let s=a;e.userid&&(s=e.userid,e.displayName&&(s=`${e.displayName} (${s})`)),this.version="1.1069.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||a,
|
|
588
|
+
this.fingerprint=null!==(r=null===(o=t[0])||void 0===o||null===(i=o.metadata)||void 0===i?void 0:i.documentFingerprint)&&void 0!==r?r:a,this.account=s,this.timestamp=(new Date).toString()}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())}}function ag(e){const t=I(e);return!(null==t||!t.authority)&&t.authority!==e.authDomain}function sg({commandName:e,iconName:t}){return so("span",{className:"whitespace-nowrap",children:[so(Ao,{name:t,classes:Pr("mx-1 -mt-1","text-color-text-light inline")}),so("em",{children:e})]})}var lg=Qo((function({settings:e}){const t=!ag(e);return so("ol",{className:"list-decimal pl-10 space-y-2",children:[so("li",{children:["To create an annotation, select text and then select the"," ",so(sg,{iconName:"annotate",commandName:"Annotate"})," ","button."]}),so("li",{
|
|
589
|
+
children:["To create a highlight (",so(To,{classes:"underline hover:underline",href:"https://web.hypothes.is/help/why-are-highlights-private-by-default/",target:"_blank",children:"visible only to you"}),"), select text and then select the"," ",so(sg,{iconName:"highlight",commandName:"Highlight"})," ","button."]}),t&&so("li",{children:["To annotate in a private group, select the group from the groups dropdown. Don't see your group? Ask the group creator to send a"," ",so(To,{classes:"underline hover:underline",href:"https://web.hypothes.is/help/how-to-join-a-private-group/",target:"_blank",children:"join link"}),")."]}),so("li",{children:["To reply to an annotation, select the"," ",so(sg,{iconName:"reply",commandName:"Reply"})," button."]})]})}),["settings"]);function cg({label:e,children:t,classes:n}){return so(m,{children:[so("dt",{className:"col-span-1 sm:text-right font-medium",children:e}),so("dd",{className:Pr("col-span-1 sm:col-span-3 text-color-text-light break-words",n),children:t})]})}
|
|
590
|
+
var ug=Qo((function({toastMessenger:e,versionData:t}){return so("div",{className:"space-y-4",children:[so("dl",{className:"grid grid-cols-1 sm:grid-cols-4 sm:gap-x-2",children:[so(cg,{label:"Version",children:t.version}),so(cg,{label:"User Agent",children:t.userAgent}),so(cg,{classes:Pr("break-all"),label:"URL",children:t.urls}),so(cg,{label:"Fingerprint",children:t.fingerprint}),so(cg,{label:"Account",children:t.account}),so(cg,{label:"Date",children:t.timestamp})]}),so("div",{className:"flex items-center justify-center",children:so(fo,{onClick:()=>{try{kl(t.asFormattedString()),e.success("Copied version info to clipboard")}catch(t){e.error("Unable to copy version info")}},icon:"copy",children:"Copy version details"})})]})}),["toastMessenger"]);function hg({children:e,onClick:t}){return so(go,{classes:"leading-none text-brand",onClick:t,children:[e,so(Ao,{classes:"ml-1",name:"arrow-right"})]})}function dg({linkText:e,url:t}){return so("div",{className:"flex-1 border-r last-of-type:border-r-0",
|
|
591
|
+
children:so(To,{href:t,classes:"flex items-center justify-center space-x-2 text-color-text-light text-lg font-medium",target:"_blank",children:[so("span",{children:e})," ",so(Ao,{name:"external",classes:"w-3 h-3"})]})})}var pg=Qo((function({auth:e,session:t}){const n=ws(),r=n.frames(),o=n.mainFrame(),i=!!n.profile().preferences.show_sidebar_tutorial,[a,s]=Vr("tutorial"),l=Zr((()=>{const t=e||{status:"logged-out"},n=[...r].sort(((e,t)=>e===o?-1:t===o?1:0));return new ig(t,n)}),[e,r,o]),c=`https://web.hypothes.is/get-help/?sys_info=${l.asEncodedURLString()}`,u=(e,t)=>{e.preventDefault(),s(t)};return so(Qf,{title:"Help",panelName:"help",onActiveChanged:Jr((e=>{!e&&i&&t.dismissSidebarTutorial()}),[t,i]),children:so("div",{className:"space-y-4",children:[so("div",{className:"flex items-center",children:[so("h3",{className:"grow text-lg font-medium","data-testid":"subpanel-title",children:{tutorial:"Getting started",versionInfo:"About this version"}[a]}),"versionInfo"===a&&so(hg,{onClick:e=>u(e,"tutorial"),
|
|
592
|
+
children:"Getting started"}),"tutorial"===a&&so(hg,{onClick:e=>u(e,"versionInfo"),children:"About this version"})]}),so("div",{className:"border-y py-4",children:["tutorial"===a&&so(lg,{}),"versionInfo"===a&&so(ug,{versionData:l})]}),so("div",{className:"flex items-center",children:[so(dg,{linkText:"Help topics",url:"https://web.hypothes.is/help/"}),so(dg,{linkText:"New support ticket",url:c})]})]})})}),["session"]),mg={exports:{}};function fg(){}fg.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r<o;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],o=[];if(r&&t)for(var i=0,a=r.length;i<a;i++)r[i].fn!==t&&r[i].fn._!==t&&o.push(r[i]);return o.length?n[e]=o:delete n[e],this}},mg.exports=fg
|
|
593
|
+
;var gg=mg.exports.TinyEmitter=fg;class vg extends Error{constructor(e){super(`Results size exceeds ${e}`)}}function _g(e){return 0===e?50:200}class bg extends gg{constructor(e,{getPageSize:t=_g,separateReplies:n=!0,incremental:r=!0,maxResults:o=null,sortBy:i="created",sortOrder:a="asc"}={}){super(),this._searchFn=e,this._getPageSize=t,this._separateReplies=n,this._incremental=r,this._maxResults=o,this._sortBy=i,this._sortOrder=a,this._canceled=!1,this._results=[],this._resultCount=null}async _getPage(e,t,n=0){const r=this._getPageSize(n),o={limit:r,sort:this._sortBy,order:this._sortOrder,_separate_replies:this._separateReplies,...e};t&&(o.search_after=t);try{const t=await this._searchFn(o);if(this._canceled)return;if(null===this._resultCount&&(this._resultCount=t.total,this.emit("resultCount",this._resultCount)),this._maxResults&&t.total>this._maxResults)return this.emit("error",new vg(this._maxResults)),void this.emit("end");const i=t.rows.concat(t.replies||[])
|
|
594
|
+
;this._incremental?this.emit("results",i):this._results=this._results.concat(i);const a=i.length===r,s=i.length>0?i[i.length-1][this._sortBy]:null;a&&s?this._getPage(e,s,n+1):(this._incremental||this.emit("results",this._results),this.emit("end"))}catch(e){if(this._canceled)return;this.emit("error",e),this.emit("end")}}get(e){this._results=[],this._resultCount=null,this._getPage(e)}cancel(){this._canceled=!0,this.emit("end")}}function yg({defaultOption:e,icon:t,onSelect:n,options:r,selectedOption:o,title:i}){const a=[e,...r],s=null!=o?o:e,l=so("span",{className:Pr("shrink-0 flex items-center gap-x-2","text-color-text font-bold text-lg"),children:[t&&so(Ao,{name:t,classes:"w-4 h-4"}),s.display]});return so(sf,{label:l,title:i,contentClass:Pr("max-h-[70vh] tall:max-h-[504px] overflow-y-auto"),children:a.map((e=>so(uf,{onClick:()=>n(e),isSelected:e.value===s.value,label:e.display},e.value)))})}function wg(){const e=ws(),t=e.getFilter("user"),n=function(){
|
|
595
|
+
const e=ws(),t=e.allAnnotations(),n=e.getFocusFilters(),r=Wo(e.profile().userid);return Zr((()=>{const o={};if(t.forEach((t=>{const n=Wo(t.user);o[n]=fl(t,e)})),n.user){const e=Wo(n.user.value)||n.user.value;o[e]=n.user.display}const i=Object.keys(o).map((e=>({display:e===r?`${o[e]} (Me)`:o[e],value:e})));return i.sort(((e,t)=>r===e.value?-1:r===t.value?1:e.display.localeCompare(t.display))),i}),[t,r,n.user,e])}();return so(yg,{defaultOption:{value:"",display:"Everybody"},icon:"profile",onSelect:t=>e.setFilter("user",t),options:n,selectedOption:t,title:"Filter by user"})}function xg({forcedVisibleCount:e,isFiltered:t,isLoading:n,resultCount:r}){const o=Xs(),i=n?r:$s(o),a=o.children.length>0,s=t&&e>0,l=i-e,c=o.children.length;return so("div",{className:"flex gap-x-1 leading-none",children:[n&&so(Fo,{size:"small"}),!n&&so("h2",{className:"font-bold",children:[!a&&so("span",{children:"No results"}),a&&t&&so("span",{children:[l," ",1===l?"result":"results"]}),a&&!t&&so("span",{
|
|
596
|
+
children:[c," ",1===c?"thread":"threads"]})]}),s&&so("h3",{className:"italic font-normal",children:["(and ",e," more)"]}),!t&&a&&so("h3",{className:"italic font-normal",children:["(",i," ",1===i?"annotation":"annotations",")"]})]})}function kg({currentPage:e,onChangePage:t,totalPages:n}){const r=e<n,o=e>1,i=function(e,t,n=5){if(t<=1)return[];const r=new Set([1,e,t]);let o=1;for(;r.size<Math.min(t,n);)e+o<=t&&r.add(e+o),e-o>=1&&r.add(e-o),++o;const i=[];return[...r].sort(((e,t)=>e-t)).forEach(((e,t,n)=>{t>0&&e-n[t-1]>1&&i.push(null),i.push(e)})),i}(e,n),a=(e,n)=>{t(e),n.blur()};return so("div",{className:"flex items-center text-lg","data-testid":"pagination-navigation",children:[so("div",{className:"w-28 h-10",children:o&&so(fo,{classes:"p-navigation-button",icon:"arrow-left",title:"Go to previous page",onClick:t=>a(e-1,t.target),variant:"dark",children:"prev"})}),so("ul",{className:Pr("hidden","md:flex md:items-center md:justify-center md:gap-x-2","md:grow"),children:i.map(((t,n)=>so("li",{
|
|
597
|
+
children:null===t?so("div",{"data-testid":"pagination-gap",children:"..."}):so(fo,{classes:"p-navigation-button",title:`Go to page ${t}`,pressed:t===e,onClick:e=>a(t,e.target),variant:"dark",children:t.toString()},`page-${n}`)},n)))}),so("div",{className:Pr("w-28 h-10 flex justify-end","grow md:grow-0"),children:r&&so(fo,{classes:"p-navigation-button",icon:"arrow-right",iconPosition:"right",title:"Go to next page",onClick:t=>a(e+1,t.target),variant:"dark",children:"next"})})]})}function Sg({currentPage:e,isLoading:t,onChangePage:n,threads:r,pageSize:o=25}){const{paginatedThreads:i,totalPages:a}=Zr((()=>{const t=r.filter((e=>$s(e)>0)),n=(e-1)*o,i=n+o,a=Math.ceil(t.length/o);return{paginatedThreads:t.slice(n,i),totalPages:a}}),[r,e,o]);return so(m,{children:[so(jf,{threads:i}),!t&&so(kg,{currentPage:e,onChangePage:n,totalPages:a})]})}var Cg=Qo((function({loadAnnotationsService:e,streamer:t}){var n
|
|
598
|
+
;const r=ws(),o=r.getFilterValues(),i=r.focusedGroup(),a=r.forcedVisibleThreads().length,s=r.hasAppliedFilter(),l=r.isLoading(),c=r.annotationResultCount(),u=r.pendingUpdateCount(),h=Xs(),d=null!==(n=null==i?void 0:i.name)&&void 0!==n?n:"…",p=(null==i?void 0:i.id)||r.directLinkedGroupId(),m=Xr(1),[f,g]=Vr(1),[v,_]=Vr(!1),b=e=>{e instanceof vg&&_(!0)},y=r.hasFetchedProfile();Wr((()=>{y&&t.connect({applyUpdatesImmediately:!1})}),[y,t]),Wr((()=>{r.setSortKey("Newest"),p&&e.load({groupId:p,sortBy:"updated",sortOrder:"desc",maxResults:5e3,onError:b,streamFilterBy:"group"})}),[e,p,r]);const w=e=>{g(e)};Wr((()=>{w(1)}),[o,i]);const x=Xr(null);Kr((()=>{f!==m.current&&(x.current&&Jf(x.current),m.current=f)}),[f]);const k=`Show ${u} new or updated ${u>1?"annotations":"annotation"}`;return so("div",{className:"grid gap-2 lg:grid-cols-2","data-testid":"notebook-container",children:[so("header",{className:"leading-none lg:col-span-2",ref:x,children:so("h1",{className:"text-2xl font-bold",
|
|
599
|
+
"data-testid":"notebook-group-name",children:d})}),so("div",{className:"justify-self-start",children:so(wg,{})}),so("div",{className:"flex items-center lg:justify-self-end text-lg font-medium",children:[u>0&&!s&&so(mo,{icon:"refresh",onClick:()=>t.applyPendingUpdates(),variant:"primary",title:k}),so(xg,{forcedVisibleCount:a,isFiltered:s,isLoading:l,resultCount:null!=c?c:0})]}),so("div",{className:"lg:col-span-2",children:[v&&so("div",{className:"py-4","data-testid":"notebook-messages",children:so(Po,{title:"Too many results to show",children:["This preview of the Notebook can show"," ",so("strong",{children:["up to ",5e3," results"]})," at a time (there are"," ",c," to show here)."," ",so("a",{href:"mailto:support@hypothes.is?subject=Hypothesis%20Notebook&body=Please%20notify%20me%20when%20the%20Hypothesis%20Notebook%20is%20updated%20to%20support%20more%20than%205000%20annotations",children:"Contact us"})," ","if you would like to be notified when support for more annotations is available."]})}),so(Sg,{
|
|
600
|
+
currentPage:f,isLoading:l,onChangePage:w,threads:h.children})]})]})}),["loadAnnotationsService","streamer"]);var Eg=Qo((function({toastMessenger:e}){const t=ws(),n=t.mainFrame(),r=t.focusedGroup(),o=`Share Annotations in ${r&&r.name||"..."}`,i=r&&n,a=i&&(s=n.uri,l=r.id,vl(s)?`https://hyp.is/go?url=${encodeURIComponent(s)}&group=${l}`:null);var s,l;return so(Qf,{title:o,panelName:"shareGroupAnnotations",children:[!i&&so("div",{className:"flex flex-row items-center justify-center",children:so(Fo,{})}),i&&so("div",{className:"text-color-text-light space-y-3",children:a?so(m,{children:[so("div",{className:"text-color-text font-medium","data-testid":"sharing-intro",children:"private"===r.type?so("p",{children:"Use this link to share these annotations with other group members:"}):so("p",{children:"Use this link to share these annotations with anyone:"})}),so("div",{children:so(Ho,{children:[so(Uo,{"aria-label":"Use this URL to share these annotations",type:"text",value:a,readOnly:!0}),so(mo,{icon:"copy",
|
|
601
|
+
onClick:()=>{try{kl(a),e.success("Copied share link to clipboard")}catch(t){e.error("Unable to copy link")}},title:"Copy share link",variant:"dark"})]})}),so("p",{"data-testid":"sharing-details",children:["private"===r.type?so("span",{children:["Annotations in the private group"," ",so("em",{children:r.name})," are only visible to group members."]}):so("span",{children:["Anyone using this link may view the annotations in the group"," ",so("em",{children:r.name}),"."]})," ",so("span",{children:["Private (",so(Ao,{name:"lock",classes:"inline -mt-0.5"})," ",so("em",{children:"Only Me"}),") annotations are only visible to you."]})]}),so("div",{className:"text-[24px]",children:so(El,{shareURI:a})})]}):so("p",{"data-testid":"no-sharing",children:"These annotations cannot be shared because this document is not available on the web."})})]})}),["toastMessenger"]);function Ag({message:e,onDismiss:t}){const n="notice"!==e.type?`${e.type.charAt(0).toUpperCase()+e.type.slice(1)}: `:"",r="notice"===e.type?"cancel":e.type
|
|
602
|
+
;return so(bo,{classes:Pr("p-0 flex border",{"sr-only":e.visuallyHidden,"border-red-error":"error"===e.type,"border-yellow-notice":"notice"===e.type,"border-green-success":"success"===e.type}),onClick:()=>t(e.id),children:[so("div",{className:Pr("flex items-center p-3 text-white",{"bg-red-error":"error"===e.type,"bg-yellow-notice":"notice"===e.type,"bg-green-success":"success"===e.type}),children:so(Ao,{name:r,classes:Pr("mt-[2px]")})}),so("div",{className:Pr("grow p-3 !mt-0"),"data-testid":"toast-message-text",children:[so("strong",{children:n}),e.message,e.moreInfoURL&&so("div",{className:"text-right",children:so(To,{href:e.moreInfoURL,onClick:e=>e.stopPropagation(),target:"_new",children:"More info"})})]})]})}var Tg=Qo((function({toastMessenger:e}){return so("div",{children:so("ul",{"aria-live":"polite","aria-relevant":"additions",className:"absolute z-2 left-0 w-full",children:ws().getToastMessages().map((t=>so("li",{className:Pr("relative w-full container hover:cursor-pointer",{"mb-2":!t.visuallyHidden,
|
|
603
|
+
"motion-safe:animate-slide-in-from-right lg:animate-fade-in":!t.isDismissed,"motion-reduce:animate-fade-in":!t.isDismissed,"animate-fade-out":t.isDismissed}),children:so(Ag,{message:t,onDismiss:t=>e.dismiss(t)})},t.id)))})})}),["toastMessenger"]);function Ng(e){return e.organization&&e.organization.name}function Mg(e){const t={};return e.forEach((e=>{if("object"!=typeof e.organization)return;const n="__default__"===(r=e.organization).id?"__default__":`${r.name.toLowerCase()}${r.id}`;var r;void 0===t[n]&&(t[n]={...e.organization,groups:[]}),function(e,t){const n=Object.assign({},e),r=t.groups;!r.length&&e.organization.logo&&(n.logo=e.organization.logo),r.push(n)}(e,t[n])})),t}function Lg(e){const t=Mg(e),n=[],r=[];return Object.keys(t).sort().forEach((e=>{"__default__"===e?n.push(...t[e].groups):r.push(...t[e].groups)})),n.length&&r.push(...n),r}function zg({heading:e,children:t}){return so(m,{children:[e&&so("h2",{className:"text-color-text-light p-3 leading-none uppercase",children:e}),so("ul",{
|
|
604
|
+
className:"border-b",children:x(t).map((e=>so("li",{children:e},e.key)))})]})}var Og=Qo((function({isExpanded:e,group:t,groups:n,onExpand:r,toastMessenger:o}){const i=t.links.html,a=i||t.canLeave,s=t.scopes&&!t.scopes.enforced||t.isScopedToUri,l=ws(),c=l.focusedGroupId(),u=t.id===c,h=t=>{t.stopPropagation(),t.preventDefault(),r(!e)},d="private"===t.type?"Copy invite link":"Copy activity link";return so(uf,{icon:t.logo||"blank",iconAlt:Ng(t),isDisabled:!s,isExpanded:!!a&&e,isSelected:u,isSubmenuVisible:a?e:void 0,label:t.name,onClick:s?()=>{l.clearDirectLinkedGroupFetchFailed(),l.clearDirectLinkedIds(),n.focus(t.id)}:h,onToggleSubmenu:h,submenu:so(m,{children:[so("ul",{children:[i&&so("li",{children:so(uf,{href:i,icon:"external",isSubmenuItem:!0,label:"View group activity"})}),i&&so("li",{children:so(uf,{onClick:()=>(e=>{try{kl(e),o.success(`Copied link for "${t.name}"`)}catch(e){o.error("Unable to copy link")}})(i),icon:"copy",isSubmenuItem:!0,label:d})}),t.canLeave&&so("li",{children:so(uf,{icon:"leave",
|
|
605
|
+
isSubmenuItem:!0,label:"Leave group",onClick:async()=>{const e=`Are you sure you want to leave the group "${t.name}"?`;await Vo({title:"Leave group?",message:e,confirmAction:"Leave"})&&n.leave(t.id)}})})]}),!s&&so("p",{className:Pr("p-2 pl-9 bg-grey-1 hyphens-none"),"data-testid":"unselectable-group-note",children:"This group is restricted to specific URLs."})]})})}),["groups","toastMessenger"]);function Rg({expandedGroup:e,onExpandGroup:t,groups:n,heading:r}){return so(zg,{heading:r,children:n.map((n=>so(Og,{isExpanded:n===e,onExpand:e=>t(e?n:null),group:n},n.id)))})}var Dg=Qo((function({settings:e}){const t=ws(),n=t.getCurrentlyViewingGroups(),r=t.getFeaturedGroups(),o=t.getMyGroups(),i=t.focusedGroup(),a=t.profile().userid,s=Zr((()=>Lg(o)),[o]),l=Zr((()=>Lg(r)),[r]),c=Zr((()=>Lg(n)),[n]),u=t.defaultAuthority(),h=a&&!Ko(a,u),d=t.getLink("groups.new"),[p,m]=Vr(null);let f;if(i){const t=i.organization.logo||function(e){const t=I(e);return t&&t.icon?t.icon:null}(e)||"",n=Ng(i)?Ng(i):"";f=so("span",{
|
|
606
|
+
className:Pr("shrink-0 flex items-center gap-x-1 text-lg text-color-text font-bold"),children:[t&&so("img",{className:Pr("relative top-[1px] w-4 h-4"),src:t,alt:n}),i.name]})}else f=so("span",{children:"…"});return!!ag(e)&&n.length+r.length+o.length<2?f:so(sf,{align:"left",contentClass:"min-w-[250px]",label:f,onOpenChanged:()=>m(null),title:i?`Select group (now viewing: ${i.name})`:"Select group",children:[c.length>0&&so(Rg,{expandedGroup:p,onExpandGroup:m,heading:"Currently Viewing",groups:c}),l.length>0&&so(Rg,{expandedGroup:p,onExpandGroup:m,heading:"Featured Groups",groups:l}),s.length>0&&so(Rg,{expandedGroup:p,onExpandGroup:m,heading:"My Groups",groups:s}),h&&so(uf,{icon:"add",href:d,label:"New private group"})]})}),["settings"]);function Ig({alwaysExpanded:e,query:t,onSearch:n}){const r=ws().isLoading(),o=Xr(),[i,a]=Vr(t),[s,l]=Vr(t);t!==i&&(l(t),a(t));const c=e||t;return so("form",{action:"#",className:Pr("relative","flex items-center","bg-white/90 hover:bg-white transition-colors"),name:"searchForm",
|
|
607
|
+
onSubmit:e=>{e.preventDefault(),(o.current.value||i)&&n(o.current.value)},children:[so(Uo,{"aria-label":"Search",classes:Pr("order-1","text-base",{"border-0":!c,"focus:border":!0,border:c},{"max-w-0 p-0":!c,"focus:max-w-[150px] focus:p-1.5 focus:ml-[2px]":!0,"max-w-[150px] p-1.5 ml-[2px]":c},"transition-[max-width] duration-300 ease-out"),dir:"auto",type:"text",name:"query",placeholder:r?"Loading…":"Search…",disabled:r,inputRef:o,value:s||"",onInput:e=>l(e.target.value)}),!r&&so("div",{className:"order-0",children:so(mo,{icon:"search",onClick:()=>o.current.focus(),size:"small",title:"Search annotations"})}),r&&so(Fo,{size:"small"})]})}function Pg(){const e=ws(),t=e.sortKey(),n=e.sortKeys().map((n=>so(uf,{label:n,onClick:()=>e.setSortKey(n),isSelected:n===t},n))),r=so("span",{className:"p-1",children:so(Ao,{name:"sort"})});return so("div",{className:"SortMenu",children:so(sf,{label:r,title:`Sort by ${t}`,align:"right",menuIndicator:!1,children:n})})}var Bg=Qo((function({router:e}){return so(Ig,{
|
|
608
|
+
query:ws().routeParams().q,onSearch:t=>{e.navigate("stream",{q:t})},alwaysExpanded:!0})}),["router"]);var Fg=Qo((function({auth:e,frameSync:t,onLogout:n,settings:r}){const o=ws(),i=o.defaultAuthority(),a=Ko(e.userid,i),s=I(r),[l,c]=Vr(!1),u=e=>s&&!!s[e],h=!a||u("onProfileRequestProvided"),d=!a||u("onLogoutRequestProvided"),p=()=>{t.notifyHost("openNotebook",o.focusedGroupId())},m=()=>a&&t.notifyHost("profileRequested"),f=(()=>{const t={};return h&&(a||(t.href=o.getLink("user",{user:e.username})),t.onClick=m),t})(),g=so("span",{className:"p-1",children:so(Ao,{name:"profile"})});return so("div",{"data-testid":"user-menu",onKeyDown:e=>{"n"===e.key&&(p(),c(!1))},children:so(sf,{label:g,title:e.displayName,align:"right",open:l,onOpenChanged:c,children:[so(zg,{children:[so(uf,{label:e.displayName,isDisabled:!h,...f}),!a&&so(uf,{label:"Account settings",href:o.getLink("account.settings")}),so(uf,{label:"Open notebook",onClick:()=>p()})]}),d&&so(zg,{children:so(uf,{label:"Log out",onClick:n})})]})})
|
|
609
|
+
}),["frameSync","settings"]);var jg=Qo((function({auth:e,frameSync:t,isSidebar:n,onLogin:r,onLogout:o,onSignUp:i,settings:a,streamer:s}){const l=!ag(a),c=Zo(["accentColor"],a),u=ws(),h=u.filterQuery(),d=u.pendingUpdateCount(),p=u.isSidebarPanelOpen("help"),f=u.isSidebarPanelOpen("shareGroupAnnotations");return so("div",{className:Pr("absolute h-10 left-0 top-0 right-0 z-4","text-grey-7 border-b theme-clean:border-b-0 bg-white"),"data-testid":"top-bar",children:so("div",{className:Pr("container flex items-center h-full","text-xl"),"data-testid":"top-bar-content",children:[so(n?Dg:Bg,{}),so("div",{className:"grow flex items-center justify-end",children:[n&&so(m,{children:[d>0&&so(mo,{icon:"refresh",onClick:()=>s.applyPendingUpdates(),size:"small",variant:"primary",title:`Show ${d} new/updated ${1===d?"annotation":"annotations"}`}),so(Ig,{query:h||null,onSearch:u.setFilterQuery}),so(Pg,{}),l&&so(mo,{icon:"share",expanded:f,onClick:()=>{u.toggleSidebarPanel("shareGroupAnnotations")},size:"small",
|
|
610
|
+
title:"Share annotations on this page"})]}),so(mo,{icon:"help",expanded:p,onClick:()=>{const e=I(a);e&&e.onHelpRequestProvided?t.notifyHost("helpRequested"):u.toggleSidebarPanel("help")},size:"small",title:"Help"}),"logged-in"===e.status?so(Fg,{auth:e,onLogout:o}):so("div",{className:"flex items-center text-lg font-medium space-x-1","data-testid":"login-links",children:["unknown"===e.status&&so("span",{children:"⋯"}),"logged-out"===e.status&&so(m,{children:[so(go,{classes:"inline",onClick:i,style:c,variant:"primary",children:"Sign up"}),so("div",{children:"/"}),so(go,{classes:"inline",onClick:r,style:c,variant:"primary",children:"Log in"})]})]})]})]})})}),["frameSync","settings","streamer"]);var Ug=Qo((function({auth:e,frameSync:t,settings:n,session:r,toastMessenger:o}){const i=ws(),a=i.hasFetchedProfile(),s=i.profile(),l=i.route(),c=Zr((()=>a?function(e){const t=Yo(e.userid);if(t&&e.userid){let n=t.username;return e.user_info&&e.user_info.display_name&&(n=e.user_info.display_name),{status:"logged-in",
|
|
611
|
+
displayName:n,userid:e.userid,username:t.username}}return{status:"logged-out"}}(s):{status:"unknown"}),[a,s]),u=Zr((()=>Zo(["appBackgroundColor"],n)),[n]),h="clean"===n.theme,d="sidebar"===l;Wr((()=>{(function(e,t,n){const r="object"==typeof t.preferences&&!!t.preferences.show_sidebar_tutorial,o=I(n)||{onHelpRequestProvided:!1};return e&&!o.onHelpRequestProvided&&r})(d,s,n)&&i.openSidebarPanel("help")}),[d,s,n,i]);const p=async()=>{if(I(n))t.notifyHost("loginRequested");else try{await e.login(),i.closeSidebarPanel("loginPrompt"),i.clearGroups(),r.reload()}catch(e){o.error(e.message)}},m=()=>{I(n)?t.notifyHost("signupRequested"):window.open(i.getLink("signup"))};return so("div",{className:Pr("h-full min-h-full overflow-scroll","lg:pb-16 bg-grey-2","js-thread-list-scroll-root",{"theme-clean":h,"pt-[49px]":"notebook"!==l,"p-4 lg:p-12":"notebook"===l}),"data-testid":"hypothesis-app",style:u,children:["notebook"!==l&&so(jg,{auth:c,onLogin:p,onSignUp:m,onLogout:async()=>{await(async()=>{const e=i.countDrafts()
|
|
612
|
+
;if(0===e)return!0;let t="";return 1===e?t="You have an unsaved annotation.\nDo you really want to discard this draft?":e>1&&(t="You have "+e+" unsaved annotations.\nDo you really want to discard these drafts?"),Vo({title:"Discard drafts?",message:t,confirmAction:"Discard"})})()&&(i.clearGroups(),i.removeAnnotations(i.unsavedAnnotations()),i.discardAllDrafts(),I(n)?t.notifyHost("logoutRequested"):r.logout())},isSidebar:d}),so("div",{className:"container",children:[so(Tg,{}),so(pg,{auth:"logged-in"===c.status?c:{}}),so(Eg,{}),l&&so("main",{children:["annotation"===l&&so(Hf,{onLogin:p}),"notebook"===l&&so(Cg,{}),"stream"===l&&so(og,{}),"sidebar"===l&&so(rg,{onLogin:p,onSignUp:m})]})]})]})}),["auth","frameSync","session","settings","toastMessenger"]);function Hg({error:e}){return so("div",{className:Pr("m-2 mt-12"),children:so(Po,{title:"Unable to start Hypothesis",children:e.message})})}class qg{constructor(e,t,n){this._activity=e,this._api=t,this._store=n}_applyDraftChanges(e){
|
|
613
|
+
const t={},n=this._store.getDraft(e);return n&&(t.tags=n.tags,t.text=n.text,t.permissions=n.isPrivate?_l(e.user):bl(e.user,e.group)),{...e,...t}}_initialize(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:"+U(8),l=Object.assign({created:t.toISOString(),group:r,permissions:yl(i,r,n),tags:[],text:"",updated:t.toISOString(),user:i,user_info:a,$tag:s,hidden:!1,links:{},document:{title:""}},e);return Fi(l)&&(l.permissions=_l(i)),l}create(e,t=new Date){const n=this._initialize(e,t);this._store.addAnnotations([n]),this._store.deleteNewAndEmptyDrafts(),Fi(n)||this._store.createDraft(n,{tags:n.tags,text:n.text,isPrivate:!Di(n)}),Ui(n)?this._store.selectTab("note"):Hi(n)&&this._store.selectTab("annotation"),(n.references||[]).forEach((e=>{this._store.setExpanded(e,!0)}))}
|
|
614
|
+
createPageNote(){const e=this._store.mainFrame();if(!this._store.isLoggedIn())return void this._store.openSidebarPanel("loginPrompt");if(!e)return;const t={target:[],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)}reply(e,t){const n={group:e.group,permissions:Di(e)?bl(t,e.group):_l(t),references:(e.references||[]).concat(e.id),target:[{source:e.target[0].source}],uri:e.uri};this.create(n)}async save(e){let t,n;const r=this._applyDraftChanges(e);let o;Oi(e)?(t=this._api.annotation.update({id:e.id},r),n="update"):(t=this._api.annotation.create({},r),n="create"),this._store.annotationSaveStarted(e);try{o=await t,this._activity.reportActivity(n,o)}finally{this._store.annotationSaveFinished(e)}for(let[t,n]of Object.entries(e))if(t.startsWith("$")){o[t]=n}
|
|
615
|
+
return this._store.removeDraft(e),this._store.addAnnotations([o]),o}}qg.$inject=["annotationActivity","api","store"];class $g{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:wl(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])}}$g.$inject=["settings"];class Gg 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 Vg(e,t){let n,r;try{n=await fetch(e,t)}catch(t){throw new Gg(e,null,t.message)}if(204===n.status)return null;try{r=await n.json()}catch(t){
|
|
616
|
+
throw new Gg(e,n,"Failed to parse response")}var o;if(!n.ok)throw new Gg(e,n,null===(o=r)||void 0===o?void 0:o.reason);return r}function Yg(e){const t={};for(let[n,r]of Object.entries(e))n.startsWith("$")||(t[n]=r);return t}function Wg(e){return"url"in e}function Kg(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s)=>{o();try{const[o,l]=await Promise.all([e,n()]),c=function(e,t){let n=e;const r=t.split(".");for(let[e,t]of r.entries()){const o=n[t];if(!o||Wg(o)){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.1069.0"};l&&(u.Authorization="Bearer "+l);const h=r();h&&(u["X-Client-Id"]=h);const{url:d,unusedParams:p}=Ya(c.url,a),m=new URL(d);for(let[e,t]of Object.entries(p)){Array.isArray(t)||(t=[t]);for(let n of t)null!=n&&m.searchParams.append(e,n.toString())}return await Vg(m.toString(),{body:s?JSON.stringify(Yg(s)):null,headers:u,
|
|
617
|
+
method:c.method})}finally{i()}}}class Xg{constructor(e,t,n){const r=e.routes();this._clientId=null;const o=()=>this._clientId,i=e=>Kg(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")},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")}}setClientId(e){this._clientId=e}}Xg.$inject=["apiRoutes","auth","store"];var Zg={exports:{}},Jg={};function Qg(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,
|
|
618
|
+
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))}var ev=Qg;Qg.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},Qg.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},Qg.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++,
|
|
619
|
+
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},Qg.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(){n._operationTimeoutCb()}),n._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},Qg.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},Qg.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},Qg.prototype.start=Qg.prototype.try,Qg.prototype.errors=function(){return this._errors},Qg.prototype.attempts=function(){return this._attempts},Qg.prototype.mainError=function(){if(0===this._errors.length)return null
|
|
620
|
+
;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},function(e){var t=ev;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];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],o=0;o<t.retries;o++)r.push(this.createTimeout(o,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(o,t)),r.sort((function(e,t){return e-t})),r},e.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,r=Math.round(n*Math.max(t.minTimeout,1)*Math.pow(t.factor,e));return r=Math.min(r,t.maxTimeout)},e.wrap=function(t,n,r){if(n instanceof Array&&(r=n,n=null),!r)for(var o in r=[],t)"function"==typeof t[o]&&r.push(o)
|
|
621
|
+
;for(var i=0;i<r.length;i++){var a=r[i],s=t[a];t[a]=function(r){var o=e.operation(n),i=Array.prototype.slice.call(arguments,1),a=i.pop();i.push((function(e){o.retry(e)||(e&&(arguments[0]=o.mainError()),a.apply(this,arguments))})),o.attempt((function(){r.apply(t,i)}))}.bind(t,s),t[a].options=n}}}(Jg);var tv=Y(Zg.exports=Jg);function nv(e,t){return new Promise(((n,r)=>{const o=tv.operation(t);o.attempt((async()=>{try{const t=await e();o.retry(),n(t)}catch(e){o.retry(e)||r(e)}}))}))}function rv(e){return nv((()=>Vg(e)))}class ov{constructor(e){this._apiURL=e.apiUrl,this._routeCache=null,this._linkCache=null}routes(){return this._routeCache||(this._routeCache=rv(this._apiURL).then((e=>e.links))),this._routeCache}links(){return this._linkCache||(this._linkCache=this.routes().then((async e=>{const t=e.links;return await rv(t.url)}))),this._linkCache}}ov.$inject=["settings"];class iv extends Error{constructor(e,t){super(e),this.cause=t}}class av{constructor(e){this.clientId=e.clientId,
|
|
622
|
+
this.tokenEndpoint=e.tokenEndpoint,this.authorizationEndpoint=e.authorizationEndpoint,this.revokeEndpoint=e.revokeEndpoint}exchangeAuthCode(e){return this._getAccessToken({client_id:this.clientId,grant_type:"authorization_code",code:e})}exchangeGrantToken(e){return this._getAccessToken({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:e})}refreshToken(e){return this._getAccessToken({grant_type:"refresh_token",refresh_token:e})}async revokeToken(e){try{await this._formPost(this.revokeEndpoint,{token:e})}catch(e){throw new iv("Failed to revoke access token",e)}}authorize(e){const t=U(16),n=new Promise(((n,r)=>{e.addEventListener("message",(function o(i){"object"==typeof i.data&&i.data.state===t&&("authorization_response"===i.data.type&&n(i.data),"authorization_canceled"===i.data.type&&r(new Error("Authorization window was closed")),e.removeEventListener("message",o))}))})),r=new URL(this.authorizationEndpoint);r.searchParams.set("client_id",this.clientId),
|
|
623
|
+
r.searchParams.set("origin",e.location.origin),r.searchParams.set("response_mode","web_message"),r.searchParams.set("response_type","code"),r.searchParams.set("state",t);const o=`left=${e.screen.width/2-237.5},top=${e.screen.height/2-215},width=475,height=430`;if(!e.open(r.toString(),"Log in to Hypothesis",o))throw new Error("Failed to open login window");return n.then((e=>e.code))}async _formPost(e,t){const n=new URLSearchParams;for(let[e,r]of Object.entries(t))n.set(e,r);n.sort();return Vg(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n.toString()})}async _getAccessToken(e){let t;try{t=await this._formPost(this.tokenEndpoint,e)}catch(e){throw new iv("Failed to fetch access token",e)}return{accessToken:t.access_token,expiresAt:Date.now()+1e3*(t.expires_in-10),refreshToken:t.refresh_token}}}class sv extends gg{constructor(e,t,n,r,o){let i,a,s;super();const l=(c="token",u=r.apiUrl,new URL(c,u).href);var c,u;function h(){let e=new URL(r.apiUrl).hostname
|
|
624
|
+
;return e=e.replace(/\./g,"%2E"),`hypothesis.oauth.${e}.token`}function d(e){n.setObject(h(),e)}const p=async()=>{if(s)return s;const e=await t.links();return s=new av({clientId:r.oauthClientId,authorizationEndpoint:e["oauth.authorize"],revokeEndpoint:e["oauth.revoke"],tokenEndpoint:l}),s},m=()=>{var e;return null===(e=I(r))||void 0===e?void 0:e.grantToken},f=async()=>{if(!a){const e=m();void 0!==e?a=e?p().then((t=>t.exchangeGrantToken(e))).catch((e=>{var t;throw t="You must reload the page to annotate.",o.error(`Hypothesis login lost: ${t}`,{autoDismiss:!1}),e})):Promise.resolve(null):i?(a=(async e=>{const t=await p(),n=await t.exchangeAuthCode(e);return d(n),n})(i),i=null):a=Promise.resolve(function(){const e=n.getObject(h());return e&&"string"==typeof e.accessToken&&"string"==typeof e.refreshToken&&"number"==typeof e.expiresAt?{accessToken:e.accessToken,refreshToken:e.refreshToken,expiresAt:e.expiresAt}:null}())}const e=a,t=await a;if(!t)return null;if(e!==a)return f();if(Date.now()>t.expiresAt){
|
|
625
|
+
const e=m();return a=(async(e,t)=>{const n=await p();let r;try{if(r=await n.refreshToken(e),Date.now()>r.expiresAt)throw new Error("Refreshed token expired in the past")}catch{return null}return t.persist&&d(r),r})(t.refreshToken,{persist:void 0===e}),f()}return t.accessToken};(()=>{e.addEventListener("storage",(({key:e})=>{e===h()&&(a=null,this.emit("oauthTokensChanged"))}))})(),this.login=async function(){const t=await p(),n=await t.authorize(e);i=n,a=null},this.logout=async function(){const[e,t]=await Promise.all([a,p()]);e&&await t.revokeToken(e.accessToken),a=Promise.resolve(null),n.removeItem(h())},this.getAccessToken=f}}sv.$inject=["$window","apiRoutes","localStorage","settings","toastMessenger"];class lv{constructor(e,t,n){this._annotationsService=e,this._toastMessenger=t,this._store=n,this._saving=new Set,this._failed=new Set}init(){const e=e=>!this._saving.has(e)&&!this._failed.has(e);this._store.subscribe((()=>{this._store.newHighlights().forEach((t=>{const n=t.$tag;e(n)&&(this._saving.add(n),
|
|
626
|
+
nv((()=>this._annotationsService.save(t))).then((()=>{this._toastMessenger.success("Highlight saved",{visuallyHidden:!0})})).catch((()=>{this._failed.add(n)})).finally((()=>{this._saving.delete(n)})))}))}))}isSaving(){return this._saving.size>0}}function cv(e,t){return!!function(e){if(null===e||"object"!=typeof e)return!1;for(let t of["frame1","frame2","type","requestId"])if("string"!=typeof e[t])return!1;return!0}(e)&&JSON.stringify(e,Object.keys(t).sort())===JSON.stringify(t,Object.keys(t).sort())}lv.$inject=["annotationsService","toastMessenger","store"];class uv{constructor({hostFrame:e,source:t}){this._hostFrame=e,this._source=t,this._listeners=new dl}destroy(){this._listeners.removeAll()}async discover(e){let t=!1;if(("guest"===this._source&&"host"===e||"guest"===this._source&&"sidebar"===e||"sidebar"===this._source&&"host"===e||"notebook"===this._source&&"sidebar"===e)&&(t=!0),!t)throw new Error("Invalid request of channel/port");const n=U(6);return new Promise(((t,r)=>{const o=()=>{
|
|
627
|
+
this._hostFrame.postMessage({frame1:this._source,frame2:e,type:"request",requestId:n},"*")},i=setInterval(o,250),a=setTimeout((()=>{clearInterval(i),r(new Error(`Unable to establish ${this._source}-${e} communication channel`))}),2e4),s=this._listeners.add(window,"message",(r=>{const{data:o,ports:l}=r;cv(o,{frame1:this._source,frame2:e,type:"offer",requestId:n})&&(clearInterval(i),clearTimeout(a),this._listeners.remove(s),t(l[0]))}));o()}))}}function hv(e,t,n=[],r=-1){e.postMessage({protocol:"frame-rpc",version:"1.0.0",arguments:n,method:t,sequence:r})}class dv{constructor({userAgent:e=navigator.userAgent,currentWindow:t=window}={}){this._port=null,this._methods=new Map,this._sequence=1,this._callbacks=new Map,this._listeners=new dl,this._listeners.add(t,"unload",(()=>{this._port&&(hv(this._port,"close"),t!==t.parent&&function(e){const t=e.match(/\bAppleWebKit\/([0-9]+)\b/);return!!t&&!(parseInt(t[1])<=537)}(e)&&t.parent.postMessage({type:"hypothesisPortClosed"},"*",[this._port]))})),this._pendingCalls=[],
|
|
628
|
+
this._receivedCloseEvent=!1}on(e,t){if(this._port)throw new Error("Cannot add a method handler after a port is connected");this._methods.set(e,t)}connect(e){this._port=e,this._listeners.add(e,"message",(e=>this._handle(e))),e.start(),hv(e,"connect");for(let[e,t]of this._pendingCalls)this.call(e,...t);this._pendingCalls=[]}destroy(){this._port&&(hv(this._port,"close"),this._port.close()),this._destroyed=!0,this._listeners.removeAll()}call(e,...t){if(this._port||this._pendingCalls.push([e,t]),!this._port||this._destroyed)return;const n=this._sequence++,r=t[t.length-1];"function"==typeof r&&(this._callbacks.set(n,r),t=t.slice(0,-1)),hv(this._port,e,t,n)}_parseMessage({data:e}){return e&&"object"==typeof e?"frame-rpc"!==e.protocol||"1.0.0"!==e.version?null:Array.isArray(e.arguments)?e:null:null}_handle(e){const t=this._parseMessage(e),n=this._port;if(t&&n)if("method"in t){if("close"===t.method){if(this._receivedCloseEvent)return;this._receivedCloseEvent=!0}const e=this._methods.get(t.method);if(!e)return
|
|
629
|
+
;const r=(...e)=>{const r={arguments:e,protocol:"frame-rpc",response:t.sequence,version:"1.0.0"};n.postMessage(r)};e(...t.arguments,r)}else if("response"in t){const e=this._callbacks.get(t.response);this._callbacks.delete(t.response),e&&e(...t.arguments)}}}function pv(e,t,n,r){let o=t();return e((()=>{const e=t();if(r?r(e,o):e===o)return;const i=o;o=e,n(e,i)}))}function mv({$tag:e,target:t,uri:n}){return{$tag:e,target:t,uri:n}}function fv(e,t){const n=e.find((e=>e.uri===t.uri));if(n)return n;const r=e.find((e=>null===e.id));return r||e[0]}class gv{constructor(e,t,n){this._window=e,this._annotationsService=t,this._store=n,this._portFinder=new uv({hostFrame:this._window.parent,source:"sidebar"}),this._listeners=new dl,this._hostRPC=new dv,this._guestRPC=new Map,this._nextGuestId=0,this._inFrame=new Set,this._highlightsVisible=!1,this._setupSyncToGuests(),this._setupHostEvents(),this._setupFeatureFlagSync()}_setupSyncToGuests(){let e=0;const t=(t,n,r)=>{let o=0;const i=new Set,a=[];t.forEach((e=>{
|
|
630
|
+
zi(e)||(Di(e)&&++o,i.add(e.$tag),this._inFrame.has(e.$tag)||a.push(e))}));const s=r.filter((e=>!i.has(e.$tag)));if(a.length>0){const e=new Map;for(let t of a){var l;const r=fv(n,t);if(!r)continue;const o=null!==(l=e.get(r.id))&&void 0!==l?l:[];o.push(t),e.set(r.id,o)}for(let[t,n]of e){const e=this._guestRPC.get(t);e&&e.call("loadAnnotations",n.map(mv))}a.forEach((e=>{this._inFrame.add(e.$tag)}))}s.forEach((e=>{this._guestRPC.forEach((t=>t.call("deleteAnnotation",e.$tag))),this._inFrame.delete(e.$tag)})),n.length>0&&n.every((e=>e.isAnnotationFetchComplete))&&(0!==o&&o===e||(this._hostRPC.call("publicAnnotationCountChanged",o),e=o))};pv(this._store.subscribe,(()=>[this._store.allAnnotations(),this._store.frames()]),(([e,n],[r])=>t(e,n,r)),La)}_connectGuest(e){const t=new dv;++this._nextGuestId;let n=`temp-${this._nextGuestId}`;this._guestRPC.set(n,t),t.on("documentInfoChanged",(e=>{this._guestRPC.delete(n),n=e.frameIdentifier,this._guestRPC.set(n,t),this._store.connectFrame({id:e.frameIdentifier,
|
|
631
|
+
metadata:e.metadata,uri:e.uri})})),t.on("close",(()=>{const e=this._store.frames().find((e=>e.id===n));e&&this._store.destroyFrame(e),t.destroy(),this._guestRPC.delete(n)})),t.on("createAnnotation",(e=>{if(!this._store.isLoggedIn())return this._hostRPC.call("openSidebar"),this._store.openSidebarPanel("loginPrompt"),void this._guestRPC.forEach((t=>t.call("deleteAnnotation",e.$tag)));this._inFrame.add(e.$tag),e.$highlight||this._hostRPC.call("openSidebar"),this._hostRPC.call("showHighlights"),this._annotationsService.create(e)}));let r={};const o=hl((()=>{this._store.updateAnchorStatus(r),r={}}),10);t.on("syncAnchoringStatus",(({$tag:e,$orphan:t})=>{this._inFrame.add(e),r[e]=t?"orphan":"anchored",o()})),t.on("showAnnotations",(e=>{this._store.selectAnnotations(this._store.findIDsForTags(e)),this._store.selectTab("annotation")})),t.on("focusAnnotations",(e=>{this._store.focusAnnotations(e||[])})),t.on("toggleAnnotationSelection",(e=>{this._store.toggleSelectedAnnotations(this._store.findIDsForTags(e))})),
|
|
632
|
+
t.on("openSidebar",(()=>{this._hostRPC.call("openSidebar")})),t.on("closeSidebar",(()=>{this._hostRPC.call("closeSidebar")})),t.connect(e),t.call("setHighlightsVisible",this._highlightsVisible),t.call("featureFlagsUpdated",this._store.profile().features)}_setupHostEvents(){this._hostRPC.on("sidebarOpened",(()=>{this._store.setSidebarOpened(!0)})),this._hostRPC.on("setHighlightsVisible",(e=>{this._highlightsVisible=e,this._guestRPC.forEach((t=>t.call("setHighlightsVisible",e)))}))}_setupFeatureFlagSync(){const e=()=>this._store.profile().features,t=e=>{this._hostRPC.call("featureFlagsUpdated",e);for(let t of this._guestRPC.values())t.call("featureFlagsUpdated",e)};t(e()),pv(this._store.subscribe,e,t)}async connect(){const e=await this._portFinder.discover("host");this._hostRPC.connect(e),this._listeners.add(e,"message",(e=>{const{data:t,ports:n}=e;cv(t,{frame1:"guest",frame2:"sidebar",type:"offer"})&&this._connectGuest(n[0])}))}notifyHost(e,...t){this._hostRPC.call(e,...t)}focusAnnotations(e){
|
|
633
|
+
this._store.focusAnnotations(e),this._guestRPC.forEach((t=>t.call("focusAnnotations",e)))}scrollToAnnotation(e){this._guestRPC.forEach((t=>t.call("scrollToAnnotation",e)))}destroy(){this._portFinder.destroy(),this._listeners.removeAll()}}gv.$inject=["$window","annotationsService","store"];const vv={id:"__default__",name:"__DEFAULT__",logo:"data:image/svg+xml;utf8,"+encodeURIComponent($o)};const _v=["organization","scopes"];class bv{constructor(e,t,n,r,o,i){this._store=e,this._api=t,this._auth=n,this._settings=o,this._toastMessenger=i,this._serviceConfig=I(o),this._reloadSetUp=!1}_mainURI(){var e,t;return null!==(e=null===(t=this._store.mainFrame())||void 0===t?void 0:t.uri)&&void 0!==e?e:null}async _filterGroups(e,t,n,r){if(r){const t=e.find((e=>e.id===r));t&&!t.isScopedToUri&&t.scopes&&t.scopes.enforced&&(e=e.filter((e=>e.id!==r)),this._store.setDirectLinkedGroupFetchFailed(),r=null)}if(t)return e;const o=e.some((e=>"__world__"!==e.id&&e.isScopedToUri))
|
|
634
|
+
;return o?"__world__"===r||"__world__"===n?e:e.filter((e=>"__world__"!==e.id)):e}_setupAutoReload(){this._reloadSetUp||(this._reloadSetUp=!0,pv(this._store.subscribe,(()=>this._mainURI()),(()=>this.load())),pv(this._store.subscribe,(()=>[this._store.hasFetchedProfile(),this._store.profile().userid]),((e,[t])=>{t&&this.load()}),La))}_addGroupsToStore(e,t){!function(e){e.forEach((e=>{e.organization&&"object"==typeof e.organization||(e.organization=vv)}))}(e);const n=0===this._store.allGroups().length,r=this._store.getDefault("focusedGroup");this._store.loadGroups(e),n&&(t&&e.some((e=>e.id===t))?this.focus(t):r&&e.some((e=>e.id===r))&&this.focus(r))}_fetchGroup(e){return this._api.group.read({id:e,expand:_v})}async _loadGroupsForUserAndDocument(){var e;const t=()=>function(e,t){const n=t(e);return null!==n?Promise.resolve(n):new Promise((n=>{const r=e.subscribe((()=>{const o=t(e);null!==o&&(r(),n(o))}))}))}(this._store,(()=>this._mainURI()));let n=null;"sidebar"===this._store.route()&&(n=await t()),
|
|
635
|
+
this._setupAutoReload();const r=this._store.directLinkedAnnotationId();let o=null;r&&(o=this._api.annotation.get({id:r}).catch((()=>null)));const i=this._store.directLinkedGroupId();let a=null;i&&(a=this._fetchGroup(i).then((e=>(this._store.clearDirectLinkedGroupFetchFailed(),e))).catch((()=>(this._store.setDirectLinkedGroupFetchFailed(),null))));const s={expand:_v},l=null===(e=this._serviceConfig)||void 0===e?void 0:e.authority;l&&(s.authority=l),n&&(s.document_uri=n);const[c,u,h,d,p]=await Promise.all([this._api.profile.groups.read({expand:_v}),this._api.groups.list(s),this._auth.getAccessToken(),o,a]);p&&!u.some((e=>e.id===p.id))&&u.push(p);let m=null;if(d){m=d.group;const e=c.concat(u).find((e=>e.id===d.group));if(!e)try{const e=await this._fetchGroup(d.group);u.push(e)}catch(e){this._toastMessenger.error("Unable to fetch group for linked annotation")}}const f=null!==h,g=await this._filterGroups(K(c,u,n,this._settings),f,m,i),v=m||i||null;return this._addGroupsToStore(g,v),g}
|
|
636
|
+
async _loadServiceSpecifiedGroups(e){const t=await this._api.profile.groups.read({expand:_v});let n;const r=async e=>{try{return await this._fetchGroup(e)}catch(e){return n=e,null}},o=await Promise.all(e.map((e=>t.find((t=>t.id===e||t.groupid===e))||r(e)))),i=o.filter((e=>null!==e)),a=this._store.directLinkedGroupId();return this._addGroupsToStore(i,a),n&&this._toastMessenger.error(`Unable to fetch groups: ${n.message}`,{autoDismiss:!1}),i}async load(){var e;const t=null===(e=this._serviceConfig)||void 0===e?void 0:e.groups;if(Array.isArray(t)||"function"==typeof(null==(n=t)?void 0:n.then)){let e=[];try{e=await t}catch(e){this._toastMessenger.error(`Unable to fetch group configuration: ${e.message}`)}return this._loadServiceSpecifiedGroups(e)}return this._loadGroupsForUserAndDocument();var n}focus(e){const t=this._store.focusedGroupId();this._store.focusGroup(e);const n=this._store.focusedGroupId();if(t!==n&&null!==t&&n){const e=this._store.newAnnotations().filter((e=>!zi(e))).map((e=>({...e,group:n})))
|
|
637
|
+
;e.length&&this._store.addAnnotations(e),this._store.setDefault("focusedGroup",n)}}leave(e){return this._api.group.member.delete({pubid:e,userid:"me"})}}bv.$inject=["store","api","auth","session","settings","toastMessenger"];class yv{constructor(e,t,n,r){this._api=e,this._store=t,this._streamer=n,this._streamFilter=r,this._searchClient=null}load({groupId:e,uris:t,onError:n,maxResults:r,sortBy:o,sortOrder:i,streamFilterBy:a="uri"}){if(this._store.removeAnnotations(this._store.savedAnnotations()),this._searchClient&&this._searchClient.cancel(),"group"===a)this._streamFilter.resetFilter().addClause("/group","equals",e,!0),this._streamer.setConfig("filter",{filter:this._streamFilter.getFilter()});else t&&t.length>0&&(this._streamFilter.resetFilter().addClause("/uri","one_of",t),this._streamer.setConfig("filter",{filter:this._streamFilter.getFilter()}));const s={incremental:!0,separateReplies:!1,maxResults:r,sortBy:o,sortOrder:i};this._searchClient=new bg(this._api.search,s),
|
|
638
|
+
this._searchClient.on("resultCount",(e=>{this._store.setAnnotationResultCount(e)})),this._searchClient.on("results",(e=>{e.length&&this._store.addAnnotations(e)})),this._searchClient.on("error",(e=>{"function"==typeof n?n(e):console.error(e)})),this._searchClient.on("end",(()=>{this._searchClient=null,t&&t.length>0&&this._store.frames().forEach((e=>{t.indexOf(e.uri)>=0&&this._store.updateFrameAnnotationFetchStatus(e.uri,!0)})),this._store.annotationFetchFinished()})),this._store.annotationFetchStarted(),this._searchClient.get({group:e,uri:t})}async loadThread(e){let t,n;this._store.clearAnnotations();try{this._store.annotationFetchStarted(),t=await this._api.annotation.get({id:e}),zi(t)&&(t=await this._api.annotation.get({id:t.references[0]})),n=await this._api.search({references:t.id})}finally{this._store.annotationFetchFinished()}const r=[t,...n.rows];if(this._store.addAnnotations(r),!zi(t)){const e=t.id;this._streamFilter.addClause("/references","one_of",e,!0).addClause("/id","equals",e,!0),
|
|
639
|
+
this._streamer.setConfig("filter",{filter:this._streamFilter.getFilter()}),this._streamer.connect()}return r}}yv.$inject=["api","store","streamer","streamFilter"];class wv{constructor(){this._store=new Map}getItem(e){var t;return null!==(t=this._store.get(e))&&void 0!==t?t:null}setItem(e,t){this._store.set(e,t)}removeItem(e){this._store.delete(e)}}class xv{constructor(e){let t="hypothesis.testKey";try{this._storage=e.localStorage,e.localStorage.setItem(t,t),e.localStorage.getItem(t),e.localStorage.removeItem(t)}catch(e){this._storage=new wv}}getItem(e){return this._storage.getItem(e)}getObject(e){const t=this._storage.getItem(e);return t?JSON.parse(t):null}setItem(e,t){this._storage.setItem(e,t)}setObject(e,t){const n=JSON.stringify(t);this._storage.setItem(e,n)}removeItem(e){this._storage.removeItem(e)}}xv.$inject=["$window"];const kv={annotationPrivacy:"hypothesis.privacy",focusedGroup:"hypothesis.groups.focus"};class Sv{constructor(e,t){this._storage=e,this._store=t}init(){for(let[e,t]of Ki(kv)){
|
|
640
|
+
const n=this._storage.getItem(t);this._store.setDefault(e,n)}pv(this._store.subscribe,(()=>this._store.getDefaults()),((e,t)=>{for(let[n,r]of Ki(e))t[n]!==r&&n in kv&&this._storage.setItem(kv[n],r)}))}}Sv.$inject=["localStorage","store"];class Cv{constructor(e,t){this._window=e,this._store=t,this._didRegisterPopstateListener=!1}currentRoute(){const e=this._window.location.pathname.slice(1).split("/"),t=new URLSearchParams(this._window.location.search),n={};for(let[e,r]of t)n[e]=r;"client"===e[0]&&e.shift();let r;switch(e[0].replace(/\.html$/,"")){case"a":r="annotation",n.id=e[1]||"";break;case"notebook":r="notebook";break;case"stream":r="stream";break;default:r="sidebar"}return{route:r,params:n}}routeUrl(e,t={}){let n;const r={...t};switch(e){case"annotation":{const e=t.id;delete r.id,n=`/a/${e}`}break;case"notebook":n="/notebook";break;case"stream":n="/stream";break;default:throw new Error(`Cannot generate URL for route "${e}"`)}let o=!1;const i=new URLSearchParams;for(let[e,t]of Object.entries(r))o=!0,
|
|
641
|
+
i.set(e,t);return o&&(n+="?"+i.toString()),n}sync(){const{route:e,params:t}=this.currentRoute();this._store.changeRoute(e,t),this._didRegisterPopstateListener||(this._window.addEventListener("popstate",(()=>{this.sync()})),this._didRegisterPopstateListener=!0)}navigate(e,t){this._window.history.pushState({},"",this.routeUrl(e,t)),this.sync()}}Cv.$inject=["$window","store"];class Ev{constructor(e,t){this._apiRoutes=e,this._store=t}async init(){try{const e=await this._apiRoutes.links();this._store.updateLinks(e)}catch(e){console.warn(`Failed to fetch Hypothesis links: ${e.message}`)}}}Ev.$inject=["apiRoutes","store"];class Av{constructor(e,t,n,r,o){var i,a;this._api=t,this._auth=n,this._store=e,this._toastMessenger=o,this._authority=null!==(i=null===(a=I(r))||void 0===a?void 0:a.authority)&&void 0!==i?i:null,this._lastLoad=null,this._lastLoadTime=null,n.on("oauthTokensChanged",(()=>this.reload()))}load(){
|
|
642
|
+
return(!this._lastLoad||!this._lastLoadTime||Date.now()-this._lastLoadTime>3e5)&&(this._lastLoadTime=Date.now(),this._lastLoad=nv((()=>{const e=this._authority?{authority:this._authority}:{};return this._api.profile.read(e)})).then((e=>(this.update(e),this._lastLoadTime=Date.now(),e))).catch((e=>{throw this._lastLoadTime=null,e}))),this._lastLoad}async dismissSidebarTutorial(){const e=await this._api.profile.update({},{preferences:{show_sidebar_tutorial:!1}});this.update(e)}update(e){const t=this._store.profile(),n=e.userid!==t.userid;return this._store.updateProfile(e),this._lastLoad=Promise.resolve(e),this._lastLoadTime=Date.now(),n&&(e.userid?br({id:e.userid}):br(null)),e}async logout(){try{return await this._auth.logout(),this.reload()}catch(e){throw this._toastMessenger.error("Log out failed"),new Error(e)}}reload(){return this._lastLoad=null,this._lastLoadTime=null,this.load()}}Av.$inject=["store","api","auth","settings","toastMessenger"];class Tv{constructor(){this._filter={match_policy:"include_any",
|
|
643
|
+
clauses:[],actions:{create:!0,update:!0,delete:!0}}}addClause(e,t,n,r=!1){return this._filter.clauses.push({field:e,operator:t,value:n,case_sensitive:r}),this}getFilter(){return this._filter}resetFilter(){return this._filter={match_policy:"include_any",clauses:[],actions:{create:!0,update:!0,delete:!0}},this}}class Nv extends gg{constructor(e){super();const t=[];let n;const r=()=>{for(;t.length>0;){const e=JSON.stringify(t.shift());n.send(e)}};this.close=()=>{n.close(1e3)},this.send=e=>{t.push(e),this.isConnected()&&r()},this.isConnected=()=>n.readyState===WebSocket.OPEN,(()=>{n=new WebSocket(e),n.onopen=e=>{r(),this.emit("open",e)},n.onclose=e=>{if(1e3===e.code||1001===e.code)return void this.emit("close",e);const t=new Error(`WebSocket closed abnormally, code: ${e.code}`);console.warn(t),this.emit("disconnect")},n.onerror=e=>{this.emit("error",e)},n.onmessage=e=>{this.emit("message",e)}})()}}class Mv{constructor(e,t,n,r,o){this._auth=n,this._groups=r,this._session=o,this._store=e,
|
|
644
|
+
this._websocketURL=t.links().then((e=>e.websocket)),this.clientId=U(32),this._socket=null,this._updateImmediately=!0,this._configMessages={},this._reconnectionAttempts=0,this._reconnectSetUp=!1}applyPendingUpdates(){const e=Object.values(this._store.pendingUpdates());e.length&&this._store.addAnnotations(e);const t=Object.keys(this._store.pendingDeletions()).map((e=>({id:e})));t.length&&this._store.removeAnnotations(t),this._store.clearPendingUpdates()}_handleSocketError(e,t){G("Error connecting to H push notification service:",t);const n=new URL(e).hostname;-1!==["localhost","127.0.0.1"].indexOf(n)&&G("Check that your H service is configured to allow WebSocket connections from "+window.location.origin)}_handleSocketMessage(e){const t=JSON.parse(e.data);if(t)if("annotation-notification"===t.type){const e=t.payload;switch(t.options.action){case"create":case"update":case"past":this._store.receiveRealTimeUpdates({updatedAnnotations:e});break;case"delete":this._store.receiveRealTimeUpdates({deletedAnnotations:e})}
|
|
645
|
+
this._updateImmediately&&this.applyPendingUpdates()}else if("session-change"===t.type)this._session.update(t.model),this._groups.load();else if("whoyouare"===t.type){const e=this._store.profile().userid;t.userid!==e&&console.warn('WebSocket user ID "%s" does not match logged-in ID "%s"',t.userid,e)}else G("Received unsupported notification",t.type)}_sendClientConfig(e){Object.keys(this._configMessages).forEach((t=>{this._configMessages[t]&&e.send(this._configMessages[t])}))}setConfig(e,t){var n;this._configMessages[e]=t,null!==(n=this._socket)&&void 0!==n&&n.isConnected()&&this._socket.send(t)}async _reconnect(){var e;const t=await this._websocketURL;if(!t)return;let n,r;null===(e=this._socket)||void 0===e||e.close();try{n=await this._auth.getAccessToken()}catch(e){throw console.error("Failed to fetch token for WebSocket authentication",e),e}if(n){const e=new URL(t);e.searchParams.set("access_token",n),r=e.toString()}else r=t;const o=new Nv(r);o.on("open",(()=>{this._reconnectionAttempts=0,
|
|
646
|
+
this._sendClientConfig(o)})),o.on("disconnect",(()=>{if(++this._reconnectionAttempts,this._reconnectionAttempts<10){const e=1e3*2**this._reconnectionAttempts;setTimeout((()=>this._reconnect()),e)}else console.error("Gave up trying to reconnect to Hypothesis real time update service")})),o.on("error",(e=>this._handleSocketError(t,e))),o.on("message",(e=>this._handleSocketMessage(e))),this._socket=o,this.setConfig("client-id",{messageType:"client_id",value:this.clientId}),this.setConfig("auth-check",{type:"whoami",id:1})}async connect(e={}){var t;this._updateImmediately=null===(t=e.applyUpdatesImmediately)||void 0===t||t,this._reconnectSetUp||(this._reconnectSetUp=!0,pv(this._store.subscribe,(()=>this._store.profile().userid),(()=>this._reconnect()))),this._socket||await this._reconnect()}}Mv.$inject=["store","apiRoutes","auth","groups","session"];class Lv{constructor(e){this._storage=e}filter(e,t=null){const n=this._storage.getObject("hypothesis.user.tags.list")||[];let r=0;return n.filter((n=>{
|
|
647
|
+
if(null!==t&&r>=t)return!1;const o=n.split(/\W+/),i=new RegExp(`^${W(e)}`,"i");return!(!o.some((e=>e.match(i)))&&!n.match(i))&&(++r,!0)}))}store(e){const t=this._storage.getObject("hypothesis.user.tags.map")||{};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("hypothesis.user.tags.map",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("hypothesis.user.tags.list",n)}}Lv.$inject=["localStorage"];class zv{constructor(e){this._store=e}forceVisible(e){e.children.forEach((e=>{this.forceVisible(e)})),e.visible||this._store.setForcedVisible(e.id,!0)}}zv.$inject=["store"];class Ov{constructor(e){this._store=e}dismiss(e){const t=this._store.getToastMessage(e);t&&!t.isDismissed&&(this._store.updateToastMessage({...t,isDismissed:!0}),setTimeout((()=>{this._store.removeToastMessage(e)}),500))}
|
|
648
|
+
_addMessage(e,t,{autoDismiss:n=!0,moreInfoURL:r="",visuallyHidden:o=!1}={}){if(this._store.hasToastMessage(e,t))return;const i=U(10),a={type:e,id:i,message:t,moreInfoURL:r,visuallyHidden:o};this._store.addToastMessage({isDismissed:!1,...a}),n&&setTimeout((()=>{this.dismiss(i)}),5e3)}error(e,t){this._addMessage("error",e,t)}success(e,t){this._addMessage("success",e,t)}notice(e,t){this._addMessage("notice",e,t)}}Ov.$inject=["store"];class Rv{constructor(){this._providers=new Map,this._instances=new Map,this._constructing=new Set}get(e){if(this._instances.has(e))return this._instances.get(e);const t=this._providers.get(e);if(!t)throw new Error(`"${e}" is not registered`);if("value"in t)return this._instances.set(e,t.value),t.value;if(this._constructing.has(e))throw new Error(`Encountered a circular dependency when constructing "${e}"`);this._constructing.add(e);try{const n=[],r="class"in t&&t.class.$inject||"factory"in t&&t.factory.$inject||[];for(const t of r)try{n.push(this.get(t))}catch(n){
|
|
649
|
+
const r=new Error(`Failed to construct dependency "${t}" of "${e}": ${n.message}`);throw r.cause=n,r}let o;if(t.class)o=new t.class(...n);else{o=(0,t.factory)(...n)}return this._instances.set(e,o),o}finally{this._constructing.delete(e)}}register(e,t){if("function"==typeof t)t={class:t};else if(!function(e){return"object"==typeof e&&null!==e&&("value"in e||"function"==typeof e.class||"function"==typeof e.factory)}(t))throw new Error(`Invalid provider for "${e}"`);return this._providers.set(e,t),this}run(e){const t="Injector.run";this.register(t,{factory:e});try{return this.get(t)}finally{this._instances.delete(t),this._providers.delete(t)}}}const Dv=function(t){for(var n={},r=t.querySelectorAll("script.js-hypothesis-config"),o=0;o<r.length;o++){var i=void 0;try{i=JSON.parse(r[o].textContent||"")}catch(e){console.warn("Could not parse settings from js-hypothesis-config tags",e),i={}}e(n,i)}return n}(document),Iv=function(e){const{version:t,origin:n}=D(e.location.href)
|
|
650
|
+
;return"1.1069.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.1069.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 Pv(e,t){e.setClientId(t.clientId)}function Bv(e,t,n){e.load(),t.load(),n.sync()}function Fv(e,t,n){e.init(),t.init(),n.init()}function jv(e,t){"sidebar"===t.route()&&e.connect()}Dv.sentry&&Iv&&function(e){const t=function(){let e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;pr({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1069.0",beforeSend:(e,t)=>{if(_r>=5)return G("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++_r;try{const n=t&&t.originalException
|
|
651
|
+
;n instanceof Event&&(e.extra||(e.extra={}),Object.assign(e.extra,{type:n.type,detail:n.detail,isTrusted:n.isTrusted}))}catch(e){}return e}});try{Wt("host_config",D(window.location.href))}catch(e){}Wt("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),vr(((e,t)=>{Yt(e,{tags:{context:t}})}))}(Dv.sentry),function(e){e.addEventListener("click",(e=>{const t=e.target;if("A"===t.tagName){const e=t;"_blank"===e.target&&(e.rel="noopener")}}))}(document.body),function(e=n){let t=!1;try{document.createElement("div").dir="auto"}catch(e){t=!0}if(t){const t=e.vnode;e.vnode=e=>{if("string"==typeof e.type){const t=e.props;"dir"in t&&"auto"===t.dir&&(t.dir="")}t&&t(e)}}}(),Pv.$inject=["api","streamer"],Bv.$inject=["groups","session","router"],Fv.$inject=["autosaveService","persistedDefaults","serviceURL"],jv.$inject=["frameSync","store"],function(e,{reset:t=!1}={}){t&&lo.clear();for(let[t,n]of Object.entries(e))lo.set(t,n)}(Go)
|
|
652
|
+
;const Uv=document.querySelector("hypothesis-app");!function(e=window){e.addEventListener("message",J)}(),async function(e,t=window){const n=function(e){const t=D(e.location.href),n=["annotations","group","query","appType","openSidebar","showHighlights","services","branding","enableExperimentalNewNoteButton","focus","requestConfigFromFrame","theme","usernameUrl"],r={openSidebar:P,requestConfigFromFrame:e=>{if("string"==typeof e)return e;const t=function(e){return"object"==typeof e&&null!==e?e:{}}(e);return{origin:F(t.origin),ancestorLevel:B(t.ancestorLevel)}}},o={};for(let[e,i]of Object.entries(t))n.includes(e)&&null!==i&&(r[e]?o[e]=r[e](i):o[e]=i);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:q(n.ancestorLevel,t),origin:n.origin}}(n,t);let o;if(r){
|
|
653
|
+
const e=await async function(e,t){return{...await H(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=H(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=I(e);if(t){if(t.apiUrl)return t.apiUrl;throw new Error("Service should contain an apiUrl value.")}return e.apiUrl}(i),i}(Dv).then((e=>{!function(e,t){const n=new Rv
|
|
654
|
+
;n.register("annotationsService",qg).register("annotationActivity",$g).register("api",Xg).register("apiRoutes",ov).register("auth",sv).register("autosaveService",lv).register("frameSync",gv).register("groups",bv).register("loadAnnotationsService",yv).register("localStorage",xv).register("persistedDefaults",Sv).register("router",Cv).register("serviceURL",Ev).register("session",Av).register("streamer",Mv).register("streamFilter",Tv).register("tags",Lv).register("threadsService",zv).register("toastMessenger",Ov).register("store",{factory:ys}),n.register("$window",{value:window}).register("settings",{value:e}),n.run(Fv),n.run(Pv),n.run(Bv),n.run(Z),n.run(jv),R(so(Jo.Provider,{value:n,children:so(Ug,{})}),t)}(e,Uv)})).catch((e=>function(e,t){console.error("Failed to start Hypothesis client: ",e),R(so(Hg,{error:e}),t)}(e,Uv)));
|
|
666
655
|
//# sourceMappingURL=sidebar.bundle.js.map
|