hypothesis 1.1004.0 → 1.1007.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.
@@ -1,120 +1,121 @@
1
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 y(e){
2
2
  (!e.__d&&(e.__d=!0)&&o.push(e)&&!_.__r++||a!==n.debounceRendering)&&((a=n.debounceRendering)||i)(_)}function _(){for(var e;_.__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 b(e,t,n,r,o,i,a,s,u,h){var d,f,v,y,_,b,x,S=r&&r.__k||c,C=S.length;for(n.__k=[],d=0;d<t.length;d++)if(null!=(y=n.__k[d]=null==(y=t[d])||"boolean"==typeof y?null:"string"==typeof y||"number"==typeof y||"bigint"==typeof y?p(null,y,null,null,y):Array.isArray(y)?p(m,{children:y},null,null,null):y.__b>0?p(y.type,y.props,y.key,null,y.__v):y)){if(y.__=n,y.__b=n.__b+1,null===(v=S[d])||v&&y.key==v.key&&y.type===v.type)S[d]=void 0;else for(f=0;f<C;f++){if((v=S[f])&&y.key==v.key&&y.type===v.type){S[f]=void 0;break}v=null}T(e,y,v=v||l,o,i,a,s,u,h),_=y.__e,(f=y.ref)&&v.ref!=f&&(x||(x=[]),
3
- v.ref&&x.push(v.ref,null,y),x.push(f,y.__c||_,y)),null!=_?(null==b&&(b=_),"function"==typeof y.type&&y.__k===v.__k?y.__d=u=w(y,u,e):u=k(e,y,v,S,_,u),"function"==typeof n.type&&(n.__d=u)):u&&v.__e==u&&u.parentNode!=e&&(u=g(v))}for(n.__e=b,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++)M(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){
3
+ v.ref&&x.push(v.ref,null,y),x.push(f,y.__c||_,y)),null!=_?(null==b&&(b=_),"function"==typeof y.type&&y.__k===v.__k?y.__d=u=w(y,u,e):u=k(e,y,v,S,_,u),"function"==typeof n.type&&(n.__d=u)):u&&v.__e==u&&u.parentNode!=e&&(u=g(v))}for(n.__e=b,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
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?E:A,i):e.removeEventListener(t,i?E:A,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 A(e){this.l[e.type+!1](n.event?n.event(e):e)}function E(e){this.l[e.type+!0](n.event?n.event(e):e)}function T(e,t,r,o,i,a,s,l,c){
5
5
  var u,d,p,g,v,y,_,w,x,k,S,C=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 C){if(w=t.props,x=(u=C.contextType)&&o[u.__c],k=u?x?x.props.value:u.__:o,r.__c?_=(d=t.__c=r.__c).__=d.__E:("prototype"in C&&C.prototype.render?t.__c=d=new C(w,k):(t.__c=d=new f(w,k),d.constructor=C,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!=C.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=h({},d.__s)),h(d.__s,C.getDerivedStateFromProps(w,d.__s))),g=d.props,v=d.state,p)null==C.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==C.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,y)}))}d.context=k,d.props=w,d.state=d.__s,(u=n.__r)&&u(t),d.__d=!1,d.__v=t,d.__P=e,u=d.render(d.props,d.state,d.context),d.state=d.__s,null!=d.getChildContext&&(o=h(h({},o),d.getChildContext())),p||null==d.getSnapshotBeforeUpdate||(y=d.getSnapshotBeforeUpdate(g,v)),S=null!=u&&u.type===m&&null==u.key?u.props.children:u,b(e,Array.isArray(S)?S:[S],t,r,o,i,a,s,l,c),d.base=t.__e,t.__h=null,d.__h.length&&s.push(d),_&&(d.__E=d.__=null),d.__e=!1}else null==a&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=L(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,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){
7
- n.__e(e,t.__v)}}))}function L(e,n,r,o,i,a,s,c){var u,h,p,m=r.props,f=n.props,v=n.type,y=0;if("svg"===v&&(i=!0),null!=a)for(;y<a.length;y++)if((u=a[y])&&"setAttribute"in u==!!v&&(v?u.localName===v:3===u.nodeType)){e=u,a[y]=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={},y=0;y<e.attributes.length;y++)m[e.attributes[y].name]=e.attributes[y].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);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(y=n.props.children,
8
- b(e,Array.isArray(y)?y:[y],n,r,o,i&&"foreignObject"!==v,a,s,a?a[0]:r.__k&&g(r,0),c),null!=a)for(y=a.length;y--;)null!=a[y]&&d(a[y]);c||("value"in f&&void 0!==(y=f.value)&&(y!==e.value||"progress"===v&&!y||"option"===v&&y!==m.value)&&C(e,"value",y,m.value,!1),"checked"in f&&void 0!==(y=f.checked)&&y!==e.checked&&C(e,"checked",y,m.checked,!1))}return e}function M(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||M(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 I(e,r,o){var i,a,s;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]
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 R(e){const t=new URL(e).hash.slice(1),n=new URLSearchParams(t).get("config");return JSON.parse(n||"{}")}function P({services:e}){return Array.isArray(e)&&e[0]?e[0]:null}function D(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}function H(e){const t=new Uint8Array(e/2);return window.crypto.getRandomValues(t),Array.from(t).map(j).join("")}function q(e,t,n,r=[],o=2e3,i=window){const a=H(10),s={
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 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 U(e,t){const n={...e,...t};return n.apiUrl=function(e){const t=P(e);if(t){if(t.apiUrl)return t.apiUrl;throw new Error("Service should contain an apiUrl value.")}return e.apiUrl}(n),n}async function $(e,t,n){return async function(e,t){Array.isArray(e.services)&&e.services.forEach(((e,n)=>{"$rpc:requestGroups"===e.groups&&(e.groups=t("requestGroups",[n],null).catch((()=>{
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,y)}))}d.context=k,d.props=w,d.state=d.__s,(u=n.__r)&&u(t),d.__d=!1,d.__v=t,d.__P=e,u=d.render(d.props,d.state,d.context),d.state=d.__s,null!=d.getChildContext&&(o=h(h({},o),d.getChildContext())),p||null==d.getSnapshotBeforeUpdate||(y=d.getSnapshotBeforeUpdate(g,v)),S=null!=u&&u.type===m&&null==u.key?u.props.children:u,b(e,Array.isArray(S)?S:[S],t,r,o,i,a,s,l,c),d.base=t.__e,t.__h=null,d.__h.length&&s.push(d),_&&(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,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){
7
+ 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,y=0;if("svg"===v&&(i=!0),null!=a)for(;y<a.length;y++)if((u=a[y])&&"setAttribute"in u==!!v&&(v?u.localName===v:3===u.nodeType)){e=u,a[y]=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={},y=0;y<e.attributes.length;y++)m[e.attributes[y].name]=e.attributes[y].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);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(y=n.props.children,
8
+ b(e,Array.isArray(y)?y:[y],n,r,o,i&&"foreignObject"!==v,a,s,a?a[0]:r.__k&&g(r,0),c),null!=a)for(y=a.length;y--;)null!=a[y]&&d(a[y]);c||("value"in f&&void 0!==(y=f.value)&&(y!==e.value||"progress"===v&&!y||"option"===v&&y!==m.value)&&C(e,"value",y,m.value,!1),"checked"in f&&void 0!==(y=f.checked)&&y!==e.checked&&C(e,"checked",y,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 I(e,r,o){var i,a,s;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]
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 P(e){const t=new URL(e).hash.slice(1),n=new URLSearchParams(t).get("config");return JSON.parse(n||"{}")}function R({services:e}){return Array.isArray(e)&&e[0]?e[0]:null}function D(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}function H(e){const t=new Uint8Array(e/2);return window.crypto.getRandomValues(t),Array.from(t).map(j).join("")}function q(e,t,n,r=[],o=2e3,i=window){const a=H(10),s={
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 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 U(e,t){const n={...e,...t};return n.apiUrl=function(e){const t=R(e);if(t){if(t.apiUrl)return t.apiUrl;throw new Error("Service should contain an apiUrl value.")}return e.apiUrl}(n),n}async function $(e,t,n){return async function(e,t){Array.isArray(e.services)&&e.services.forEach(((e,n)=>{"$rpc:requestGroups"===e.groups&&(e.groups=t("requestGroups",[n],null).catch((()=>{
11
11
  throw new Error("Unable to fetch groups")})))}));return e}(U(e,await q(t,n,"requestConfig",[],3e3)),((e,r=[],o=3e3)=>q(t,n,e,r,o)))}t=c.slice,n={__e:function(e,t){for(var n,r,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(e)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e),o=n.__d),o)return n.__E=n}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),y(this))},f.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),y(this))},f.prototype.render=m,o=[],i="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_.__r=0,s=0;let G=new Set;function V(...e){const t=e.join();G.has(t)||(console.warn(...e),G.add(t))}V.reset=()=>{G.clear()}
12
- ;var W="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},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=P(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(Y).join(".*"))))}(t,e.scopes.uri_patterns);return!0}(e,n))),a}let X=[];function Z(e,t,n){const r=(e=>({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){
12
+ ;var W="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},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=R(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(Y).join(".*"))))}(t,e.scopes.uri_patterns);return!0}(e,n))),a}let X=[];function Z(e,t,n){const r=(e=>({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){
13
13
  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 V(`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)}Z.$inject=["store","settings","$window"];var Q=function(e,t){return Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){
14
14
  for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},Q(e,t)};function ee(e,t){function n(){this.constructor=e}Q(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var te,ne=function(){return ne=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ne.apply(this,arguments)};function re(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function oe(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function ie(){
15
15
  for(var e=[],t=0;t<arguments.length;t++)e=e.concat(oe(arguments[t]));return e}function ae(){return"undefined"!=typeof __SENTRY_NO_DEBUG__&&!__SENTRY_BROWSER_BUNDLE__}function se(){return!("undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&__SENTRY_BROWSER_BUNDLE__)&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}!function(e){e.Fatal="fatal",e.Error="error",e.Warning="warning",e.Log="log",e.Info="info",e.Debug="debug",e.Critical="critical"}(te||(te={}));var le={};function ce(){return se()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:le}var ue=Object.prototype.toString;function he(e){switch(ue.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return we(e,Error)}}function de(e,t){return ue.call(e)==="[object "+t+"]"}function pe(e){return de(e,"ErrorEvent")}function me(e){return de(e,"DOMError")}function fe(e){return de(e,"String")}function ge(e){
16
16
  return null===e||"object"!=typeof e&&"function"!=typeof e}function ve(e){return de(e,"Object")}function ye(e){return"undefined"!=typeof Event&&we(e,Event)}function _e(e){return"undefined"!=typeof Element&&we(e,Element)}function be(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function we(e,t){try{return e instanceof t}catch(e){return!1}}function xe(e,t){try{for(var n=e,r=[],o=0,i=0,a=" > ".length,s=void 0;n&&o++<5&&!("html"===(s=ke(n,t))||o>1&&i+r.length*a+s.length>=80);)r.push(s),i+=s.length,n=n.parentNode;return r.reverse().join(" > ")}catch(e){return"<unknown>"}}function ke(e,t){var n,r,o,i,a,s=e,l=[];if(!s||!s.tagName)return"";l.push(s.tagName.toLowerCase());var c=t&&t.length?t.filter((function(e){return s.getAttribute(e)})).map((function(e){return[e,s.getAttribute(e)]})):null;if(c&&c.length)c.forEach((function(e){l.push("["+e[0]+'="'+e[1]+'"]')}));else if(s.id&&l.push("#"+s.id),(n=s.className)&&fe(n))for(r=n.split(/\s+/),a=0;a<r.length;a++)l.push("."+r[a]);var u=["type","name","title","alt"]
17
17
  ;for(a=0;a<u.length;a++)o=u[a],(i=s.getAttribute(o))&&l.push("["+o+'="'+i+'"]');return l.join("")}var Se=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){return e.__proto__=t,e}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n]);return e});var Ce=function(e){function t(t){var n=this.constructor,r=e.call(this,t)||this;return r.message=t,r.name=n.prototype.constructor.name,Se(r,n.prototype),r}return ee(t,e),t}(Error),Ae=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Ee(e,t){void 0===t&&(t=!1);var n=e.host,r=e.path,o=e.pass,i=e.port,a=e.projectId;return e.protocol+"://"+e.publicKey+(t&&o?":"+o:"")+"@"+n+(i?":"+i:"")+"/"+(r?r+"/":r)+a}function Te(e){return"user"in e&&!("publicKey"in e)&&(e.publicKey=e.user),{user:e.publicKey||"",protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Ne(e){var t="string"==typeof e?function(e){var t=Ae.exec(e)
18
- ;if(!t)throw new Ce("Invalid Sentry Dsn: "+e);var n=oe(t.slice(1),6),r=n[0],o=n[1],i=n[2],a=void 0===i?"":i,s=n[3],l=n[4],c=void 0===l?"":l,u="",h=n[5],d=h.split("/");if(d.length>1&&(u=d.slice(0,-1).join("/"),h=d.pop()),h){var p=h.match(/^\d+/);p&&(h=p[0])}return Te({host:s,pass:a,path:u,projectId:h,port:c,protocol:r,publicKey:o})}(e):Te(e);return function(e){if(ae()){var t=e.port,n=e.projectId,r=e.protocol;if(["protocol","publicKey","host","projectId"].forEach((function(t){if(!e[t])throw new Ce("Invalid Sentry Dsn: "+t+" missing")})),!n.match(/^\d+$/))throw new Ce("Invalid Sentry Dsn: Invalid projectId "+n);if(!function(e){return"http"===e||"https"===e}(r))throw new Ce("Invalid Sentry Dsn: Invalid protocol "+r);if(t&&isNaN(parseInt(t,10)))throw new Ce("Invalid Sentry Dsn: Invalid port "+t)}}(t),t}var Le=["fatal","error","warning","log","info","debug","critical"],Me=ce(),ze="Sentry Logger ";function Oe(e){var t=ce();if(!("console"in t))return e();var n=t.console,r={}
19
- ;["debug","info","warn","error","log","assert"].forEach((function(e){e in t.console&&n[e].__sentry_original__&&(r[e]=n[e],n[e]=n[e].__sentry_original__)}));var o=e();return Object.keys(r).forEach((function(e){n[e]=r[e]})),o}var Ie=function(){function e(){this._enabled=!1}return e.prototype.disable=function(){this._enabled=!1},e.prototype.enable=function(){this._enabled=!0},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&Oe((function(){Me.console.log(ze+"[Log]: "+e.join(" "))}))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&Oe((function(){Me.console.warn(ze+"[Warn]: "+e.join(" "))}))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&Oe((function(){Me.console.error(ze+"[Error]: "+e.join(" "))}))},e}();Me.__SENTRY__=Me.__SENTRY__||{};var Re=Me.__SENTRY__.logger||(Me.__SENTRY__.logger=new Ie);function Pe(e){if(!e.length)return[]
20
- ;var t=e,n=t[0].function||"",r=t[t.length-1].function||"";return-1===n.indexOf("captureMessage")&&-1===n.indexOf("captureException")||(t=t.slice(1)),-1!==r.indexOf("sentryWrapped")&&(t=t.slice(0,-1)),t.slice(0,50).map((function(e){return ne(ne({},e),{filename:e.filename||t[0].filename,function:e.function||"?"})})).reverse()}function De(e){try{return e&&"function"==typeof e&&e.name||"<anonymous>"}catch(e){return"<anonymous>"}}function Be(e,t){return void 0===t&&(t=0),"string"!=typeof e||0===t||e.length<=t?e:e.substr(0,t)+"..."}function Fe(e,t){if(!Array.isArray(e))return"";for(var n=[],r=0;r<e.length;r++){var o=e[r];try{n.push(String(o))}catch(e){n.push("[value cannot be serialized]")}}return n.join(t)}function je(e,t){return!!fe(e)&&(de(t,"RegExp")?t.test(e):"string"==typeof t&&-1!==e.indexOf(t))}function He(e,t,n){if(t in e){var r=e[t],o=n(r);if("function"==typeof o)try{Ue(o,r)}catch(e){}e[t]=o}}function qe(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}function Ue(e,t){
21
- var n=t.prototype||{};e.prototype=t.prototype=n,qe(e,"__sentry_original__",t)}function $e(e){return e.__sentry_original__}function Ge(e){if(he(e)){var t=e,n={message:t.message,name:t.name,stack:t.stack};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}if(ye(e)){var o=e,i={};i.type=o.type;try{i.target=_e(o.target)?xe(o.target):Object.prototype.toString.call(o.target)}catch(e){i.target="<unknown>"}try{i.currentTarget=_e(o.currentTarget)?xe(o.currentTarget):Object.prototype.toString.call(o.currentTarget)}catch(e){i.currentTarget="<unknown>"}for(var a in"undefined"!=typeof CustomEvent&&we(e,CustomEvent)&&(i.detail=o.detail),o)Object.prototype.hasOwnProperty.call(o,a)&&(i[a]=o[a]);return i}return e}function Ve(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}function We(e,t,n){void 0===t&&(t=3),void 0===n&&(n=102400);var r=Xe(e,t);return Ve(r)>n?We(e,t-1,n):r}function Ye(e,t){
22
- return"domain"===t&&e&&"object"==typeof e&&e._events?"[Domain]":"domainEmitter"===t?"[DomainEmitter]":"undefined"!=typeof global&&e===global?"[Global]":"undefined"!=typeof window&&e===window?"[Window]":"undefined"!=typeof document&&e===document?"[Document]":ve(n=e)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n?"[SyntheticEvent]":"number"==typeof e&&e!=e?"[NaN]":void 0===e?"[undefined]":"function"==typeof e?"[Function: "+De(e)+"]":"symbol"==typeof e?"["+String(e)+"]":"bigint"==typeof e?"[BigInt: "+String(e)+"]":e;var n}function Ke(e,t,n,r){if(void 0===n&&(n=1/0),void 0===r&&(r=function(){var e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(var r=0;r<t.length;r++)if(t[r]===n)return!0;return t.push(n),!1},function(n){if(e)t.delete(n);else for(var r=0;r<t.length;r++)if(t[r]===n){t.splice(r,1);break}}]}()),0===n)return function(e){if("string"==typeof e)return e;var t=Object.prototype.toString.call(e)
23
- ;if("[object Object]"===t)return"[Object]";if("[object Array]"===t)return"[Array]";var n=Ye(e);return ge(n)?n:t}(t);if(null!=t&&"function"==typeof t.toJSON)return t.toJSON();var o=Ye(t,e);if(ge(o))return o;var i=Ge(t),a=Array.isArray(t)?[]:{};if(r[0](t))return"[Circular ~]";for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(a[s]=Ke(s,i[s],n-1,r));return r[1](t),a}function Xe(e,t){try{return JSON.parse(JSON.stringify(e,(function(e,n){return Ke(e,n,t)})))}catch(e){return"**non-serializable**"}}function Ze(e,t){void 0===t&&(t=40);var n=Object.keys(Ge(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return Be(n[0],t);for(var r=n.length;r>0;r--){var o=n.slice(0,r).join(", ");if(!(o.length>t))return r===n.length?o:Be(o,t)}return""}function Je(e){var t,n;if(ve(e)){var r=e,o={};try{for(var i=re(Object.keys(r)),a=i.next();!a.done;a=i.next()){var s=a.value;void 0!==r[s]&&(o[s]=Je(r[s]))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}
24
- return o}return Array.isArray(e)?e.map(Je):e}function Qe(){if(!("fetch"in ce()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(e){return!1}}function et(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function tt(){if(!Qe())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(e){return!1}}var nt,rt=ce(),ot={},it={};function at(e){if(!it[e])switch(it[e]=!0,e){case"console":!function(){if(!("console"in rt))return;["debug","info","warn","error","log","assert"].forEach((function(e){e in rt.console&&He(rt.console,e,(function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];lt("console",{args:n,level:e}),t&&t.apply(rt.console,n)}}))}))}();break;case"dom":!function(){if(!("document"in rt))return;var e=lt.bind(null,"dom"),t=pt(e,!0);rt.document.addEventListener("click",t,!1),rt.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((function(t){var n=rt[t]&&rt[t].prototype
18
+ ;if(!t)throw new Ce("Invalid Sentry Dsn: "+e);var n=oe(t.slice(1),6),r=n[0],o=n[1],i=n[2],a=void 0===i?"":i,s=n[3],l=n[4],c=void 0===l?"":l,u="",h=n[5],d=h.split("/");if(d.length>1&&(u=d.slice(0,-1).join("/"),h=d.pop()),h){var p=h.match(/^\d+/);p&&(h=p[0])}return Te({host:s,pass:a,path:u,projectId:h,port:c,protocol:r,publicKey:o})}(e):Te(e);return function(e){if(ae()){var t=e.port,n=e.projectId,r=e.protocol;if(["protocol","publicKey","host","projectId"].forEach((function(t){if(!e[t])throw new Ce("Invalid Sentry Dsn: "+t+" missing")})),!n.match(/^\d+$/))throw new Ce("Invalid Sentry Dsn: Invalid projectId "+n);if(!function(e){return"http"===e||"https"===e}(r))throw new Ce("Invalid Sentry Dsn: Invalid protocol "+r);if(t&&isNaN(parseInt(t,10)))throw new Ce("Invalid Sentry Dsn: Invalid port "+t)}}(t),t}var Me=["fatal","error","warning","log","info","debug","critical"],Le=ce(),ze="Sentry Logger ";function Oe(e){var t=ce();if(!("console"in t))return e();var n=t.console,r={}
19
+ ;["debug","info","warn","error","log","assert"].forEach((function(e){e in t.console&&n[e].__sentry_original__&&(r[e]=n[e],n[e]=n[e].__sentry_original__)}));var o=e();return Object.keys(r).forEach((function(e){n[e]=r[e]})),o}var Ie=function(){function e(){this._enabled=!1}return e.prototype.disable=function(){this._enabled=!1},e.prototype.enable=function(){this._enabled=!0},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&Oe((function(){var t;(t=Le.console).log.apply(t,ie([ze+"[Log]:"],e))}))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&Oe((function(){var t;(t=Le.console).warn.apply(t,ie([ze+"[Warn]:"],e))}))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&Oe((function(){var t;(t=Le.console).error.apply(t,ie([ze+"[Error]:"],e))}))},e}();Le.__SENTRY__=Le.__SENTRY__||{};var Pe=Le.__SENTRY__.logger||(Le.__SENTRY__.logger=new Ie);function Re(e){
20
+ if(!e.length)return[];var t=e,n=t[0].function||"",r=t[t.length-1].function||"";return-1===n.indexOf("captureMessage")&&-1===n.indexOf("captureException")||(t=t.slice(1)),-1!==r.indexOf("sentryWrapped")&&(t=t.slice(0,-1)),t.slice(0,50).map((function(e){return ne(ne({},e),{filename:e.filename||t[0].filename,function:e.function||"?"})})).reverse()}function De(e){try{return e&&"function"==typeof e&&e.name||"<anonymous>"}catch(e){return"<anonymous>"}}function Be(e,t){return void 0===t&&(t=0),"string"!=typeof e||0===t||e.length<=t?e:e.substr(0,t)+"..."}function Fe(e,t){if(!Array.isArray(e))return"";for(var n=[],r=0;r<e.length;r++){var o=e[r];try{n.push(String(o))}catch(e){n.push("[value cannot be serialized]")}}return n.join(t)}function je(e,t){return!!fe(e)&&(de(t,"RegExp")?t.test(e):"string"==typeof t&&-1!==e.indexOf(t))}function He(e,t,n){if(t in e){var r=e[t],o=n(r);if("function"==typeof o)try{Ue(o,r)}catch(e){}e[t]=o}}function qe(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}
21
+ function Ue(e,t){var n=t.prototype||{};e.prototype=t.prototype=n,qe(e,"__sentry_original__",t)}function $e(e){return e.__sentry_original__}function Ge(e){if(he(e)){var t=e,n={message:t.message,name:t.name,stack:t.stack};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}if(ye(e)){var o=e,i={};i.type=o.type;try{i.target=_e(o.target)?xe(o.target):Object.prototype.toString.call(o.target)}catch(e){i.target="<unknown>"}try{i.currentTarget=_e(o.currentTarget)?xe(o.currentTarget):Object.prototype.toString.call(o.currentTarget)}catch(e){i.currentTarget="<unknown>"}for(var a in"undefined"!=typeof CustomEvent&&we(e,CustomEvent)&&(i.detail=o.detail),o)Object.prototype.hasOwnProperty.call(o,a)&&(i[a]=o[a]);return i}return e}function Ve(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}function We(e,t,n){void 0===t&&(t=3),void 0===n&&(n=102400);var r=Xe(e,t);return Ve(r)>n?We(e,t-1,n):r}function Ye(e,t){
22
+ return"domain"===t&&e&&"object"==typeof e&&e._events?"[Domain]":"domainEmitter"===t?"[DomainEmitter]":"undefined"!=typeof global&&e===global?"[Global]":"undefined"!=typeof window&&e===window?"[Window]":"undefined"!=typeof document&&e===document?"[Document]":ve(n=e)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n?"[SyntheticEvent]":"number"==typeof e&&e!=e?"[NaN]":void 0===e?"[undefined]":"function"==typeof e?"[Function: "+De(e)+"]":"symbol"==typeof e?"["+String(e)+"]":"bigint"==typeof e?"[BigInt: "+String(e)+"]":e;var n}function Ke(e,t,n,r){void 0===n&&(n=1/0),void 0===r&&(r=function(){var e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(var r=0;r<t.length;r++)if(t[r]===n)return!0;return t.push(n),!1},function(n){if(e)t.delete(n);else for(var r=0;r<t.length;r++)if(t[r]===n){t.splice(r,1);break}}]}());var o=oe(r,2),i=o[0],a=o[1];if(0===n)return function(e){if("string"==typeof e)return e;var t=Object.prototype.toString.call(e)
23
+ ;if("[object Object]"===t)return"[Object]";if("[object Array]"===t)return"[Array]";var n=Ye(e);return ge(n)?n:t}(t);if(null!=t&&"function"==typeof t.toJSON)return t.toJSON();var s=Ye(t,e);if(ge(s))return s;var l=Ge(t),c=Array.isArray(t)?[]:{};if(i(t))return"[Circular ~]";for(var u in l)if(Object.prototype.hasOwnProperty.call(l,u)){var h=l[u];c[u]=Ke(u,h,n-1,r)}return a(t),c}function Xe(e,t){try{return Ke("",e,t)}catch(e){return"**non-serializable**"}}function Ze(e,t){void 0===t&&(t=40);var n=Object.keys(Ge(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return Be(n[0],t);for(var r=n.length;r>0;r--){var o=n.slice(0,r).join(", ");if(!(o.length>t))return r===n.length?o:Be(o,t)}return""}function Je(e){var t,n;if(ve(e)){var r=e,o={};try{for(var i=re(Object.keys(r)),a=i.next();!a.done;a=i.next()){var s=a.value;void 0!==r[s]&&(o[s]=Je(r[s]))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return o}return Array.isArray(e)?e.map(Je):e}
24
+ function Qe(){if(!("fetch"in ce()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(e){return!1}}function et(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function tt(){if(!Qe())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(e){return!1}}var nt,rt=ce(),ot={},it={};function at(e){if(!it[e])switch(it[e]=!0,e){case"console":!function(){if(!("console"in rt))return;["debug","info","warn","error","log","assert"].forEach((function(e){e in rt.console&&He(rt.console,e,(function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];lt("console",{args:n,level:e}),t&&t.apply(rt.console,n)}}))}))}();break;case"dom":!function(){if(!("document"in rt))return;var e=lt.bind(null,"dom"),t=pt(e,!0);rt.document.addEventListener("click",t,!1),rt.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((function(t){var n=rt[t]&&rt[t].prototype
25
25
  ;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(He(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=pt(e);s.handler=l,t.call(this,n,l,o)}s.refCount+=1}catch(e){}return t.call(this,n,r,o)}})),He(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 rt))return;var e=XMLHttpRequest.prototype;He(e,"open",(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=this,o=t[1],i=r.__sentry_xhr__={
26
26
  method:fe(t[0])?t[0].toUpperCase():t[0],url:t[1]};fe(o)&&"POST"===i.method&&o.match(/sentry_key/)&&(r.__sentry_own_request__=!0);var a=function(){if(4===r.readyState){try{i.status_code=r.status}catch(e){}lt("xhr",{args:t,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:r})}};return"onreadystatechange"in r&&"function"==typeof r.onreadystatechange?He(r,"onreadystatechange",(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return a(),e.apply(r,t)}})):r.addEventListener("readystatechange",a),e.apply(r,t)}})),He(e,"send",(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this.__sentry_xhr__&&void 0!==t[0]&&(this.__sentry_xhr__.body=t[0]),lt("xhr",{args:t,startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}}))}();break;case"fetch":!function(){if(!function(){if(!Qe())return!1;var e=ce();if(et(e.fetch))return!0;var t=!1,n=e.document;if(n&&"function"==typeof n.createElement)try{var r=n.createElement("iframe");r.hidden=!0,
27
- n.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(t=et(r.contentWindow.fetch)),n.head.removeChild(r)}catch(e){ae()&&Re.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return t}())return;He(rt,"fetch",(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r={args:t,fetchData:{method:ct(t),url:ut(t)},startTimestamp:Date.now()};return lt("fetch",ne({},r)),e.apply(rt,t).then((function(e){return lt("fetch",ne(ne({},r),{endTimestamp:Date.now(),response:e})),e}),(function(e){throw lt("fetch",ne(ne({},r),{endTimestamp:Date.now(),error:e})),e}))}}))}();break;case"history":!function(){if(!function(){var e=ce(),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=rt.onpopstate;function t(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.length>2?t[2]:void 0;if(r){var o=nt,i=String(r);nt=i,lt("history",{from:o,to:i})}
28
- return e.apply(this,t)}}rt.onpopstate=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=rt.location.href,o=nt;if(nt=r,lt("history",{from:o,to:r}),e)try{return e.apply(this,t)}catch(e){}},He(rt.history,"pushState",t),He(rt.history,"replaceState",t)}();break;case"error":mt=rt.onerror,rt.onerror=function(e,t,n,r,o){return lt("error",{column:r,error:o,line:n,msg:e,url:t}),!!mt&&mt.apply(this,arguments)};break;case"unhandledrejection":ft=rt.onunhandledrejection,rt.onunhandledrejection=function(e){return lt("unhandledrejection",e),!ft||ft.apply(this,arguments)};break;default:Re.warn("unknown instrumentation type:",e)}}function st(e,t){ot[e]=ot[e]||[],ot[e].push(t),at(e)}function lt(e,t){var n,r;if(e&&ot[e])try{for(var o=re(ot[e]||[]),i=o.next();!i.done;i=o.next()){var a=i.value;try{a(t)}catch(t){ae()&&Re.error("Error while triggering instrumentation handler.\nType: "+e+"\nName: "+De(a)+"\nError: "+t)}}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{
27
+ n.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(t=et(r.contentWindow.fetch)),n.head.removeChild(r)}catch(e){ae()&&Pe.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return t}())return;He(rt,"fetch",(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r={args:t,fetchData:{method:ct(t),url:ut(t)},startTimestamp:Date.now()};return lt("fetch",ne({},r)),e.apply(rt,t).then((function(e){return lt("fetch",ne(ne({},r),{endTimestamp:Date.now(),response:e})),e}),(function(e){throw lt("fetch",ne(ne({},r),{endTimestamp:Date.now(),error:e})),e}))}}))}();break;case"history":!function(){if(!function(){var e=ce(),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=rt.onpopstate;function t(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.length>2?t[2]:void 0;if(r){var o=nt,i=String(r);nt=i,lt("history",{from:o,to:i})}
28
+ return e.apply(this,t)}}rt.onpopstate=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=rt.location.href,o=nt;if(nt=r,lt("history",{from:o,to:r}),e)try{return e.apply(this,t)}catch(e){}},He(rt.history,"pushState",t),He(rt.history,"replaceState",t)}();break;case"error":mt=rt.onerror,rt.onerror=function(e,t,n,r,o){return lt("error",{column:r,error:o,line:n,msg:e,url:t}),!!mt&&mt.apply(this,arguments)};break;case"unhandledrejection":ft=rt.onunhandledrejection,rt.onunhandledrejection=function(e){return lt("unhandledrejection",e),!ft||ft.apply(this,arguments)};break;default:Pe.warn("unknown instrumentation type:",e)}}function st(e,t){ot[e]=ot[e]||[],ot[e].push(t),at(e)}function lt(e,t){var n,r;if(e&&ot[e])try{for(var o=re(ot[e]||[]),i=o.next();!i.done;i=o.next()){var a=i.value;try{a(t)}catch(t){ae()&&Pe.error("Error while triggering instrumentation handler.\nType: "+e+"\nName: "+De(a)+"\nError:",t)}}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{
29
29
  if(n)throw n.error}}}function ct(e){return void 0===e&&(e=[]),"Request"in rt&&we(e[0],Request)&&e[0].method?String(e[0].method).toUpperCase():e[1]&&e[1].method?String(e[1].method).toUpperCase():"GET"}function ut(e){return void 0===e&&(e=[]),"string"==typeof e[0]?e[0]:"Request"in rt&&we(e[0],Request)?e[0].url:String(e[0])}var ht,dt;function pt(e,t){return void 0===t&&(t=!1),function(n){if(n&&dt!==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===ht||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}(dt,n))&&(e({event:n,name:r,global:t}),dt=n),clearTimeout(ht),ht=rt.setTimeout((function(){ht=void 0}),1e3)}}}var mt=null;var ft=null;function gt(){var e=ce(),t=e.crypto||e.msCrypto;if(void 0!==t&&t.getRandomValues){var n=new Uint16Array(8);t.getRandomValues(n),
30
30
  n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;var r=function(e){for(var t=e.toString(16);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,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function vt(e){if(!e)return{};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 yt(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function _t(e){var t=e.message,n=e.event_id;if(t)return t;var r=yt(e);return r?r.type&&r.value?r.type+": "+r.value:r.type||r.value||n||"<unknown>":n||"<unknown>"}function bt(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 wt(e,t){var n=yt(e);if(n){var r=n.mechanism;if(n.mechanism=ne(ne(ne({},{type:"generic",
31
31
  handled:!0}),r),t),t&&"data"in t){var o=ne(ne({},r&&r.data),t.data);n.mechanism.data=o}}}function xt(e){if(e&&e.__sentry_captured__)return!0;try{qe(e,"__sentry_captured__",!0)}catch(e){}return!1}function kt(e){return new Ct((function(t){t(e)}))}function St(e){return new Ct((function(t,n){n(e)}))}var Ct=function(){function e(e){var t=this;this._state=0,this._handlers=[],this._resolve=function(e){t._setResult(1,e)},this._reject=function(e){t._setResult(2,e)},this._setResult=function(e,n){0===t._state&&(be(n)?n.then(t._resolve,t._reject):(t._state=e,t._value=n,t._executeHandlers()))},this._executeHandlers=function(){if(0!==t._state){var e=t._handlers.slice();t._handlers=[],e.forEach((function(e){e[0]||(1===t._state&&e[1](t._value),2===t._state&&e[2](t._value),e[0]=!0)}))}};try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}return e.prototype.then=function(t,n){var r=this;return new e((function(e,o){r._handlers.push([!1,function(n){if(t)try{e(t(n))}catch(e){o(e)}else e(n)},function(t){if(n)try{e(n(t))
32
- }catch(e){o(e)}else o(t)}]),r._executeHandlers()}))},e.prototype.catch=function(e){return this.then((function(e){return e}),e)},e.prototype.finally=function(t){var n=this;return new e((function(e,r){var o,i;return n.then((function(e){i=!1,o=e,t&&t()}),(function(e){i=!0,o=e,t&&t()})).then((function(){i?r(o):e(o)}))}))},e}();function At(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 St(new Ce("Not adding Promise due to buffer limit reached."));var o=r();return-1===t.indexOf(o)&&t.push(o),o.then((function(){return n(o)})).then(null,(function(){return n(o).then(null,(function(){}))})),o},drain:function(e){return new Ct((function(n,r){var o=t.length;if(!o)return n(!0);var i=setTimeout((function(){e&&e>0&&n(!1)}),e);t.forEach((function(e){kt(e).then((function(){--o||(clearTimeout(i),n(!0))}),r)}))}))}}}function Et(e){return"warn"===e?te.Warning:function(e){return-1!==Le.indexOf(e)}(e)?e:te.Log}var Tt={nowSeconds:function(){
33
- return Date.now()/1e3}};var Nt=se()?function(){try{return(e=module,t="perf_hooks",e.require(t)).performance}catch(e){return}var e,t}():function(){var e=ce().performance;if(e&&e.now)return{now:function(){return e.now()},timeOrigin:Date.now()-e.now()}}(),Lt=void 0===Nt?Tt:{nowSeconds:function(){return(Nt.timeOrigin+Nt.now())/1e3}},Mt=Tt.nowSeconds.bind(Tt),zt=Lt.nowSeconds.bind(Lt);!function(){var e=ce().performance;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 Ot=function(){function e(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={}}return e.clone=function(t){var n=new e;return t&&(n._breadcrumbs=ie(t._breadcrumbs),n._tags=ne({},t._tags),n._extra=ne({},t._extra),n._contexts=ne({},t._contexts),
34
- n._user=t._user,n._level=t._level,n._span=t._span,n._session=t._session,n._transactionName=t._transactionName,n._fingerprint=t._fingerprint,n._eventProcessors=ie(t._eventProcessors),n._requestSession=t._requestSession),n},e.prototype.addScopeListener=function(e){this._scopeListeners.push(e)},e.prototype.addEventProcessor=function(e){return this._eventProcessors.push(e),this},e.prototype.setUser=function(e){return this._user=e||{},this._session&&this._session.update({user:e}),this._notifyScopeListeners(),this},e.prototype.getUser=function(){return this._user},e.prototype.getRequestSession=function(){return this._requestSession},e.prototype.setRequestSession=function(e){return this._requestSession=e,this},e.prototype.setTags=function(e){return this._tags=ne(ne({},this._tags),e),this._notifyScopeListeners(),this},e.prototype.setTag=function(e,t){var n;return this._tags=ne(ne({},this._tags),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setExtras=function(e){
35
- return this._extra=ne(ne({},this._extra),e),this._notifyScopeListeners(),this},e.prototype.setExtra=function(e,t){var n;return this._extra=ne(ne({},this._extra),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setFingerprint=function(e){return this._fingerprint=e,this._notifyScopeListeners(),this},e.prototype.setLevel=function(e){return this._level=e,this._notifyScopeListeners(),this},e.prototype.setTransactionName=function(e){return this._transactionName=e,this._notifyScopeListeners(),this},e.prototype.setTransaction=function(e){return this.setTransactionName(e)},e.prototype.setContext=function(e,t){var n;return null===t?delete this._contexts[e]:this._contexts=ne(ne({},this._contexts),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setSpan=function(e){return this._span=e,this._notifyScopeListeners(),this},e.prototype.getSpan=function(){return this._span},e.prototype.getTransaction=function(){var e=this.getSpan();return e&&e.transaction},e.prototype.setSession=function(e){
36
- return e?this._session=e:delete this._session,this._notifyScopeListeners(),this},e.prototype.getSession=function(){return this._session},e.prototype.update=function(t){if(!t)return this;if("function"==typeof t){var n=t(this);return n instanceof e?n:this}return t instanceof e?(this._tags=ne(ne({},this._tags),t._tags),this._extra=ne(ne({},this._extra),t._extra),this._contexts=ne(ne({},this._contexts),t._contexts),t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint),t._requestSession&&(this._requestSession=t._requestSession)):ve(t)&&(t=t,this._tags=ne(ne({},this._tags),t.tags),this._extra=ne(ne({},this._extra),t.extra),this._contexts=ne(ne({},this._contexts),t.contexts),t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession)),this},e.prototype.clear=function(){return this._breadcrumbs=[],this._tags={},
37
- 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},e.prototype.addBreadcrumb=function(e,t){var n="number"==typeof t?Math.min(t,100):100;if(n<=0)return this;var r=ne({timestamp:Mt()},e);return this._breadcrumbs=ie(this._breadcrumbs,[r]).slice(-n),this._notifyScopeListeners(),this},e.prototype.clearBreadcrumbs=function(){return this._breadcrumbs=[],this._notifyScopeListeners(),this},e.prototype.applyToEvent=function(e,t){if(this._extra&&Object.keys(this._extra).length&&(e.extra=ne(ne({},this._extra),e.extra)),this._tags&&Object.keys(this._tags).length&&(e.tags=ne(ne({},this._tags),e.tags)),this._user&&Object.keys(this._user).length&&(e.user=ne(ne({},this._user),e.user)),this._contexts&&Object.keys(this._contexts).length&&(e.contexts=ne(ne({},this._contexts),e.contexts)),this._level&&(e.level=this._level),
38
- this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts=ne({trace:this._span.getTraceContext()},e.contexts);var n=this._span.transaction&&this._span.transaction.name;n&&(e.tags=ne({transaction:n},e.tags))}return this._applyFingerprint(e),e.breadcrumbs=ie(e.breadcrumbs||[],this._breadcrumbs),e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata=this._sdkProcessingMetadata,this._notifyEventProcessors(ie(It(),this._eventProcessors),e,t)},e.prototype.setSDKProcessingMetadata=function(e){return this._sdkProcessingMetadata=ne(ne({},this._sdkProcessingMetadata),e),this},e.prototype._notifyEventProcessors=function(e,t,n,r){var o=this;return void 0===r&&(r=0),new Ct((function(i,a){var s=e[r];if(null===t||"function"!=typeof s)i(t);else{var l=s(ne({},t),n);be(l)?l.then((function(t){return o._notifyEventProcessors(e,t,n,r+1).then(i)})).then(null,a):o._notifyEventProcessors(e,l,n,r+1).then(i).then(null,a)}}))},e.prototype._notifyScopeListeners=function(){var e=this
39
- ;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((function(t){t(e)})),this._notifyingListeners=!1)},e.prototype._applyFingerprint=function(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},e}();function It(){var e=ce();return e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.globalEventProcessors=e.__SENTRY__.globalEventProcessors||[],e.__SENTRY__.globalEventProcessors}function Rt(e){It().push(e)}var Pt=function(){function e(e){this.errors=0,this.sid=gt(),this.duration=0,this.status="ok",this.init=!0,this.ignoreDuration=!1;var t=zt();this.timestamp=t,this.started=t,e&&this.update(e)}return e.prototype.update=function(e){if(void 0===e&&(e={}),e.user&&(!this.ipAddress&&e.user.ip_address&&(this.ipAddress=e.user.ip_address),this.did||e.did||(this.did=e.user.id||e.user.email||e.user.username)),
40
- this.timestamp=e.timestamp||zt(),e.ignoreDuration&&(this.ignoreDuration=e.ignoreDuration),e.sid&&(this.sid=32===e.sid.length?e.sid:gt()),void 0!==e.init&&(this.init=e.init),!this.did&&e.did&&(this.did=""+e.did),"number"==typeof e.started&&(this.started=e.started),this.ignoreDuration)this.duration=void 0;else if("number"==typeof e.duration)this.duration=e.duration;else{var t=this.timestamp-this.started;this.duration=t>=0?t:0}e.release&&(this.release=e.release),e.environment&&(this.environment=e.environment),!this.ipAddress&&e.ipAddress&&(this.ipAddress=e.ipAddress),!this.userAgent&&e.userAgent&&(this.userAgent=e.userAgent),"number"==typeof e.errors&&(this.errors=e.errors),e.status&&(this.status=e.status)},e.prototype.close=function(e){e?this.update({status:e}):"ok"===this.status?this.update({status:"exited"}):this.update()},e.prototype.toJSON=function(){return Je({sid:""+this.sid,init:this.init,started:new Date(1e3*this.started).toISOString(),timestamp:new Date(1e3*this.timestamp).toISOString(),
41
- status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?""+this.did:void 0,duration:this.duration,attrs:{release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent}})},e}(),Dt=function(){function e(e,t,n){void 0===t&&(t=new Ot),void 0===n&&(n=4),this._version=n,this._stack=[{}],this.getStackTop().scope=t,e&&this.bindClient(e)}return e.prototype.isOlderThan=function(e){return this._version<e},e.prototype.bindClient=function(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()},e.prototype.pushScope=function(){var e=Ot.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e},e.prototype.popScope=function(){return!(this.getStack().length<=1)&&!!this.getStack().pop()},e.prototype.withScope=function(e){var t=this.pushScope();try{e(t)}finally{this.popScope()}},e.prototype.getClient=function(){return this.getStackTop().client},e.prototype.getScope=function(){
42
- return this.getStackTop().scope},e.prototype.getStack=function(){return this._stack},e.prototype.getStackTop=function(){return this._stack[this._stack.length-1]},e.prototype.captureException=function(e,t){var n=this._lastEventId=t&&t.event_id?t.event_id:gt(),r=t;if(!t){var o=void 0;try{throw new Error("Sentry syntheticException")}catch(e){o=e}r={originalException:e,syntheticException:o}}return this._invokeClient("captureException",e,ne(ne({},r),{event_id:n})),n},e.prototype.captureMessage=function(e,t,n){var r=this._lastEventId=n&&n.event_id?n.event_id:gt(),o=n;if(!n){var i=void 0;try{throw new Error(e)}catch(e){i=e}o={originalException:e,syntheticException:i}}return this._invokeClient("captureMessage",e,t,ne(ne({},o),{event_id:r})),r},e.prototype.captureEvent=function(e,t){var n=t&&t.event_id?t.event_id:gt();return"transaction"!==e.type&&(this._lastEventId=n),this._invokeClient("captureEvent",e,ne(ne({},t),{event_id:n})),n},e.prototype.lastEventId=function(){return this._lastEventId},
43
- e.prototype.addBreadcrumb=function(e,t){var n=this.getStackTop(),r=n.scope,o=n.client;if(r&&o){var i=o.getOptions&&o.getOptions()||{},a=i.beforeBreadcrumb,s=void 0===a?null:a,l=i.maxBreadcrumbs,c=void 0===l?100:l;if(!(c<=0)){var u=Mt(),h=ne({timestamp:u},e),d=s?Oe((function(){return s(h,t)})):h;null!==d&&r.addBreadcrumb(d,c)}}},e.prototype.setUser=function(e){var t=this.getScope();t&&t.setUser(e)},e.prototype.setTags=function(e){var t=this.getScope();t&&t.setTags(e)},e.prototype.setExtras=function(e){var t=this.getScope();t&&t.setExtras(e)},e.prototype.setTag=function(e,t){var n=this.getScope();n&&n.setTag(e,t)},e.prototype.setExtra=function(e,t){var n=this.getScope();n&&n.setExtra(e,t)},e.prototype.setContext=function(e,t){var n=this.getScope();n&&n.setContext(e,t)},e.prototype.configureScope=function(e){var t=this.getStackTop(),n=t.scope,r=t.client;n&&r&&e(n)},e.prototype.run=function(e){var t=Ft(this);try{e(this)}finally{Ft(t)}},e.prototype.getIntegration=function(e){var t=this.getClient()
44
- ;if(!t)return null;try{return t.getIntegration(e)}catch(t){return Re.warn("Cannot retrieve integration "+e.id+" from the current Hub"),null}},e.prototype.startSpan=function(e){return this._callExtensionMethod("startSpan",e)},e.prototype.startTransaction=function(e,t){return this._callExtensionMethod("startTransaction",e,t)},e.prototype.traceHeaders=function(){return this._callExtensionMethod("traceHeaders")},e.prototype.captureSession=function(e){if(void 0===e&&(e=!1),e)return this.endSession();this._sendSessionUpdate()},e.prototype.endSession=function(){var e=this.getStackTop(),t=e&&e.scope,n=t&&t.getSession();n&&n.close(),this._sendSessionUpdate(),t&&t.setSession()},e.prototype.startSession=function(e){var t=this.getStackTop(),n=t.scope,r=t.client,o=r&&r.getOptions()||{},i=o.release,a=o.environment,s=(ce().navigator||{}).userAgent,l=new Pt(ne(ne(ne({release:i,environment:a},n&&{user:n.getUser()}),s&&{userAgent:s}),e));if(n){var c=n.getSession&&n.getSession();c&&"ok"===c.status&&c.update({status:"exited"}),
45
- this.endSession(),n.setSession(l)}return l},e.prototype._sendSessionUpdate=function(){var e=this.getStackTop(),t=e.scope,n=e.client;if(t){var r=t.getSession&&t.getSession();r&&n&&n.captureSession&&n.captureSession(r)}},e.prototype._invokeClient=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=this.getStackTop(),i=o.scope,a=o.client;a&&a[e]&&(t=a)[e].apply(t,ie(n,[i]))},e.prototype._callExtensionMethod=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Bt(),o=r.__SENTRY__;if(o&&o.extensions&&"function"==typeof o.extensions[e])return o.extensions[e].apply(this,t);Re.warn("Extension method "+e+" couldn't be found, doing nothing.")},e}();function Bt(){var e=ce();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function Ft(e){var t=Bt(),n=qt(t);return Ut(t,e),n}function jt(){var e=Bt();return Ht(e)&&!qt(e).isOlderThan(4)||Ut(e,new Dt),se()?function(e){try{var t=Bt().__SENTRY__,n=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active
46
- ;if(!n)return qt(e);if(!Ht(n)||qt(n).isOlderThan(4)){var r=qt(e).getStackTop();Ut(n,new Dt(r.client,Ot.clone(r.scope)))}return qt(n)}catch(t){return qt(e)}}(e):qt(e)}function Ht(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function qt(e){return e&&e.__SENTRY__&&e.__SENTRY__.hub||(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=new Dt),e.__SENTRY__.hub}function Ut(e,t){return!!e&&(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=t,!0)}function $t(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=jt();if(r&&r[e])return r[e].apply(r,ie(t));throw new Error("No hub defined or "+e+" was not found on the hub, please open a bug report.")}function Gt(e,t){var n;try{throw new Error("Sentry syntheticException")}catch(e){n=e}return $t("captureException",e,{captureContext:t,originalException:e,syntheticException:n})}function Vt(e,t){$t("setExtra",e,t)}function Wt(e){$t("withScope",e)}function Yt(e){var t=e.protocol?e.protocol+":":"",n=e.port?":"+e.port:""
47
- ;return t+"//"+e.host+n+(e.path?"/"+e.path:"")+"/api/"}function Kt(e,t){return""+Yt(e)+e.projectId+"/"+t+"/"}function Xt(e){return t={sentry_key:e.publicKey,sentry_version:"7"},Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&");var t}function Zt(e){return function(e){return Kt(e,"store")}(e)+"?"+Xt(e)}function Jt(e,t){return t||function(e){return Kt(e,"envelope")}(e)+"?"+Xt(e)}var Qt=[];function en(e){return e.reduce((function(e,t){return e.every((function(e){return t.name!==e.name}))&&e.push(t),e}),[])}function tn(e){var t={};return function(e){var t=e.defaultIntegrations&&ie(e.defaultIntegrations)||[],n=e.integrations,r=ie(en(t));Array.isArray(n)?r=ie(r.filter((function(e){return n.every((function(t){return t.name!==e.name}))})),en(n)):"function"==typeof n&&(r=n(r),r=Array.isArray(r)?r:[r]);var o=r.map((function(e){return e.name})),i="Debug";return-1!==o.indexOf(i)&&r.push.apply(r,ie(r.splice(o.indexOf(i),1))),r}(e).forEach((function(e){t[e.name]=e,
48
- function(e){-1===Qt.indexOf(e.name)&&(e.setupOnce(Rt,jt),Qt.push(e.name),Re.log("Integration installed: "+e.name))}(e)})),qe(t,"initialized",!0),t}var nn="Not capturing exception because it's already been captured.",rn=function(){function e(e,t){this._integrations={},this._numProcessing=0,this._backend=new e(t),this._options=t,t.dsn&&(this._dsn=Ne(t.dsn))}return e.prototype.captureException=function(e,t,n){var r=this;if(!xt(e)){var o=t&&t.event_id;return this._process(this._getBackend().eventFromException(e,t).then((function(e){return r._captureEvent(e,t,n)})).then((function(e){o=e}))),o}Re.log(nn)},e.prototype.captureMessage=function(e,t,n,r){var o=this,i=n&&n.event_id,a=ge(e)?this._getBackend().eventFromMessage(String(e),t,n):this._getBackend().eventFromException(e,n);return this._process(a.then((function(e){return o._captureEvent(e,n,r)})).then((function(e){i=e}))),i},e.prototype.captureEvent=function(e,t,n){if(!(t&&t.originalException&&xt(t.originalException))){var r=t&&t.event_id
49
- ;return this._process(this._captureEvent(e,t,n).then((function(e){r=e}))),r}Re.log(nn)},e.prototype.captureSession=function(e){this._isEnabled()?"string"!=typeof e.release?ae()&&Re.warn("Discarded session because of missing or non-string release"):(this._sendSession(e),e.update({init:!1})):ae()&&Re.warn("SDK not enabled, will not capture session.")},e.prototype.getDsn=function(){return this._dsn},e.prototype.getOptions=function(){return this._options},e.prototype.getTransport=function(){return this._getBackend().getTransport()},e.prototype.flush=function(e){var t=this;return this._isClientDoneProcessing(e).then((function(n){return t.getTransport().close(e).then((function(e){return n&&e}))}))},e.prototype.close=function(e){var t=this;return this.flush(e).then((function(e){return t.getOptions().enabled=!1,e}))},e.prototype.setupIntegrations=function(){this._isEnabled()&&!this._integrations.initialized&&(this._integrations=tn(this._options))},e.prototype.getIntegration=function(e){try{
50
- return this._integrations[e.id]||null}catch(t){return Re.warn("Cannot retrieve integration "+e.id+" from the current Client"),null}},e.prototype._updateSessionFromEvent=function(e,t){var n,r,o=!1,i=!1,a=t.exception&&t.exception.values;if(a){i=!0;try{for(var s=re(a),l=s.next();!l.done;l=s.next()){var c=l.value.mechanism;if(c&&!1===c.handled){o=!0;break}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}var u="ok"===e.status;(u&&0===e.errors||u&&o)&&(e.update(ne(ne({},o&&{status:"crashed"}),{errors:e.errors||Number(i||o)})),this.captureSession(e))},e.prototype._sendSession=function(e){this._getBackend().sendSession(e)},e.prototype._isClientDoneProcessing=function(e){var t=this;return new Ct((function(n){var r=0,o=setInterval((function(){0==t._numProcessing?(clearInterval(o),n(!0)):(r+=1,e&&r>=e&&(clearInterval(o),n(!1)))}),1)}))},e.prototype._getBackend=function(){return this._backend},e.prototype._isEnabled=function(){
51
- return!1!==this.getOptions().enabled&&void 0!==this._dsn},e.prototype._prepareEvent=function(e,t,n){var r=this,o=this.getOptions().normalizeDepth,i=void 0===o?3:o,a=ne(ne({},e),{event_id:e.event_id||(n&&n.event_id?n.event_id:gt()),timestamp:e.timestamp||Mt()});this._applyClientOptions(a),this._applyIntegrationsMetadata(a);var s=t;n&&n.captureContext&&(s=Ot.clone(s).update(n.captureContext));var l=kt(a);return s&&(l=s.applyToEvent(a,n)),l.then((function(e){return e&&(e.sdkProcessingMetadata=ne(ne({},e.sdkProcessingMetadata),{normalizeDepth:Xe(i)})),"number"==typeof i&&i>0?r._normalizeEvent(e,i):e}))},e.prototype._normalizeEvent=function(e,t){if(!e)return null;var n=ne(ne(ne(ne(ne({},e),e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((function(e){return ne(ne({},e),e.data&&{data:Xe(e.data,t)})}))}),e.user&&{user:Xe(e.user,t)}),e.contexts&&{contexts:Xe(e.contexts,t)}),e.extra&&{extra:Xe(e.extra,t)});return e.contexts&&e.contexts.trace&&(n.contexts.trace=e.contexts.trace),
52
- e.sdkProcessingMetadata=ne(ne({},e.sdkProcessingMetadata),{baseClientNormalized:!0}),n},e.prototype._applyClientOptions=function(e){var t=this.getOptions(),n=t.environment,r=t.release,o=t.dist,i=t.maxValueLength,a=void 0===i?250:i;"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=Be(e.message,a));var s=e.exception&&e.exception.values&&e.exception.values[0];s&&s.value&&(s.value=Be(s.value,a));var l=e.request;l&&l.url&&(l.url=Be(l.url,a))},e.prototype._applyIntegrationsMetadata=function(e){var t=Object.keys(this._integrations);t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=ie(e.sdk.integrations||[],t))},e.prototype._sendEvent=function(e){this._getBackend().sendEvent(e)},e.prototype._captureEvent=function(e,t,n){return this._processEvent(e,t,n).then((function(e){return e.event_id}),(function(e){Re.error(e)}))},e.prototype._processEvent=function(e,t,n){
53
- var r=this,o=this.getOptions(),i=o.beforeSend,a=o.sampleRate,s=this.getTransport();function l(e,t){s.recordLostEvent&&s.recordLostEvent(e,t)}if(!this._isEnabled())return St(new Ce("SDK not enabled, will not capture event."));var c="transaction"===e.type;return!c&&"number"==typeof a&&Math.random()>a?(l("sample_rate","event"),St(new Ce("Discarding event because it's not included in the random sample (sampling rate = "+a+")"))):this._prepareEvent(e,n,t).then((function(n){if(null===n)throw l("event_processor",e.type||"event"),new Ce("An event processor returned null, will not send event.");return t&&t.data&&!0===t.data.__sentry__||c||!i?n:function(e){var t="`beforeSend` method has to return `null` or a valid event.";if(be(e))return e.then((function(e){if(!ve(e)&&null!==e)throw new Ce(t);return e}),(function(e){throw new Ce("beforeSend rejected with "+e)}));if(!ve(e)&&null!==e)throw new Ce(t);return e}(i(n,t))})).then((function(t){if(null===t)throw l("before_send",e.type||"event"),
54
- new Ce("`beforeSend` returned `null`, will not send event.");var o=n&&n.getSession&&n.getSession();return!c&&o&&r._updateSessionFromEvent(o,t),r._sendEvent(t),t})).then(null,(function(e){if(e instanceof Ce)throw e;throw r.captureException(e,{data:{__sentry__:!0},originalException:e}),new Ce("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: "+e)}))},e.prototype._process=function(e){var t=this;this._numProcessing+=1,e.then((function(e){return t._numProcessing-=1,e}),(function(e){return t._numProcessing-=1,e}))},e}();var on=function(){function e(){}return e.prototype.sendEvent=function(e){return kt({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:"skipped"})},e.prototype.close=function(e){return kt(!0)},e}(),an=function(){function e(e){this._options=e,this._options.dsn||Re.warn("No DSN provided, backend will not do anything."),this._transport=this._setupTransport()}
55
- return e.prototype.eventFromException=function(e,t){throw new Ce("Backend has to implement `eventFromException` method")},e.prototype.eventFromMessage=function(e,t,n){throw new Ce("Backend has to implement `eventFromMessage` method")},e.prototype.sendEvent=function(e){this._transport.sendEvent(e).then(null,(function(e){ae()&&Re.error("Error while sending event: "+e)}))},e.prototype.sendSession=function(e){this._transport.sendSession?this._transport.sendSession(e).then(null,(function(e){ae()&&Re.error("Error while sending session: "+e)})):ae()&&Re.warn("Dropping session because custom transport doesn't implement sendSession")},e.prototype.getTransport=function(){return this._transport},e.prototype._setupTransport=function(){return new on},e}();function sn(e){if(e.metadata&&e.metadata.sdk){var t=e.metadata.sdk;return{name:t.name,version:t.version}}}function ln(e,t){var n,r=sn(t),o=e.type||"event",i="transaction"===o||!!t.tunnel,a=(e.sdkProcessingMetadata||{}).transactionSampling||{},s=a.method,l=a.rate
56
- ;!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=ie(e.sdk.integrations||[],t.integrations||[]),e.sdk.packages=ie(e.sdk.packages||[],t.packages||[]))}(e,t.metadata.sdk),e.tags=e.tags||{},e.extra=e.extra||{},e.sdkProcessingMetadata&&e.sdkProcessingMetadata.baseClientNormalized||(e.tags.skippedNormalization=!0,e.extra.normalizeDepth=e.sdkProcessingMetadata?e.sdkProcessingMetadata.normalizeDepth:"unset"),delete e.sdkProcessingMetadata;try{n=JSON.stringify(e)}catch(t){e.tags.JSONStringifyError=!0,e.extra.JSONStringifyError=t;try{n=JSON.stringify(Xe(e))}catch(e){var c=e;n=JSON.stringify({message:"JSON.stringify error after renormalization",extra:{message:c.message,stack:c.stack}})}}var u={body:n,type:o,url:i?Jt(t.dsn,t.tunnel):Zt(t.dsn)};if(i){var h=JSON.stringify(ne(ne({event_id:e.event_id,sent_at:(new Date).toISOString()},r&&{sdk:r}),!!t.tunnel&&{dsn:Ee(t.dsn)}))+"\n"+JSON.stringify({type:o,sample_rates:[{id:s,rate:l}]})+"\n"+u.body
57
- ;u.body=h}return u}var cn,un=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(){cn=Function.prototype.toString,Function.prototype.toString=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=$e(this)||this;return cn.apply(n,e)}},e.id="FunctionToString",e}(),hn=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],dn=function(){function e(t){void 0===t&&(t={}),this._options=t,this.name=e.id}return e.prototype.setupOnce=function(){Rt((function(t){var n=jt();if(!n)return t;var r=n.getIntegration(e);if(r){var o=n.getClient(),i=o?o.getOptions():{},a="function"==typeof r._mergeOptions?r._mergeOptions(i):{};return"function"!=typeof r._shouldDropEvent?t:r._shouldDropEvent(t,a)?null:t}return t}))},e.prototype._shouldDropEvent=function(e,t){return this._isSentryError(e,t)?(ae()&&Re.warn("Event dropped due to being internal Sentry Error.\nEvent: "+_t(e)),
58
- !0):this._isIgnoredError(e,t)?(ae()&&Re.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: "+_t(e)),!0):this._isDeniedUrl(e,t)?(ae()&&Re.warn("Event dropped due to being matched by `denyUrls` option.\nEvent: "+_t(e)+".\nUrl: "+this._getEventFilterUrl(e)),!0):!this._isAllowedUrl(e,t)&&(ae()&&Re.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: "+_t(e)+".\nUrl: "+this._getEventFilterUrl(e)),!0)},e.prototype._isSentryError=function(e,t){if(!t.ignoreInternal)return!1;try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1},e.prototype._isIgnoredError=function(e,t){return!(!t.ignoreErrors||!t.ignoreErrors.length)&&this._getPossibleEventMessages(e).some((function(e){return t.ignoreErrors.some((function(t){return je(e,t)}))}))},e.prototype._isDeniedUrl=function(e,t){if(!t.denyUrls||!t.denyUrls.length)return!1;var n=this._getEventFilterUrl(e);return!!n&&t.denyUrls.some((function(e){return je(n,e)}))},e.prototype._isAllowedUrl=function(e,t){
59
- if(!t.allowUrls||!t.allowUrls.length)return!0;var n=this._getEventFilterUrl(e);return!n||t.allowUrls.some((function(e){return je(n,e)}))},e.prototype._mergeOptions=function(e){return void 0===e&&(e={}),{allowUrls:ie(this._options.whitelistUrls||[],this._options.allowUrls||[],e.whitelistUrls||[],e.allowUrls||[]),denyUrls:ie(this._options.blacklistUrls||[],this._options.denyUrls||[],e.blacklistUrls||[],e.denyUrls||[]),ignoreErrors:ie(this._options.ignoreErrors||[],e.ignoreErrors||[],hn),ignoreInternal:void 0===this._options.ignoreInternal||this._options.ignoreInternal}},e.prototype._getPossibleEventMessages=function(e){if(e.message)return[e.message];if(e.exception)try{var t=e.exception.values&&e.exception.values[0]||{},n=t.type,r=void 0===n?"":n,o=t.value,i=void 0===o?"":o;return[""+i,r+": "+i]}catch(t){return ae()&&Re.error("Cannot extract message for event "+_t(e)),[]}return[]},e.prototype._getLastValidUrl=function(e){void 0===e&&(e=[]);for(var t=e.length-1;t>=0;t--){var n=e[t]
60
- ;if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null},e.prototype._getEventFilterUrl=function(e){try{if(e.stacktrace)return this._getLastValidUrl(e.stacktrace.frames);var t;try{t=e.exception.values[0].stacktrace.frames}catch(e){}return t?this._getLastValidUrl(t):null}catch(t){return ae()&&Re.error("Cannot extract url for event "+_t(e)),null}},e.id="InboundFilters",e}();function pn(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 mn=/^\s*at (?:(.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,fn=/\((\S*)(?::(\d+))(?::(\d+))\)/,gn=function(e){var t=mn.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){var n=fn.exec(t[2]);n&&(t[2]=n[1],t[3]=n[2],t[4]=n[3])}var r=oe(An(t[1]||"?",t[2]),2),o=r[0];return pn(r[1],o,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}
61
- },vn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,yn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,_n=function(e){var t,n=vn.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=yn.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var o=n[3],i=n[1]||"?";return i=(t=oe(An(i,o),2))[0],pn(o=t[1],i,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},bn=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,wn=function(e){var t=bn.exec(e);return t?pn(t[2],t[1]||"?",+t[3],t[4]?+t[4]:void 0):void 0},xn=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,kn=function(e){var t=xn.exec(e);return t?pn(t[2],t[3]||"?",+t[1]):void 0},Sn=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,Cn=function(e){var t=Sn.exec(e)
62
- ;return t?pn(t[5],t[3]||t[4]||"?",+t[1],+t[2]):void 0},An=function(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]};function En(e){var t=Nn(e),n={type:e&&e.name,value:Mn(e)};return t&&t.length&&(n.stacktrace={frames:t}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function Tn(e){return{exception:{values:[En(e)]}}}function Nn(e){var t=e.stacktrace||e.stack||"",n=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(Ln.test(e.message))return 1}return 0}(e);try{return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t,n){var r,o,i,a;void 0===n&&(n=0);var s=[];try{for(var l=re(t.split("\n").slice(n)),c=l.next();!c.done;c=l.next()){var u=c.value;try{for(var h=(i=void 0,re(e)),d=h.next();!d.done;d=h.next()){var p=(0,d.value)(u);if(p){s.push(p);break}}}catch(e){i={error:e}}finally{try{
63
- d&&!d.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(o=l.return)&&o.call(l)}finally{if(r)throw r.error}}return Pe(s)}}(kn,Cn,gn,wn,_n)(t,n)}catch(e){}return[]}var Ln=/Minified React error #\d+;/i;function Mn(e){var t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function zn(e,t,n){var r;if(void 0===n&&(n={}),pe(e)&&e.error)return Tn(e.error);if(me(e)||de(e,"DOMException")){var o=e;if("stack"in e)r=Tn(e);else{var i=o.name||(me(o)?"DOMError":"DOMException"),a=o.message?i+": "+o.message:i;bt(r=On(a,t,n),a)}return"code"in o&&(r.tags=ne(ne({},r.tags),{"DOMException.code":""+o.code})),r}return he(e)?Tn(e):ve(e)||ye(e)?(r=function(e,t,n){var r={exception:{values:[{type:ye(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:"Non-Error "+(n?"promise rejection":"exception")+" captured with keys: "+Ze(e)}]},extra:{__serialized__:We(e)}};if(t){var o=Nn(t);o.length&&(r.stacktrace={frames:o})}return r
64
- }(e,t,n.isRejection),wt(r,{synthetic:!0}),r):(bt(r=On(e,t,n),""+e,void 0),wt(r,{synthetic:!0}),r)}function On(e,t,n){void 0===n&&(n={});var r={message:e};if(n.attachStacktrace&&t){var o=Nn(t);o.length&&(r.stacktrace={frames:o})}return r}var In,Rn=ce();function Pn(){if(In)return In;if(et(Rn.fetch))return In=Rn.fetch.bind(Rn);var e=Rn.document,t=Rn.fetch;if(e&&"function"==typeof e.createElement)try{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){ae()&&Re.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return In=t.bind(Rn)}function Dn(e,t){if("[object Navigator]"===Object.prototype.toString.call(Rn&&Rn.navigator)&&"function"==typeof Rn.navigator.sendBeacon)return Rn.navigator.sendBeacon.bind(Rn.navigator)(e,t);if(Qe()){var n=Pn();n(e,{body:t,method:"POST",credentials:"omit",keepalive:!0}).then(null,(function(e){console.error(e)}))}else;}function Bn(e){
65
- return"event"===e?"error":e}var Fn=ce(),jn=function(){function e(e){var t,n,r,o=this;this.options=e,this._buffer=At(30),this._rateLimits={},this._outcomes={},this._api=(t=e.dsn,n=e._metadata,r=e.tunnel,{initDsn:t,metadata:n||{},dsn:Ne(t),tunnel:r}),this.url=Zt(this._api.dsn),this.options.sendClientReports&&Fn.document&&Fn.document.addEventListener("visibilitychange",(function(){"hidden"===Fn.document.visibilityState&&o._flushOutcomes()}))}return e.prototype.sendEvent=function(e){return this._sendRequest(ln(e,this._api),e)},e.prototype.sendSession=function(e){return this._sendRequest(function(e,t){var n=sn(t),r="aggregates"in e?"sessions":"session";return{body:JSON.stringify(ne(ne({sent_at:(new Date).toISOString()},n&&{sdk:n}),!!t.tunnel&&{dsn:Ee(t.dsn)}))+"\n"+JSON.stringify({type:r})+"\n"+JSON.stringify(e),type:r,url:Jt(t.dsn,t.tunnel)}}(e,this._api),e)},e.prototype.close=function(e){return this._buffer.drain(e)},e.prototype.recordLostEvent=function(e,t){var n;if(this.options.sendClientReports){
66
- var r=Bn(t)+":"+e;Re.log("Adding outcome: "+r),this._outcomes[r]=(null!=(n=this._outcomes[r])?n:0)+1}},e.prototype._flushOutcomes=function(){if(this.options.sendClientReports){var e=this._outcomes;if(this._outcomes={},Object.keys(e).length){Re.log("Flushing outcomes:\n"+JSON.stringify(e,null,2));var t,n,r,o,i,a=Jt(this._api.dsn,this._api.tunnel),s=Object.keys(e).map((function(t){var n=oe(t.split(":"),2),r=n[0];return{reason:n[1],category:r,quantity:e[t]}})),l=(t=s,n=this._api.tunnel&&Ee(this._api.dsn),i=[{type:"client_report"},{timestamp:r||Mt(),discarded_events:t}],void 0===(o=[i])&&(o=[]),[n?{dsn:n}:{},o]);try{Dn(a,function(e){var t=oe(e,2),n=t[0],r=t[1],o=JSON.stringify(n);return r.reduce((function(e,t){var n=oe(t,2),r=n[0],o=n[1];return e+"\n"+JSON.stringify(r)+"\n"+JSON.stringify(o)}),o)}(l))}catch(e){Re.error(e)}}else Re.log("No outcomes to flush")}},e.prototype._handleResponse=function(e){
67
- var t,n=e.requestType,r=e.response,o=e.headers,i=e.resolve,a=e.reject,s=(t=r.status)>=200&&t<300?"success":429===t?"rate_limit":t>=400&&t<500?"invalid":t>=500?"failed":"unknown";this._handleRateLimit(o)&&ae()&&Re.warn("Too many "+n+" requests, backing off until: "+this._disabledUntil(n)),"success"!==s?a(r):i({status:s})},e.prototype._disabledUntil=function(e){var t=Bn(e);return this._rateLimits[t]||this._rateLimits.all},e.prototype._isRateLimited=function(e){return this._disabledUntil(e)>new Date(Date.now())},e.prototype._handleRateLimit=function(e){var t,n,r,o,i=Date.now(),a=e["x-sentry-rate-limits"],s=e["retry-after"];if(a){try{for(var l=re(a.trim().split(",")),c=l.next();!c.done;c=l.next()){var u=c.value.split(":",2),h=parseInt(u[0],10),d=1e3*(isNaN(h)?60:h);try{for(var p=(r=void 0,re(u[1].split(";"))),m=p.next();!m.done;m=p.next()){var f=m.value;this._rateLimits[f||"all"]=new Date(i+d)}}catch(e){r={error:e}}finally{try{m&&!m.done&&(o=p.return)&&o.call(p)}finally{if(r)throw r.error}}}}catch(e){t={error:e}
68
- }finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return!0}return!!s&&(this._rateLimits.all=new Date(i+function(e,t){if(!t)return 6e4;var n=parseInt(""+t,10);if(!isNaN(n))return 1e3*n;var r=Date.parse(""+t);return isNaN(r)?6e4:r-e}(i,s)),!0)},e}(),Hn=function(e){function t(t,n){void 0===n&&(n=Pn());var r=e.call(this,t)||this;return r._fetch=n,r}return ee(t,e),t.prototype._sendRequest=function(e,t){var n=this;if(this._isRateLimited(e.type))return this.recordLostEvent("ratelimit_backoff",e.type),Promise.reject({event:t,type:e.type,reason:"Transport for "+e.type+" requests locked till "+this._disabledUntil(e.type)+" due to too many requests.",status:429});var r={body:e.body,method:"POST",referrerPolicy:tt()?"origin":""};return void 0!==this.options.fetchParameters&&Object.assign(r,this.options.fetchParameters),void 0!==this.options.headers&&(r.headers=this.options.headers),this._buffer.add((function(){return new Ct((function(t,o){n._fetch(e.url,r).then((function(r){var i={
69
- "x-sentry-rate-limits":r.headers.get("X-Sentry-Rate-Limits"),"retry-after":r.headers.get("Retry-After")};n._handleResponse({requestType:e.type,response:r,headers:i,resolve:t,reject:o})})).catch(o)}))})).then(void 0,(function(t){throw t instanceof Ce?n.recordLostEvent("queue_overflow",e.type):n.recordLostEvent("network_error",e.type),t}))},t}(jn),qn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ee(t,e),t.prototype._sendRequest=function(e,t){var n=this;return this._isRateLimited(e.type)?(this.recordLostEvent("ratelimit_backoff",e.type),Promise.reject({event:t,type:e.type,reason:"Transport for "+e.type+" requests locked till "+this._disabledUntil(e.type)+" due to too many requests.",status:429})):this._buffer.add((function(){return new Ct((function(t,r){var o=new XMLHttpRequest;for(var i in o.onreadystatechange=function(){if(4===o.readyState){var i={"x-sentry-rate-limits":o.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":o.getResponseHeader("Retry-After")}
70
- ;n._handleResponse({requestType:e.type,response:o,headers:i,resolve:t,reject:r})}},o.open("POST",e.url),n.options.headers)Object.prototype.hasOwnProperty.call(n.options.headers,i)&&o.setRequestHeader(i,n.options.headers[i]);o.send(e.body)}))})).then(void 0,(function(t){throw t instanceof Ce?n.recordLostEvent("queue_overflow",e.type):n.recordLostEvent("network_error",e.type),t}))},t}(jn),Un=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ee(t,e),t.prototype.eventFromException=function(e,t){return function(e,t,n){var r=zn(t,n&&n.syntheticException||void 0,{attachStacktrace:e.attachStacktrace});return wt(r),r.level=te.Error,n&&n.event_id&&(r.event_id=n.event_id),kt(r)}(this._options,e,t)},t.prototype.eventFromMessage=function(e,t,n){return void 0===t&&(t=te.Info),function(e,t,n,r){void 0===n&&(n=te.Info);var o=On(t,r&&r.syntheticException||void 0,{attachStacktrace:e.attachStacktrace});return o.level=n,r&&r.event_id&&(o.event_id=r.event_id),kt(o)}(this._options,e,t,n)},
71
- t.prototype._setupTransport=function(){if(!this._options.dsn)return e.prototype._setupTransport.call(this);var t=ne(ne({},this._options.transportOptions),{dsn:this._options.dsn,tunnel:this._options.tunnel,sendClientReports:this._options.sendClientReports,_metadata:this._options._metadata});return this._options.transport?new this._options.transport(t):Qe()?new Hn(t):new qn(t)},t}(an),$n=ce(),Gn=0;function Vn(){return Gn>0}function Wn(){Gn+=1,setTimeout((function(){Gn-=1}))}function Yn(e,t,n){if(void 0===t&&(t={}),"function"!=typeof e)return e;try{var r=e.__sentry_wrapped__;if(r)return r;if($e(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((function(e){return Yn(e,t)}));return e.apply(this,o)}catch(e){throw Wn(),Wt((function(n){n.addEventProcessor((function(e){return t.mechanism&&(bt(e,void 0,void 0),wt(e,t.mechanism)),e.extra=ne(ne({},e.extra),{arguments:r}),e})),Gt(e)})),e}};try{
72
- for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i])}catch(e){}Ue(o,e),qe(e,"__sentry_wrapped__",o);try{Object.getOwnPropertyDescriptor(o,"name").configurable&&Object.defineProperty(o,"name",{get:function(){return e.name}})}catch(e){}return o}function Kn(e){if(void 0===e&&(e={}),$n.document)if(e.eventId)if(e.dsn){var t=$n.document.createElement("script");t.async=!0,t.src=function(e,t){var n=Ne(e),r=Yt(n)+"embed/error-page/",o="dsn="+Ee(n);for(var i in t)if("dsn"!==i)if("user"===i){if(!t.user)continue;t.user.name&&(o+="&name="+encodeURIComponent(t.user.name)),t.user.email&&(o+="&email="+encodeURIComponent(t.user.email))}else o+="&"+encodeURIComponent(i)+"="+encodeURIComponent(t[i]);return r+"?"+o}(e.dsn,e),e.onLoad&&(t.onload=e.onLoad);var n=$n.document.head||$n.document.body;n&&n.appendChild(t)}else ae()&&Re.error("Missing dsn option in showReportDialog call");else ae()&&Re.error("Missing eventId option in showReportDialog call")}var Xn=function(){function e(t){this.name=e.id,
73
- this._installFunc={onerror:Zn,onunhandledrejection:Jn},this._options=ne({onerror:!0,onunhandledrejection:!0},t)}return e.prototype.setupOnce=function(){Error.stackTraceLimit=50;var e=this._options;for(var t in e){var n=this._installFunc[t];n&&e[t]&&(er(t),n(),this._installFunc[t]=void 0)}},e.id="GlobalHandlers",e}();function Zn(){st("error",(function(e){var t=oe(nr(),2),n=t[0],r=t[1];if(n.getIntegration(Xn)){var o=e.msg,i=e.url,a=e.line,s=e.column,l=e.error;if(!(Vn()||l&&l.__sentry_own_request__)){var c=void 0===l&&fe(o)?function(e,t,n,r){var o=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,i=pe(e)?e.message:e,a="Error",s=i.match(o);s&&(a=s[1],i=s[2]);return Qn({exception:{values:[{type:a,value:i}]}},t,n,r)}(o,i,a,s):Qn(zn(l||o,void 0,{attachStacktrace:r,isRejection:!1}),i,a,s);c.level=te.Error,tr(n,l,c,"onerror")}}}))}function Jn(){st("unhandledrejection",(function(e){var t=oe(nr(),2),n=t[0],r=t[1];if(n.getIntegration(Xn)){var o=e;try{
74
- "reason"in e?o=e.reason:"detail"in e&&"reason"in e.detail&&(o=e.detail.reason)}catch(e){}if(Vn()||o&&o.__sentry_own_request__)return!0;var i=ge(o)?{exception:{values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(o)}]}}:zn(o,void 0,{attachStacktrace:r,isRejection:!0});i.level=te.Error,tr(n,o,i,"onunhandledrejection")}}))}function Qn(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=fe(t)&&t.length>0?t:function(){var e=ce();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 er(e){ae()&&Re.log("Global Handler attached: "+e)}function tr(e,t,n,r){wt(n,{handled:!1,type:r}),e.captureEvent(n,{originalException:t})}function nr(){var e=jt(),t=e.getClient();return[e,t&&t.getOptions().attachStacktrace]}
75
- var rr=["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"],or=function(){function e(t){this.name=e.id,this._options=ne({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},t)}return e.prototype.setupOnce=function(){var e=ce();this._options.setTimeout&&He(e,"setTimeout",ir),this._options.setInterval&&He(e,"setInterval",ir),this._options.requestAnimationFrame&&He(e,"requestAnimationFrame",ar),this._options.XMLHttpRequest&&"XMLHttpRequest"in e&&He(XMLHttpRequest.prototype,"send",sr);var t=this._options.eventTarget;t&&(Array.isArray(t)?t:rr).forEach(lr)},e.id="TryCatch",e}()
76
- ;function ir(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t[0];return t[0]=Yn(r,{mechanism:{data:{function:De(e)},handled:!0,type:"instrument"}}),e.apply(this,t)}}function ar(e){return function(t){return e.call(this,Yn(t,{mechanism:{data:{function:"requestAnimationFrame",handler:De(e)},handled:!0,type:"instrument"}}))}}function sr(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=this,o=["onload","onerror","onprogress","onreadystatechange"];return o.forEach((function(e){e in r&&"function"==typeof r[e]&&He(r,e,(function(t){var n={mechanism:{data:{function:e,handler:De(t)},handled:!0,type:"instrument"}},r=$e(t);return r&&(n.mechanism.data.handler=De(r)),Yn(t,n)}))})),e.apply(this,t)}}function lr(e){var t=ce(),n=t[e]&&t[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(He(n,"addEventListener",(function(t){return function(n,r,o){try{"function"==typeof r.handleEvent&&(r.handleEvent=Yn(r.handleEvent.bind(r),{
77
- mechanism:{data:{function:"handleEvent",handler:De(r),target:e},handled:!0,type:"instrument"}}))}catch(e){}return t.call(this,n,Yn(r,{mechanism:{data:{function:"addEventListener",handler:De(r),target:e},handled:!0,type:"instrument"}}),o)}})),He(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)}})))}var cr=function(){function e(t){this.name=e.id,this._options=ne({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t)}return e.prototype.addSentryBreadcrumb=function(e){this._options.sentry&&jt().addBreadcrumb({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:_t(e)},{event:e})},e.prototype.setupOnce=function(){this._options.console&&st("console",ur),this._options.dom&&st("dom",function(e){function t(t){var n,r="object"==typeof e?e.serializeAttribute:void 0;"string"==typeof r&&(r=[r]);try{n=t.event.target?xe(t.event.target,r):xe(t.event,r)
78
- }catch(e){n="<unknown>"}0!==n.length&&jt().addBreadcrumb({category:"ui."+t.name,message:n},{event:t.event,name:t.name,global:t.global})}return t}(this._options.dom)),this._options.xhr&&st("xhr",hr),this._options.fetch&&st("fetch",dr),this._options.history&&st("history",pr)},e.id="Breadcrumbs",e}();function ur(e){var t={category:"console",data:{arguments:e.args,logger:"console"},level:Et(e.level),message:Fe(e.args," ")};if("assert"===e.level){if(!1!==e.args[0])return;t.message="Assertion failed: "+(Fe(e.args.slice(1)," ")||"console.assert"),t.data.arguments=e.args.slice(1)}jt().addBreadcrumb(t,{input:e.args,level:e.level})}function hr(e){if(e.endTimestamp){if(e.xhr.__sentry_own_request__)return;var t=e.xhr.__sentry_xhr__||{},n=t.method,r=t.url,o=t.status_code,i=t.body;jt().addBreadcrumb({category:"xhr",data:{method:n,url:r,status_code:o},type:"http"},{xhr:e.xhr,input:i})}else;}function dr(e){e.endTimestamp&&(e.fetchData.url.match(/sentry_key/)&&"POST"===e.fetchData.method||(e.error?jt().addBreadcrumb({
79
- category:"fetch",data:e.fetchData,level:te.Error,type:"http"},{data:e.error,input:e.args}):jt().addBreadcrumb({category:"fetch",data:ne(ne({},e.fetchData),{status_code:e.response.status}),type:"http"},{input:e.args,response:e.response})))}function pr(e){var t=ce(),n=e.from,r=e.to,o=vt(t.location.href),i=vt(n),a=vt(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),jt().addBreadcrumb({category:"navigation",data:{from:n,to:r}})}var mr=function(){function e(t){void 0===t&&(t={}),this.name=e.id,this._key=t.key||"cause",this._limit=t.limit||5}return e.prototype.setupOnce=function(){Rt((function(t,n){var r=jt().getIntegration(e);return r?function(e,t,n,r){if(!(n.exception&&n.exception.values&&r&&we(r.originalException,Error)))return n;var o=fr(t,r.originalException,e);return n.exception.values=ie(o,n.exception.values),n}(r._key,r._limit,t,n):t}))},e.id="LinkedErrors",e}();function fr(e,t,n,r){if(void 0===r&&(r=[]),
80
- !we(t[n],Error)||r.length+1>=e)return r;var o=En(t[n]);return fr(e,t[n],n,ie([o],r))}var gr=ce(),vr=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(){Rt((function(t){if(jt().getIntegration(e)){if(!gr.navigator&&!gr.location&&!gr.document)return t;var n=t.request&&t.request.url||gr.location&&gr.location.href,r=(gr.document||{}).referrer,o=(gr.navigator||{}).userAgent,i=ne(ne(ne({},t.request&&t.request.headers),r&&{Referer:r}),o&&{"User-Agent":o}),a=ne(ne({},n&&{url:n}),{headers:i});return ne(ne({},t),{request:a})}return t}))},e.id="UserAgent",e}(),yr=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(t,n){t((function(t){var r=n().getIntegration(e);if(r){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(!br(e,t))return!1;if(!_r(e,t))return!1;return!0}(e,t))return!0;if(function(e,t){var n=wr(t),r=wr(e);if(!n||!r)return!1
81
- ;if(n.type!==r.type||n.value!==r.value)return!1;if(!br(e,t))return!1;if(!_r(e,t))return!1;return!0}(e,t))return!0;return!1}(t,r._previousEvent))return Re.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(e){return r._previousEvent=t}return r._previousEvent=t}return t}))},e.id="Dedupe",e}();function _r(e,t){var n=xr(e),r=xr(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(n=n,(r=r).length!==n.length)return!1;for(var o=0;o<r.length;o++){var i=r[o],a=n[o];if(i.filename!==a.filename||i.lineno!==a.lineno||i.colno!==a.colno||i.function!==a.function)return!1}return!0}function br(e,t){var 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 wr(e){return e.exception&&e.exception.values&&e.exception.values[0]}function xr(e){var t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch(e){return}else if(e.stacktrace)return e.stacktrace.frames}var kr=function(e){function t(t){
82
- void 0===t&&(t={});return t._metadata=t._metadata||{},t._metadata.sdk=t._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:"6.18.1"}],version:"6.18.1"},e.call(this,Un,t)||this}return ee(t,e),t.prototype.showReportDialog=function(e){void 0===e&&(e={}),ce().document&&(this._isEnabled()?Kn(ne(ne({},e),{dsn:e.dsn||this.getDsn()})):Re.error("Trying to call showReportDialog with Sentry Client disabled"))},t.prototype._prepareEvent=function(t,n,r){return t.platform=t.platform||"javascript",e.prototype._prepareEvent.call(this,t,n,r)},t.prototype._sendEvent=function(t){var n=this.getIntegration(cr);n&&n.addSentryBreadcrumb(t),e.prototype._sendEvent.call(this,t)},t}(rn),Sr=[new dn,new un,new or,new cr,new Xn,new mr,new yr,new vr];function Cr(e){if(void 0===e&&(e={}),void 0===e.defaultIntegrations&&(e.defaultIntegrations=Sr),void 0===e.release){var t=ce();t.SENTRY_RELEASE&&t.SENTRY_RELEASE.id&&(e.release=t.SENTRY_RELEASE.id)}
83
- void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0),function(e,t){!0===t.debug&&Re.enable();var n=jt(),r=n.getScope();r&&r.update(t.initialScope);var o=new e(t);n.bindClient(o)}(kr,e),e.autoSessionTracking&&function(){if(void 0===ce().document)return void(ae()&&Re.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));var e=jt();if(!e.captureSession)return;Ar(e),st("history",(function(e){var t=e.from,n=e.to;void 0!==t&&t!==n&&Ar(jt())}))}()}function Ar(e){e.startSession({ignoreDuration:!0}),e.captureSession()}function Er(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)}let Tr=0;function Nr(e){!function(e){$t("setUser",e)}(e)}!function(){function e(e){
32
+ }catch(e){o(e)}else o(t)}]),r._executeHandlers()}))},e.prototype.catch=function(e){return this.then((function(e){return e}),e)},e.prototype.finally=function(t){var n=this;return new e((function(e,r){var o,i;return n.then((function(e){i=!1,o=e,t&&t()}),(function(e){i=!0,o=e,t&&t()})).then((function(){i?r(o):e(o)}))}))},e}();function At(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 St(new Ce("Not adding Promise due to buffer limit reached."));var o=r();return-1===t.indexOf(o)&&t.push(o),o.then((function(){return n(o)})).then(null,(function(){return n(o).then(null,(function(){}))})),o},drain:function(e){return new Ct((function(n,r){var o=t.length;if(!o)return n(!0);var i=setTimeout((function(){e&&e>0&&n(!1)}),e);t.forEach((function(e){kt(e).then((function(){--o||(clearTimeout(i),n(!0))}),r)}))}))}}}function Et(e){return"warn"===e?te.Warning:function(e){return-1!==Me.indexOf(e)}(e)?e:te.Log}var Tt={nowSeconds:function(){
33
+ return Date.now()/1e3}};var Nt=se()?function(){try{return(e=module,t="perf_hooks",e.require(t)).performance}catch(e){return}var e,t}():function(){var e=ce().performance;if(e&&e.now)return{now:function(){return e.now()},timeOrigin:Date.now()-e.now()}}(),Mt=void 0===Nt?Tt:{nowSeconds:function(){return(Nt.timeOrigin+Nt.now())/1e3}},Lt=Tt.nowSeconds.bind(Tt),zt=Mt.nowSeconds.bind(Mt);function Ot(e,t){return void 0===t&&(t=[]),[e,t]}function It(e){var t=oe(e,2),n=t[0],r=t[1],o=JSON.stringify(n);return r.reduce((function(e,t){var n=oe(t,2),r=n[0],o=n[1],i=ge(o)?String(o):JSON.stringify(o);return e+"\n"+JSON.stringify(r)+"\n"+i}),o)}!function(){var e=ce().performance;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 Pt=function(){function e(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._user={},
34
+ this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={}}return e.clone=function(t){var n=new e;return t&&(n._breadcrumbs=ie(t._breadcrumbs),n._tags=ne({},t._tags),n._extra=ne({},t._extra),n._contexts=ne({},t._contexts),n._user=t._user,n._level=t._level,n._span=t._span,n._session=t._session,n._transactionName=t._transactionName,n._fingerprint=t._fingerprint,n._eventProcessors=ie(t._eventProcessors),n._requestSession=t._requestSession),n},e.prototype.addScopeListener=function(e){this._scopeListeners.push(e)},e.prototype.addEventProcessor=function(e){return this._eventProcessors.push(e),this},e.prototype.setUser=function(e){return this._user=e||{},this._session&&this._session.update({user:e}),this._notifyScopeListeners(),this},e.prototype.getUser=function(){return this._user},e.prototype.getRequestSession=function(){return this._requestSession},e.prototype.setRequestSession=function(e){return this._requestSession=e,this},e.prototype.setTags=function(e){
35
+ return this._tags=ne(ne({},this._tags),e),this._notifyScopeListeners(),this},e.prototype.setTag=function(e,t){var n;return this._tags=ne(ne({},this._tags),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setExtras=function(e){return this._extra=ne(ne({},this._extra),e),this._notifyScopeListeners(),this},e.prototype.setExtra=function(e,t){var n;return this._extra=ne(ne({},this._extra),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setFingerprint=function(e){return this._fingerprint=e,this._notifyScopeListeners(),this},e.prototype.setLevel=function(e){return this._level=e,this._notifyScopeListeners(),this},e.prototype.setTransactionName=function(e){return this._transactionName=e,this._notifyScopeListeners(),this},e.prototype.setTransaction=function(e){return this.setTransactionName(e)},e.prototype.setContext=function(e,t){var n;return null===t?delete this._contexts[e]:this._contexts=ne(ne({},this._contexts),((n={})[e]=t,n)),this._notifyScopeListeners(),this},
36
+ e.prototype.setSpan=function(e){return this._span=e,this._notifyScopeListeners(),this},e.prototype.getSpan=function(){return this._span},e.prototype.getTransaction=function(){var e=this.getSpan();return e&&e.transaction},e.prototype.setSession=function(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this},e.prototype.getSession=function(){return this._session},e.prototype.update=function(t){if(!t)return this;if("function"==typeof t){var n=t(this);return n instanceof e?n:this}return t instanceof e?(this._tags=ne(ne({},this._tags),t._tags),this._extra=ne(ne({},this._extra),t._extra),this._contexts=ne(ne({},this._contexts),t._contexts),t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint),t._requestSession&&(this._requestSession=t._requestSession)):ve(t)&&(t=t,this._tags=ne(ne({},this._tags),t.tags),this._extra=ne(ne({},this._extra),t.extra),this._contexts=ne(ne({},this._contexts),t.contexts),
37
+ t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession)),this},e.prototype.clear=function(){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},e.prototype.addBreadcrumb=function(e,t){var n="number"==typeof t?Math.min(t,100):100;if(n<=0)return this;var r=ne({timestamp:Lt()},e);return this._breadcrumbs=ie(this._breadcrumbs,[r]).slice(-n),this._notifyScopeListeners(),this},e.prototype.clearBreadcrumbs=function(){return this._breadcrumbs=[],this._notifyScopeListeners(),this},e.prototype.applyToEvent=function(e,t){if(this._extra&&Object.keys(this._extra).length&&(e.extra=ne(ne({},this._extra),e.extra)),this._tags&&Object.keys(this._tags).length&&(e.tags=ne(ne({},this._tags),e.tags)),
38
+ this._user&&Object.keys(this._user).length&&(e.user=ne(ne({},this._user),e.user)),this._contexts&&Object.keys(this._contexts).length&&(e.contexts=ne(ne({},this._contexts),e.contexts)),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts=ne({trace:this._span.getTraceContext()},e.contexts);var n=this._span.transaction&&this._span.transaction.name;n&&(e.tags=ne({transaction:n},e.tags))}return this._applyFingerprint(e),e.breadcrumbs=ie(e.breadcrumbs||[],this._breadcrumbs),e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata=this._sdkProcessingMetadata,this._notifyEventProcessors(ie(Rt(),this._eventProcessors),e,t)},e.prototype.setSDKProcessingMetadata=function(e){return this._sdkProcessingMetadata=ne(ne({},this._sdkProcessingMetadata),e),this},e.prototype._notifyEventProcessors=function(e,t,n,r){var o=this;return void 0===r&&(r=0),new Ct((function(i,a){var s=e[r];if(null===t||"function"!=typeof s)i(t);else{
39
+ var l=s(ne({},t),n);be(l)?l.then((function(t){return o._notifyEventProcessors(e,t,n,r+1).then(i)})).then(null,a):o._notifyEventProcessors(e,l,n,r+1).then(i).then(null,a)}}))},e.prototype._notifyScopeListeners=function(){var e=this;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((function(t){t(e)})),this._notifyingListeners=!1)},e.prototype._applyFingerprint=function(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},e}();function Rt(){var e=ce();return e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.globalEventProcessors=e.__SENTRY__.globalEventProcessors||[],e.__SENTRY__.globalEventProcessors}function Dt(e){Rt().push(e)}var Bt=function(){function e(e){this.errors=0,this.sid=gt(),this.duration=0,this.status="ok",this.init=!0,this.ignoreDuration=!1;var t=zt();this.timestamp=t,this.started=t,
40
+ e&&this.update(e)}return e.prototype.update=function(e){if(void 0===e&&(e={}),e.user&&(!this.ipAddress&&e.user.ip_address&&(this.ipAddress=e.user.ip_address),this.did||e.did||(this.did=e.user.id||e.user.email||e.user.username)),this.timestamp=e.timestamp||zt(),e.ignoreDuration&&(this.ignoreDuration=e.ignoreDuration),e.sid&&(this.sid=32===e.sid.length?e.sid:gt()),void 0!==e.init&&(this.init=e.init),!this.did&&e.did&&(this.did=""+e.did),"number"==typeof e.started&&(this.started=e.started),this.ignoreDuration)this.duration=void 0;else if("number"==typeof e.duration)this.duration=e.duration;else{var t=this.timestamp-this.started;this.duration=t>=0?t:0}e.release&&(this.release=e.release),e.environment&&(this.environment=e.environment),!this.ipAddress&&e.ipAddress&&(this.ipAddress=e.ipAddress),!this.userAgent&&e.userAgent&&(this.userAgent=e.userAgent),"number"==typeof e.errors&&(this.errors=e.errors),e.status&&(this.status=e.status)},e.prototype.close=function(e){e?this.update({status:e
41
+ }):"ok"===this.status?this.update({status:"exited"}):this.update()},e.prototype.toJSON=function(){return Je({sid:""+this.sid,init:this.init,started:new Date(1e3*this.started).toISOString(),timestamp:new Date(1e3*this.timestamp).toISOString(),status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?""+this.did:void 0,duration:this.duration,attrs:{release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent}})},e}(),Ft=function(){function e(e,t,n){void 0===t&&(t=new Pt),void 0===n&&(n=4),this._version=n,this._stack=[{}],this.getStackTop().scope=t,e&&this.bindClient(e)}return e.prototype.isOlderThan=function(e){return this._version<e},e.prototype.bindClient=function(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()},e.prototype.pushScope=function(){var e=Pt.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e},e.prototype.popScope=function(){
42
+ return!(this.getStack().length<=1)&&!!this.getStack().pop()},e.prototype.withScope=function(e){var t=this.pushScope();try{e(t)}finally{this.popScope()}},e.prototype.getClient=function(){return this.getStackTop().client},e.prototype.getScope=function(){return this.getStackTop().scope},e.prototype.getStack=function(){return this._stack},e.prototype.getStackTop=function(){return this._stack[this._stack.length-1]},e.prototype.captureException=function(e,t){var n=this._lastEventId=t&&t.event_id?t.event_id:gt(),r=t;if(!t){var o=void 0;try{throw new Error("Sentry syntheticException")}catch(e){o=e}r={originalException:e,syntheticException:o}}return this._invokeClient("captureException",e,ne(ne({},r),{event_id:n})),n},e.prototype.captureMessage=function(e,t,n){var r=this._lastEventId=n&&n.event_id?n.event_id:gt(),o=n;if(!n){var i=void 0;try{throw new Error(e)}catch(e){i=e}o={originalException:e,syntheticException:i}}return this._invokeClient("captureMessage",e,t,ne(ne({},o),{event_id:r})),r},
43
+ e.prototype.captureEvent=function(e,t){var n=t&&t.event_id?t.event_id:gt();return"transaction"!==e.type&&(this._lastEventId=n),this._invokeClient("captureEvent",e,ne(ne({},t),{event_id:n})),n},e.prototype.lastEventId=function(){return this._lastEventId},e.prototype.addBreadcrumb=function(e,t){var n=this.getStackTop(),r=n.scope,o=n.client;if(r&&o){var i=o.getOptions&&o.getOptions()||{},a=i.beforeBreadcrumb,s=void 0===a?null:a,l=i.maxBreadcrumbs,c=void 0===l?100:l;if(!(c<=0)){var u=Lt(),h=ne({timestamp:u},e),d=s?Oe((function(){return s(h,t)})):h;null!==d&&r.addBreadcrumb(d,c)}}},e.prototype.setUser=function(e){var t=this.getScope();t&&t.setUser(e)},e.prototype.setTags=function(e){var t=this.getScope();t&&t.setTags(e)},e.prototype.setExtras=function(e){var t=this.getScope();t&&t.setExtras(e)},e.prototype.setTag=function(e,t){var n=this.getScope();n&&n.setTag(e,t)},e.prototype.setExtra=function(e,t){var n=this.getScope();n&&n.setExtra(e,t)},e.prototype.setContext=function(e,t){var n=this.getScope()
44
+ ;n&&n.setContext(e,t)},e.prototype.configureScope=function(e){var t=this.getStackTop(),n=t.scope,r=t.client;n&&r&&e(n)},e.prototype.run=function(e){var t=Ht(this);try{e(this)}finally{Ht(t)}},e.prototype.getIntegration=function(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return Pe.warn("Cannot retrieve integration "+e.id+" from the current Hub"),null}},e.prototype.startSpan=function(e){return this._callExtensionMethod("startSpan",e)},e.prototype.startTransaction=function(e,t){return this._callExtensionMethod("startTransaction",e,t)},e.prototype.traceHeaders=function(){return this._callExtensionMethod("traceHeaders")},e.prototype.captureSession=function(e){if(void 0===e&&(e=!1),e)return this.endSession();this._sendSessionUpdate()},e.prototype.endSession=function(){var e=this.getStackTop(),t=e&&e.scope,n=t&&t.getSession();n&&n.close(),this._sendSessionUpdate(),t&&t.setSession()},e.prototype.startSession=function(e){
45
+ var t=this.getStackTop(),n=t.scope,r=t.client,o=r&&r.getOptions()||{},i=o.release,a=o.environment,s=(ce().navigator||{}).userAgent,l=new Bt(ne(ne(ne({release:i,environment:a},n&&{user:n.getUser()}),s&&{userAgent:s}),e));if(n){var c=n.getSession&&n.getSession();c&&"ok"===c.status&&c.update({status:"exited"}),this.endSession(),n.setSession(l)}return l},e.prototype._sendSessionUpdate=function(){var e=this.getStackTop(),t=e.scope,n=e.client;if(t){var r=t.getSession&&t.getSession();r&&n&&n.captureSession&&n.captureSession(r)}},e.prototype._invokeClient=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=this.getStackTop(),i=o.scope,a=o.client;a&&a[e]&&(t=a)[e].apply(t,ie(n,[i]))},e.prototype._callExtensionMethod=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=jt(),o=r.__SENTRY__;if(o&&o.extensions&&"function"==typeof o.extensions[e])return o.extensions[e].apply(this,t);Pe.warn("Extension method "+e+" couldn't be found, doing nothing.")},e}();function jt(){
46
+ var e=ce();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function Ht(e){var t=jt(),n=$t(t);return Gt(t,e),n}function qt(){var e=jt();return Ut(e)&&!$t(e).isOlderThan(4)||Gt(e,new Ft),se()?function(e){try{var t=jt().__SENTRY__,n=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active;if(!n)return $t(e);if(!Ut(n)||$t(n).isOlderThan(4)){var r=$t(e).getStackTop();Gt(n,new Ft(r.client,Pt.clone(r.scope)))}return $t(n)}catch(t){return $t(e)}}(e):$t(e)}function Ut(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function $t(e){return e&&e.__SENTRY__&&e.__SENTRY__.hub||(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=new Ft),e.__SENTRY__.hub}function Gt(e,t){return!!e&&(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=t,!0)}function Vt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=qt();if(r&&r[e])return r[e].apply(r,ie(t));throw new Error("No hub defined or "+e+" was not found on the hub, please open a bug report.")}function Wt(e,t){var n;try{
47
+ throw new Error("Sentry syntheticException")}catch(e){n=e}return Vt("captureException",e,{captureContext:t,originalException:e,syntheticException:n})}function Yt(e,t){Vt("setExtra",e,t)}function Kt(e){Vt("withScope",e)}function Xt(e){var t=e.protocol?e.protocol+":":"",n=e.port?":"+e.port:"";return t+"//"+e.host+n+(e.path?"/"+e.path:"")+"/api/"}function Zt(e,t){return""+Xt(e)+e.projectId+"/"+t+"/"}function Jt(e){return t={sentry_key:e.publicKey,sentry_version:"7"},Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&");var t}function Qt(e){return function(e){return Zt(e,"store")}(e)+"?"+Jt(e)}function en(e,t){return t||function(e){return Zt(e,"envelope")}(e)+"?"+Jt(e)}var tn=[];function nn(e){return e.reduce((function(e,t){return e.every((function(e){return t.name!==e.name}))&&e.push(t),e}),[])}function rn(e){var t={};return function(e){var t=e.defaultIntegrations&&ie(e.defaultIntegrations)||[],n=e.integrations,r=ie(nn(t))
48
+ ;Array.isArray(n)?r=ie(r.filter((function(e){return n.every((function(t){return t.name!==e.name}))})),nn(n)):"function"==typeof n&&(r=n(r),r=Array.isArray(r)?r:[r]);var o=r.map((function(e){return e.name})),i="Debug";return-1!==o.indexOf(i)&&r.push.apply(r,ie(r.splice(o.indexOf(i),1))),r}(e).forEach((function(e){t[e.name]=e,function(e){-1===tn.indexOf(e.name)&&(e.setupOnce(Dt,qt),tn.push(e.name),Pe.log("Integration installed: "+e.name))}(e)})),qe(t,"initialized",!0),t}var on="Not capturing exception because it's already been captured.",an=function(){function e(e,t){this._integrations={},this._numProcessing=0,this._backend=new e(t),this._options=t,t.dsn&&(this._dsn=Ne(t.dsn))}return e.prototype.captureException=function(e,t,n){var r=this;if(!xt(e)){var o=t&&t.event_id;return this._process(this._getBackend().eventFromException(e,t).then((function(e){return r._captureEvent(e,t,n)})).then((function(e){o=e}))),o}Pe.log(on)},e.prototype.captureMessage=function(e,t,n,r){
49
+ var o=this,i=n&&n.event_id,a=ge(e)?this._getBackend().eventFromMessage(String(e),t,n):this._getBackend().eventFromException(e,n);return this._process(a.then((function(e){return o._captureEvent(e,n,r)})).then((function(e){i=e}))),i},e.prototype.captureEvent=function(e,t,n){if(!(t&&t.originalException&&xt(t.originalException))){var r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then((function(e){r=e}))),r}Pe.log(on)},e.prototype.captureSession=function(e){this._isEnabled()?"string"!=typeof e.release?ae()&&Pe.warn("Discarded session because of missing or non-string release"):(this._sendSession(e),e.update({init:!1})):ae()&&Pe.warn("SDK not enabled, will not capture session.")},e.prototype.getDsn=function(){return this._dsn},e.prototype.getOptions=function(){return this._options},e.prototype.getTransport=function(){return this._getBackend().getTransport()},e.prototype.flush=function(e){var t=this;return this._isClientDoneProcessing(e).then((function(n){
50
+ return t.getTransport().close(e).then((function(e){return n&&e}))}))},e.prototype.close=function(e){var t=this;return this.flush(e).then((function(e){return t.getOptions().enabled=!1,e}))},e.prototype.setupIntegrations=function(){this._isEnabled()&&!this._integrations.initialized&&(this._integrations=rn(this._options))},e.prototype.getIntegration=function(e){try{return this._integrations[e.id]||null}catch(t){return Pe.warn("Cannot retrieve integration "+e.id+" from the current Client"),null}},e.prototype._updateSessionFromEvent=function(e,t){var n,r,o=!1,i=!1,a=t.exception&&t.exception.values;if(a){i=!0;try{for(var s=re(a),l=s.next();!l.done;l=s.next()){var c=l.value.mechanism;if(c&&!1===c.handled){o=!0;break}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}var u="ok"===e.status;(u&&0===e.errors||u&&o)&&(e.update(ne(ne({},o&&{status:"crashed"}),{errors:e.errors||Number(i||o)})),this.captureSession(e))},e.prototype._sendSession=function(e){
51
+ this._getBackend().sendSession(e)},e.prototype._isClientDoneProcessing=function(e){var t=this;return new Ct((function(n){var r=0,o=setInterval((function(){0==t._numProcessing?(clearInterval(o),n(!0)):(r+=1,e&&r>=e&&(clearInterval(o),n(!1)))}),1)}))},e.prototype._getBackend=function(){return this._backend},e.prototype._isEnabled=function(){return!1!==this.getOptions().enabled&&void 0!==this._dsn},e.prototype._prepareEvent=function(e,t,n){var r=this,o=this.getOptions().normalizeDepth,i=void 0===o?3:o,a=ne(ne({},e),{event_id:e.event_id||(n&&n.event_id?n.event_id:gt()),timestamp:e.timestamp||Lt()});this._applyClientOptions(a),this._applyIntegrationsMetadata(a);var s=t;n&&n.captureContext&&(s=Pt.clone(s).update(n.captureContext));var l=kt(a);return s&&(l=s.applyToEvent(a,n)),l.then((function(e){return e&&(e.sdkProcessingMetadata=ne(ne({},e.sdkProcessingMetadata),{normalizeDepth:Xe(i)})),"number"==typeof i&&i>0?r._normalizeEvent(e,i):e}))},e.prototype._normalizeEvent=function(e,t){if(!e)return null
52
+ ;var n=ne(ne(ne(ne(ne({},e),e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((function(e){return ne(ne({},e),e.data&&{data:Xe(e.data,t)})}))}),e.user&&{user:Xe(e.user,t)}),e.contexts&&{contexts:Xe(e.contexts,t)}),e.extra&&{extra:Xe(e.extra,t)});return e.contexts&&e.contexts.trace&&(n.contexts.trace=e.contexts.trace),e.sdkProcessingMetadata=ne(ne({},e.sdkProcessingMetadata),{baseClientNormalized:!0}),n},e.prototype._applyClientOptions=function(e){var t=this.getOptions(),n=t.environment,r=t.release,o=t.dist,i=t.maxValueLength,a=void 0===i?250:i;"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=Be(e.message,a));var s=e.exception&&e.exception.values&&e.exception.values[0];s&&s.value&&(s.value=Be(s.value,a));var l=e.request;l&&l.url&&(l.url=Be(l.url,a))},e.prototype._applyIntegrationsMetadata=function(e){var t=Object.keys(this._integrations);t.length>0&&(e.sdk=e.sdk||{},
53
+ e.sdk.integrations=ie(e.sdk.integrations||[],t))},e.prototype._sendEvent=function(e){this._getBackend().sendEvent(e)},e.prototype._captureEvent=function(e,t,n){return this._processEvent(e,t,n).then((function(e){return e.event_id}),(function(e){Pe.error(e)}))},e.prototype._processEvent=function(e,t,n){var r=this,o=this.getOptions(),i=o.beforeSend,a=o.sampleRate,s=this.getTransport();function l(e,t){s.recordLostEvent&&s.recordLostEvent(e,t)}if(!this._isEnabled())return St(new Ce("SDK not enabled, will not capture event."));var c="transaction"===e.type;return!c&&"number"==typeof a&&Math.random()>a?(l("sample_rate","event"),St(new Ce("Discarding event because it's not included in the random sample (sampling rate = "+a+")"))):this._prepareEvent(e,n,t).then((function(n){if(null===n)throw l("event_processor",e.type||"event"),new Ce("An event processor returned null, will not send event.");return t&&t.data&&!0===t.data.__sentry__||c||!i?n:function(e){var t="`beforeSend` method has to return `null` or a valid event."
54
+ ;if(be(e))return e.then((function(e){if(!ve(e)&&null!==e)throw new Ce(t);return e}),(function(e){throw new Ce("beforeSend rejected with "+e)}));if(!ve(e)&&null!==e)throw new Ce(t);return e}(i(n,t))})).then((function(t){if(null===t)throw l("before_send",e.type||"event"),new Ce("`beforeSend` returned `null`, will not send event.");var o=n&&n.getSession&&n.getSession();return!c&&o&&r._updateSessionFromEvent(o,t),r._sendEvent(t),t})).then(null,(function(e){if(e instanceof Ce)throw e;throw r.captureException(e,{data:{__sentry__:!0},originalException:e}),new Ce("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: "+e)}))},e.prototype._process=function(e){var t=this;this._numProcessing+=1,e.then((function(e){return t._numProcessing-=1,e}),(function(e){return t._numProcessing-=1,e}))},e}();var sn=function(){function e(){}return e.prototype.sendEvent=function(e){return kt({
55
+ reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:"skipped"})},e.prototype.close=function(e){return kt(!0)},e}(),ln=function(){function e(e){this._options=e,this._options.dsn||Pe.warn("No DSN provided, backend will not do anything."),this._transport=this._setupTransport()}return e.prototype.eventFromException=function(e,t){throw new Ce("Backend has to implement `eventFromException` method")},e.prototype.eventFromMessage=function(e,t,n){throw new Ce("Backend has to implement `eventFromMessage` method")},e.prototype.sendEvent=function(e){this._transport.sendEvent(e).then(null,(function(e){ae()&&Pe.error("Error while sending event:",e)}))},e.prototype.sendSession=function(e){this._transport.sendSession?this._transport.sendSession(e).then(null,(function(e){ae()&&Pe.error("Error while sending session:",e)})):ae()&&Pe.warn("Dropping session because custom transport doesn't implement sendSession")},e.prototype.getTransport=function(){return this._transport},
56
+ e.prototype._setupTransport=function(){return new sn},e}();function cn(e){if(e.metadata&&e.metadata.sdk){var t=e.metadata.sdk;return{name:t.name,version:t.version}}}function un(e,t){var n,r=cn(t),o=e.type||"event",i="transaction"===o||!!t.tunnel,a=(e.sdkProcessingMetadata||{}).transactionSampling||{},s=a.method,l=a.rate;!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=ie(e.sdk.integrations||[],t.integrations||[]),e.sdk.packages=ie(e.sdk.packages||[],t.packages||[]))}(e,t.metadata.sdk),e.tags=e.tags||{},e.extra=e.extra||{},e.sdkProcessingMetadata&&e.sdkProcessingMetadata.baseClientNormalized||(e.tags.skippedNormalization=!0,e.extra.normalizeDepth=e.sdkProcessingMetadata?e.sdkProcessingMetadata.normalizeDepth:"unset"),delete e.sdkProcessingMetadata;try{n=JSON.stringify(e)}catch(t){e.tags.JSONStringifyError=!0,e.extra.JSONStringifyError=t;try{n=JSON.stringify(Xe(e))}catch(e){var c=e;n=JSON.stringify({
57
+ message:"JSON.stringify error after renormalization",extra:{message:c.message,stack:c.stack}})}}var u={body:n,type:o,url:i?en(t.dsn,t.tunnel):Qt(t.dsn)};if(i){var h=Ot(ne(ne({event_id:e.event_id,sent_at:(new Date).toISOString()},r&&{sdk:r}),!!t.tunnel&&{dsn:Ee(t.dsn)}),[[{type:o,sample_rates:[{id:s,rate:l}]},u.body]]);u.body=It(h)}return u}var hn,dn=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(){hn=Function.prototype.toString,Function.prototype.toString=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=$e(this)||this;return hn.apply(n,e)}},e.id="FunctionToString",e}(),pn=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],mn=function(){function e(t){void 0===t&&(t={}),this._options=t,this.name=e.id}return e.prototype.setupOnce=function(){Dt((function(t){var n=qt();if(!n)return t;var r=n.getIntegration(e);if(r){var o=n.getClient(),i=o?o.getOptions():{},a="function"==typeof r._mergeOptions?r._mergeOptions(i):{}
58
+ ;return"function"!=typeof r._shouldDropEvent?t:r._shouldDropEvent(t,a)?null:t}return t}))},e.prototype._shouldDropEvent=function(e,t){return this._isSentryError(e,t)?(ae()&&Pe.warn("Event dropped due to being internal Sentry Error.\nEvent: "+_t(e)),!0):this._isIgnoredError(e,t)?(ae()&&Pe.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: "+_t(e)),!0):this._isDeniedUrl(e,t)?(ae()&&Pe.warn("Event dropped due to being matched by `denyUrls` option.\nEvent: "+_t(e)+".\nUrl: "+this._getEventFilterUrl(e)),!0):!this._isAllowedUrl(e,t)&&(ae()&&Pe.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: "+_t(e)+".\nUrl: "+this._getEventFilterUrl(e)),!0)},e.prototype._isSentryError=function(e,t){if(!t.ignoreInternal)return!1;try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1},e.prototype._isIgnoredError=function(e,t){return!(!t.ignoreErrors||!t.ignoreErrors.length)&&this._getPossibleEventMessages(e).some((function(e){return t.ignoreErrors.some((function(t){
59
+ return je(e,t)}))}))},e.prototype._isDeniedUrl=function(e,t){if(!t.denyUrls||!t.denyUrls.length)return!1;var n=this._getEventFilterUrl(e);return!!n&&t.denyUrls.some((function(e){return je(n,e)}))},e.prototype._isAllowedUrl=function(e,t){if(!t.allowUrls||!t.allowUrls.length)return!0;var n=this._getEventFilterUrl(e);return!n||t.allowUrls.some((function(e){return je(n,e)}))},e.prototype._mergeOptions=function(e){return void 0===e&&(e={}),{allowUrls:ie(this._options.whitelistUrls||[],this._options.allowUrls||[],e.whitelistUrls||[],e.allowUrls||[]),denyUrls:ie(this._options.blacklistUrls||[],this._options.denyUrls||[],e.blacklistUrls||[],e.denyUrls||[]),ignoreErrors:ie(this._options.ignoreErrors||[],e.ignoreErrors||[],pn),ignoreInternal:void 0===this._options.ignoreInternal||this._options.ignoreInternal}},e.prototype._getPossibleEventMessages=function(e){if(e.message)return[e.message];if(e.exception)try{var t=e.exception.values&&e.exception.values[0]||{},n=t.type,r=void 0===n?"":n,o=t.value,i=void 0===o?"":o
60
+ ;return[""+i,r+": "+i]}catch(t){return ae()&&Pe.error("Cannot extract message for event "+_t(e)),[]}return[]},e.prototype._getLastValidUrl=function(e){void 0===e&&(e=[]);for(var t=e.length-1;t>=0;t--){var n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null},e.prototype._getEventFilterUrl=function(e){try{if(e.stacktrace)return this._getLastValidUrl(e.stacktrace.frames);var t;try{t=e.exception.values[0].stacktrace.frames}catch(e){}return t?this._getLastValidUrl(t):null}catch(t){return ae()&&Pe.error("Cannot extract url for event "+_t(e)),null}},e.id="InboundFilters",e}();function fn(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 gn=/^\s*at (?:(.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,vn=/\((\S*)(?::(\d+))(?::(\d+))\)/,yn=[30,function(e){var t=gn.exec(e);if(t){
61
+ if(t[2]&&0===t[2].indexOf("eval")){var n=vn.exec(t[2]);n&&(t[2]=n[1],t[3]=n[2],t[4]=n[3])}var r=oe(Tn(t[1]||"?",t[2]),2),o=r[0];return fn(r[1],o,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],_n=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,bn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,wn=[50,function(e){var t,n=_n.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=bn.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var o=n[3],i=n[1]||"?";return i=(t=oe(Tn(i,o),2))[0],fn(o=t[1],i,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}}],xn=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,kn=[40,function(e){var t=xn.exec(e);return t?fn(t[2],t[1]||"?",+t[3],t[4]?+t[4]:void 0):void 0}],Sn=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,Cn=[10,function(e){var t=Sn.exec(e)
62
+ ;return t?fn(t[2],t[3]||"?",+t[1]):void 0}],An=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,En=[20,function(e){var t=An.exec(e);return t?fn(t[5],t[3]||t[4]||"?",+t[1],+t[2]):void 0}],Tn=function(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]};function Nn(e){var t=Ln(e),n={type:e&&e.name,value:On(e)};return t.length&&(n.stacktrace={frames:t}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function Mn(e){return{exception:{values:[Nn(e)]}}}function Ln(e){var t=e.stacktrace||e.stack||"",n=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(zn.test(e.message))return 1}return 0}(e);try{return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.sort((function(e,t){return e[0]-t[0]})).map((function(e){return e[1]}));return function(e,t){
63
+ var r,o,i,a;void 0===t&&(t=0);var s=[];try{for(var l=re(e.split("\n").slice(t)),c=l.next();!c.done;c=l.next()){var u=c.value;try{for(var h=(i=void 0,re(n)),d=h.next();!d.done;d=h.next()){var p=(0,d.value)(u);if(p){s.push(p);break}}}catch(e){i={error:e}}finally{try{d&&!d.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(o=l.return)&&o.call(l)}finally{if(r)throw r.error}}return Re(s)}}(Cn,En,yn,kn,wn)(t,n)}catch(e){}return[]}var zn=/Minified React error #\d+;/i;function On(e){var t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function In(e,t,n,r){var o;if(pe(e)&&e.error)return Mn(e.error);if(me(e)||de(e,"DOMException")){var i=e;if("stack"in e)o=Mn(e);else{var a=i.name||(me(i)?"DOMError":"DOMException"),s=i.message?a+": "+i.message:a;bt(o=Pn(s,t,n),s)}return"code"in i&&(o.tags=ne(ne({},o.tags),{"DOMException.code":""+i.code})),o}return he(e)?Mn(e):ve(e)||ye(e)?(o=function(e,t,n){var r={exception:{
64
+ values:[{type:ye(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:"Non-Error "+(n?"promise rejection":"exception")+" captured with keys: "+Ze(e)}]},extra:{__serialized__:We(e)}};if(t){var o=Ln(t);o.length&&(r.stacktrace={frames:o})}return r}(e,t,r),wt(o,{synthetic:!0}),o):(bt(o=Pn(e,t,n),""+e,void 0),wt(o,{synthetic:!0}),o)}function Pn(e,t,n){var r={message:e};if(n&&t){var o=Ln(t);o.length&&(r.stacktrace={frames:o})}return r}var Rn,Dn=ce();function Bn(){if(Rn)return Rn;if(et(Dn.fetch))return Rn=Dn.fetch.bind(Dn);var e=Dn.document,t=Dn.fetch;if(e&&"function"==typeof e.createElement)try{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){ae()&&Pe.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return Rn=t.bind(Dn)}function Fn(e,t){
65
+ if("[object Navigator]"===Object.prototype.toString.call(Dn&&Dn.navigator)&&"function"==typeof Dn.navigator.sendBeacon)return Dn.navigator.sendBeacon.bind(Dn.navigator)(e,t);if(Qe()){var n=Bn();n(e,{body:t,method:"POST",credentials:"omit",keepalive:!0}).then(null,(function(e){console.error(e)}))}else;}function jn(e){return"event"===e?"error":e}var Hn=ce(),qn=function(){function e(e){var t,n,r,o=this;this.options=e,this._buffer=At(30),this._rateLimits={},this._outcomes={},this._api=(t=e.dsn,n=e._metadata,r=e.tunnel,{initDsn:t,metadata:n||{},dsn:Ne(t),tunnel:r}),this.url=Qt(this._api.dsn),this.options.sendClientReports&&Hn.document&&Hn.document.addEventListener("visibilitychange",(function(){"hidden"===Hn.document.visibilityState&&o._flushOutcomes()}))}return e.prototype.sendEvent=function(e){return this._sendRequest(un(e,this._api),e)},e.prototype.sendSession=function(e){return this._sendRequest(function(e,t){var n=cn(t),r="aggregates"in e?"sessions":"session";return{body:It(Ot(ne(ne({
66
+ sent_at:(new Date).toISOString()},n&&{sdk:n}),!!t.tunnel&&{dsn:Ee(t.dsn)}),[[{type:r},e]])),type:r,url:en(t.dsn,t.tunnel)}}(e,this._api),e)},e.prototype.close=function(e){return this._buffer.drain(e)},e.prototype.recordLostEvent=function(e,t){var n;if(this.options.sendClientReports){var r=jn(t)+":"+e;Pe.log("Adding outcome: "+r),this._outcomes[r]=(null!=(n=this._outcomes[r])?n:0)+1}},e.prototype._flushOutcomes=function(){if(this.options.sendClientReports){var e=this._outcomes;if(this._outcomes={},Object.keys(e).length){Pe.log("Flushing outcomes:\n"+JSON.stringify(e,null,2));var t,n,r,o=en(this._api.dsn,this._api.tunnel),i=Object.keys(e).map((function(t){var n=oe(t.split(":"),2),r=n[0];return{reason:n[1],category:r,quantity:e[t]}})),a=(t=i,Ot((n=this._api.tunnel&&Ee(this._api.dsn))?{dsn:n}:{},[[{type:"client_report"},{timestamp:r||Lt(),discarded_events:t}]]));try{Fn(o,It(a))}catch(e){Pe.error(e)}}else Pe.log("No outcomes to flush")}},e.prototype._handleResponse=function(e){
67
+ var t,n=e.requestType,r=e.response,o=e.headers,i=e.resolve,a=e.reject,s=(t=r.status)>=200&&t<300?"success":429===t?"rate_limit":t>=400&&t<500?"invalid":t>=500?"failed":"unknown";this._handleRateLimit(o)&&ae()&&Pe.warn("Too many "+n+" requests, backing off until: "+this._disabledUntil(n)),"success"!==s?a(r):i({status:s})},e.prototype._disabledUntil=function(e){var t=jn(e);return this._rateLimits[t]||this._rateLimits.all},e.prototype._isRateLimited=function(e){return this._disabledUntil(e)>new Date(Date.now())},e.prototype._handleRateLimit=function(e){var t,n,r,o,i=Date.now(),a=e["x-sentry-rate-limits"],s=e["retry-after"];if(a){try{for(var l=re(a.trim().split(",")),c=l.next();!c.done;c=l.next()){var u=c.value.split(":",2),h=parseInt(u[0],10),d=1e3*(isNaN(h)?60:h);try{for(var p=(r=void 0,re(u[1].split(";"))),m=p.next();!m.done;m=p.next()){var f=m.value;this._rateLimits[f||"all"]=new Date(i+d)}}catch(e){r={error:e}}finally{try{m&&!m.done&&(o=p.return)&&o.call(p)}finally{if(r)throw r.error}}}}catch(e){t={error:e}
68
+ }finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return!0}return!!s&&(this._rateLimits.all=new Date(i+function(e,t){void 0===t&&(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}(s,i)),!0)},e}(),Un=function(e){function t(t,n){void 0===n&&(n=Bn());var r=e.call(this,t)||this;return r._fetch=n,r}return ee(t,e),t.prototype._sendRequest=function(e,t){var n=this;if(this._isRateLimited(e.type))return this.recordLostEvent("ratelimit_backoff",e.type),Promise.reject({event:t,type:e.type,reason:"Transport for "+e.type+" requests locked till "+this._disabledUntil(e.type)+" due to too many requests.",status:429});var r={body:e.body,method:"POST",referrerPolicy:tt()?"origin":""};return void 0!==this.options.fetchParameters&&Object.assign(r,this.options.fetchParameters),void 0!==this.options.headers&&(r.headers=this.options.headers),this._buffer.add((function(){return new Ct((function(t,o){n._fetch(e.url,r).then((function(r){var i={
69
+ "x-sentry-rate-limits":r.headers.get("X-Sentry-Rate-Limits"),"retry-after":r.headers.get("Retry-After")};n._handleResponse({requestType:e.type,response:r,headers:i,resolve:t,reject:o})})).catch(o)}))})).then(void 0,(function(t){throw t instanceof Ce?n.recordLostEvent("queue_overflow",e.type):n.recordLostEvent("network_error",e.type),t}))},t}(qn),$n=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ee(t,e),t.prototype._sendRequest=function(e,t){var n=this;return this._isRateLimited(e.type)?(this.recordLostEvent("ratelimit_backoff",e.type),Promise.reject({event:t,type:e.type,reason:"Transport for "+e.type+" requests locked till "+this._disabledUntil(e.type)+" due to too many requests.",status:429})):this._buffer.add((function(){return new Ct((function(t,r){var o=new XMLHttpRequest;for(var i in o.onreadystatechange=function(){if(4===o.readyState){var i={"x-sentry-rate-limits":o.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":o.getResponseHeader("Retry-After")}
70
+ ;n._handleResponse({requestType:e.type,response:o,headers:i,resolve:t,reject:r})}},o.open("POST",e.url),n.options.headers)Object.prototype.hasOwnProperty.call(n.options.headers,i)&&o.setRequestHeader(i,n.options.headers[i]);o.send(e.body)}))})).then(void 0,(function(t){throw t instanceof Ce?n.recordLostEvent("queue_overflow",e.type):n.recordLostEvent("network_error",e.type),t}))},t}(qn),Gn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ee(t,e),t.prototype.eventFromException=function(e,t){return function(e,t,n){var r=In(e,t&&t.syntheticException||void 0,n);return wt(r),r.level=te.Error,t&&t.event_id&&(r.event_id=t.event_id),kt(r)}(e,t,this._options.attachStacktrace)},t.prototype.eventFromMessage=function(e,t,n){return void 0===t&&(t=te.Info),function(e,t,n,r){void 0===t&&(t=te.Info);var o=Pn(e,n&&n.syntheticException||void 0,r);return o.level=t,n&&n.event_id&&(o.event_id=n.event_id),kt(o)}(e,t,n,this._options.attachStacktrace)},t.prototype._setupTransport=function(){
71
+ if(!this._options.dsn)return e.prototype._setupTransport.call(this);var t=ne(ne({},this._options.transportOptions),{dsn:this._options.dsn,tunnel:this._options.tunnel,sendClientReports:this._options.sendClientReports,_metadata:this._options._metadata});return this._options.transport?new this._options.transport(t):Qe()?new Un(t):new $n(t)},t}(ln),Vn=ce(),Wn=0;function Yn(){return Wn>0}function Kn(){Wn+=1,setTimeout((function(){Wn-=1}))}function Xn(e,t,n){if(void 0===t&&(t={}),"function"!=typeof e)return e;try{var r=e.__sentry_wrapped__;if(r)return r;if($e(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((function(e){return Xn(e,t)}));return e.apply(this,o)}catch(e){throw Kn(),Kt((function(n){n.addEventProcessor((function(e){return t.mechanism&&(bt(e,void 0,void 0),wt(e,t.mechanism)),e.extra=ne(ne({},e.extra),{arguments:r}),e})),Wt(e)})),e}};try{
72
+ for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i])}catch(e){}Ue(o,e),qe(e,"__sentry_wrapped__",o);try{Object.getOwnPropertyDescriptor(o,"name").configurable&&Object.defineProperty(o,"name",{get:function(){return e.name}})}catch(e){}return o}function Zn(e){if(void 0===e&&(e={}),Vn.document)if(e.eventId)if(e.dsn){var t=Vn.document.createElement("script");t.async=!0,t.src=function(e,t){var n=Ne(e),r=Xt(n)+"embed/error-page/",o="dsn="+Ee(n);for(var i in t)if("dsn"!==i)if("user"===i){if(!t.user)continue;t.user.name&&(o+="&name="+encodeURIComponent(t.user.name)),t.user.email&&(o+="&email="+encodeURIComponent(t.user.email))}else o+="&"+encodeURIComponent(i)+"="+encodeURIComponent(t[i]);return r+"?"+o}(e.dsn,e),e.onLoad&&(t.onload=e.onLoad);var n=Vn.document.head||Vn.document.body;n&&n.appendChild(t)}else ae()&&Pe.error("Missing dsn option in showReportDialog call");else ae()&&Pe.error("Missing eventId option in showReportDialog call")}var Jn=function(){function e(t){this.name=e.id,
73
+ this._installFunc={onerror:Qn,onunhandledrejection:er},this._options=ne({onerror:!0,onunhandledrejection:!0},t)}return e.prototype.setupOnce=function(){Error.stackTraceLimit=50;var e=this._options;for(var t in e){var n=this._installFunc[t];n&&e[t]&&(nr(t),n(),this._installFunc[t]=void 0)}},e.id="GlobalHandlers",e}();function Qn(){st("error",(function(e){var t=oe(or(),2),n=t[0],r=t[1];if(n.getIntegration(Jn)){var o=e.msg,i=e.url,a=e.line,s=e.column,l=e.error;if(!(Yn()||l&&l.__sentry_own_request__)){var c=void 0===l&&fe(o)?function(e,t,n,r){var o=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,i=pe(e)?e.message:e,a="Error",s=i.match(o);s&&(a=s[1],i=s[2]);return tr({exception:{values:[{type:a,value:i}]}},t,n,r)}(o,i,a,s):tr(In(l||o,void 0,r,!1),i,a,s);c.level=te.Error,rr(n,l,c,"onerror")}}}))}function er(){st("unhandledrejection",(function(e){var t=oe(or(),2),n=t[0],r=t[1];if(n.getIntegration(Jn)){var o=e;try{
74
+ "reason"in e?o=e.reason:"detail"in e&&"reason"in e.detail&&(o=e.detail.reason)}catch(e){}if(Yn()||o&&o.__sentry_own_request__)return!0;var i=ge(o)?{exception:{values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(o)}]}}:In(o,void 0,r,!0);i.level=te.Error,rr(n,o,i,"onunhandledrejection")}}))}function tr(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=fe(t)&&t.length>0?t:function(){var e=ce();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 nr(e){ae()&&Pe.log("Global Handler attached: "+e)}function rr(e,t,n,r){wt(n,{handled:!1,type:r}),e.captureEvent(n,{originalException:t})}function or(){var e=qt(),t=e.getClient();return[e,t&&t.getOptions().attachStacktrace]}
75
+ var ir=["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"],ar=function(){function e(t){this.name=e.id,this._options=ne({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},t)}return e.prototype.setupOnce=function(){var e=ce();this._options.setTimeout&&He(e,"setTimeout",sr),this._options.setInterval&&He(e,"setInterval",sr),this._options.requestAnimationFrame&&He(e,"requestAnimationFrame",lr),this._options.XMLHttpRequest&&"XMLHttpRequest"in e&&He(XMLHttpRequest.prototype,"send",cr);var t=this._options.eventTarget;t&&(Array.isArray(t)?t:ir).forEach(ur)},e.id="TryCatch",e}()
76
+ ;function sr(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t[0];return t[0]=Xn(r,{mechanism:{data:{function:De(e)},handled:!0,type:"instrument"}}),e.apply(this,t)}}function lr(e){return function(t){return e.call(this,Xn(t,{mechanism:{data:{function:"requestAnimationFrame",handler:De(e)},handled:!0,type:"instrument"}}))}}function cr(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=this,o=["onload","onerror","onprogress","onreadystatechange"];return o.forEach((function(e){e in r&&"function"==typeof r[e]&&He(r,e,(function(t){var n={mechanism:{data:{function:e,handler:De(t)},handled:!0,type:"instrument"}},r=$e(t);return r&&(n.mechanism.data.handler=De(r)),Xn(t,n)}))})),e.apply(this,t)}}function ur(e){var t=ce(),n=t[e]&&t[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(He(n,"addEventListener",(function(t){return function(n,r,o){try{"function"==typeof r.handleEvent&&(r.handleEvent=Xn(r.handleEvent.bind(r),{
77
+ mechanism:{data:{function:"handleEvent",handler:De(r),target:e},handled:!0,type:"instrument"}}))}catch(e){}return t.call(this,n,Xn(r,{mechanism:{data:{function:"addEventListener",handler:De(r),target:e},handled:!0,type:"instrument"}}),o)}})),He(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)}})))}var hr=function(){function e(t){this.name=e.id,this._options=ne({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t)}return e.prototype.addSentryBreadcrumb=function(e){this._options.sentry&&qt().addBreadcrumb({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:_t(e)},{event:e})},e.prototype.setupOnce=function(){this._options.console&&st("console",dr),this._options.dom&&st("dom",function(e){function t(t){var n,r="object"==typeof e?e.serializeAttribute:void 0;"string"==typeof r&&(r=[r]);try{n=t.event.target?xe(t.event.target,r):xe(t.event,r)
78
+ }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&&st("xhr",pr),this._options.fetch&&st("fetch",mr),this._options.history&&st("history",fr)},e.id="Breadcrumbs",e}();function dr(e){var t={category:"console",data:{arguments:e.args,logger:"console"},level:Et(e.level),message:Fe(e.args," ")};if("assert"===e.level){if(!1!==e.args[0])return;t.message="Assertion failed: "+(Fe(e.args.slice(1)," ")||"console.assert"),t.data.arguments=e.args.slice(1)}qt().addBreadcrumb(t,{input:e.args,level:e.level})}function pr(e){if(e.endTimestamp){if(e.xhr.__sentry_own_request__)return;var t=e.xhr.__sentry_xhr__||{},n=t.method,r=t.url,o=t.status_code,i=t.body;qt().addBreadcrumb({category:"xhr",data:{method:n,url:r,status_code:o},type:"http"},{xhr:e.xhr,input:i})}else;}function mr(e){e.endTimestamp&&(e.fetchData.url.match(/sentry_key/)&&"POST"===e.fetchData.method||(e.error?qt().addBreadcrumb({
79
+ category:"fetch",data:e.fetchData,level:te.Error,type:"http"},{data:e.error,input:e.args}):qt().addBreadcrumb({category:"fetch",data:ne(ne({},e.fetchData),{status_code:e.response.status}),type:"http"},{input:e.args,response:e.response})))}function fr(e){var t=ce(),n=e.from,r=e.to,o=vt(t.location.href),i=vt(n),a=vt(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}})}var gr=function(){function e(t){void 0===t&&(t={}),this.name=e.id,this._key=t.key||"cause",this._limit=t.limit||5}return e.prototype.setupOnce=function(){Dt((function(t,n){var r=qt().getIntegration(e);return r?function(e,t,n,r){if(!(n.exception&&n.exception.values&&r&&we(r.originalException,Error)))return n;var o=vr(t,r.originalException,e);return n.exception.values=ie(o,n.exception.values),n}(r._key,r._limit,t,n):t}))},e.id="LinkedErrors",e}();function vr(e,t,n,r){if(void 0===r&&(r=[]),
80
+ !we(t[n],Error)||r.length+1>=e)return r;var o=Nn(t[n]);return vr(e,t[n],n,ie([o],r))}var yr=ce(),_r=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(){Dt((function(t){if(qt().getIntegration(e)){if(!yr.navigator&&!yr.location&&!yr.document)return t;var n=t.request&&t.request.url||yr.location&&yr.location.href,r=(yr.document||{}).referrer,o=(yr.navigator||{}).userAgent,i=ne(ne(ne({},t.request&&t.request.headers),r&&{Referer:r}),o&&{"User-Agent":o}),a=ne(ne({},n&&{url:n}),{headers:i});return ne(ne({},t),{request:a})}return t}))},e.id="UserAgent",e}(),br=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(t,n){t((function(t){var r=n().getIntegration(e);if(r){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(!xr(e,t))return!1;if(!wr(e,t))return!1;return!0}(e,t))return!0;if(function(e,t){var n=kr(t),r=kr(e);if(!n||!r)return!1
81
+ ;if(n.type!==r.type||n.value!==r.value)return!1;if(!xr(e,t))return!1;if(!wr(e,t))return!1;return!0}(e,t))return!0;return!1}(t,r._previousEvent))return Pe.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(e){return r._previousEvent=t}return r._previousEvent=t}return t}))},e.id="Dedupe",e}();function wr(e,t){var n=Sr(e),r=Sr(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(n=n,(r=r).length!==n.length)return!1;for(var o=0;o<r.length;o++){var i=r[o],a=n[o];if(i.filename!==a.filename||i.lineno!==a.lineno||i.colno!==a.colno||i.function!==a.function)return!1}return!0}function xr(e,t){var 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 kr(e){return e.exception&&e.exception.values&&e.exception.values[0]}function Sr(e){var t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch(e){return}else if(e.stacktrace)return e.stacktrace.frames}var Cr=function(e){function t(t){
82
+ void 0===t&&(t={});return t._metadata=t._metadata||{},t._metadata.sdk=t._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:"6.18.2"}],version:"6.18.2"},e.call(this,Gn,t)||this}return ee(t,e),t.prototype.showReportDialog=function(e){void 0===e&&(e={}),ce().document&&(this._isEnabled()?Zn(ne(ne({},e),{dsn:e.dsn||this.getDsn()})):Pe.error("Trying to call showReportDialog with Sentry Client disabled"))},t.prototype._prepareEvent=function(t,n,r){return t.platform=t.platform||"javascript",e.prototype._prepareEvent.call(this,t,n,r)},t.prototype._sendEvent=function(t){var n=this.getIntegration(hr);n&&n.addSentryBreadcrumb(t),e.prototype._sendEvent.call(this,t)},t}(an),Ar=[new mn,new dn,new ar,new hr,new Jn,new gr,new br,new _r];function Er(e){if(void 0===e&&(e={}),void 0===e.defaultIntegrations&&(e.defaultIntegrations=Ar),void 0===e.release){var t=ce();t.SENTRY_RELEASE&&t.SENTRY_RELEASE.id&&(e.release=t.SENTRY_RELEASE.id)}
83
+ void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0),function(e,t){!0===t.debug&&Pe.enable();var n=qt(),r=n.getScope();r&&r.update(t.initialScope);var o=new e(t);n.bindClient(o)}(Cr,e),e.autoSessionTracking&&function(){if(void 0===ce().document)return void(ae()&&Pe.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));var e=qt();if(!e.captureSession)return;Tr(e),st("history",(function(e){var t=e.from,n=e.to;void 0!==t&&t!==n&&Tr(qt())}))}()}function Tr(e){e.startSession({ignoreDuration:!0}),e.captureSession()}function Nr(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)}let Mr=0;function Lr(e){!function(e){Vt("setUser",e)}(e)}!function(){function e(e){
84
84
  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){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),
85
85
  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),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())}
86
86
  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),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.6.6",n,{Fragment:m,Component:f})
87
- ;var Lr={};function Mr(e){return e.type===m?"Fragment":"function"==typeof e.type?e.type.displayName||e.type.name:"string"==typeof e.type?e.type:"#text"}var zr=[],Or=[];function Ir(){return zr.length>0?zr[zr.length-1]:null}var Rr=!1;function Pr(e){return"function"==typeof e.type&&e.type!=m}function Dr(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 "+Mr(t);var n=t.__source;return n?e+=" (at "+n.fileName+":"+n.lineNumber+")":Rr||(Rr=!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 Br="function"==typeof WeakMap,Fr=f.prototype.setState;f.prototype.setState=function(e,t){
88
- 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'+Dr(Ir())):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'+Dr(this.__v)),Fr.call(this,e,t)};var jr=f.prototype.forceUpdate;function Hr(e){var t=e.props,n=Mr(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){
89
- 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'+Dr(Ir())):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'+Dr(this.__v)),jr.call(this,e)},function(){!function(){var e=n.__b,t=n.diffed,r=n.__,o=n.vnode,i=n.__r;n.diffed=function(e){Pr(e)&&Or.pop(),zr.pop(),t&&t(e)},n.__b=function(t){Pr(t)&&zr.push(t),e&&e(t)},n.__=function(e,t){Or=[],r&&r(e,t)},n.vnode=function(e){e.__o=Or.length>0?Or[Or.length-1]:null,o&&o(e)},n.__r=function(e){Pr(e)&&Or.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=Br?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,c=[];n.__e=function(e,t,n){if(t&&t.__c&&"function"==typeof e.then){var r=e
90
- ;e=new Error("Missing Suspense. The throwing component was: "+Mr(t));for(var o=t;o;o=o.__)if(o.__c&&o.__c.__c){e=r;break}if(e instanceof Error)throw e}try{i(e,t,n),"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=Mr(e);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"+Hr(n)+"\n\n"+Dr(n));if(null!=r&&"object"==typeof r){
91
- 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"+Mr(n)+" = "+Hr(r)+";\n let vnode = <My"+Mr(n)+" />;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+Dr(n));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(r)?"array":r))}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."+Hr(n)+"\n\n"+Dr(n)):"td"===r&&"tr"!==o.type?console.error("Improper nesting of table. Your <td> should have a <tr> parent."+Hr(n)+"\n\n"+Dr(n)):"th"===r&&"tr"!==o.type&&console.error("Improper nesting of table. Your <th> should have a <tr>."+Hr(n)+"\n\n"+Dr(n)):console.error("Improper nesting of table. Your <thead/tbody/tfoot> should have a <table> parent."+Hr(n)+"\n\n"+Dr(n)),
92
- 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"+Hr(n)+"\n\n"+Dr(n));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"+Hr(n)+"\n\n"+Dr(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 "+Mr(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){
93
- 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 Lr||(Lr[i.message]=!0,console.error("Failed prop type: "+i.message+(o&&"\n"+o()||"")))}))}(n.type.propTypes,c,0,Mr(n),(function(){return Dr(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]
94
- ;"__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(",");throw new Error("Objects are not valid as a child. Encountered an object with the keys {"+n+"}.\n\n"+Dr(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'+Hr(t)+"\n\n"+Dr(t));break}n.push(a)}}}}();var qr={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)}
95
- }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}()}(qr);var Ur,$r,Gr,Vr=qr.exports,Wr=0,Yr=[],Kr=n.__b,Xr=n.__r,Zr=n.diffed,Jr=n.__c,Qr=n.unmount;function eo(e,t){n.__h&&n.__h($r,e,Wr||t),Wr=0;var r=$r.__H||($r.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function to(e){return Wr=1,no(fo,e)}function no(e,t,n){var r=eo(Ur++,2);return r.t=e,r.__c||(r.__=[n?n(t):fo(void 0,t),function(e){var t=r.t(r.__[0],e);r.__[0]!==t&&(r.__=[t,r.__[1]],r.__c.setState({}))}],r.__c=$r),r.__}function ro(e,t){var r=eo(Ur++,3);!n.__s&&mo(r.__H,t)&&(r.__=e,r.__H=t,$r.__H.__h.push(r))}function oo(e,t){var r=eo(Ur++,4);!n.__s&&mo(r.__H,t)&&(r.__=e,r.__H=t,$r.__h.push(r))}function io(e){return Wr=5,ao((function(){return{current:e}}),[])}function ao(e,t){var n=eo(Ur++,7);return mo(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function so(e,t){return Wr=8,
96
- ao((function(){return e}),t)}function lo(e){var t=$r.context[e.__c],n=eo(Ur++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub($r)),t.props.value):e.__}function co(){for(var e;e=Yr.shift();)if(e.__P)try{e.__H.__h.forEach(ho),e.__H.__h.forEach(po),e.__H.__h=[]}catch(t){e.__H.__h=[],n.__e(t,e.__v)}}n.__b=function(e){$r=null,Kr&&Kr(e)},n.__r=function(e){Xr&&Xr(e),Ur=0;var t=($r=e.__c).__H;t&&(t.__h.forEach(ho),t.__h.forEach(po),t.__h=[])},n.diffed=function(e){Zr&&Zr(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==Yr.push(t)&&Gr===n.requestAnimationFrame||((Gr=n.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),uo&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);uo&&(t=requestAnimationFrame(n))})(co)),$r=null},n.__c=function(e,t){t.some((function(e){try{e.__h.forEach(ho),e.__h=e.__h.filter((function(e){return!e.__||po(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],n.__e(r,e.__v)}})),Jr&&Jr(e,t)},n.unmount=function(e){Qr&&Qr(e);var t,r=e.__c
97
- ;r&&r.__H&&(r.__H.__.forEach((function(e){try{ho(e)}catch(e){t=e}})),t&&n.__e(t,r.__v))};var uo="function"==typeof requestAnimationFrame;function ho(e){var t=$r,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),$r=t}function po(e){var t=$r;e.__c=e.__(),$r=t}function mo(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function fo(e,t){return"function"==typeof t?t(e):t}var go=0;function vo(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:--go,__source:o,__self:i};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 yo=new Map;function _o({name:e,className:t="",inline:n=!1,title:r=""}){const o=yo.get(e);if(!o)throw new Error(`Icon "${e.toString()}" is not registered`);const i=io();oo((()=>{const e=i.current.querySelector("svg");e&&e.setAttribute("class",t)}),[t,o]);const a={}
98
- ;return r&&(a.title=r),vo("span",{className:Vr("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 bo(e,t){const n="string"==typeof e?Symbol(e):e;return yo.set(n,t),n}var wo="/home/runner/work/frontend-shared/frontend-shared/src/components/buttons.js";function xo({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),vo("button",{ref:e,className:Vr(n,`${n}--${i}`,`${n}--${a}`,{[`${n}--icon-${o}`]:r},t),type:c,...p,...u},void 0,!1,{fileName:wo,lineNumber:82,columnNumber:5})}function ko({className:e="Hyp-IconButton",...t}){const{icon:n}=t;return vo(xo,{className:e,...t,
99
- children:vo(_o,{name:n},void 0,!1,{fileName:wo,lineNumber:109,columnNumber:7})},void 0,!1,{fileName:wo,lineNumber:108,columnNumber:5})}function So({children:e,className:t="Hyp-LabeledButton",...n}){const{icon:r,iconPosition:o="left"}=n;return vo(xo,{className:t,...n,children:[r&&"left"===o&&vo(_o,{name:r},void 0,!1,{fileName:wo,lineNumber:127,columnNumber:43}),e,r&&"right"===o&&vo(_o,{name:r},void 0,!1,{fileName:wo,lineNumber:129,columnNumber:44})]},void 0,!0,{fileName:wo,lineNumber:126,columnNumber:5})}function Co(e){return vo(xo,{className:"Hyp-LinkButton",...e},void 0,!1,{fileName:wo,lineNumber:140,columnNumber:10})}
100
- bo("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 Ao="/home/runner/work/frontend-shared/frontend-shared/src/components/containers.js";function Eo({children:e,classes:t="",containerRef:n}){return vo("div",{className:Vr("Hyp-Frame",t),ref:n,children:e},void 0,!1,{fileName:Ao,lineNumber:26,columnNumber:5})}function To({children:e,direction:t="row",classes:n="",containerRef:r}){return vo("div",{className:Vr(`Hyp-Actions--${t}`,n),ref:r,children:e},void 0,!1,{fileName:Ao,lineNumber:72,columnNumber:5})}
101
- var No='<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',Lo="/home/runner/work/frontend-shared/frontend-shared/src/components/Dialog.js";const Mo=bo("cancel",No);let zo=0;function Oo(e){const[t]=to((()=>(++zo,`${e}-${zo}`)));return t}function Io({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=Oo("dialog-description"),d=Oo("dialog-title"),p=io();ro((()=>{if(null!==i){const e=null==i?void 0:i.current;e&&!e.disabled?e.focus():p.current.focus()}}),[]),oo((()=>{const e=p.current.querySelector("p");e&&(e.id=h,
102
- p.current.setAttribute("aria-describedby",h))}),[h]);const m=a&&c,f=e||m;return vo("div",{"aria-labelledby":d,className:Vr("Hyp-Dialog",{"Hyp-Dialog--closeable":a&&u},r),ref:p,role:s,tabIndex:-1,children:[vo("header",{className:"Hyp-Dialog__header",children:[o&&vo("div",{className:"Hyp-Dialog__header-icon",children:vo(_o,{name:o,title:l,"data-testid":"header-icon"},void 0,!1,{fileName:Lo,lineNumber:139,columnNumber:13})},void 0,!1,{fileName:Lo,lineNumber:138,columnNumber:11}),vo("h2",{className:"Hyp-Dialog__title",id:d,children:l},void 0,!1,{fileName:Lo,lineNumber:142,columnNumber:9}),a&&u&&vo("div",{className:"Hyp-Dialog__close",children:vo(ko,{"data-testid":"close-button",icon:Mo,title:"Close",onClick:a},void 0,!1,{fileName:Lo,lineNumber:147,columnNumber:13})},void 0,!1,{fileName:Lo,lineNumber:146,columnNumber:11})]},void 0,!0,{fileName:Lo,lineNumber:136,columnNumber:7}),n,f&&vo("div",{className:"Hyp-Dialog__actions",children:[m&&vo(So,{"data-testid":"cancel-button",onClick:a,children:t},void 0,!1,{
103
- fileName:Lo,lineNumber:160,columnNumber:13}),e]},void 0,!0,{fileName:Lo,lineNumber:158,columnNumber:9})]},void 0,!0,{fileName:Lo,lineNumber:125,columnNumber:5})}function Ro({name:e,classes:t="",containerClasses:n="",title:r=""}){const o=yo.get(e);if(!o)throw new Error(`Icon "${e.toString()}" is not registered`);const i=io();oo((()=>{const e=i.current.querySelector("svg");e&&e.setAttribute("class",Vr("Hyp-Icon",t))}),[t,o]);const a={};return r&&(a.title=r),vo("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 Po({children:e,classes:t="",linkRef:n,...r}){return vo("a",{className:Vr("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 Do(e){const t={Left:"ArrowLeft",Up:"ArrowUp",Down:"ArrowDown",Right:"ArrowRight",
104
- Spacebar:" ",Del:"Delete"};return t[e]?t[e]:e}function Bo(e,t,n,{useCapture:r=!1}={}){return t.forEach((t=>e.addEventListener(t,n,r))),()=>{t.forEach((t=>e.removeEventListener(t,n,r)))}}function Fo(e,t,n){ro((()=>{if(!t)return()=>{};const r=Bo(document.body,["keydown"],(e=>{"Escape"===Do(e.key)&&n()})),o=Bo(document.body,["focus"],(t=>{e.current&&!e.current.contains(t.target)&&n()}),{useCapture:!0}),i=Bo(document.body,["mousedown","click"],(t=>{e.current&&!e.current.contains(t.target)&&n()}),{useCapture:!0});return()=>{r(),i(),o()}}),[e,t,n])}var jo="/home/runner/work/frontend-shared/frontend-shared/src/components/Modal.js";function Ho({children:e,onCancel:t,...n}){const r=io();return Fo(r,!0,(()=>{t&&t()})),vo(m,{children:[vo("div",{className:"Hyp-Modal__overlay"},void 0,!1,{fileName:jo,lineNumber:39,columnNumber:7}),vo("div",{className:"Hyp-Modal",ref:r,children:vo(Io,{onCancel:t,...n,children:e},void 0,!1,{fileName:jo,lineNumber:41,columnNumber:9})},void 0,!1,{fileName:jo,lineNumber:40,columnNumber:7})]
105
- },void 0,!0)}function qo({message:e,confirmAction:t,onConfirm:n,onCancel:r,...o}){return vo(Ho,{onCancel:r,buttons:[vo(So,{onClick:n,variant:"primary","data-testid":"confirm-button",children:t},"ok",!1,{fileName:jo,lineNumber:76,columnNumber:9})],...o,children:vo("p",{children:e},void 0,!1,{fileName:jo,lineNumber:87,columnNumber:7})},void 0,!1,{fileName:jo,lineNumber:73,columnNumber:5})}var Uo="/home/runner/work/frontend-shared/frontend-shared/src/components/Panel.js";const $o=bo("cancel",No);function Go({children:e,icon:t,onClose:n,title:r}){const o=!!n;return vo("div",{className:Vr("Hyp-Panel",{"Hyp-Panel--closeable":o}),children:[vo("header",{className:"Hyp-Panel__header",children:[t&&vo("div",{className:"Hyp-Panel__header-icon",children:vo(_o,{name:t,title:r},void 0,!1,{fileName:Uo,lineNumber:37,columnNumber:13})},void 0,!1,{fileName:Uo,lineNumber:36,columnNumber:11}),vo("h2",{className:"Hyp-Panel__title",children:r},void 0,!1,{fileName:Uo,lineNumber:40,columnNumber:9}),o&&vo("div",{
106
- className:"Hyp-Panel__close",children:vo(ko,{icon:$o,title:"Close",onClick:n},void 0,!1,{fileName:Uo,lineNumber:43,columnNumber:13})},void 0,!1,{fileName:Uo,lineNumber:42,columnNumber:11})]},void 0,!0,{fileName:Uo,lineNumber:34,columnNumber:7}),vo("div",{className:"Hyp-Panel__content",children:e},void 0,!1,{fileName:Uo,lineNumber:47,columnNumber:7})]},void 0,!0,{fileName:Uo,lineNumber:29,columnNumber:5})}
107
- const Vo=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>')
108
- ;function Wo({classes:e="",size:t="medium"}){return vo(Ro,{name:Vo,containerClasses:Vr(`Hyp-Spinner--${t}`,e)},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Spinner.js",lineNumber:32,columnNumber:5})}var Yo="/home/runner/work/frontend-shared/frontend-shared/src/components/TextInput.js";function Ko({classes:e="",inputRef:t,hasError:n=!1,type:r="text",...o}){return vo("input",{className:Vr("Hyp-TextInput",{"has-error":n},e),...o,ref:t,type:r},void 0,!1,{fileName:Yo,lineNumber:39,columnNumber:5})}function Xo({children:e,classes:t=""}){return vo("div",{className:Vr("Hyp-TextInputWithButton",t),children:e},void 0,!1,{fileName:Yo,lineNumber:67,columnNumber:5})}
109
- var Zo='<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>',Jo='<?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'
110
- ;const Qo={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>',
87
+ ;var zr={};function Or(e){return e.type===m?"Fragment":"function"==typeof e.type?e.type.displayName||e.type.name:"string"==typeof e.type?e.type:"#text"}var Ir=[],Pr=[];function Rr(){return Ir.length>0?Ir[Ir.length-1]:null}var Dr=!1;function Br(e){return"function"==typeof e.type&&e.type!=m}function Fr(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 "+Or(t);var n=t.__source;return n?e+=" (at "+n.fileName+":"+n.lineNumber+")":Dr||(Dr=!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 jr="function"==typeof WeakMap,Hr=f.prototype.setState;f.prototype.setState=function(e,t){
88
+ 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'+Fr(Rr())):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'+Fr(this.__v)),Hr.call(this,e,t)};var qr=f.prototype.forceUpdate;function Ur(e){var t=e.props,n=Or(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){
89
+ 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'+Fr(Rr())):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'+Fr(this.__v)),qr.call(this,e)},function(){!function(){var e=n.__b,t=n.diffed,r=n.__,o=n.vnode,i=n.__r;n.diffed=function(e){Br(e)&&Pr.pop(),Ir.pop(),t&&t(e)},n.__b=function(t){Br(t)&&Ir.push(t),e&&e(t)},n.__=function(e,t){Pr=[],r&&r(e,t)},n.vnode=function(e){e.__o=Pr.length>0?Pr[Pr.length-1]:null,o&&o(e)},n.__r=function(e){Br(e)&&Pr.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=jr?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,c=[];n.__e=function(e,t,n){if(t&&t.__c&&"function"==typeof e.then){var r=e
90
+ ;e=new Error("Missing Suspense. The throwing component was: "+Or(t));for(var o=t;o;o=o.__)if(o.__c&&o.__c.__c){e=r;break}if(e instanceof Error)throw e}try{i(e,t,n),"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=Or(e);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"+Ur(n)+"\n\n"+Fr(n));if(null!=r&&"object"==typeof r){
91
+ 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"+Or(n)+" = "+Ur(r)+";\n let vnode = <My"+Or(n)+" />;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+Fr(n));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(r)?"array":r))}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."+Ur(n)+"\n\n"+Fr(n)):"td"===r&&"tr"!==o.type?console.error("Improper nesting of table. Your <td> should have a <tr> parent."+Ur(n)+"\n\n"+Fr(n)):"th"===r&&"tr"!==o.type&&console.error("Improper nesting of table. Your <th> should have a <tr>."+Ur(n)+"\n\n"+Fr(n)):console.error("Improper nesting of table. Your <thead/tbody/tfoot> should have a <table> parent."+Ur(n)+"\n\n"+Fr(n)),
92
+ 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"+Ur(n)+"\n\n"+Fr(n));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"+Ur(n)+"\n\n"+Fr(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 "+Or(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){
93
+ 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 zr||(zr[i.message]=!0,console.error("Failed prop type: "+i.message+(o&&"\n"+o()||"")))}))}(n.type.propTypes,c,0,Or(n),(function(){return Fr(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]
94
+ ;"__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(",");throw new Error("Objects are not valid as a child. Encountered an object with the keys {"+n+"}.\n\n"+Fr(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'+Ur(t)+"\n\n"+Fr(t));break}n.push(a)}}}}();var $r={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)}
95
+ }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}()}($r);var Gr,Vr,Wr,Yr=$r.exports,Kr=0,Xr=[],Zr=n.__b,Jr=n.__r,Qr=n.diffed,eo=n.__c,to=n.unmount;function no(e,t){n.__h&&n.__h(Vr,e,Kr||t),Kr=0;var r=Vr.__H||(Vr.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function ro(e){return Kr=1,oo(vo,e)}function oo(e,t,n){var r=no(Gr++,2);return r.t=e,r.__c||(r.__=[n?n(t):vo(void 0,t),function(e){var t=r.t(r.__[0],e);r.__[0]!==t&&(r.__=[t,r.__[1]],r.__c.setState({}))}],r.__c=Vr),r.__}function io(e,t){var r=no(Gr++,3);!n.__s&&go(r.__H,t)&&(r.__=e,r.__H=t,Vr.__H.__h.push(r))}function ao(e,t){var r=no(Gr++,4);!n.__s&&go(r.__H,t)&&(r.__=e,r.__H=t,Vr.__h.push(r))}function so(e){return Kr=5,lo((function(){return{current:e}}),[])}function lo(e,t){var n=no(Gr++,7);return go(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function co(e,t){return Kr=8,
96
+ lo((function(){return e}),t)}function uo(e){var t=Vr.context[e.__c],n=no(Gr++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Vr)),t.props.value):e.__}function ho(){for(var e;e=Xr.shift();)if(e.__P)try{e.__H.__h.forEach(mo),e.__H.__h.forEach(fo),e.__H.__h=[]}catch(t){e.__H.__h=[],n.__e(t,e.__v)}}n.__b=function(e){Vr=null,Zr&&Zr(e)},n.__r=function(e){Jr&&Jr(e),Gr=0;var t=(Vr=e.__c).__H;t&&(t.__h.forEach(mo),t.__h.forEach(fo),t.__h=[])},n.diffed=function(e){Qr&&Qr(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==Xr.push(t)&&Wr===n.requestAnimationFrame||((Wr=n.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),po&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);po&&(t=requestAnimationFrame(n))})(ho)),Vr=null},n.__c=function(e,t){t.some((function(e){try{e.__h.forEach(mo),e.__h=e.__h.filter((function(e){return!e.__||fo(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],n.__e(r,e.__v)}})),eo&&eo(e,t)},n.unmount=function(e){to&&to(e);var t,r=e.__c
97
+ ;r&&r.__H&&(r.__H.__.forEach((function(e){try{mo(e)}catch(e){t=e}})),t&&n.__e(t,r.__v))};var po="function"==typeof requestAnimationFrame;function mo(e){var t=Vr,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Vr=t}function fo(e){var t=Vr;e.__c=e.__(),Vr=t}function go(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function vo(e,t){return"function"==typeof t?t(e):t}var yo=0;function _o(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:--yo,__source:o,__self:i};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 bo=new Map;function wo({name:e,className:t="",inline:n=!1,title:r=""}){const o=bo.get(e);if(!o)throw new Error(`Icon "${e.toString()}" is not registered`);const i=so();ao((()=>{const e=i.current.querySelector("svg");e&&e.setAttribute("class",t)}),[t,o]);const a={}
98
+ ;return r&&(a.title=r),_o("span",{className:Yr("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 xo(e,t){const n="string"==typeof e?Symbol(e):e;return bo.set(n,t),n}var ko="/home/runner/work/frontend-shared/frontend-shared/src/components/buttons.js";function So({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),_o("button",{ref:e,className:Yr(n,`${n}--${i}`,`${n}--${a}`,{[`${n}--icon-${o}`]:r},t),type:c,...p,...u},void 0,!1,{fileName:ko,lineNumber:82,columnNumber:5})}function Co({className:e="Hyp-IconButton",...t}){const{icon:n}=t;return _o(So,{className:e,...t,
99
+ children:_o(wo,{name:n},void 0,!1,{fileName:ko,lineNumber:109,columnNumber:7})},void 0,!1,{fileName:ko,lineNumber:108,columnNumber:5})}function Ao({children:e,className:t="Hyp-LabeledButton",...n}){const{icon:r,iconPosition:o="left"}=n;return _o(So,{className:t,...n,children:[r&&"left"===o&&_o(wo,{name:r},void 0,!1,{fileName:ko,lineNumber:127,columnNumber:43}),e,r&&"right"===o&&_o(wo,{name:r},void 0,!1,{fileName:ko,lineNumber:129,columnNumber:44})]},void 0,!0,{fileName:ko,lineNumber:126,columnNumber:5})}function Eo(e){return _o(So,{className:"Hyp-LinkButton",...e},void 0,!1,{fileName:ko,lineNumber:140,columnNumber:10})}
100
+ xo("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 To="/home/runner/work/frontend-shared/frontend-shared/src/components/containers.js";function No({children:e,classes:t="",containerRef:n}){return _o("div",{className:Yr("Hyp-Frame",t),ref:n,children:e},void 0,!1,{fileName:To,lineNumber:26,columnNumber:5})}function Mo({children:e,direction:t="row",classes:n="",containerRef:r}){return _o("div",{className:Yr(`Hyp-Actions--${t}`,n),ref:r,children:e},void 0,!1,{fileName:To,lineNumber:72,columnNumber:5})}
101
+ var Lo='<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',zo="/home/runner/work/frontend-shared/frontend-shared/src/components/Dialog.js";const Oo=xo("cancel",Lo);let Io=0;function Po(e){const[t]=ro((()=>(++Io,`${e}-${Io}`)));return t}function Ro({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=Po("dialog-description"),d=Po("dialog-title"),p=so();io((()=>{if(null!==i){const e=null==i?void 0:i.current;e&&!e.disabled?e.focus():p.current.focus()}}),[]),ao((()=>{const e=p.current.querySelector("p");e&&(e.id=h,
102
+ p.current.setAttribute("aria-describedby",h))}),[h]);const m=a&&c,f=e||m;return _o("div",{"aria-labelledby":d,className:Yr("Hyp-Dialog",{"Hyp-Dialog--closeable":a&&u},r),ref:p,role:s,tabIndex:-1,children:[_o("header",{className:"Hyp-Dialog__header",children:[o&&_o("div",{className:"Hyp-Dialog__header-icon",children:_o(wo,{name:o,title:l,"data-testid":"header-icon"},void 0,!1,{fileName:zo,lineNumber:139,columnNumber:13})},void 0,!1,{fileName:zo,lineNumber:138,columnNumber:11}),_o("h2",{className:"Hyp-Dialog__title",id:d,children:l},void 0,!1,{fileName:zo,lineNumber:142,columnNumber:9}),a&&u&&_o("div",{className:"Hyp-Dialog__close",children:_o(Co,{"data-testid":"close-button",icon:Oo,title:"Close",onClick:a},void 0,!1,{fileName:zo,lineNumber:147,columnNumber:13})},void 0,!1,{fileName:zo,lineNumber:146,columnNumber:11})]},void 0,!0,{fileName:zo,lineNumber:136,columnNumber:7}),n,f&&_o("div",{className:"Hyp-Dialog__actions",children:[m&&_o(Ao,{"data-testid":"cancel-button",onClick:a,children:t},void 0,!1,{
103
+ fileName:zo,lineNumber:160,columnNumber:13}),e]},void 0,!0,{fileName:zo,lineNumber:158,columnNumber:9})]},void 0,!0,{fileName:zo,lineNumber:125,columnNumber:5})}function Do({name:e,classes:t="",containerClasses:n="",title:r=""}){const o=bo.get(e);if(!o)throw new Error(`Icon "${e.toString()}" is not registered`);const i=so();ao((()=>{const e=i.current.querySelector("svg");e&&e.setAttribute("class",Yr("Hyp-Icon",t))}),[t,o]);const a={};return r&&(a.title=r),_o("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 Bo({children:e,classes:t="",linkRef:n,...r}){return _o("a",{className:Yr("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 Fo(e){const t={Left:"ArrowLeft",Up:"ArrowUp",Down:"ArrowDown",Right:"ArrowRight",
104
+ Spacebar:" ",Del:"Delete"};return t[e]?t[e]:e}function jo(e,t,n,{useCapture:r=!1}={}){return t.forEach((t=>e.addEventListener(t,n,r))),()=>{t.forEach((t=>e.removeEventListener(t,n,r)))}}function Ho(e,t,n){io((()=>{if(!t)return()=>{};const r=jo(document.body,["keydown"],(e=>{"Escape"===Fo(e.key)&&n()})),o=jo(document.body,["focus"],(t=>{e.current&&!e.current.contains(t.target)&&n()}),{useCapture:!0}),i=jo(document.body,["mousedown","click"],(t=>{e.current&&!e.current.contains(t.target)&&n()}),{useCapture:!0});return()=>{r(),i(),o()}}),[e,t,n])}var qo="/home/runner/work/frontend-shared/frontend-shared/src/components/Modal.js";function Uo({children:e,onCancel:t,...n}){const r=so();return Ho(r,!0,(()=>{t&&t()})),_o(m,{children:[_o("div",{className:"Hyp-Modal__overlay"},void 0,!1,{fileName:qo,lineNumber:39,columnNumber:7}),_o("div",{className:"Hyp-Modal",ref:r,children:_o(Ro,{onCancel:t,...n,children:e},void 0,!1,{fileName:qo,lineNumber:41,columnNumber:9})},void 0,!1,{fileName:qo,lineNumber:40,columnNumber:7})]
105
+ },void 0,!0)}function $o({message:e,confirmAction:t,onConfirm:n,onCancel:r,...o}){return _o(Uo,{onCancel:r,buttons:[_o(Ao,{onClick:n,variant:"primary","data-testid":"confirm-button",children:t},"ok",!1,{fileName:qo,lineNumber:76,columnNumber:9})],...o,children:_o("p",{children:e},void 0,!1,{fileName:qo,lineNumber:87,columnNumber:7})},void 0,!1,{fileName:qo,lineNumber:73,columnNumber:5})}var Go="/home/runner/work/frontend-shared/frontend-shared/src/components/Panel.js";const Vo=xo("cancel",Lo);function Wo({children:e,icon:t,onClose:n,title:r}){const o=!!n;return _o("div",{className:Yr("Hyp-Panel",{"Hyp-Panel--closeable":o}),children:[_o("header",{className:"Hyp-Panel__header",children:[t&&_o("div",{className:"Hyp-Panel__header-icon",children:_o(wo,{name:t,title:r},void 0,!1,{fileName:Go,lineNumber:37,columnNumber:13})},void 0,!1,{fileName:Go,lineNumber:36,columnNumber:11}),_o("h2",{className:"Hyp-Panel__title",children:r},void 0,!1,{fileName:Go,lineNumber:40,columnNumber:9}),o&&_o("div",{
106
+ className:"Hyp-Panel__close",children:_o(Co,{icon:Vo,title:"Close",onClick:n},void 0,!1,{fileName:Go,lineNumber:43,columnNumber:13})},void 0,!1,{fileName:Go,lineNumber:42,columnNumber:11})]},void 0,!0,{fileName:Go,lineNumber:34,columnNumber:7}),_o("div",{className:"Hyp-Panel__content",children:e},void 0,!1,{fileName:Go,lineNumber:47,columnNumber:7})]},void 0,!0,{fileName:Go,lineNumber:29,columnNumber:5})}
107
+ const Yo=xo("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>')
108
+ ;function Ko({classes:e="",size:t="medium"}){return _o(Do,{name:Yo,containerClasses:Yr(`Hyp-Spinner--${t}`,e)},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Spinner.js",lineNumber:32,columnNumber:5})}var Xo="/home/runner/work/frontend-shared/frontend-shared/src/components/TextInput.js";function Zo({classes:e="",inputRef:t,hasError:n=!1,type:r="text",...o}){return _o("input",{className:Yr("Hyp-TextInput",{"has-error":n},e),...o,ref:t,type:r},void 0,!1,{fileName:Xo,lineNumber:39,columnNumber:5})}function Jo({children:e,classes:t=""}){return _o("div",{className:Yr("Hyp-TextInputWithButton",t),children:e},void 0,!1,{fileName:Xo,lineNumber:67,columnNumber:5})}
109
+ 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>',ei='<?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'
110
+ ;const ti={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>',
111
111
  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',
112
- "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:No,"caret-right":Zo,
112
+ "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:Lo,"caret-right":Qo,
113
113
  "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>',
114
114
  "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>',
115
- "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>',collapsed:Zo,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>',
116
- 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',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>',
117
- "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:No,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>',
115
+ "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,
116
+ 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',
117
+ 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:Lo,
118
+ 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>',
118
119
  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>',
119
120
  "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>',
120
121
  "format-bold":'<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="M8.661 16c.805 0 1.536-.117 2.193-.351a4.953 4.953 0 001.69-.993c.47-.428.831-.947 1.081-1.557s.375-1.287.375-2.03c0-.29-.038-.588-.114-.893a4.123 4.123 0 00-.325-.87 3.937 3.937 0 00-.495-.754 4.412 4.412 0 00-.604-.597c-.17-.126-.17-.264 0-.412.381-.335.699-.772.953-1.311.254-.54.382-1.062.382-1.568 0-.64-.132-1.244-.394-1.813a4.628 4.628 0 00-1.081-1.484c-.458-.42-1-.753-1.627-.999A5.531 5.531 0 008.66 0h-6.14a.534.534 0 00-.362.14A.415.415 0 002 .456v15.086c0 .119.053.225.159.318.106.093.227.139.362.139h6.14zm-.127-9.852H5.826c-.17 0-.254-.075-.254-.223V3.437c0-.157.085-.235.254-.235h2.708c.45 0 .847.145 1.195.435.347.29.521.633.521 1.027 0 .394-.174.74-.521 1.038a1.784 1.784 0 01-1.195.446zm0 6.65H5.826c-.17 0-.254-.075-.254-.223v-2.99c0-.157.085-.235.254-.235h2.708c.56 0 1.004.177 1.335.53.33.353.495.75.495 1.188 0 .454-.165.856-.495 1.205-.33.35-.776.525-1.335.525z"></path></g></svg>',
@@ -128,7 +129,7 @@ hide:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0
128
129
  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>',
129
130
  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>',
130
131
  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>',
131
- 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:Jo,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',
132
+ 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:ei,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',
132
133
  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',
133
134
  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>',
134
135
  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>',
@@ -138,54 +139,54 @@ search:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="
138
139
  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>',
139
140
  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',
140
141
  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',
141
- 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 ei({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",
142
- document.body.appendChild(r),new Promise((o=>{const i=e=>{I(null,r),r.remove(),o(e)};I(vo(qo,{title:e,message:t,confirmAction:n,onConfirm:()=>i(!0),onCancel:()=>i(!1)}),r)}))}function ti(e){if(!e)return null;const t=e.match(/^acct:([^@]+)@(.+)/);return t?{username:t[1],provider:t[2]}:null}function ni(e){const t=ti(e);return t?t.username:""}function ri(e,t){const n=ti(e);return!!n&&n.provider!==t}const oi={accentColor:"color",appBackgroundColor:"backgroundColor",ctaBackgroundColor:"backgroundColor",ctaTextColor:"color",selectionFontFamily:"fontFamily",annotationFontFamily:"fontFamily"};function ii(e,t){const n={};if(!t.branding)return n;const{branding:r}=t;return e.forEach((e=>{const t=oi[e],o=r[e];t&&o&&(n[t]=o)})),n}const ai=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(y)},
143
- 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 si(e,t){function n(n){const r=lo(ai),o={};for(let e of t)e in n||(o[e]=r.get(e));return vo(e,{...o,...n})}const r=e.displayName||e.name;return n.displayName=`withServices(${r})`,n}class li{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 ci(){const e=(t="store",lo(ai).get(t));var t;const[,n]=no((e=>e+1),0),r=io([]).current,o=io(null);if(!o.current){const t={},n=(e,n)=>{const o=e[n];if("function"!=typeof o)return o;let i=t[n];return i||(i=(...t)=>{const i=r.find((e=>e.matches(n,t)));if(i)return i.result;const a=e.getState(),s=o.apply(e,t);return a===e.getState()&&r.push(new li(n,o,t,s)),s},t[n]=i,i)};o.current=new Proxy(e,{
144
- get:n})}return ro((()=>e.subscribe((()=>{r.find((t=>t.method.apply(e,t.args)!==t.result))&&(r.splice(0,r.length),n(0))}))),[r,e]),o.current}const ui={collapsed:!1,depth:0,visible:!0,replyCount:0};function hi(e){return e.id||e.$tag}function di(e,t,n){return!(!e[n]||e[n].parent===t)&&(!e[n].parent||di(e,t,e[n].parent))}function pi(e,t,n=[]){if(e[t].parent||!n.length)return;const r=n[n.length-1];e[r]||(e[r]={...ui,children:[],id:r},pi(e,r,n.slice(0,-1))),di(e,t,r)&&(e[t].parent=r,e[r].children.push(e[t]))}function mi(e,t){return Object.assign({},t(e),{children:e.children.map((e=>mi(e,t)))})}function fi(e,t,n){const r=e.children.map((e=>fi(e,n,n))).slice().sort(t);return{...e,children:r}}function gi(e,t){const n=e.children.map((e=>gi(e,t+1))),r=n.reduce(((e,t)=>e+1+t.replyCount),0);return{...e,children:n,depth:t,replyCount:r}}function vi(e){return e.children.some((e=>e.visible||vi(e)))}
145
- const yi=(e,t)=>e.annotation&&t.annotation?e.annotation.created<t.annotation.created?-1:e.annotation.created>t.annotation.created?1:0:0;function _i(e,t){const n=t.selected.length>0,r=t.forcedVisible.length>0;let o=function(e){const t={};e.forEach((e=>{const n=hi(e);t[n]={...ui,children:[],annotation:e,id:n}})),e.forEach((e=>{const n=(e.references||[]).filter((t=>t!==e.id));return pi(t,hi(e),n)}));const n=[];for(const e in t)t[e].parent||(t[e].collapsed=!0,n.push(t[e]));return{...ui,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=mi(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||vi(e))),o=mi(o,(e=>{const n={collapsed:e.collapsed}
146
- ;if(t.expanded.hasOwnProperty(e.id))n.collapsed=!t.expanded[e.id];else{const r=t.filterFn&&vi(e);n.collapsed=e.collapsed&&!r}return{...e,...n}})),o=fi(o,t.sortCompareFn,yi),o=gi(o,-1),o}function bi(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 wi(e){if(!e)return[];const t=function(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]=bi(r);o&&(n[e]=o+":"+t(i))}return n}function xi(e){const t={},n=e=>"tag"===e?"tags":e,r=(e,n)=>t[e]?t[e].push(n):t[e]=[n];if(e){const t=wi(e);for(const e of t){let[t,o]=bi(e);t||(t="any",o=e),r(n(t),o)}}return t}function ki(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
147
- }}function Si(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 Ci(e){const t=ki(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 Ai(e){let t=ki(e).title;return t.length>30&&(t=t.slice(0,30)+"…"),t}function Ei(e){return(e.references||[]).length>0}function Ti(e){return!!e.id}function Ni(e){return!e.id}function Li(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 Mi(e){return!!(e.target&&e.target.length>0&&e.target[0].selector)}function zi(e){return Mi(e)&&void 0===e.$orphan&&!e.$anchorTimeout}function Oi(e){return!!e.hidden}function Ii(e){return!!e.$highlight||!Ni(e)&&!(Pi(e)||Ei(e)||e.hidden||e.text||e.tags&&e.tags.length)}function Ri(e){return Mi(e)&&!0===e.$orphan}function Pi(e){
148
- return!Mi(e)&&!Ei(e)}function Di(e){return!(!Mi(e)||Ri(e))}function Bi(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 Fi(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}
149
- const ji=/[\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
150
- ;function Hi(e){return"string"!=typeof e?e:function(e){return e.replace(ji,"")}((t=e,t.normalize("NFKD"))).toLowerCase();var t}class qi{constructor(e,t,n){this.field=e,this.term=t,this.checker=n}matches(e){const t=this.checker;if(t.autofalse&&t.autofalse(e))return!1;let n=t.value(e);return n=Array.isArray(n)?n.map(Hi):Hi(n),t.match(this.term,n)}}class Ui{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)))}}const $i={quote:{autofalse:e=>(e.references||[]).length>0,value:e=>Fi(e)||"",match:(e,t)=>t.indexOf(e)>-1},since:{autofalse:e=>"string"!=typeof e.updated,value:e=>new Date(e.updated),match:(e,t)=>(Date.now()-t)/1e3<=e},tag:{autofalse:e=>!Array.isArray(e.tags),value:e=>e.tags,match:(e,t)=>t.includes(e)},text:{autofalse:e=>"string"!=typeof e.text,value:e=>e.text,match:(e,t)=>t.indexOf(e)>-1},uri:{autofalse:e=>"string"!=typeof e.uri,value:e=>e.uri,match:(e,t)=>t.indexOf(e)>-1},user:{
151
- autofalse:e=>"string"!=typeof e.user,value:e=>e.user+" "+function(e){return e.user_info&&e.user_info.display_name||""}(e),match:(e,t)=>t.indexOf(e)>-1}};function Gi(e){return Ri(e)?"orphan":Pi(e)?"note":"annotation"}function Vi(e,t){const n=e.visible===t;return e.children.reduce(((e,n)=>e+Vi(n,t)),n?1:0)}function Wi(e){return Vi(e,!1)}function Yi(e){return Vi(e,!0)}function Ki(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 Ki(n);throw new Error("Thread contains no annotations")}function Xi(e){return Ki([e]).reduce(((e,t)=>t.created>e?t.created:e),"")}function Zi(e){return Ki([e]).reduce(((e,t)=>(e||(e=t.created),t.created<e?t.created:e)),"")}const Ji={Newest:function(e,t){const n=Xi(e),r=Xi(t);return n>r?-1:n<r?1:0},Oldest:function(e,t){const n=Zi(e),r=Zi(t);return n<r?-1:n>r?1:0},Location:function(e,t){if(!e.annotation||!t.annotation)return function(e,t){
152
- return e.annotation||t.annotation?e.annotation?1:-1:0}(e,t);const n=Bi(e.annotation),r=Bi(t.annotation);return n<r?-1:n>r?1:0}};const Qi=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){const t=e.selection,n={expanded:t.expanded,forcedVisible:t.forcedVisible,selected:t.selected,sortCompareFn:Ji[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=wi(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":
153
- 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);n.filterFn=t=>function(e,t){const n=Object.entries(t).filter((([,e])=>e.terms.length>0)).map((([e,t])=>{const n=t.terms.map(Hi);let r;if("any"===e){const e=["quote","text","tag","user"];r=n.map((t=>new Ui("or",e.map((e=>new qi(e,t,$i[e]))))))}else r=n.map((t=>new qi(e,t,$i[e])));return new Ui(t.operator,r)})),r=new Ui("and",n);return e.filter((e=>e.id&&r.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,!zi(n)&&Gi(n)===r);var n,r}),_i(e.annotations,n)}));function ea(){const e=ci(),t=e.allAnnotations(),n=e.filterQuery(),r=e.route(),o=e.selectionState(),i=e.getFilterValues(),a=ao((()=>({annotations:t,route:r,selection:{...o,
154
- filterQuery:n,filters:i}})),[t,n,r,o,i]);return Qi(a)}var ta=/^\s+|\s+$/g,na=/^[-+]0x[0-9a-f]+$/i,ra=/^0b[01]+$/i,oa=/^0o[0-7]+$/i,ia=parseInt,aa="object"==typeof W&&W&&W.Object===Object&&W,sa="object"==typeof self&&self&&self.Object===Object&&self,la=aa||sa||Function("return this")(),ca=Object.prototype.toString,ua=Math.max,ha=Math.min,da=function(){return la.Date.now()};function pa(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ma(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==ca.call(e)}(e))return NaN;if(pa(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=pa(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(ta,"");var n=ra.test(e);return n||oa.test(e)?ia(e.slice(2),n?2:8):na.test(e)?NaN:+e}var fa=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)}
155
- function m(e){return c=e,s=setTimeout(g,t),u?p(e):a}function f(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-c>=i}function g(){var e=da();if(f(e))return v(e);s=setTimeout(g,function(e){var n=t-(e-l);return h?ha(n,i-(e-c)):n}(e))}function v(e){return s=void 0,d&&r?p(e):(r=o=void 0,a)}function y(){var e=da(),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=ma(t)||0,pa(n)&&(u=!!n.leading,i=(h="maxWait"in n)?ua(ma(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d),y.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=o=s=void 0},y.flush=function(){return void 0===s?a:v(da())},y};class ga{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(){
156
- this._listeners.forEach((({eventTarget:e,eventType:t,listener:n})=>{e.removeEventListener(t,n)})),this._listeners.clear()}}const va={defaultHeight:200,marginAbove:800,marginBelow:800};function ya(e){const t=window.getComputedStyle(e);return e.getBoundingClientRect().height+(parseFloat(t.marginTop)+parseFloat(t.marginBottom))}function _a(e){return/^http(s?):/i.test(e)}function ba(e){return{read:[e],update:[e],delete:[e]}}function wa(e,t){return Object.assign(ba(e),{read:["group:"+t]})}function xa(e,t,n){return"private"===function(e){switch(e){case"private":case"shared":return e;default:return"shared"}}(n)&&e?ba(e):wa(e,t)}function ka(e){return e.read.some((e=>0===e.indexOf("group:")))}function Sa(e){return!ka(e)}function Ca(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),
157
- t.setSelectionRange(0,t.value.length),document.execCommand("copy")}finally{t.remove()}}function Aa({label:e,iconName:t,uri:n}){return vo("li",{className:"ShareLinks__link",children:vo("a",{"aria-label":e,href:n,title:e,target:"_blank",rel:"noopener noreferrer",children:vo(Ro,{name:t,classes:"ShareLinks__icon"})})})}function Ea({shareURI:e}){const t=encodeURIComponent(e);return vo("ul",{className:"ShareLinks",children:[vo(Aa,{iconName:"twitter",label:"Tweet share link",uri:`https://twitter.com/intent/tweet?url=${t}&hashtags=annotated`}),vo(Aa,{iconName:"facebook",label:"Share on Facebook",uri:`https://www.facebook.com/sharer/sharer.php?u=${t}`}),vo(Aa,{iconName:"email",label:"Share via email",uri:`mailto:?subject=${encodeURIComponent("Let's Annotate")}&body=${t}`})]})}function Ta(){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)()}
158
- var Na=si((function({annotation:e,toastMessenger:t,group:n,shareUri:r}){const o=Sa(e.permissions),i=_a(e.uri),a=io(null),s=io(null),[l,c]=to(!1),u=io(l);if(Fo(a,l,(()=>c(!1))),ro((()=>{var e,t;u.current!==l&&(u.current=l,l&&!Ta()&&(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?vo("span",{children:["Only members of the group ",vo("em",{children:n.name})," may view this annotation."]}):vo("span",{children:"Anyone using this link may view this annotation."}),p=o?vo("span",{children:"Only you may view this annotation."}):d;return vo("div",{className:"AnnotationShareControl",ref:a,children:[vo(ko,{icon:"share",title:"Share",onClick:()=>c(!l),expanded:l}),l&&vo("div",{className:"annotation-share-panel",children:[vo("div",{className:"annotation-share-panel__header",children:vo("div",{className:"annotation-share-panel__title",children:"Share this annotation"})}),vo("div",{className:"annotation-share-panel__content",
159
- children:[vo("div",{className:"hyp-u-layout-row annotation-share-panel__inputs",children:vo(Xo,{children:[vo(Ko,{"aria-label":"Use this URL to share this annotation",type:"text",value:r,readOnly:!0,inputRef:s}),vo(ko,{icon:"copy",title:"Copy share link to clipboard",onClick:()=>{try{Ca(r),t.success("Copied share link to clipboard")}catch(e){t.error("Unable to copy link")}},variant:"dark"})]})}),vo("div",i?{className:"annotation-share-panel__details",children:p}:{className:"annotation-share-panel__details",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&&vo(Ea,{shareURI:r})]}),vo(Ro,{name:"pointer",classes:"annotation-share-panel__arrow"})]})]})}),["toastMessenger"]);var La=si((function({annotation:e,annotationsService:t,onReply:n,settings:r,toastMessenger:o}){const i=ci(),a=i.profile(),s=i.getGroup(e.group),l=i.isLoggedIn(),c=t=>function(e,t,n){return-1!==e[t].indexOf(n||"")
160
- }(e.permissions,t,a.userid),u=c("delete"),h=c("update"),d=function(e){const t=P(e);return!1!==(null==t?void 0:t.allowFlagging)}(r)&&!!a.userid&&a.userid!==e.user,p=function(e){const t=P(e);return!1!==(null==t?void 0:t.enableShareLinks)}(r)&&function(e){var t,n,r,o,i,a;return _a(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 vo("div",{className:"AnnotationActionBar hyp-u-layout-row text-xl font-medium",children:[h&&vo(ko,{icon:"edit",title:"Edit",onClick:()=>{i.createDraft(e,{tags:e.tags,text:e.text,isPrivate:Sa(e.permissions)})}}),u&&vo(ko,{icon:"trash",title:"Delete",onClick:async()=>{if(await ei({title:"Delete annotation?",message:"Are you sure you want to delete this annotation?",confirmAction:"Delete"}))try{await t.delete(e)}catch(e){o.error(e.message)}}}),vo(ko,{icon:"reply",title:"Reply",onClick:()=>{
161
- l?n():i.openSidebarPanel("loginPrompt")}}),p&&vo(Na,{annotation:e,group:s,shareUri:p}),d&&!e.flagged&&vo(ko,{icon:"flag",title:"Report this annotation to moderators",onClick:()=>{t.flag(e).catch((()=>o.error("Flagging annotation failed")))}}),d&&e.flagged&&vo(ko,{pressed:!0,icon:"flag--active",title:"Annotation has been reported to the moderators"})]})}),["annotationsService","settings","toastMessenger"]);function Ma({isCollapsed:e,setCollapsed:t,linkStyle:n={}}){return vo("div",{className:"Excerpt__inline-controls",children:vo("div",{className:"Excerpt__toggle-container",children:vo(Co,{classes:"InlineLinkButton InlineLinkButton--underlined",onClick:()=>t(!e),expanded:!e,title:"Toggle visibility of full excerpt text",style:n,variant:"dark",children:e?"More":"Less"})})})}const za=()=>{};var Oa=si((function({children:e,collapse:t=!1,collapsedHeight:n,inlineControls:r=!0,onCollapsibleChanged:o=za,onToggleCollapsed:i=za,overflowThreshold:a=0,settings:s={}}){const[l,c]=to(!0),u=io(),[h,d]=to(0),p=so((()=>{
162
- const e=u.current.clientHeight;d(e);o(e>n+a)}),[n,o,a]);oo((()=>{const e=function(e,t){if("undefined"!=typeof ResizeObserver){const n=new ResizeObserver((()=>t(e.clientWidth,e.clientHeight)));return n.observe(e),()=>n.disconnect()}const n=new ga;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 vo("div",{className:"Excerpt",style:g,children:[vo("div",{className:"Excerpt__content",ref:u,children:e}),vo("div",{role:"presentation",onClick:()=>v(!1),className:Vr({Excerpt__shadow:!0,"Excerpt__shadow--transparent":r,"is-hidden":!f}),title:"Show the full excerpt"}),m&&r&&vo(Ma,{isCollapsed:l,setCollapsed:v,
163
- linkStyle:ii(["selectionFontFamily"],s)})]})}),["settings"]);function Ia(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 Ra(e){const t=/(\d+)([hms]?)/g,n={h:3600,m:60,s:1};let r,o=0;for(;null!==(r=t.exec(e));)r[2]?o+=Number(r[1])*n[r[2]]:o+=+r[1];return o.toString()}function Pa(e,t){const n=function(e){const t=["end","start","t"],n=new URLSearchParams(e.search),r=new URLSearchParams;for(let[e,o]of n)t.includes(e)&&("t"===e?r.append("start",Ra(o)):r.append(e,o));r.sort();let o=r.toString();return o&&(o=`?${o}`),o}(t);return Ia(`https://www.youtube.com/embed/${e}${n}`)}function Da(e,t,n,{aspectRatio:r}={}){return o=>{if(o.hostname!==e)return null
164
- ;const i=t.exec(o.pathname);if(!i)return null;const a=i[1];return Ia(n(a),r)}}const Ba=[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?Pa(t[1],e):null},function(e){if("youtu.be"!==e.hostname)return null;const t=/^\/([^/]+)\/?$/.exec(e.pathname);return t?Pa(t[1],e):null},Da("vimeo.com",/^\/([^/?#]+)\/?$/,(e=>`https://player.vimeo.com/video/${e}`)),Da("vimeo.com",/^\/channels\/[^/]+\/([^/?#]+)\/?$/,(e=>`https://player.vimeo.com/video/${e}`)),Da("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;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],""))}
165
- const a=new URL(`https://archive.org/embed/${n}`);return o&&a.searchParams.append("start",o),i&&a.searchParams.append("end",i),Ia(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 Fa(e){if(e.href!==e.textContent&&decodeURI(e.href)!==e.textContent)return null;const t=function(e){let t,n;for(n=0;n<Ba.length;n++)if(t=Ba[n](e),t)return t;return null}(e);return t&&e.parentElement.replaceChild(t,e),t}var ja=Object.hasOwnProperty,Ha=Object.setPrototypeOf,qa=Object.isFrozen,Ua=Object.getPrototypeOf,$a=Object.getOwnPropertyDescriptor,Ga=Object.freeze,Va=Object.seal,Wa=Object.create,Ya="undefined"!=typeof Reflect&&Reflect,Ka=Ya.apply,Xa=Ya.construct;Ka||(Ka=function(e,t,n){return e.apply(t,n)}),Ga||(Ga=function(e){return e}),Va||(Va=function(e){return e}),Xa||(Xa=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){
166
- if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t))))});var Za,Ja=ls(Array.prototype.forEach),Qa=ls(Array.prototype.pop),es=ls(Array.prototype.push),ts=ls(String.prototype.toLowerCase),ns=ls(String.prototype.match),rs=ls(String.prototype.replace),os=ls(String.prototype.indexOf),is=ls(String.prototype.trim),as=ls(RegExp.prototype.test),ss=(Za=TypeError,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return Xa(Za,t)});function ls(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Ka(e,t,r)}}function cs(e,t){Ha&&Ha(e,null);for(var n=t.length;n--;){var r=t[n];if("string"==typeof r){var o=ts(r);o!==r&&(qa(t)||(t[n]=o),r=o)}e[r]=!0}return e}function us(e){var t=Wa(null),n=void 0;for(n in e)Ka(ja,e,[n])&&(t[n]=e[n]);return t}function hs(e,t){for(;null!==e;){var n=$a(e,t);if(n){if(n.get)return ls(n.get);if("function"==typeof n.value)return ls(n.value)}e=Ua(e)}
142
+ 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 ni({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",
143
+ document.body.appendChild(r),new Promise((o=>{const i=e=>{I(null,r),r.remove(),o(e)};I(_o($o,{title:e,message:t,confirmAction:n,onConfirm:()=>i(!0),onCancel:()=>i(!1)}),r)}))}function ri(e){if(!e)return null;const t=e.match(/^acct:([^@]+)@(.+)/);return t?{username:t[1],provider:t[2]}:null}function oi(e){const t=ri(e);return t?t.username:""}function ii(e,t){const n=ri(e);return!!n&&n.provider!==t}const ai={accentColor:"color",appBackgroundColor:"backgroundColor",ctaBackgroundColor:"backgroundColor",ctaTextColor:"color",selectionFontFamily:"fontFamily",annotationFontFamily:"fontFamily"};function si(e,t){const n={};if(!t.branding)return n;const{branding:r}=t;return e.forEach((e=>{const t=ai[e],o=r[e];t&&o&&(n[t]=o)})),n}const li=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(y)},
144
+ 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 ci(e,t){function n(n){const r=uo(li),o={};for(let e of t)e in n||(o[e]=r.get(e));return _o(e,{...o,...n})}const r=e.displayName||e.name;return n.displayName=`withServices(${r})`,n}class ui{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 hi(){const e=(t="store",uo(li).get(t));var t;const[,n]=oo((e=>e+1),0),r=so([]).current,o=so(null);if(!o.current){const t={},n=(e,n)=>{const o=e[n];if("function"!=typeof o)return o;let i=t[n];return i||(i=(...t)=>{const i=r.find((e=>e.matches(n,t)));if(i)return i.result;const a=e.getState(),s=o.apply(e,t);return a===e.getState()&&r.push(new ui(n,o,t,s)),s},t[n]=i,i)};o.current=new Proxy(e,{
145
+ get:n})}return io((()=>e.subscribe((()=>{r.find((t=>t.method.apply(e,t.args)!==t.result))&&(r.splice(0,r.length),n(0))}))),[r,e]),o.current}const di={collapsed:!1,depth:0,visible:!0,replyCount:0};function pi(e){return e.id||e.$tag}function mi(e,t,n){return!(!e[n]||e[n].parent===t)&&(!e[n].parent||mi(e,t,e[n].parent))}function fi(e,t,n=[]){if(e[t].parent||!n.length)return;const r=n[n.length-1];e[r]||(e[r]={...di,children:[],id:r},fi(e,r,n.slice(0,-1))),mi(e,t,r)&&(e[t].parent=r,e[r].children.push(e[t]))}function gi(e,t){return Object.assign({},t(e),{children:e.children.map((e=>gi(e,t)))})}function vi(e,t,n){const r=e.children.map((e=>vi(e,n,n))).slice().sort(t);return{...e,children:r}}function yi(e,t){const n=e.children.map((e=>yi(e,t+1))),r=n.reduce(((e,t)=>e+1+t.replyCount),0);return{...e,children:n,depth:t,replyCount:r}}function _i(e){return e.children.some((e=>e.visible||_i(e)))}
146
+ const bi=(e,t)=>e.annotation&&t.annotation?e.annotation.created<t.annotation.created?-1:e.annotation.created>t.annotation.created?1:0:0;function wi(e,t){const n=t.selected.length>0,r=t.forcedVisible.length>0;let o=function(e){const t={};e.forEach((e=>{const n=pi(e);t[n]={...di,children:[],annotation:e,id:n}})),e.forEach((e=>{const n=(e.references||[]).filter((t=>t!==e.id));return fi(t,pi(e),n)}));const n=[];for(const e in t)t[e].parent||(t[e].collapsed=!0,n.push(t[e]));return{...di,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=gi(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||_i(e))),o=gi(o,(e=>{const n={collapsed:e.collapsed}
147
+ ;if(t.expanded.hasOwnProperty(e.id))n.collapsed=!t.expanded[e.id];else{const r=t.filterFn&&_i(e);n.collapsed=e.collapsed&&!r}return{...e,...n}})),o=vi(o,t.sortCompareFn,bi),o=yi(o,-1),o}function xi(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 ki(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]=xi(r);o&&(n[e]=o+":"+t(i))}return n}function Si(e){const t={},n=e=>"tag"===e?"tags":e;if(e){const r=ki(e);for(const e of r){let[r,o]=xi(e);r||(r="any",o=e);const i=n(r);t[i]?t[i].push(o):t[i]=[o]}}return t}function Ci(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}}
148
+ function Ai(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 Ei(e){const t=Ci(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 Ti(e){let t=Ci(e).title;return t.length>30&&(t=t.slice(0,30)+"…"),t}function Ni(e){return(e.references||[]).length>0}function Mi(e){return!!e.id}function Li(e){return!e.id}function zi(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 Oi(e){return!!(e.target&&e.target.length>0&&e.target[0].selector)}function Ii(e){return Oi(e)&&void 0===e.$orphan&&!e.$anchorTimeout}function Pi(e){return!!e.hidden}function Ri(e){return!!e.$highlight||!Li(e)&&!(Bi(e)||Ni(e)||e.hidden||e.text||e.tags&&e.tags.length)}function Di(e){return Oi(e)&&!0===e.$orphan}function Bi(e){
149
+ return!Oi(e)&&!Ni(e)}function Fi(e){return!(!Oi(e)||Di(e))}function ji(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 Hi(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}
150
+ const qi=/[\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
151
+ ;function Ui(e){return"string"!=typeof e?e:function(e){return e.replace(qi,"")}((t=e,t.normalize("NFKD"))).toLowerCase();var t}class $i{constructor(e,t,n){this.field=e,this.term=t,this.checker=n}matches(e){const t=this.checker;if(t.autofalse&&t.autofalse(e))return!1;let n=t.value(e);return n=Array.isArray(n)?n.map(Ui):Ui(n),t.match(this.term,n)}}class Gi{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)))}}const Vi={quote:{autofalse:e=>(e.references||[]).length>0,value:e=>Hi(e)||"",match:(e,t)=>t.indexOf(e)>-1},since:{autofalse:e=>"string"!=typeof e.updated,value:e=>new Date(e.updated),match:(e,t)=>(Date.now()-t)/1e3<=e},tag:{autofalse:e=>!Array.isArray(e.tags),value:e=>e.tags,match:(e,t)=>t.includes(e)},text:{autofalse:e=>"string"!=typeof e.text,value:e=>e.text,match:(e,t)=>t.indexOf(e)>-1},uri:{autofalse:e=>"string"!=typeof e.uri,value:e=>e.uri,match:(e,t)=>t.indexOf(e)>-1},user:{
152
+ autofalse:e=>"string"!=typeof e.user,value:e=>e.user+" "+function(e){return e.user_info&&e.user_info.display_name||""}(e),match:(e,t)=>t.indexOf(e)>-1}};function Wi(e){return Di(e)?"orphan":Bi(e)?"note":"annotation"}function Yi(e,t){const n=e.visible===t;return e.children.reduce(((e,n)=>e+Yi(n,t)),n?1:0)}function Ki(e){return Yi(e,!1)}function Xi(e){return Yi(e,!0)}function Zi(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 Zi(n);throw new Error("Thread contains no annotations")}function Ji(e){return Zi([e]).reduce(((e,t)=>t.created>e?t.created:e),"")}function Qi(e){return Zi([e]).reduce(((e,t)=>(e||(e=t.created),t.created<e?t.created:e)),"")}const ea={Newest:function(e,t){const n=Ji(e),r=Ji(t);return n>r?-1:n<r?1:0},Oldest:function(e,t){const n=Qi(e),r=Qi(t);return n<r?-1:n>r?1:0},Location:function(e,t){if(!e.annotation||!t.annotation)return function(e,t){
153
+ return e.annotation||t.annotation?e.annotation?1:-1:0}(e,t);const n=ji(e.annotation),r=ji(t.annotation);return n<r?-1:n>r?1:0}};const ta=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){const t=e.selection,n={expanded:t.expanded,forcedVisible:t.forcedVisible,selected:t.selected,sortCompareFn:ea[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=ki(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":
154
+ 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);n.filterFn=t=>function(e,t){const n=Object.entries(t).filter((([,e])=>e.terms.length>0)).map((([e,t])=>{const n=t.terms.map(Ui);let r;if("any"===e){const e=["quote","text","tag","user"];r=n.map((t=>new Gi("or",e.map((e=>new $i(e,t,Vi[e]))))))}else r=n.map((t=>new $i(e,t,Vi[e])));return new Gi(t.operator,r)})),r=new Gi("and",n);return e.filter((e=>e.id&&r.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,!Ii(n)&&Wi(n)===r);var n,r}),wi(e.annotations,n)}));function na(){const e=hi(),t=e.allAnnotations(),n=e.filterQuery(),r=e.route(),o=e.selectionState(),i=e.getFilterValues(),a=lo((()=>({annotations:t,route:r,selection:{...o,
155
+ filterQuery:n,filters:i}})),[t,n,r,o,i]);return ta(a)}var ra=/^\s+|\s+$/g,oa=/^[-+]0x[0-9a-f]+$/i,ia=/^0b[01]+$/i,aa=/^0o[0-7]+$/i,sa=parseInt,la="object"==typeof W&&W&&W.Object===Object&&W,ca="object"==typeof self&&self&&self.Object===Object&&self,ua=la||ca||Function("return this")(),ha=Object.prototype.toString,da=Math.max,pa=Math.min,ma=function(){return ua.Date.now()};function fa(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ga(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==ha.call(e)}(e))return NaN;if(fa(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=fa(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(ra,"");var n=ia.test(e);return n||aa.test(e)?sa(e.slice(2),n?2:8):oa.test(e)?NaN:+e}var va=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)}
156
+ function m(e){return c=e,s=setTimeout(g,t),u?p(e):a}function f(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-c>=i}function g(){var e=ma();if(f(e))return v(e);s=setTimeout(g,function(e){var n=t-(e-l);return h?pa(n,i-(e-c)):n}(e))}function v(e){return s=void 0,d&&r?p(e):(r=o=void 0,a)}function y(){var e=ma(),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=ga(t)||0,fa(n)&&(u=!!n.leading,i=(h="maxWait"in n)?da(ga(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d),y.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=o=s=void 0},y.flush=function(){return void 0===s?a:v(ma())},y};class ya{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(){
157
+ this._listeners.forEach((({eventTarget:e,eventType:t,listener:n})=>{e.removeEventListener(t,n)})),this._listeners.clear()}}const _a={defaultHeight:200,marginAbove:800,marginBelow:800};function ba(e){const t=window.getComputedStyle(e);return e.getBoundingClientRect().height+(parseFloat(t.marginTop)+parseFloat(t.marginBottom))}function wa(e){return/^http(s?):/i.test(e)}function xa(e){return{read:[e],update:[e],delete:[e]}}function ka(e,t){return Object.assign(xa(e),{read:["group:"+t]})}function Sa(e,t,n){return"private"===function(e){switch(e){case"private":case"shared":return e;default:return"shared"}}(n)&&e?xa(e):ka(e,t)}function Ca(e){return e.read.some((e=>0===e.indexOf("group:")))}function Aa(e){return!Ca(e)}function Ea(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),
158
+ t.setSelectionRange(0,t.value.length),document.execCommand("copy")}finally{t.remove()}}function Ta({label:e,iconName:t,uri:n}){return _o("li",{children:_o(Bo,{"aria-label":e,classes:"text-grey-6 hover:text-color-text block",href:n,title:e,target:"_blank",children:_o(Do,{name:t})})})}function Na({shareURI:e}){const t=encodeURIComponent(e);return _o("ul",{className:"flex flex-row gap-x-4 items-center justify-center border-t pt-2",children:[_o(Ta,{iconName:"twitter",label:"Tweet share link",uri:`https://twitter.com/intent/tweet?url=${t}&hashtags=annotated`}),_o(Ta,{iconName:"facebook",label:"Share on Facebook",uri:`https://www.facebook.com/sharer/sharer.php?u=${t}`}),_o(Ta,{iconName:"email",label:"Share via email",uri:`mailto:?subject=${encodeURIComponent("Let's Annotate")}&body=${t}`})]})}function Ma(){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)()}
159
+ var La=ci((function({annotation:e,toastMessenger:t,group:n,shareUri:r}){const o=Aa(e.permissions),i=wa(e.uri),a=so(null),s=so(null),[l,c]=ro(!1),u=so(l);if(Ho(a,l,(()=>c(!1))),io((()=>{var e,t;u.current!==l&&(u.current=l,l&&!Ma()&&(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?_o("span",{children:["Only members of the group ",_o("em",{children:n.name})," may view this annotation."]}):_o("span",{children:"Anyone using this link may view this annotation."}),p=o?_o("span",{children:"Only you may view this annotation."}):d;return _o("div",{className:"AnnotationShareControl",ref:a,children:[_o(Co,{icon:"share",title:"Share",onClick:()=>c(!l),expanded:l}),l&&_o("div",{className:"annotation-share-panel",children:[_o("div",{className:"annotation-share-panel__header",children:_o("div",{className:"annotation-share-panel__title",children:"Share this annotation"})}),_o("div",{className:"annotation-share-panel__content",
160
+ children:[_o("div",{className:"hyp-u-layout-row annotation-share-panel__inputs",children:_o(Jo,{children:[_o(Zo,{"aria-label":"Use this URL to share this annotation",type:"text",value:r,readOnly:!0,inputRef:s}),_o(Co,{icon:"copy",title:"Copy share link to clipboard",onClick:()=>{try{Ea(r),t.success("Copied share link to clipboard")}catch(e){t.error("Unable to copy link")}},variant:"dark"})]})}),_o("div",i?{className:"annotation-share-panel__details",children:p}:{className:"annotation-share-panel__details",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&&_o(Na,{shareURI:r})]}),_o(Do,{name:"pointer",classes:"annotation-share-panel__arrow"})]})]})}),["toastMessenger"]);var za=ci((function({annotation:e,annotationsService:t,onReply:n,settings:r,toastMessenger:o}){const i=hi(),a=i.profile(),s=i.getGroup(e.group),l=i.isLoggedIn(),c=t=>function(e,t,n){return-1!==e[t].indexOf(n||"")
161
+ }(e.permissions,t,a.userid),u=c("delete"),h=c("update"),d=function(e){const t=R(e);return!1!==(null==t?void 0:t.allowFlagging)}(r)&&!!a.userid&&a.userid!==e.user,p=function(e){const t=R(e);return!1!==(null==t?void 0:t.enableShareLinks)}(r)&&function(e){var t,n,r,o,i,a;return wa(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 _o("div",{className:"AnnotationActionBar hyp-u-layout-row text-xl font-medium",children:[h&&_o(Co,{icon:"edit",title:"Edit",onClick:()=>{i.createDraft(e,{tags:e.tags,text:e.text,isPrivate:Aa(e.permissions)})}}),u&&_o(Co,{icon:"trash",title:"Delete",onClick:async()=>{if(await ni({title:"Delete annotation?",message:"Are you sure you want to delete this annotation?",confirmAction:"Delete"}))try{await t.delete(e)}catch(e){o.error(e.message)}}}),_o(Co,{icon:"reply",title:"Reply",onClick:()=>{
162
+ l?n():i.openSidebarPanel("loginPrompt")}}),p&&_o(La,{annotation:e,group:s,shareUri:p}),d&&!e.flagged&&_o(Co,{icon:"flag",title:"Report this annotation to moderators",onClick:()=>{t.flag(e).catch((()=>o.error("Flagging annotation failed")))}}),d&&e.flagged&&_o(Co,{pressed:!0,icon:"flag--active",title:"Annotation has been reported to the moderators"})]})}),["annotationsService","settings","toastMessenger"]);function Oa({isCollapsed:e,setCollapsed:t,linkStyle:n={}}){return _o("div",{className:"Excerpt__inline-controls",children:_o("div",{className:"Excerpt__toggle-container",children:_o(Eo,{classes:"InlineLinkButton InlineLinkButton--underlined",onClick:()=>t(!e),expanded:!e,title:"Toggle visibility of full excerpt text",style:n,variant:"dark",children:e?"More":"Less"})})})}const Ia=()=>{};var Pa=ci((function({children:e,collapse:t=!1,collapsedHeight:n,inlineControls:r=!0,onCollapsibleChanged:o=Ia,onToggleCollapsed:i=Ia,overflowThreshold:a=0,settings:s={}}){const[l,c]=ro(!0),u=so(),[h,d]=ro(0),p=co((()=>{
163
+ const e=u.current.clientHeight;d(e);o(e>n+a)}),[n,o,a]);ao((()=>{const e=function(e,t){if("undefined"!=typeof ResizeObserver){const n=new ResizeObserver((()=>t(e.clientWidth,e.clientHeight)));return n.observe(e),()=>n.disconnect()}const n=new ya;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 _o("div",{className:"Excerpt",style:g,children:[_o("div",{className:"Excerpt__content",ref:u,children:e}),_o("div",{role:"presentation",onClick:()=>v(!1),className:Yr({Excerpt__shadow:!0,"Excerpt__shadow--transparent":r,"is-hidden":!f}),title:"Show the full excerpt"}),m&&r&&_o(Oa,{isCollapsed:l,setCollapsed:v,
164
+ linkStyle:si(["selectionFontFamily"],s)})]})}),["settings"]);function Ra(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 Da(e){const t=/(\d+)([hms]?)/g,n={h:3600,m:60,s:1};let r,o=0;for(;null!==(r=t.exec(e));)r[2]?o+=Number(r[1])*n[r[2]]:o+=+r[1];return o.toString()}function Ba(e,t){const n=function(e){const t=["end","start","t"],n=new URLSearchParams(e.search),r=new URLSearchParams;for(let[e,o]of n)t.includes(e)&&("t"===e?r.append("start",Da(o)):r.append(e,o));r.sort();let o=r.toString();return o&&(o=`?${o}`),o}(t);return Ra(`https://www.youtube.com/embed/${e}${n}`)}function Fa(e,t,n,{aspectRatio:r}={}){return o=>{if(o.hostname!==e)return null
165
+ ;const i=t.exec(o.pathname);if(!i)return null;const a=i[1];return Ra(n(a),r)}}const ja=[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?Ba(t[1],e):null},function(e){if("youtu.be"!==e.hostname)return null;const t=/^\/([^/]+)\/?$/.exec(e.pathname);return t?Ba(t[1],e):null},Fa("vimeo.com",/^\/([^/?#]+)\/?$/,(e=>`https://player.vimeo.com/video/${e}`)),Fa("vimeo.com",/^\/channels\/[^/]+\/([^/?#]+)\/?$/,(e=>`https://player.vimeo.com/video/${e}`)),Fa("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;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],""))}
166
+ const a=new URL(`https://archive.org/embed/${n}`);return o&&a.searchParams.append("start",o),i&&a.searchParams.append("end",i),Ra(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 Ha(e){if(e.href!==e.textContent&&decodeURI(e.href)!==e.textContent)return null;const t=function(e){let t,n;for(n=0;n<ja.length;n++)if(t=ja[n](e),t)return t;return null}(e);return t&&e.parentElement.replaceChild(t,e),t}var qa=Object.hasOwnProperty,Ua=Object.setPrototypeOf,$a=Object.isFrozen,Ga=Object.getPrototypeOf,Va=Object.getOwnPropertyDescriptor,Wa=Object.freeze,Ya=Object.seal,Ka=Object.create,Xa="undefined"!=typeof Reflect&&Reflect,Za=Xa.apply,Ja=Xa.construct;Za||(Za=function(e,t,n){return e.apply(t,n)}),Wa||(Wa=function(e){return e}),Ya||(Ya=function(e){return e}),Ja||(Ja=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){
167
+ if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t))))});var Qa,es=us(Array.prototype.forEach),ts=us(Array.prototype.pop),ns=us(Array.prototype.push),rs=us(String.prototype.toLowerCase),os=us(String.prototype.match),is=us(String.prototype.replace),as=us(String.prototype.indexOf),ss=us(String.prototype.trim),ls=us(RegExp.prototype.test),cs=(Qa=TypeError,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return Ja(Qa,t)});function us(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Za(e,t,r)}}function hs(e,t){Ua&&Ua(e,null);for(var n=t.length;n--;){var r=t[n];if("string"==typeof r){var o=rs(r);o!==r&&($a(t)||(t[n]=o),r=o)}e[r]=!0}return e}function ds(e){var t=Ka(null),n=void 0;for(n in e)Za(qa,e,[n])&&(t[n]=e[n]);return t}function ps(e,t){for(;null!==e;){var n=Va(e,t);if(n){if(n.get)return us(n.get);if("function"==typeof n.value)return us(n.value)}e=Ga(e)}
167
168
  return function(e){return console.warn("fallback value for",e),null}}
168
- var ds=Ga(["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"]),ps=Ga(["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"]),ms=Ga(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),fs=Ga(["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"]),gs=Ga(["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"]),vs=Ga(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ys=Ga(["#text"]),_s=Ga(["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"]),bs=Ga(["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"]),ws=Ga(["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"]),xs=Ga(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ks=Va(/\{\{[\s\S]*|[\s\S]*\}\}/gm),Ss=Va(/<%[\s\S]*|[\s\S]*%>/gm),Cs=Va(/^data-[\-\w.\u00B7-\uFFFF]/),As=Va(/^aria-[\-\w]+$/),Es=Va(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ts=Va(/^(?:\w+script|data):/i),Ns=Va(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ls=Va(/^html$/i),Ms="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){
169
- return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function zs(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var Os=function(){return"undefined"==typeof window?null:window},Is=function(e,t){if("object"!==(void 0===e?"undefined":Ms(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 Rs=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Os(),n=function(t){return e(t)};if(n.version="2.3.6",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n
170
- ;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=hs(f,"cloneNode"),v=hs(f,"nextSibling"),y=hs(f,"childNodes"),_=hs(f,"parentNode");if("function"==typeof a){var b=o.createElement("template");b.content&&b.content.ownerDocument&&(o=b.content.ownerDocument)}var w=Is(m,r),x=w?w.createHTML(""):"",k=o,S=k.implementation,C=k.createNodeIterator,A=k.createDocumentFragment,E=k.getElementsByTagName,T=r.importNode,N={};try{N=us(o).documentMode?o.documentMode:{}}catch(e){}var L={};n.isSupported="function"==typeof _&&S&&void 0!==S.createHTMLDocument&&9!==N;var M=ks,z=Ss,O=Cs,I=As,R=Ts,P=Ns,D=Es,B=null,F=cs({},[].concat(zs(ds),zs(ps),zs(ms),zs(gs),zs(ys))),j=null,H=cs({},[].concat(zs(_s),zs(bs),zs(ws),zs(xs))),q=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{
171
- writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),U=null,$=null,G=!0,V=!0,W=!1,Y=!1,K=!1,X=!1,Z=!1,J=!1,Q=!1,ee=!1,te=!0,ne=!0,re=!1,oe={},ie=null,ae=cs({},["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"]),se=null,le=cs({},["audio","video","img","source","image","track"]),ce=null,ue=cs({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),he="http://www.w3.org/1998/Math/MathML",de="http://www.w3.org/2000/svg",pe="http://www.w3.org/1999/xhtml",me=pe,fe=!1,ge=void 0,ve=["application/xhtml+xml","text/html"],ye="text/html",_e=void 0,be=null,we=o.createElement("form"),xe=function(e){return e instanceof RegExp||e instanceof Function},ke=function(e){
172
- be&&be===e||(e&&"object"===(void 0===e?"undefined":Ms(e))||(e={}),e=us(e),B="ALLOWED_TAGS"in e?cs({},e.ALLOWED_TAGS):F,j="ALLOWED_ATTR"in e?cs({},e.ALLOWED_ATTR):H,ce="ADD_URI_SAFE_ATTR"in e?cs(us(ue),e.ADD_URI_SAFE_ATTR):ue,se="ADD_DATA_URI_TAGS"in e?cs(us(le),e.ADD_DATA_URI_TAGS):le,ie="FORBID_CONTENTS"in e?cs({},e.FORBID_CONTENTS):ae,U="FORBID_TAGS"in e?cs({},e.FORBID_TAGS):{},$="FORBID_ATTR"in e?cs({},e.FORBID_ATTR):{},oe="USE_PROFILES"in e&&e.USE_PROFILES,G=!1!==e.ALLOW_ARIA_ATTR,V=!1!==e.ALLOW_DATA_ATTR,W=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Y=e.SAFE_FOR_TEMPLATES||!1,K=e.WHOLE_DOCUMENT||!1,J=e.RETURN_DOM||!1,Q=e.RETURN_DOM_FRAGMENT||!1,ee=e.RETURN_TRUSTED_TYPE||!1,Z=e.FORCE_BODY||!1,te=!1!==e.SANITIZE_DOM,ne=!1!==e.KEEP_CONTENT,re=e.IN_PLACE||!1,D=e.ALLOWED_URI_REGEXP||D,me=e.NAMESPACE||pe,e.CUSTOM_ELEMENT_HANDLING&&xe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(q.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),
173
- e.CUSTOM_ELEMENT_HANDLING&&xe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(q.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(q.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ge=ge=-1===ve.indexOf(e.PARSER_MEDIA_TYPE)?ye:e.PARSER_MEDIA_TYPE,_e="application/xhtml+xml"===ge?function(e){return e}:ts,Y&&(V=!1),Q&&(J=!0),oe&&(B=cs({},[].concat(zs(ys))),j=[],!0===oe.html&&(cs(B,ds),cs(j,_s)),!0===oe.svg&&(cs(B,ps),cs(j,bs),cs(j,xs)),!0===oe.svgFilters&&(cs(B,ms),cs(j,bs),cs(j,xs)),!0===oe.mathMl&&(cs(B,gs),cs(j,ws),cs(j,xs))),e.ADD_TAGS&&(B===F&&(B=us(B)),cs(B,e.ADD_TAGS)),e.ADD_ATTR&&(j===H&&(j=us(j)),cs(j,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&cs(ce,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(ie===ae&&(ie=us(ie)),cs(ie,e.FORBID_CONTENTS)),ne&&(B["#text"]=!0),K&&cs(B,["html","head","body"]),B.table&&(cs(B,["tbody"]),delete U.tbody),Ga&&Ga(e),be=e)
174
- },Se=cs({},["mi","mo","mn","ms","mtext"]),Ce=cs({},["foreignobject","desc","title","annotation-xml"]),Ae=cs({},ps);cs(Ae,ms),cs(Ae,fs);var Ee=cs({},gs);cs(Ee,vs);var Te=function(e){var t=_(e);t&&t.tagName||(t={namespaceURI:pe,tagName:"template"});var n=ts(e.tagName),r=ts(t.tagName);if(e.namespaceURI===de)return t.namespaceURI===pe?"svg"===n:t.namespaceURI===he?"svg"===n&&("annotation-xml"===r||Se[r]):Boolean(Ae[n]);if(e.namespaceURI===he)return t.namespaceURI===pe?"math"===n:t.namespaceURI===de?"math"===n&&Ce[r]:Boolean(Ee[n]);if(e.namespaceURI===pe){if(t.namespaceURI===de&&!Ce[r])return!1;if(t.namespaceURI===he&&!Se[r])return!1;var o=cs({},["title","style","font","a","script"]);return!Ee[n]&&(o[n]||!Ae[n])}return!1},Ne=function(e){es(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=x}catch(t){e.remove()}}},Le=function(e,t){try{es(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){es(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),
175
- "is"===e&&!j[e])if(J||Q)try{Ne(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Me=function(e){var t=void 0,n=void 0;if(Z)e="<remove></remove>"+e;else{var r=ns(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===ge&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=w?w.createHTML(e):e;if(me===pe)try{t=(new p).parseFromString(i,ge)}catch(e){}if(!t||!t.documentElement){t=S.createDocument(me,"template",null);try{t.documentElement.innerHTML=fe?"":i}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(o.createTextNode(n),a.childNodes[0]||null),me===pe?E.call(t,K?"html":"body")[0]:K?t.documentElement:a},ze=function(e){return C.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},Oe=function(e){
176
- 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)},Ie=function(e){return"object"===(void 0===s?"undefined":Ms(s))?e instanceof s:e&&"object"===(void 0===e?"undefined":Ms(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Re=function(e,t,r){L[e]&&Ja(L[e],(function(e){e.call(n,t,r,be)}))},Pe=function(e){var t=void 0;if(Re("beforeSanitizeElements",e,null),Oe(e))return Ne(e),!0;if(ns(e.nodeName,/[\u0080-\uFFFF]/))return Ne(e),!0;var r=_e(e.nodeName);if(Re("uponSanitizeElement",e,{tagName:r,allowedTags:B}),!Ie(e.firstElementChild)&&(!Ie(e.content)||!Ie(e.content.firstElementChild))&&as(/<[/\w]/g,e.innerHTML)&&as(/<[/\w]/g,e.textContent))return Ne(e),!0;if("select"===r&&as(/<template/i,e.innerHTML))return Ne(e),!0;if(!B[r]||U[r]){if(!U[r]&&Be(r)){
177
- if(q.tagNameCheck instanceof RegExp&&as(q.tagNameCheck,r))return!1;if(q.tagNameCheck instanceof Function&&q.tagNameCheck(r))return!1}if(ne&&!ie[r]){var o=_(e)||e.parentNode,i=y(e)||e.childNodes;if(i&&o)for(var a=i.length-1;a>=0;--a)o.insertBefore(g(i[a],!0),v(e))}return Ne(e),!0}return e instanceof l&&!Te(e)?(Ne(e),!0):"noscript"!==r&&"noembed"!==r||!as(/<\/no(script|embed)/i,e.innerHTML)?(Y&&3===e.nodeType&&(t=e.textContent,t=rs(t,M," "),t=rs(t,z," "),e.textContent!==t&&(es(n.removed,{element:e.cloneNode()}),e.textContent=t)),Re("afterSanitizeElements",e,null),!1):(Ne(e),!0)},De=function(e,t,n){if(te&&("id"===t||"name"===t)&&(n in o||n in we))return!1;if(V&&!$[t]&&as(O,t));else if(G&&as(I,t));else if(!j[t]||$[t]){
178
- if(!(Be(e)&&(q.tagNameCheck instanceof RegExp&&as(q.tagNameCheck,e)||q.tagNameCheck instanceof Function&&q.tagNameCheck(e))&&(q.attributeNameCheck instanceof RegExp&&as(q.attributeNameCheck,t)||q.attributeNameCheck instanceof Function&&q.attributeNameCheck(t))||"is"===t&&q.allowCustomizedBuiltInElements&&(q.tagNameCheck instanceof RegExp&&as(q.tagNameCheck,n)||q.tagNameCheck instanceof Function&&q.tagNameCheck(n))))return!1}else if(ce[t]);else if(as(D,rs(n,P,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==os(n,"data:")||!se[e]){if(W&&!as(R,rs(n,P,"")));else if(n)return!1}else;return!0},Be=function(e){return e.indexOf("-")>0},Fe=function(e){var t=void 0,r=void 0,o=void 0,i=void 0;Re("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j};for(i=a.length;i--;){var l=t=a[i],c=l.name,u=l.namespaceURI;if(r=is(t.value),o=_e(c),s.attrName=o,s.attrValue=r,s.keepAttr=!0,s.forceKeepAttr=void 0,Re("uponSanitizeAttribute",e,s),
179
- r=s.attrValue,!s.forceKeepAttr&&(Le(c,e),s.keepAttr))if(as(/\/>/i,r))Le(c,e);else{Y&&(r=rs(r,M," "),r=rs(r,z," "));var h=_e(e.nodeName);if(De(h,o,r))try{u?e.setAttributeNS(u,c,r):e.setAttribute(c,r),Qa(n.removed)}catch(e){}}}Re("afterSanitizeAttributes",e,null)}},je=function e(t){var n=void 0,r=ze(t);for(Re("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)Re("uponSanitizeShadowNode",n,null),Pe(n)||(n.content instanceof i&&e(n.content),Fe(n));Re("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e,o){var a=void 0,l=void 0,c=void 0,u=void 0,h=void 0;if((fe=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ie(e)){if("function"!=typeof e.toString)throw ss("toString is not a function");if("string"!=typeof(e=e.toString()))throw ss("dirty is not a string, aborting")}if(!n.isSupported){if("object"===Ms(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(Ie(e))return t.toStaticHTML(e.outerHTML)}return e}if(X||ke(o),n.removed=[],"string"==typeof e&&(re=!1),re){
180
- if(e.nodeName){var d=_e(e.nodeName);if(!B[d]||U[d])throw ss("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof s)1===(l=(a=Me("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?a=l:a.appendChild(l);else{if(!J&&!Y&&!K&&-1===e.indexOf("<"))return w&&ee?w.createHTML(e):e;if(!(a=Me(e)))return J?null:ee?x:""}a&&Z&&Ne(a.firstChild);for(var p=ze(re?e:a);c=p.nextNode();)3===c.nodeType&&c===u||Pe(c)||(c.content instanceof i&&je(c.content),Fe(c),u=c);if(u=null,re)return e;if(J){if(Q)for(h=A.call(a.ownerDocument);a.firstChild;)h.appendChild(a.firstChild);else h=a;return j.shadowroot&&(h=T.call(r,h,!0)),h}var m=K?a.outerHTML:a.innerHTML;return K&&B["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&as(Ls,a.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+a.ownerDocument.doctype.name+">\n"+m),Y&&(m=rs(m,M," "),m=rs(m,z," ")),w&&ee?w.createHTML(m):m},n.setConfig=function(e){ke(e),X=!0},n.clearConfig=function(){
181
- be=null,X=!1},n.isValidAttribute=function(e,t,n){be||ke({});var r=_e(e),o=_e(t);return De(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(L[e]=L[e]||[],es(L[e],t))},n.removeHook=function(e){L[e]&&Qa(L[e])},n.removeHooks=function(e){L[e]&&(L[e]=[])},n.removeAllHooks=function(){L={}},n}(),Ps=/["'&<>]/,Ds=function(e){var t,n=""+e,r=Ps.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="&quot;";break;case 38:t="&amp;";break;case 39:t="&#39;";break;case 60:t="&lt;";break;case 62:t="&gt;";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 Bs{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new Bs(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class Fs{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}
182
- range(e,t){return new Fs(t,Bs.range(this,e))}}class js{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__=js.prototype,l.position=n,l}}js.prototype.__proto__=Error.prototype;var Hs=/([A-Z])/g,qs={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},Us=/[&><"']/g;var $s=function e(t){return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},Gs={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(Us,(e=>qs[e]))},hyphenate:function(e){return e.replace(Hs,"-$1").toLowerCase()},getBaseElem:$s,isCharacterBox:function(e){var t=$s(e)
183
- ;return"mathord"===t.type||"textord"===t.type||"atom"===t.type},protocolFromUrl:function(e){var t=/^\s*([^\\/#]*?)(?::|&#0*58|&#x0*3a)/i.exec(e);return null!=t?t[1]:"_relative"}},Vs={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",
169
+ var ms=Wa(["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"]),fs=Wa(["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"]),gs=Wa(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),vs=Wa(["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"]),ys=Wa(["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"]),_s=Wa(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),bs=Wa(["#text"]),ws=Wa(["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"]),xs=Wa(["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"]),ks=Wa(["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"]),Ss=Wa(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Cs=Ya(/\{\{[\s\S]*|[\s\S]*\}\}/gm),As=Ya(/<%[\s\S]*|[\s\S]*%>/gm),Es=Ya(/^data-[\-\w.\u00B7-\uFFFF]/),Ts=Ya(/^aria-[\-\w]+$/),Ns=Ya(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ms=Ya(/^(?:\w+script|data):/i),Ls=Ya(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),zs=Ya(/^html$/i),Os="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){
170
+ return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function Is(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var Ps=function(){return"undefined"==typeof window?null:window},Rs=function(e,t){if("object"!==(void 0===e?"undefined":Os(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 Ds=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ps(),n=function(t){return e(t)};if(n.version="2.3.6",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n
171
+ ;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=ps(f,"cloneNode"),v=ps(f,"nextSibling"),y=ps(f,"childNodes"),_=ps(f,"parentNode");if("function"==typeof a){var b=o.createElement("template");b.content&&b.content.ownerDocument&&(o=b.content.ownerDocument)}var w=Rs(m,r),x=w?w.createHTML(""):"",k=o,S=k.implementation,C=k.createNodeIterator,A=k.createDocumentFragment,E=k.getElementsByTagName,T=r.importNode,N={};try{N=ds(o).documentMode?o.documentMode:{}}catch(e){}var M={};n.isSupported="function"==typeof _&&S&&void 0!==S.createHTMLDocument&&9!==N;var L=Cs,z=As,O=Es,I=Ts,P=Ms,R=Ls,D=Ns,B=null,F=hs({},[].concat(Is(ms),Is(fs),Is(gs),Is(ys),Is(bs))),j=null,H=hs({},[].concat(Is(ws),Is(xs),Is(ks),Is(Ss))),q=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{
172
+ writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),U=null,$=null,G=!0,V=!0,W=!1,Y=!1,K=!1,X=!1,Z=!1,J=!1,Q=!1,ee=!1,te=!0,ne=!0,re=!1,oe={},ie=null,ae=hs({},["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"]),se=null,le=hs({},["audio","video","img","source","image","track"]),ce=null,ue=hs({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),he="http://www.w3.org/1998/Math/MathML",de="http://www.w3.org/2000/svg",pe="http://www.w3.org/1999/xhtml",me=pe,fe=!1,ge=void 0,ve=["application/xhtml+xml","text/html"],ye="text/html",_e=void 0,be=null,we=o.createElement("form"),xe=function(e){return e instanceof RegExp||e instanceof Function},ke=function(e){
173
+ be&&be===e||(e&&"object"===(void 0===e?"undefined":Os(e))||(e={}),e=ds(e),B="ALLOWED_TAGS"in e?hs({},e.ALLOWED_TAGS):F,j="ALLOWED_ATTR"in e?hs({},e.ALLOWED_ATTR):H,ce="ADD_URI_SAFE_ATTR"in e?hs(ds(ue),e.ADD_URI_SAFE_ATTR):ue,se="ADD_DATA_URI_TAGS"in e?hs(ds(le),e.ADD_DATA_URI_TAGS):le,ie="FORBID_CONTENTS"in e?hs({},e.FORBID_CONTENTS):ae,U="FORBID_TAGS"in e?hs({},e.FORBID_TAGS):{},$="FORBID_ATTR"in e?hs({},e.FORBID_ATTR):{},oe="USE_PROFILES"in e&&e.USE_PROFILES,G=!1!==e.ALLOW_ARIA_ATTR,V=!1!==e.ALLOW_DATA_ATTR,W=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Y=e.SAFE_FOR_TEMPLATES||!1,K=e.WHOLE_DOCUMENT||!1,J=e.RETURN_DOM||!1,Q=e.RETURN_DOM_FRAGMENT||!1,ee=e.RETURN_TRUSTED_TYPE||!1,Z=e.FORCE_BODY||!1,te=!1!==e.SANITIZE_DOM,ne=!1!==e.KEEP_CONTENT,re=e.IN_PLACE||!1,D=e.ALLOWED_URI_REGEXP||D,me=e.NAMESPACE||pe,e.CUSTOM_ELEMENT_HANDLING&&xe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(q.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),
174
+ e.CUSTOM_ELEMENT_HANDLING&&xe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(q.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(q.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ge=ge=-1===ve.indexOf(e.PARSER_MEDIA_TYPE)?ye:e.PARSER_MEDIA_TYPE,_e="application/xhtml+xml"===ge?function(e){return e}:rs,Y&&(V=!1),Q&&(J=!0),oe&&(B=hs({},[].concat(Is(bs))),j=[],!0===oe.html&&(hs(B,ms),hs(j,ws)),!0===oe.svg&&(hs(B,fs),hs(j,xs),hs(j,Ss)),!0===oe.svgFilters&&(hs(B,gs),hs(j,xs),hs(j,Ss)),!0===oe.mathMl&&(hs(B,ys),hs(j,ks),hs(j,Ss))),e.ADD_TAGS&&(B===F&&(B=ds(B)),hs(B,e.ADD_TAGS)),e.ADD_ATTR&&(j===H&&(j=ds(j)),hs(j,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&hs(ce,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(ie===ae&&(ie=ds(ie)),hs(ie,e.FORBID_CONTENTS)),ne&&(B["#text"]=!0),K&&hs(B,["html","head","body"]),B.table&&(hs(B,["tbody"]),delete U.tbody),Wa&&Wa(e),be=e)
175
+ },Se=hs({},["mi","mo","mn","ms","mtext"]),Ce=hs({},["foreignobject","desc","title","annotation-xml"]),Ae=hs({},fs);hs(Ae,gs),hs(Ae,vs);var Ee=hs({},ys);hs(Ee,_s);var Te=function(e){var t=_(e);t&&t.tagName||(t={namespaceURI:pe,tagName:"template"});var n=rs(e.tagName),r=rs(t.tagName);if(e.namespaceURI===de)return t.namespaceURI===pe?"svg"===n:t.namespaceURI===he?"svg"===n&&("annotation-xml"===r||Se[r]):Boolean(Ae[n]);if(e.namespaceURI===he)return t.namespaceURI===pe?"math"===n:t.namespaceURI===de?"math"===n&&Ce[r]:Boolean(Ee[n]);if(e.namespaceURI===pe){if(t.namespaceURI===de&&!Ce[r])return!1;if(t.namespaceURI===he&&!Se[r])return!1;var o=hs({},["title","style","font","a","script"]);return!Ee[n]&&(o[n]||!Ae[n])}return!1},Ne=function(e){ns(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=x}catch(t){e.remove()}}},Me=function(e,t){try{ns(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){ns(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),
176
+ "is"===e&&!j[e])if(J||Q)try{Ne(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Le=function(e){var t=void 0,n=void 0;if(Z)e="<remove></remove>"+e;else{var r=os(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===ge&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=w?w.createHTML(e):e;if(me===pe)try{t=(new p).parseFromString(i,ge)}catch(e){}if(!t||!t.documentElement){t=S.createDocument(me,"template",null);try{t.documentElement.innerHTML=fe?"":i}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(o.createTextNode(n),a.childNodes[0]||null),me===pe?E.call(t,K?"html":"body")[0]:K?t.documentElement:a},ze=function(e){return C.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},Oe=function(e){
177
+ 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)},Ie=function(e){return"object"===(void 0===s?"undefined":Os(s))?e instanceof s:e&&"object"===(void 0===e?"undefined":Os(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Pe=function(e,t,r){M[e]&&es(M[e],(function(e){e.call(n,t,r,be)}))},Re=function(e){var t=void 0;if(Pe("beforeSanitizeElements",e,null),Oe(e))return Ne(e),!0;if(os(e.nodeName,/[\u0080-\uFFFF]/))return Ne(e),!0;var r=_e(e.nodeName);if(Pe("uponSanitizeElement",e,{tagName:r,allowedTags:B}),!Ie(e.firstElementChild)&&(!Ie(e.content)||!Ie(e.content.firstElementChild))&&ls(/<[/\w]/g,e.innerHTML)&&ls(/<[/\w]/g,e.textContent))return Ne(e),!0;if("select"===r&&ls(/<template/i,e.innerHTML))return Ne(e),!0;if(!B[r]||U[r]){if(!U[r]&&Be(r)){
178
+ if(q.tagNameCheck instanceof RegExp&&ls(q.tagNameCheck,r))return!1;if(q.tagNameCheck instanceof Function&&q.tagNameCheck(r))return!1}if(ne&&!ie[r]){var o=_(e)||e.parentNode,i=y(e)||e.childNodes;if(i&&o)for(var a=i.length-1;a>=0;--a)o.insertBefore(g(i[a],!0),v(e))}return Ne(e),!0}return e instanceof l&&!Te(e)?(Ne(e),!0):"noscript"!==r&&"noembed"!==r||!ls(/<\/no(script|embed)/i,e.innerHTML)?(Y&&3===e.nodeType&&(t=e.textContent,t=is(t,L," "),t=is(t,z," "),e.textContent!==t&&(ns(n.removed,{element:e.cloneNode()}),e.textContent=t)),Pe("afterSanitizeElements",e,null),!1):(Ne(e),!0)},De=function(e,t,n){if(te&&("id"===t||"name"===t)&&(n in o||n in we))return!1;if(V&&!$[t]&&ls(O,t));else if(G&&ls(I,t));else if(!j[t]||$[t]){
179
+ if(!(Be(e)&&(q.tagNameCheck instanceof RegExp&&ls(q.tagNameCheck,e)||q.tagNameCheck instanceof Function&&q.tagNameCheck(e))&&(q.attributeNameCheck instanceof RegExp&&ls(q.attributeNameCheck,t)||q.attributeNameCheck instanceof Function&&q.attributeNameCheck(t))||"is"===t&&q.allowCustomizedBuiltInElements&&(q.tagNameCheck instanceof RegExp&&ls(q.tagNameCheck,n)||q.tagNameCheck instanceof Function&&q.tagNameCheck(n))))return!1}else if(ce[t]);else if(ls(D,is(n,R,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==as(n,"data:")||!se[e]){if(W&&!ls(P,is(n,R,"")));else if(n)return!1}else;return!0},Be=function(e){return e.indexOf("-")>0},Fe=function(e){var t=void 0,r=void 0,o=void 0,i=void 0;Pe("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j};for(i=a.length;i--;){var l=t=a[i],c=l.name,u=l.namespaceURI;if(r=ss(t.value),o=_e(c),s.attrName=o,s.attrValue=r,s.keepAttr=!0,s.forceKeepAttr=void 0,Pe("uponSanitizeAttribute",e,s),
180
+ r=s.attrValue,!s.forceKeepAttr&&(Me(c,e),s.keepAttr))if(ls(/\/>/i,r))Me(c,e);else{Y&&(r=is(r,L," "),r=is(r,z," "));var h=_e(e.nodeName);if(De(h,o,r))try{u?e.setAttributeNS(u,c,r):e.setAttribute(c,r),ts(n.removed)}catch(e){}}}Pe("afterSanitizeAttributes",e,null)}},je=function e(t){var n=void 0,r=ze(t);for(Pe("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)Pe("uponSanitizeShadowNode",n,null),Re(n)||(n.content instanceof i&&e(n.content),Fe(n));Pe("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e,o){var a=void 0,l=void 0,c=void 0,u=void 0,h=void 0;if((fe=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ie(e)){if("function"!=typeof e.toString)throw cs("toString is not a function");if("string"!=typeof(e=e.toString()))throw cs("dirty is not a string, aborting")}if(!n.isSupported){if("object"===Os(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(Ie(e))return t.toStaticHTML(e.outerHTML)}return e}if(X||ke(o),n.removed=[],"string"==typeof e&&(re=!1),re){
181
+ if(e.nodeName){var d=_e(e.nodeName);if(!B[d]||U[d])throw cs("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof s)1===(l=(a=Le("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?a=l:a.appendChild(l);else{if(!J&&!Y&&!K&&-1===e.indexOf("<"))return w&&ee?w.createHTML(e):e;if(!(a=Le(e)))return J?null:ee?x:""}a&&Z&&Ne(a.firstChild);for(var p=ze(re?e:a);c=p.nextNode();)3===c.nodeType&&c===u||Re(c)||(c.content instanceof i&&je(c.content),Fe(c),u=c);if(u=null,re)return e;if(J){if(Q)for(h=A.call(a.ownerDocument);a.firstChild;)h.appendChild(a.firstChild);else h=a;return j.shadowroot&&(h=T.call(r,h,!0)),h}var m=K?a.outerHTML:a.innerHTML;return K&&B["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&ls(zs,a.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+a.ownerDocument.doctype.name+">\n"+m),Y&&(m=is(m,L," "),m=is(m,z," ")),w&&ee?w.createHTML(m):m},n.setConfig=function(e){ke(e),X=!0},n.clearConfig=function(){
182
+ be=null,X=!1},n.isValidAttribute=function(e,t,n){be||ke({});var r=_e(e),o=_e(t);return De(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(M[e]=M[e]||[],ns(M[e],t))},n.removeHook=function(e){M[e]&&ts(M[e])},n.removeHooks=function(e){M[e]&&(M[e]=[])},n.removeAllHooks=function(){M={}},n}(),Bs=/["'&<>]/,Fs=function(e){var t,n=""+e,r=Bs.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="&quot;";break;case 38:t="&amp;";break;case 39:t="&#39;";break;case 60:t="&lt;";break;case 62:t="&gt;";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 js{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new js(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class Hs{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}
183
+ range(e,t){return new Hs(t,js.range(this,e))}}class qs{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__=qs.prototype,l.position=n,l}}qs.prototype.__proto__=Error.prototype;var Us=/([A-Z])/g,$s={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},Gs=/[&><"']/g;var Vs=function e(t){return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},Ws={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(Gs,(e=>$s[e]))},hyphenate:function(e){return e.replace(Us,"-$1").toLowerCase()},getBaseElem:Vs,isCharacterBox:function(e){var t=Vs(e)
184
+ ;return"mathord"===t.type||"textord"===t.type||"atom"===t.type},protocolFromUrl:function(e){var t=/^\s*([^\\/#]*?)(?::|&#0*58|&#x0*3a)/i.exec(e);return null!=t?t[1]:"_relative"}},Ys={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",
184
185
  cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],
185
- description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function Ws(e){if(e.default)return e.default
186
- ;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 Ys{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||{},Vs)if(Vs.hasOwnProperty(t)){var n=Vs[t];this[t]=void 0!==e[t]?n.processor?n.processor(e[t]):e[t]:Ws(n)}}reportNonstrict(e,t,n){var r=this.strict;if("function"==typeof r&&(r=r(e,t,n)),r&&"ignore"!==r){if(!0===r||"error"===r)throw new js("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n)
187
- ;"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=Gs.protocolFromUrl(e.url));var t="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(t)}}class Ks{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 Xs[Zs[this.id]]}sub(){return Xs[Js[this.id]]}fracNum(){
188
- return Xs[Qs[this.id]]}fracDen(){return Xs[el[this.id]]}cramp(){return Xs[tl[this.id]]}text(){return Xs[nl[this.id]]}isTight(){return this.size>=2}}var Xs=[new Ks(0,0,!1),new Ks(1,0,!0),new Ks(2,1,!1),new Ks(3,1,!0),new Ks(4,2,!1),new Ks(5,2,!0),new Ks(6,3,!1),new Ks(7,3,!0)],Zs=[4,5,4,5,6,7,6,7],Js=[5,5,5,5,7,7,7,7],Qs=[2,3,4,5,6,7,6,7],el=[3,3,5,5,7,7,7,7],tl=[1,1,3,3,5,5,7,7],nl=[0,1,2,3,2,3,2,3],rl={DISPLAY:Xs[0],TEXT:Xs[2],SCRIPT:Xs[4],SCRIPTSCRIPT:Xs[6]},ol=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];var il=[];function al(e){for(var t=0;t<il.length;t+=2)if(e>=il[t]&&e<=il[t+1])return!0;return!1}ol.forEach((e=>e.blocks.forEach((e=>il.push(...e)))));var sl={
186
+ description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function Ks(e){if(e.default)return e.default
187
+ ;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 Xs{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||{},Ys)if(Ys.hasOwnProperty(t)){var n=Ys[t];this[t]=void 0!==e[t]?n.processor?n.processor(e[t]):e[t]:Ks(n)}}reportNonstrict(e,t,n){var r=this.strict;if("function"==typeof r&&(r=r(e,t,n)),r&&"ignore"!==r){if(!0===r||"error"===r)throw new qs("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n)
188
+ ;"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=Ws.protocolFromUrl(e.url));var t="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(t)}}class Zs{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 Js[Qs[this.id]]}sub(){return Js[el[this.id]]}fracNum(){
189
+ return Js[tl[this.id]]}fracDen(){return Js[nl[this.id]]}cramp(){return Js[rl[this.id]]}text(){return Js[ol[this.id]]}isTight(){return this.size>=2}}var Js=[new Zs(0,0,!1),new Zs(1,0,!0),new Zs(2,1,!1),new Zs(3,1,!0),new Zs(4,2,!1),new Zs(5,2,!0),new Zs(6,3,!1),new Zs(7,3,!0)],Qs=[4,5,4,5,6,7,6,7],el=[5,5,5,5,7,7,7,7],tl=[2,3,4,5,6,7,6,7],nl=[3,3,5,5,7,7,7,7],rl=[1,1,3,3,5,5,7,7],ol=[0,1,2,3,2,3,2,3],il={DISPLAY:Js[0],TEXT:Js[2],SCRIPT:Js[4],SCRIPTSCRIPT:Js[6]},al=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];var sl=[];function ll(e){for(var t=0;t<sl.length;t+=2)if(e>=sl[t]&&e<=sl[t+1])return!0;return!1}al.forEach((e=>e.blocks.forEach((e=>sl.push(...e)))));var cl={
189
190
  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",
190
191
  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",
191
192
  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",
@@ -205,7 +206,7 @@ widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,
205
206
  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",
206
207
  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",
207
208
  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",
208
- 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 ll{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 Gs.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 cl={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],
209
+ 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 ul{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 Ws.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 hl={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],
209
210
  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],
210
211
  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],
211
212
  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],
@@ -262,186 +263,186 @@ shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,
262
263
  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],
263
264
  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],
264
265
  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],
265
- 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]}},ul={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],
266
- 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]},hl={"Å":"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",
267
- "а":"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 dl(e,t,n){if(!cl[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),o=cl[t][r];if(!o&&e[0]in hl&&(r=hl[e[0]].charCodeAt(0),o=cl[t][r]),o||"text"!==n||al(r)&&(o=cl[t][77]),o)return{depth:o[0],height:o[1],italic:o[2],skew:o[3],width:o[4]}}var pl={};var ml=[[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]],fl=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],gl=function(e,t){return t.size<2?e:ml[e-1][t.size-1]};class vl{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,
268
- this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||vl.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=fl[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 vl(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:gl(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,
269
- textSize:e,sizeMultiplier:fl[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=gl(vl.BASESIZE,e);return this.size===t&&this.textSize===vl.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!==vl.BASESIZE?["sizing","reset-size"+this.size,"size"+vl.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!pl[t=e>=5?0:e>=3?1:2]){var n=pl[t]={
270
- cssEmPerMu:ul.quad[t]/18};for(var r in ul)ul.hasOwnProperty(r)&&(n[r]=ul[r][t])}return pl[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}vl.BASESIZE=6;var yl={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},_l={ex:!0,em:!0,mu:!0},bl=function(e){return"string"!=typeof e&&(e=e.unit),e in yl||e in _l||"ex"===e},wl=function(e,t){var n;if(e.unit in yl)n=yl[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 js("Invalid unit: '"+e.unit+"'");n=r.fontMetrics().quad}r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},xl=function(e){return+e.toFixed(4)+"em"},kl=function(e){return e.filter((e=>e)).join(" ")},Sl=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,
271
- 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)}},Cl=function(e){var t=document.createElement(e);for(var n in t.className=kl(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},Al=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+Gs.escape(kl(this.classes))+'"');var n="";for(var r in this.style)this.style.hasOwnProperty(r)&&(n+=Gs.hyphenate(r)+":"+this.style[r]+";");for(var o in n&&(t+=' style="'+Gs.escape(n)+'"'),this.attributes)this.attributes.hasOwnProperty(o)&&(t+=" "+o+'="'+Gs.escape(this.attributes[o])+'"');t+=">";for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup();return t+="</"+e+">"};class El{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,
272
- this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,Sl.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return Gs.contains(this.classes,e)}toNode(){return Cl.call(this,"span")}toMarkup(){return Al.call(this,"span")}}class Tl{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,Sl.call(this,t,r),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return Gs.contains(this.classes,e)}toNode(){return Cl.call(this,"a")}toMarkup(){return Al.call(this,"a")}}class Nl{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 Gs.contains(this.classes,e)}toNode(){var e=document.createElement("img")
273
- ;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+=Gs.hyphenate(n)+":"+this.style[n]+";");return t&&(e+=' style="'+Gs.escape(t)+'"'),e+="'/>"}}var Ll={"î":"ı̂","ï":"ı̈","í":"ı́","ì":"ı̀"};class Ml{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<ol.length;t++)for(var n=ol[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"),
274
- /[îïíì]/.test(this.text)&&(this.text=Ll[this.text])}hasClass(e){return Gs.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=xl(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=kl(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+=Gs.escape(kl(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+=Gs.hyphenate(r)+":"+this.style[r]+";");n&&(e=!0,t+=' style="'+Gs.escape(n)+'"');var o=Gs.escape(this.text);return e?(t+=">",t+=o,t+="</span>"):o}}class zl{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){
275
- 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 Ol{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",sl[this.pathName]),e}toMarkup(){return this.alternate?"<path d='"+this.alternate+"'/>":"<path d='"+sl[this.pathName]+"'/>"}}class Il{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){
276
- 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 Rl(e){if(e instanceof Ml)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}var Pl={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Dl={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Bl={math:{},text:{}};function Fl(e,t,n,r,o,i){Bl[e][o]={font:t,group:n,replace:r},i&&r&&(Bl[e][r]=Bl[e][o])}var jl="math",Hl="text",ql="main",Ul="ams",$l="accent-token",Gl="bin",Vl="close",Wl="mathord",Yl="op-token",Kl="open",Xl="rel",Zl="textord";Fl(jl,ql,Xl,"≡","\\equiv",!0),Fl(jl,ql,Xl,"≺","\\prec",!0),Fl(jl,ql,Xl,"≻","\\succ",!0),Fl(jl,ql,Xl,"∼","\\sim",!0),Fl(jl,ql,Xl,"⊥","\\perp"),Fl(jl,ql,Xl,"⪯","\\preceq",!0),
277
- Fl(jl,ql,Xl,"⪰","\\succeq",!0),Fl(jl,ql,Xl,"≃","\\simeq",!0),Fl(jl,ql,Xl,"∣","\\mid",!0),Fl(jl,ql,Xl,"≪","\\ll",!0),Fl(jl,ql,Xl,"≫","\\gg",!0),Fl(jl,ql,Xl,"≍","\\asymp",!0),Fl(jl,ql,Xl,"∥","\\parallel"),Fl(jl,ql,Xl,"⋈","\\bowtie",!0),Fl(jl,ql,Xl,"⌣","\\smile",!0),Fl(jl,ql,Xl,"⊑","\\sqsubseteq",!0),Fl(jl,ql,Xl,"⊒","\\sqsupseteq",!0),Fl(jl,ql,Xl,"≐","\\doteq",!0),Fl(jl,ql,Xl,"⌢","\\frown",!0),Fl(jl,ql,Xl,"∋","\\ni",!0),Fl(jl,ql,Xl,"∝","\\propto",!0),Fl(jl,ql,Xl,"⊢","\\vdash",!0),Fl(jl,ql,Xl,"⊣","\\dashv",!0),Fl(jl,ql,Xl,"∋","\\owns"),Fl(jl,ql,"punct",".","\\ldotp"),Fl(jl,ql,"punct","⋅","\\cdotp"),Fl(jl,ql,Zl,"#","\\#"),Fl(Hl,ql,Zl,"#","\\#"),Fl(jl,ql,Zl,"&","\\&"),Fl(Hl,ql,Zl,"&","\\&"),Fl(jl,ql,Zl,"ℵ","\\aleph",!0),Fl(jl,ql,Zl,"∀","\\forall",!0),Fl(jl,ql,Zl,"ℏ","\\hbar",!0),Fl(jl,ql,Zl,"∃","\\exists",!0),Fl(jl,ql,Zl,"∇","\\nabla",!0),Fl(jl,ql,Zl,"♭","\\flat",!0),Fl(jl,ql,Zl,"ℓ","\\ell",!0),Fl(jl,ql,Zl,"♮","\\natural",!0),Fl(jl,ql,Zl,"♣","\\clubsuit",!0),Fl(jl,ql,Zl,"℘","\\wp",!0),Fl(jl,ql,Zl,"♯","\\sharp",!0),
278
- Fl(jl,ql,Zl,"♢","\\diamondsuit",!0),Fl(jl,ql,Zl,"ℜ","\\Re",!0),Fl(jl,ql,Zl,"♡","\\heartsuit",!0),Fl(jl,ql,Zl,"ℑ","\\Im",!0),Fl(jl,ql,Zl,"♠","\\spadesuit",!0),Fl(jl,ql,Zl,"§","\\S",!0),Fl(Hl,ql,Zl,"§","\\S"),Fl(jl,ql,Zl,"¶","\\P",!0),Fl(Hl,ql,Zl,"¶","\\P"),Fl(jl,ql,Zl,"†","\\dag"),Fl(Hl,ql,Zl,"†","\\dag"),Fl(Hl,ql,Zl,"†","\\textdagger"),Fl(jl,ql,Zl,"‡","\\ddag"),Fl(Hl,ql,Zl,"‡","\\ddag"),Fl(Hl,ql,Zl,"‡","\\textdaggerdbl"),Fl(jl,ql,Vl,"⎱","\\rmoustache",!0),Fl(jl,ql,Kl,"⎰","\\lmoustache",!0),Fl(jl,ql,Vl,"⟯","\\rgroup",!0),Fl(jl,ql,Kl,"⟮","\\lgroup",!0),Fl(jl,ql,Gl,"∓","\\mp",!0),Fl(jl,ql,Gl,"⊖","\\ominus",!0),Fl(jl,ql,Gl,"⊎","\\uplus",!0),Fl(jl,ql,Gl,"⊓","\\sqcap",!0),Fl(jl,ql,Gl,"∗","\\ast"),Fl(jl,ql,Gl,"⊔","\\sqcup",!0),Fl(jl,ql,Gl,"◯","\\bigcirc",!0),Fl(jl,ql,Gl,"∙","\\bullet"),Fl(jl,ql,Gl,"‡","\\ddagger"),Fl(jl,ql,Gl,"≀","\\wr",!0),Fl(jl,ql,Gl,"⨿","\\amalg"),Fl(jl,ql,Gl,"&","\\And"),Fl(jl,ql,Xl,"⟵","\\longleftarrow",!0),Fl(jl,ql,Xl,"⇐","\\Leftarrow",!0),Fl(jl,ql,Xl,"⟸","\\Longleftarrow",!0),
279
- Fl(jl,ql,Xl,"⟶","\\longrightarrow",!0),Fl(jl,ql,Xl,"⇒","\\Rightarrow",!0),Fl(jl,ql,Xl,"⟹","\\Longrightarrow",!0),Fl(jl,ql,Xl,"↔","\\leftrightarrow",!0),Fl(jl,ql,Xl,"⟷","\\longleftrightarrow",!0),Fl(jl,ql,Xl,"⇔","\\Leftrightarrow",!0),Fl(jl,ql,Xl,"⟺","\\Longleftrightarrow",!0),Fl(jl,ql,Xl,"↦","\\mapsto",!0),Fl(jl,ql,Xl,"⟼","\\longmapsto",!0),Fl(jl,ql,Xl,"↗","\\nearrow",!0),Fl(jl,ql,Xl,"↩","\\hookleftarrow",!0),Fl(jl,ql,Xl,"↪","\\hookrightarrow",!0),Fl(jl,ql,Xl,"↘","\\searrow",!0),Fl(jl,ql,Xl,"↼","\\leftharpoonup",!0),Fl(jl,ql,Xl,"⇀","\\rightharpoonup",!0),Fl(jl,ql,Xl,"↙","\\swarrow",!0),Fl(jl,ql,Xl,"↽","\\leftharpoondown",!0),Fl(jl,ql,Xl,"⇁","\\rightharpoondown",!0),Fl(jl,ql,Xl,"↖","\\nwarrow",!0),Fl(jl,ql,Xl,"⇌","\\rightleftharpoons",!0),Fl(jl,Ul,Xl,"≮","\\nless",!0),Fl(jl,Ul,Xl,"","\\@nleqslant"),Fl(jl,Ul,Xl,"","\\@nleqq"),Fl(jl,Ul,Xl,"⪇","\\lneq",!0),Fl(jl,Ul,Xl,"≨","\\lneqq",!0),Fl(jl,Ul,Xl,"","\\@lvertneqq"),Fl(jl,Ul,Xl,"⋦","\\lnsim",!0),Fl(jl,Ul,Xl,"⪉","\\lnapprox",!0),Fl(jl,Ul,Xl,"⊀","\\nprec",!0),
280
- Fl(jl,Ul,Xl,"⋠","\\npreceq",!0),Fl(jl,Ul,Xl,"⋨","\\precnsim",!0),Fl(jl,Ul,Xl,"⪹","\\precnapprox",!0),Fl(jl,Ul,Xl,"≁","\\nsim",!0),Fl(jl,Ul,Xl,"","\\@nshortmid"),Fl(jl,Ul,Xl,"∤","\\nmid",!0),Fl(jl,Ul,Xl,"⊬","\\nvdash",!0),Fl(jl,Ul,Xl,"⊭","\\nvDash",!0),Fl(jl,Ul,Xl,"⋪","\\ntriangleleft"),Fl(jl,Ul,Xl,"⋬","\\ntrianglelefteq",!0),Fl(jl,Ul,Xl,"⊊","\\subsetneq",!0),Fl(jl,Ul,Xl,"","\\@varsubsetneq"),Fl(jl,Ul,Xl,"⫋","\\subsetneqq",!0),Fl(jl,Ul,Xl,"","\\@varsubsetneqq"),Fl(jl,Ul,Xl,"≯","\\ngtr",!0),Fl(jl,Ul,Xl,"","\\@ngeqslant"),Fl(jl,Ul,Xl,"","\\@ngeqq"),Fl(jl,Ul,Xl,"⪈","\\gneq",!0),Fl(jl,Ul,Xl,"≩","\\gneqq",!0),Fl(jl,Ul,Xl,"","\\@gvertneqq"),Fl(jl,Ul,Xl,"⋧","\\gnsim",!0),Fl(jl,Ul,Xl,"⪊","\\gnapprox",!0),Fl(jl,Ul,Xl,"⊁","\\nsucc",!0),Fl(jl,Ul,Xl,"⋡","\\nsucceq",!0),Fl(jl,Ul,Xl,"⋩","\\succnsim",!0),Fl(jl,Ul,Xl,"⪺","\\succnapprox",!0),Fl(jl,Ul,Xl,"≆","\\ncong",!0),Fl(jl,Ul,Xl,"","\\@nshortparallel"),Fl(jl,Ul,Xl,"∦","\\nparallel",!0),Fl(jl,Ul,Xl,"⊯","\\nVDash",!0),Fl(jl,Ul,Xl,"⋫","\\ntriangleright"),
281
- Fl(jl,Ul,Xl,"⋭","\\ntrianglerighteq",!0),Fl(jl,Ul,Xl,"","\\@nsupseteqq"),Fl(jl,Ul,Xl,"⊋","\\supsetneq",!0),Fl(jl,Ul,Xl,"","\\@varsupsetneq"),Fl(jl,Ul,Xl,"⫌","\\supsetneqq",!0),Fl(jl,Ul,Xl,"","\\@varsupsetneqq"),Fl(jl,Ul,Xl,"⊮","\\nVdash",!0),Fl(jl,Ul,Xl,"⪵","\\precneqq",!0),Fl(jl,Ul,Xl,"⪶","\\succneqq",!0),Fl(jl,Ul,Xl,"","\\@nsubseteqq"),Fl(jl,Ul,Gl,"⊴","\\unlhd"),Fl(jl,Ul,Gl,"⊵","\\unrhd"),Fl(jl,Ul,Xl,"↚","\\nleftarrow",!0),Fl(jl,Ul,Xl,"↛","\\nrightarrow",!0),Fl(jl,Ul,Xl,"⇍","\\nLeftarrow",!0),Fl(jl,Ul,Xl,"⇏","\\nRightarrow",!0),Fl(jl,Ul,Xl,"↮","\\nleftrightarrow",!0),Fl(jl,Ul,Xl,"⇎","\\nLeftrightarrow",!0),Fl(jl,Ul,Xl,"△","\\vartriangle"),Fl(jl,Ul,Zl,"ℏ","\\hslash"),Fl(jl,Ul,Zl,"▽","\\triangledown"),Fl(jl,Ul,Zl,"◊","\\lozenge"),Fl(jl,Ul,Zl,"Ⓢ","\\circledS"),Fl(jl,Ul,Zl,"®","\\circledR"),Fl(Hl,Ul,Zl,"®","\\circledR"),Fl(jl,Ul,Zl,"∡","\\measuredangle",!0),Fl(jl,Ul,Zl,"∄","\\nexists"),Fl(jl,Ul,Zl,"℧","\\mho"),Fl(jl,Ul,Zl,"Ⅎ","\\Finv",!0),Fl(jl,Ul,Zl,"⅁","\\Game",!0),Fl(jl,Ul,Zl,"‵","\\backprime"),
282
- Fl(jl,Ul,Zl,"▲","\\blacktriangle"),Fl(jl,Ul,Zl,"▼","\\blacktriangledown"),Fl(jl,Ul,Zl,"■","\\blacksquare"),Fl(jl,Ul,Zl,"⧫","\\blacklozenge"),Fl(jl,Ul,Zl,"★","\\bigstar"),Fl(jl,Ul,Zl,"∢","\\sphericalangle",!0),Fl(jl,Ul,Zl,"∁","\\complement",!0),Fl(jl,Ul,Zl,"ð","\\eth",!0),Fl(Hl,ql,Zl,"ð","ð"),Fl(jl,Ul,Zl,"╱","\\diagup"),Fl(jl,Ul,Zl,"╲","\\diagdown"),Fl(jl,Ul,Zl,"□","\\square"),Fl(jl,Ul,Zl,"□","\\Box"),Fl(jl,Ul,Zl,"◊","\\Diamond"),Fl(jl,Ul,Zl,"¥","\\yen",!0),Fl(Hl,Ul,Zl,"¥","\\yen",!0),Fl(jl,Ul,Zl,"✓","\\checkmark",!0),Fl(Hl,Ul,Zl,"✓","\\checkmark"),Fl(jl,Ul,Zl,"ℶ","\\beth",!0),Fl(jl,Ul,Zl,"ℸ","\\daleth",!0),Fl(jl,Ul,Zl,"ℷ","\\gimel",!0),Fl(jl,Ul,Zl,"ϝ","\\digamma",!0),Fl(jl,Ul,Zl,"ϰ","\\varkappa"),Fl(jl,Ul,Kl,"┌","\\@ulcorner",!0),Fl(jl,Ul,Vl,"┐","\\@urcorner",!0),Fl(jl,Ul,Kl,"└","\\@llcorner",!0),Fl(jl,Ul,Vl,"┘","\\@lrcorner",!0),Fl(jl,Ul,Xl,"≦","\\leqq",!0),Fl(jl,Ul,Xl,"⩽","\\leqslant",!0),Fl(jl,Ul,Xl,"⪕","\\eqslantless",!0),Fl(jl,Ul,Xl,"≲","\\lesssim",!0),Fl(jl,Ul,Xl,"⪅","\\lessapprox",!0),
283
- Fl(jl,Ul,Xl,"≊","\\approxeq",!0),Fl(jl,Ul,Gl,"⋖","\\lessdot"),Fl(jl,Ul,Xl,"⋘","\\lll",!0),Fl(jl,Ul,Xl,"≶","\\lessgtr",!0),Fl(jl,Ul,Xl,"⋚","\\lesseqgtr",!0),Fl(jl,Ul,Xl,"⪋","\\lesseqqgtr",!0),Fl(jl,Ul,Xl,"≑","\\doteqdot"),Fl(jl,Ul,Xl,"≓","\\risingdotseq",!0),Fl(jl,Ul,Xl,"≒","\\fallingdotseq",!0),Fl(jl,Ul,Xl,"∽","\\backsim",!0),Fl(jl,Ul,Xl,"⋍","\\backsimeq",!0),Fl(jl,Ul,Xl,"⫅","\\subseteqq",!0),Fl(jl,Ul,Xl,"⋐","\\Subset",!0),Fl(jl,Ul,Xl,"⊏","\\sqsubset",!0),Fl(jl,Ul,Xl,"≼","\\preccurlyeq",!0),Fl(jl,Ul,Xl,"⋞","\\curlyeqprec",!0),Fl(jl,Ul,Xl,"≾","\\precsim",!0),Fl(jl,Ul,Xl,"⪷","\\precapprox",!0),Fl(jl,Ul,Xl,"⊲","\\vartriangleleft"),Fl(jl,Ul,Xl,"⊴","\\trianglelefteq"),Fl(jl,Ul,Xl,"⊨","\\vDash",!0),Fl(jl,Ul,Xl,"⊪","\\Vvdash",!0),Fl(jl,Ul,Xl,"⌣","\\smallsmile"),Fl(jl,Ul,Xl,"⌢","\\smallfrown"),Fl(jl,Ul,Xl,"≏","\\bumpeq",!0),Fl(jl,Ul,Xl,"≎","\\Bumpeq",!0),Fl(jl,Ul,Xl,"≧","\\geqq",!0),Fl(jl,Ul,Xl,"⩾","\\geqslant",!0),Fl(jl,Ul,Xl,"⪖","\\eqslantgtr",!0),Fl(jl,Ul,Xl,"≳","\\gtrsim",!0),Fl(jl,Ul,Xl,"⪆","\\gtrapprox",!0),
284
- Fl(jl,Ul,Gl,"⋗","\\gtrdot"),Fl(jl,Ul,Xl,"⋙","\\ggg",!0),Fl(jl,Ul,Xl,"≷","\\gtrless",!0),Fl(jl,Ul,Xl,"⋛","\\gtreqless",!0),Fl(jl,Ul,Xl,"⪌","\\gtreqqless",!0),Fl(jl,Ul,Xl,"≖","\\eqcirc",!0),Fl(jl,Ul,Xl,"≗","\\circeq",!0),Fl(jl,Ul,Xl,"≜","\\triangleq",!0),Fl(jl,Ul,Xl,"∼","\\thicksim"),Fl(jl,Ul,Xl,"≈","\\thickapprox"),Fl(jl,Ul,Xl,"⫆","\\supseteqq",!0),Fl(jl,Ul,Xl,"⋑","\\Supset",!0),Fl(jl,Ul,Xl,"⊐","\\sqsupset",!0),Fl(jl,Ul,Xl,"≽","\\succcurlyeq",!0),Fl(jl,Ul,Xl,"⋟","\\curlyeqsucc",!0),Fl(jl,Ul,Xl,"≿","\\succsim",!0),Fl(jl,Ul,Xl,"⪸","\\succapprox",!0),Fl(jl,Ul,Xl,"⊳","\\vartriangleright"),Fl(jl,Ul,Xl,"⊵","\\trianglerighteq"),Fl(jl,Ul,Xl,"⊩","\\Vdash",!0),Fl(jl,Ul,Xl,"∣","\\shortmid"),Fl(jl,Ul,Xl,"∥","\\shortparallel"),Fl(jl,Ul,Xl,"≬","\\between",!0),Fl(jl,Ul,Xl,"⋔","\\pitchfork",!0),Fl(jl,Ul,Xl,"∝","\\varpropto"),Fl(jl,Ul,Xl,"◀","\\blacktriangleleft"),Fl(jl,Ul,Xl,"∴","\\therefore",!0),Fl(jl,Ul,Xl,"∍","\\backepsilon"),Fl(jl,Ul,Xl,"▶","\\blacktriangleright"),Fl(jl,Ul,Xl,"∵","\\because",!0),
285
- Fl(jl,Ul,Xl,"⋘","\\llless"),Fl(jl,Ul,Xl,"⋙","\\gggtr"),Fl(jl,Ul,Gl,"⊲","\\lhd"),Fl(jl,Ul,Gl,"⊳","\\rhd"),Fl(jl,Ul,Xl,"≂","\\eqsim",!0),Fl(jl,ql,Xl,"⋈","\\Join"),Fl(jl,Ul,Xl,"≑","\\Doteq",!0),Fl(jl,Ul,Gl,"∔","\\dotplus",!0),Fl(jl,Ul,Gl,"∖","\\smallsetminus"),Fl(jl,Ul,Gl,"⋒","\\Cap",!0),Fl(jl,Ul,Gl,"⋓","\\Cup",!0),Fl(jl,Ul,Gl,"⩞","\\doublebarwedge",!0),Fl(jl,Ul,Gl,"⊟","\\boxminus",!0),Fl(jl,Ul,Gl,"⊞","\\boxplus",!0),Fl(jl,Ul,Gl,"⋇","\\divideontimes",!0),Fl(jl,Ul,Gl,"⋉","\\ltimes",!0),Fl(jl,Ul,Gl,"⋊","\\rtimes",!0),Fl(jl,Ul,Gl,"⋋","\\leftthreetimes",!0),Fl(jl,Ul,Gl,"⋌","\\rightthreetimes",!0),Fl(jl,Ul,Gl,"⋏","\\curlywedge",!0),Fl(jl,Ul,Gl,"⋎","\\curlyvee",!0),Fl(jl,Ul,Gl,"⊝","\\circleddash",!0),Fl(jl,Ul,Gl,"⊛","\\circledast",!0),Fl(jl,Ul,Gl,"⋅","\\centerdot"),Fl(jl,Ul,Gl,"⊺","\\intercal",!0),Fl(jl,Ul,Gl,"⋒","\\doublecap"),Fl(jl,Ul,Gl,"⋓","\\doublecup"),Fl(jl,Ul,Gl,"⊠","\\boxtimes",!0),Fl(jl,Ul,Xl,"⇢","\\dashrightarrow",!0),Fl(jl,Ul,Xl,"⇠","\\dashleftarrow",!0),Fl(jl,Ul,Xl,"⇇","\\leftleftarrows",!0),
286
- Fl(jl,Ul,Xl,"⇆","\\leftrightarrows",!0),Fl(jl,Ul,Xl,"⇚","\\Lleftarrow",!0),Fl(jl,Ul,Xl,"↞","\\twoheadleftarrow",!0),Fl(jl,Ul,Xl,"↢","\\leftarrowtail",!0),Fl(jl,Ul,Xl,"↫","\\looparrowleft",!0),Fl(jl,Ul,Xl,"⇋","\\leftrightharpoons",!0),Fl(jl,Ul,Xl,"↶","\\curvearrowleft",!0),Fl(jl,Ul,Xl,"↺","\\circlearrowleft",!0),Fl(jl,Ul,Xl,"↰","\\Lsh",!0),Fl(jl,Ul,Xl,"⇈","\\upuparrows",!0),Fl(jl,Ul,Xl,"↿","\\upharpoonleft",!0),Fl(jl,Ul,Xl,"⇃","\\downharpoonleft",!0),Fl(jl,ql,Xl,"⊶","\\origof",!0),Fl(jl,ql,Xl,"⊷","\\imageof",!0),Fl(jl,Ul,Xl,"⊸","\\multimap",!0),Fl(jl,Ul,Xl,"↭","\\leftrightsquigarrow",!0),Fl(jl,Ul,Xl,"⇉","\\rightrightarrows",!0),Fl(jl,Ul,Xl,"⇄","\\rightleftarrows",!0),Fl(jl,Ul,Xl,"↠","\\twoheadrightarrow",!0),Fl(jl,Ul,Xl,"↣","\\rightarrowtail",!0),Fl(jl,Ul,Xl,"↬","\\looparrowright",!0),Fl(jl,Ul,Xl,"↷","\\curvearrowright",!0),Fl(jl,Ul,Xl,"↻","\\circlearrowright",!0),Fl(jl,Ul,Xl,"↱","\\Rsh",!0),Fl(jl,Ul,Xl,"⇊","\\downdownarrows",!0),Fl(jl,Ul,Xl,"↾","\\upharpoonright",!0),Fl(jl,Ul,Xl,"⇂","\\downharpoonright",!0),
287
- Fl(jl,Ul,Xl,"⇝","\\rightsquigarrow",!0),Fl(jl,Ul,Xl,"⇝","\\leadsto"),Fl(jl,Ul,Xl,"⇛","\\Rrightarrow",!0),Fl(jl,Ul,Xl,"↾","\\restriction"),Fl(jl,ql,Zl,"‘","`"),Fl(jl,ql,Zl,"$","\\$"),Fl(Hl,ql,Zl,"$","\\$"),Fl(Hl,ql,Zl,"$","\\textdollar"),Fl(jl,ql,Zl,"%","\\%"),Fl(Hl,ql,Zl,"%","\\%"),Fl(jl,ql,Zl,"_","\\_"),Fl(Hl,ql,Zl,"_","\\_"),Fl(Hl,ql,Zl,"_","\\textunderscore"),Fl(jl,ql,Zl,"∠","\\angle",!0),Fl(jl,ql,Zl,"∞","\\infty",!0),Fl(jl,ql,Zl,"′","\\prime"),Fl(jl,ql,Zl,"△","\\triangle"),Fl(jl,ql,Zl,"Γ","\\Gamma",!0),Fl(jl,ql,Zl,"Δ","\\Delta",!0),Fl(jl,ql,Zl,"Θ","\\Theta",!0),Fl(jl,ql,Zl,"Λ","\\Lambda",!0),Fl(jl,ql,Zl,"Ξ","\\Xi",!0),Fl(jl,ql,Zl,"Π","\\Pi",!0),Fl(jl,ql,Zl,"Σ","\\Sigma",!0),Fl(jl,ql,Zl,"Υ","\\Upsilon",!0),Fl(jl,ql,Zl,"Φ","\\Phi",!0),Fl(jl,ql,Zl,"Ψ","\\Psi",!0),Fl(jl,ql,Zl,"Ω","\\Omega",!0),Fl(jl,ql,Zl,"A","Α"),Fl(jl,ql,Zl,"B","Β"),Fl(jl,ql,Zl,"E","Ε"),Fl(jl,ql,Zl,"Z","Ζ"),Fl(jl,ql,Zl,"H","Η"),Fl(jl,ql,Zl,"I","Ι"),Fl(jl,ql,Zl,"K","Κ"),Fl(jl,ql,Zl,"M","Μ"),Fl(jl,ql,Zl,"N","Ν"),Fl(jl,ql,Zl,"O","Ο"),
288
- Fl(jl,ql,Zl,"P","Ρ"),Fl(jl,ql,Zl,"T","Τ"),Fl(jl,ql,Zl,"X","Χ"),Fl(jl,ql,Zl,"¬","\\neg",!0),Fl(jl,ql,Zl,"¬","\\lnot"),Fl(jl,ql,Zl,"⊤","\\top"),Fl(jl,ql,Zl,"⊥","\\bot"),Fl(jl,ql,Zl,"∅","\\emptyset"),Fl(jl,Ul,Zl,"∅","\\varnothing"),Fl(jl,ql,Wl,"α","\\alpha",!0),Fl(jl,ql,Wl,"β","\\beta",!0),Fl(jl,ql,Wl,"γ","\\gamma",!0),Fl(jl,ql,Wl,"δ","\\delta",!0),Fl(jl,ql,Wl,"ϵ","\\epsilon",!0),Fl(jl,ql,Wl,"ζ","\\zeta",!0),Fl(jl,ql,Wl,"η","\\eta",!0),Fl(jl,ql,Wl,"θ","\\theta",!0),Fl(jl,ql,Wl,"ι","\\iota",!0),Fl(jl,ql,Wl,"κ","\\kappa",!0),Fl(jl,ql,Wl,"λ","\\lambda",!0),Fl(jl,ql,Wl,"μ","\\mu",!0),Fl(jl,ql,Wl,"ν","\\nu",!0),Fl(jl,ql,Wl,"ξ","\\xi",!0),Fl(jl,ql,Wl,"ο","\\omicron",!0),Fl(jl,ql,Wl,"π","\\pi",!0),Fl(jl,ql,Wl,"ρ","\\rho",!0),Fl(jl,ql,Wl,"σ","\\sigma",!0),Fl(jl,ql,Wl,"τ","\\tau",!0),Fl(jl,ql,Wl,"υ","\\upsilon",!0),Fl(jl,ql,Wl,"ϕ","\\phi",!0),Fl(jl,ql,Wl,"χ","\\chi",!0),Fl(jl,ql,Wl,"ψ","\\psi",!0),Fl(jl,ql,Wl,"ω","\\omega",!0),Fl(jl,ql,Wl,"ε","\\varepsilon",!0),Fl(jl,ql,Wl,"ϑ","\\vartheta",!0),
289
- Fl(jl,ql,Wl,"ϖ","\\varpi",!0),Fl(jl,ql,Wl,"ϱ","\\varrho",!0),Fl(jl,ql,Wl,"ς","\\varsigma",!0),Fl(jl,ql,Wl,"φ","\\varphi",!0),Fl(jl,ql,Gl,"∗","*",!0),Fl(jl,ql,Gl,"+","+"),Fl(jl,ql,Gl,"−","-",!0),Fl(jl,ql,Gl,"⋅","\\cdot",!0),Fl(jl,ql,Gl,"∘","\\circ"),Fl(jl,ql,Gl,"÷","\\div",!0),Fl(jl,ql,Gl,"±","\\pm",!0),Fl(jl,ql,Gl,"×","\\times",!0),Fl(jl,ql,Gl,"∩","\\cap",!0),Fl(jl,ql,Gl,"∪","\\cup",!0),Fl(jl,ql,Gl,"∖","\\setminus"),Fl(jl,ql,Gl,"∧","\\land"),Fl(jl,ql,Gl,"∨","\\lor"),Fl(jl,ql,Gl,"∧","\\wedge",!0),Fl(jl,ql,Gl,"∨","\\vee",!0),Fl(jl,ql,Zl,"√","\\surd"),Fl(jl,ql,Kl,"⟨","\\langle",!0),Fl(jl,ql,Kl,"∣","\\lvert"),Fl(jl,ql,Kl,"∥","\\lVert"),Fl(jl,ql,Vl,"?","?"),Fl(jl,ql,Vl,"!","!"),Fl(jl,ql,Vl,"⟩","\\rangle",!0),Fl(jl,ql,Vl,"∣","\\rvert"),Fl(jl,ql,Vl,"∥","\\rVert"),Fl(jl,ql,Xl,"=","="),Fl(jl,ql,Xl,":",":"),Fl(jl,ql,Xl,"≈","\\approx",!0),Fl(jl,ql,Xl,"≅","\\cong",!0),Fl(jl,ql,Xl,"≥","\\ge"),Fl(jl,ql,Xl,"≥","\\geq",!0),Fl(jl,ql,Xl,"←","\\gets"),Fl(jl,ql,Xl,">","\\gt",!0),Fl(jl,ql,Xl,"∈","\\in",!0),
290
- Fl(jl,ql,Xl,"","\\@not"),Fl(jl,ql,Xl,"⊂","\\subset",!0),Fl(jl,ql,Xl,"⊃","\\supset",!0),Fl(jl,ql,Xl,"⊆","\\subseteq",!0),Fl(jl,ql,Xl,"⊇","\\supseteq",!0),Fl(jl,Ul,Xl,"⊈","\\nsubseteq",!0),Fl(jl,Ul,Xl,"⊉","\\nsupseteq",!0),Fl(jl,ql,Xl,"⊨","\\models"),Fl(jl,ql,Xl,"←","\\leftarrow",!0),Fl(jl,ql,Xl,"≤","\\le"),Fl(jl,ql,Xl,"≤","\\leq",!0),Fl(jl,ql,Xl,"<","\\lt",!0),Fl(jl,ql,Xl,"→","\\rightarrow",!0),Fl(jl,ql,Xl,"→","\\to"),Fl(jl,Ul,Xl,"≱","\\ngeq",!0),Fl(jl,Ul,Xl,"≰","\\nleq",!0),Fl(jl,ql,"spacing"," ","\\ "),Fl(jl,ql,"spacing"," ","\\space"),Fl(jl,ql,"spacing"," ","\\nobreakspace"),Fl(Hl,ql,"spacing"," ","\\ "),Fl(Hl,ql,"spacing"," "," "),Fl(Hl,ql,"spacing"," ","\\space"),Fl(Hl,ql,"spacing"," ","\\nobreakspace"),Fl(jl,ql,"spacing",null,"\\nobreak"),Fl(jl,ql,"spacing",null,"\\allowbreak"),Fl(jl,ql,"punct",",",","),Fl(jl,ql,"punct",";",";"),Fl(jl,Ul,Gl,"⊼","\\barwedge",!0),Fl(jl,Ul,Gl,"⊻","\\veebar",!0),Fl(jl,ql,Gl,"⊙","\\odot",!0),Fl(jl,ql,Gl,"⊕","\\oplus",!0),Fl(jl,ql,Gl,"⊗","\\otimes",!0),
291
- Fl(jl,ql,Zl,"∂","\\partial",!0),Fl(jl,ql,Gl,"⊘","\\oslash",!0),Fl(jl,Ul,Gl,"⊚","\\circledcirc",!0),Fl(jl,Ul,Gl,"⊡","\\boxdot",!0),Fl(jl,ql,Gl,"△","\\bigtriangleup"),Fl(jl,ql,Gl,"▽","\\bigtriangledown"),Fl(jl,ql,Gl,"†","\\dagger"),Fl(jl,ql,Gl,"⋄","\\diamond"),Fl(jl,ql,Gl,"⋆","\\star"),Fl(jl,ql,Gl,"◃","\\triangleleft"),Fl(jl,ql,Gl,"▹","\\triangleright"),Fl(jl,ql,Kl,"{","\\{"),Fl(Hl,ql,Zl,"{","\\{"),Fl(Hl,ql,Zl,"{","\\textbraceleft"),Fl(jl,ql,Vl,"}","\\}"),Fl(Hl,ql,Zl,"}","\\}"),Fl(Hl,ql,Zl,"}","\\textbraceright"),Fl(jl,ql,Kl,"{","\\lbrace"),Fl(jl,ql,Vl,"}","\\rbrace"),Fl(jl,ql,Kl,"[","\\lbrack",!0),Fl(Hl,ql,Zl,"[","\\lbrack",!0),Fl(jl,ql,Vl,"]","\\rbrack",!0),Fl(Hl,ql,Zl,"]","\\rbrack",!0),Fl(jl,ql,Kl,"(","\\lparen",!0),Fl(jl,ql,Vl,")","\\rparen",!0),Fl(Hl,ql,Zl,"<","\\textless",!0),Fl(Hl,ql,Zl,">","\\textgreater",!0),Fl(jl,ql,Kl,"⌊","\\lfloor",!0),Fl(jl,ql,Vl,"⌋","\\rfloor",!0),Fl(jl,ql,Kl,"⌈","\\lceil",!0),Fl(jl,ql,Vl,"⌉","\\rceil",!0),Fl(jl,ql,Zl,"\\","\\backslash"),Fl(jl,ql,Zl,"∣","|"),
292
- Fl(jl,ql,Zl,"∣","\\vert"),Fl(Hl,ql,Zl,"|","\\textbar",!0),Fl(jl,ql,Zl,"∥","\\|"),Fl(jl,ql,Zl,"∥","\\Vert"),Fl(Hl,ql,Zl,"∥","\\textbardbl"),Fl(Hl,ql,Zl,"~","\\textasciitilde"),Fl(Hl,ql,Zl,"\\","\\textbackslash"),Fl(Hl,ql,Zl,"^","\\textasciicircum"),Fl(jl,ql,Xl,"↑","\\uparrow",!0),Fl(jl,ql,Xl,"⇑","\\Uparrow",!0),Fl(jl,ql,Xl,"↓","\\downarrow",!0),Fl(jl,ql,Xl,"⇓","\\Downarrow",!0),Fl(jl,ql,Xl,"↕","\\updownarrow",!0),Fl(jl,ql,Xl,"⇕","\\Updownarrow",!0),Fl(jl,ql,Yl,"∐","\\coprod"),Fl(jl,ql,Yl,"⋁","\\bigvee"),Fl(jl,ql,Yl,"⋀","\\bigwedge"),Fl(jl,ql,Yl,"⨄","\\biguplus"),Fl(jl,ql,Yl,"⋂","\\bigcap"),Fl(jl,ql,Yl,"⋃","\\bigcup"),Fl(jl,ql,Yl,"∫","\\int"),Fl(jl,ql,Yl,"∫","\\intop"),Fl(jl,ql,Yl,"∬","\\iint"),Fl(jl,ql,Yl,"∭","\\iiint"),Fl(jl,ql,Yl,"∏","\\prod"),Fl(jl,ql,Yl,"∑","\\sum"),Fl(jl,ql,Yl,"⨂","\\bigotimes"),Fl(jl,ql,Yl,"⨁","\\bigoplus"),Fl(jl,ql,Yl,"⨀","\\bigodot"),Fl(jl,ql,Yl,"∮","\\oint"),Fl(jl,ql,Yl,"∯","\\oiint"),Fl(jl,ql,Yl,"∰","\\oiiint"),Fl(jl,ql,Yl,"⨆","\\bigsqcup"),Fl(jl,ql,Yl,"∫","\\smallint"),
293
- Fl(Hl,ql,"inner","…","\\textellipsis"),Fl(jl,ql,"inner","…","\\mathellipsis"),Fl(Hl,ql,"inner","…","\\ldots",!0),Fl(jl,ql,"inner","…","\\ldots",!0),Fl(jl,ql,"inner","⋯","\\@cdots",!0),Fl(jl,ql,"inner","⋱","\\ddots",!0),Fl(jl,ql,Zl,"⋮","\\varvdots"),Fl(jl,ql,$l,"ˊ","\\acute"),Fl(jl,ql,$l,"ˋ","\\grave"),Fl(jl,ql,$l,"¨","\\ddot"),Fl(jl,ql,$l,"~","\\tilde"),Fl(jl,ql,$l,"ˉ","\\bar"),Fl(jl,ql,$l,"˘","\\breve"),Fl(jl,ql,$l,"ˇ","\\check"),Fl(jl,ql,$l,"^","\\hat"),Fl(jl,ql,$l,"⃗","\\vec"),Fl(jl,ql,$l,"˙","\\dot"),Fl(jl,ql,$l,"˚","\\mathring"),Fl(jl,ql,Wl,"","\\@imath"),Fl(jl,ql,Wl,"","\\@jmath"),Fl(jl,ql,Zl,"ı","ı"),Fl(jl,ql,Zl,"ȷ","ȷ"),Fl(Hl,ql,Zl,"ı","\\i",!0),Fl(Hl,ql,Zl,"ȷ","\\j",!0),Fl(Hl,ql,Zl,"ß","\\ss",!0),Fl(Hl,ql,Zl,"æ","\\ae",!0),Fl(Hl,ql,Zl,"œ","\\oe",!0),Fl(Hl,ql,Zl,"ø","\\o",!0),Fl(Hl,ql,Zl,"Æ","\\AE",!0),Fl(Hl,ql,Zl,"Œ","\\OE",!0),Fl(Hl,ql,Zl,"Ø","\\O",!0),Fl(Hl,ql,$l,"ˊ","\\'"),Fl(Hl,ql,$l,"ˋ","\\`"),Fl(Hl,ql,$l,"ˆ","\\^"),Fl(Hl,ql,$l,"˜","\\~"),Fl(Hl,ql,$l,"ˉ","\\="),Fl(Hl,ql,$l,"˘","\\u"),
294
- Fl(Hl,ql,$l,"˙","\\."),Fl(Hl,ql,$l,"¸","\\c"),Fl(Hl,ql,$l,"˚","\\r"),Fl(Hl,ql,$l,"ˇ","\\v"),Fl(Hl,ql,$l,"¨",'\\"'),Fl(Hl,ql,$l,"˝","\\H"),Fl(Hl,ql,$l,"◯","\\textcircled");var Jl={"--":!0,"---":!0,"``":!0,"''":!0};Fl(Hl,ql,Zl,"–","--",!0),Fl(Hl,ql,Zl,"–","\\textendash"),Fl(Hl,ql,Zl,"—","---",!0),Fl(Hl,ql,Zl,"—","\\textemdash"),Fl(Hl,ql,Zl,"‘","`",!0),Fl(Hl,ql,Zl,"‘","\\textquoteleft"),Fl(Hl,ql,Zl,"’","'",!0),Fl(Hl,ql,Zl,"’","\\textquoteright"),Fl(Hl,ql,Zl,"“","``",!0),Fl(Hl,ql,Zl,"“","\\textquotedblleft"),Fl(Hl,ql,Zl,"”","''",!0),Fl(Hl,ql,Zl,"”","\\textquotedblright"),Fl(jl,ql,Zl,"°","\\degree",!0),Fl(Hl,ql,Zl,"°","\\degree"),Fl(Hl,ql,Zl,"°","\\textdegree",!0),Fl(jl,ql,Zl,"£","\\pounds"),Fl(jl,ql,Zl,"£","\\mathsterling",!0),Fl(Hl,ql,Zl,"£","\\pounds"),Fl(Hl,ql,Zl,"£","\\textsterling",!0),Fl(jl,Ul,Zl,"✠","\\maltese"),Fl(Hl,Ul,Zl,"✠","\\maltese");for(var Ql=0;Ql<'0123456789/@."'.length;Ql++){var ec='0123456789/@."'.charAt(Ql);Fl(jl,ql,Zl,ec,ec)}for(var tc=0;tc<'0123456789!@*()-=+";:?/.,'.length;tc++){
295
- var nc='0123456789!@*()-=+";:?/.,'.charAt(tc);Fl(Hl,ql,Zl,nc,nc)}for(var rc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",oc=0;oc<rc.length;oc++){var ic=rc.charAt(oc);Fl(jl,ql,Wl,ic,ic),Fl(Hl,ql,Zl,ic,ic)}Fl(jl,Ul,Zl,"C","ℂ"),Fl(Hl,Ul,Zl,"C","ℂ"),Fl(jl,Ul,Zl,"H","ℍ"),Fl(Hl,Ul,Zl,"H","ℍ"),Fl(jl,Ul,Zl,"N","ℕ"),Fl(Hl,Ul,Zl,"N","ℕ"),Fl(jl,Ul,Zl,"P","ℙ"),Fl(Hl,Ul,Zl,"P","ℙ"),Fl(jl,Ul,Zl,"Q","ℚ"),Fl(Hl,Ul,Zl,"Q","ℚ"),Fl(jl,Ul,Zl,"R","ℝ"),Fl(Hl,Ul,Zl,"R","ℝ"),Fl(jl,Ul,Zl,"Z","ℤ"),Fl(Hl,Ul,Zl,"Z","ℤ"),Fl(jl,ql,Wl,"h","ℎ"),Fl(Hl,ql,Wl,"h","ℎ");for(var ac="",sc=0;sc<rc.length;sc++){var lc=rc.charAt(sc);Fl(jl,ql,Wl,lc,ac=String.fromCharCode(55349,56320+sc)),Fl(Hl,ql,Zl,lc,ac),Fl(jl,ql,Wl,lc,ac=String.fromCharCode(55349,56372+sc)),Fl(Hl,ql,Zl,lc,ac),Fl(jl,ql,Wl,lc,ac=String.fromCharCode(55349,56424+sc)),Fl(Hl,ql,Zl,lc,ac),Fl(jl,ql,Wl,lc,ac=String.fromCharCode(55349,56580+sc)),Fl(Hl,ql,Zl,lc,ac),Fl(jl,ql,Wl,lc,ac=String.fromCharCode(55349,56736+sc)),Fl(Hl,ql,Zl,lc,ac),
296
- Fl(jl,ql,Wl,lc,ac=String.fromCharCode(55349,56788+sc)),Fl(Hl,ql,Zl,lc,ac),Fl(jl,ql,Wl,lc,ac=String.fromCharCode(55349,56840+sc)),Fl(Hl,ql,Zl,lc,ac),Fl(jl,ql,Wl,lc,ac=String.fromCharCode(55349,56944+sc)),Fl(Hl,ql,Zl,lc,ac),sc<26&&(Fl(jl,ql,Wl,lc,ac=String.fromCharCode(55349,56632+sc)),Fl(Hl,ql,Zl,lc,ac),Fl(jl,ql,Wl,lc,ac=String.fromCharCode(55349,56476+sc)),Fl(Hl,ql,Zl,lc,ac))}Fl(jl,ql,Wl,"k",ac=String.fromCharCode(55349,56668)),Fl(Hl,ql,Zl,"k",ac);for(var cc=0;cc<10;cc++){var uc=cc.toString();Fl(jl,ql,Wl,uc,ac=String.fromCharCode(55349,57294+cc)),Fl(Hl,ql,Zl,uc,ac),Fl(jl,ql,Wl,uc,ac=String.fromCharCode(55349,57314+cc)),Fl(Hl,ql,Zl,uc,ac),Fl(jl,ql,Wl,uc,ac=String.fromCharCode(55349,57324+cc)),Fl(Hl,ql,Zl,uc,ac),Fl(jl,ql,Wl,uc,ac=String.fromCharCode(55349,57334+cc)),Fl(Hl,ql,Zl,uc,ac)}for(var hc=0;hc<"ÐÞþ".length;hc++){var dc="ÐÞþ".charAt(hc);Fl(jl,ql,Wl,dc,dc),Fl(Hl,ql,Zl,dc,dc)}
297
- var pc=[["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"]],mc=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],fc=function(e,t,n){
298
- return Bl[n][e]&&Bl[n][e].replace&&(e=Bl[n][e].replace),{value:e,metrics:dl(e,t,n)}},gc=function(e,t,n,r,o){var i,a=fc(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 Ml(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 Ml(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},vc=(e,t)=>{if(kl(e.classes)!==kl(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},yc=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),
299
- i.maxFontSize>r&&(r=i.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},_c=function(e,t,n,r){var o=new El(e,t,n,r);return yc(o),o},bc=(e,t,n,r)=>new El(e,t,n,r),wc=function(e){var t=new ll(e);return yc(t),t},xc=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")},kc={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"},
300
- mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Sc={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Cc={fontMap:kc,makeSymbol:gc,mathsym:function(e,t,n,r){return void 0===r&&(r=[]),"boldsymbol"===n.font&&fc(e,"Main-Bold",t).metrics?gc(e,"Main-Bold",t,n,r.concat(["mathbf"])):"\\"===e||"main"===Bl[t][e].font?gc(e,"Main-Regular",t,n,r):gc(e,"AMS-Regular",t,n,r.concat(["amsrm"]))},makeSpan:_c,makeSvgSpan:bc,makeLineSpan:function(e,t,n){var r=_c([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=xl(r.height),r.maxFontSize=1,r},makeAnchor:function(e,t,n,r){var o=new Tl(e,t,n,r);return yc(o),o},makeFragment:wc,wrapFragment:function(e,t){return e instanceof ll?_c([],[e],t):e},makeVList:function(e,t){for(var{children:n,depth:r}=function(e){if("individualShift"===e.positionType){
301
- 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=_c(["pstrut"],[]);l.style.height=xl(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{
302
- var f=m.elem,g=m.wrapperClasses||[],v=m.wrapperStyle||{},y=_c(g,[l,f],void 0,v);y.style.top=xl(-o-d-f.depth),m.marginLeft&&(y.style.marginLeft=m.marginLeft),m.marginRight&&(y.style.marginRight=m.marginRight),c.push(y),d+=f.height+f.depth}u=Math.min(u,d),h=Math.max(h,d)}var _,b=_c(["vlist"],c);if(b.style.height=xl(h),u<0){var w=_c([],[]),x=_c(["vlist"],[w]);x.style.height=xl(-u);var k=_c(["vlist-s"],[new Ml("​")]);_=[_c(["vlist-r"],[b,k]),_c(["vlist-r"],[x])]}else _=[_c(["vlist-r"],[b])];var S=_c(["vlist-t"],_);return 2===_.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[pc[o][2],pc[o][r]]}if(120782<=n&&n<=120831){var i=Math.floor((n-120782)/10);return[mc[i][2],mc[i][r]]}
303
- if(120485===n||120486===n)return[pc[0][2],pc[0][r]];if(120486<n&&n<120782)return["",""];throw new js("Unsupported character: "+e)}(o,r);return gc(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&&fc(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=kc[s].fontName,h=[s]):(u=xc(s,t.fontWeight,t.fontShape),h=[s,t.fontWeight,t.fontShape]);if(fc(o,u,r).metrics)return gc(o,u,r,t,i.concat(h));if(Jl.hasOwnProperty(o)&&"Typewriter"===u.substr(0,10)){for(var p=[],m=0;m<o.length;m++)p.push(gc(o[m],u,r,t,i.concat(h)));return wc(p)}}if("mathord"===n)return gc(o,"Math-Italic",r,t,i.concat(["mathnormal"]));if("textord"===n){var f=Bl[r][o]&&Bl[r][o].font;if("ams"===f){var g=xc("amsrm",t.fontWeight,t.fontShape);return gc(o,g,r,t,i.concat("amsrm",t.fontWeight,t.fontShape))}if("main"!==f&&f){var v=xc(f,t.fontWeight,t.fontShape)
304
- ;return gc(o,v,r,t,i.concat(v,t.fontWeight,t.fontShape))}var y=xc("textrm",t.fontWeight,t.fontShape);return gc(o,y,r,t,i.concat(t.fontWeight,t.fontShape))}throw new Error("unexpected type: "+n+" in makeOrd")},makeGlue:(e,t)=>{var n=_c(["mspace"],[],t),r=wl(e,t);return n.style.marginRight=xl(r),n},staticSvg:function(e,t){var[n,r,o]=Sc[e],i=new Ol(n),a=new zl([i],{width:xl(r),height:xl(o),style:"width:"+xl(r),viewBox:"0 0 "+1e3*r+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),s=bc(["overlay"],[a],t);return s.height=o,s.style.height=xl(o),s.style.width=xl(r),s},svgData:Sc,tryCombineChars:e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof Ml&&r instanceof Ml&&vc(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}},Ac={number:3,unit:"mu"},Ec={number:4,unit:"mu"},Tc={number:5,unit:"mu"},Nc={mord:{mop:Ac,mbin:Ec,mrel:Tc,minner:Ac},mop:{mord:Ac,mop:Ac,mrel:Tc,minner:Ac},mbin:{mord:Ec,mop:Ec,mopen:Ec,minner:Ec},mrel:{
305
- mord:Tc,mop:Tc,mopen:Tc,minner:Tc},mopen:{},mclose:{mop:Ac,mbin:Ec,mrel:Tc,minner:Ac},mpunct:{mord:Ac,mop:Ac,mrel:Tc,mopen:Ac,mclose:Ac,mpunct:Ac,minner:Ac},minner:{mord:Ac,mop:Ac,mbin:Ec,mrel:Tc,mopen:Ac,mpunct:Ac,minner:Ac}},Lc={mord:{mop:Ac},mop:{mord:Ac,mop:Ac},mbin:{},mrel:{},mopen:{},mclose:{mop:Ac},mpunct:{},minner:{mop:Ac}},Mc={},zc={},Oc={};function Ic(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)Mc[n[l]]=s;t&&(i&&(zc[t]=i),a&&(Oc[t]=a))}function Rc(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;Ic({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var Pc=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e
306
- },Dc=function(e){return"ordgroup"===e.type?e.body:[e]},Bc=Cc.makeSpan,Fc=["leftmost","mbin","mopen","mrel","mop","mpunct"],jc=["rightmost","mrel","mclose","mpunct"],Hc={display:rl.DISPLAY,text:rl.TEXT,script:rl.SCRIPT,scriptscript:rl.SCRIPTSCRIPT},qc={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Uc=function(e,t,n,r){void 0===r&&(r=[null,null]);for(var o=[],i=0;i<e.length;i++){var a=Kc(e[i],t);if(a instanceof ll){var s=a.children;o.push(...s)}else o.push(a)}if(Cc.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(Hc[c.style]))}var u=Bc([r[0]||"leftmost"],[],t),h=Bc([r[1]||"rightmost"],[],t),d="root"===n;return $c(o,((e,t)=>{var n=t.classes[0],r=e.classes[0];"mbin"===n&&Gs.contains(jc,r)?t.classes[0]="mord":"mbin"===r&&Gs.contains(Fc,n)&&(e.classes[0]="mord")}),{node:u},h,d),$c(o,((e,t)=>{
307
- var n=Wc(t),r=Wc(e),o=n&&r?e.hasClass("mtight")?Lc[n][r]:Nc[n][r]:null;if(o)return Cc.makeGlue(o,l)}),{node:u},h,d),o},$c=function e(t,n,r,o,i){o&&t.push(o);for(var a=0;a<t.length;a++){var s=t[a],l=Gc(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=Bc(["leftmost"])),r.insertAfter=(e=>n=>{t.splice(e+1,0,n),a++})(a)}}o&&t.pop()},Gc=function(e){return e instanceof ll||e instanceof Tl||e instanceof El&&e.hasClass("enclosing")?e:null},Vc=function e(t,n){var r=Gc(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},Wc=function(e,t){return e?(t&&(e=Vc(e,t)),qc[e.classes[0]]||null):null},Yc=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Bc(t.concat(n))},Kc=function(e,t,n){if(!e)return Bc();if(zc[e.type]){var r=zc[e.type](e,t);if(n&&t.size!==n.size){
308
- r=Bc(t.sizingClasses(n),[r],t);var o=t.sizeMultiplier/n.sizeMultiplier;r.height*=o,r.depth*=o}return r}throw new js("Got group of unknown type: '"+e.type+"'")};function Xc(e,t){var n=Bc(["base"],e,t),r=Bc(["strut"]);return r.style.height=xl(n.height+n.depth),n.depth&&(r.style.verticalAlign=xl(-n.depth)),n.children.unshift(r),n}function Zc(e,t){var n=null;1===e.length&&"tag"===e[0].type&&(n=e[0].tag,e=e[0].body);var r,o=Uc(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(Xc(s,t)),s=[])}else o[l].hasClass("newline")&&(s.pop(),s.length>0&&(a.push(Xc(s,t)),s=[]),a.push(o[l]));s.length>0&&a.push(Xc(s,t)),n?((i=Xc(Uc(n,t,!0))).classes=["tag"],a.push(i)):r&&a.push(r);var u=Bc(["katex-html"],a);if(u.setAttribute("aria-hidden","true"),i){
309
- var h=i.children[0];h.style.height=xl(u.height+u.depth),u.depth&&(h.style.verticalAlign=xl(-u.depth))}return u}function Jc(e){return new ll(e)}class Qc{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=kl(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+=Gs.escape(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+Gs.escape(kl(this.classes))+'"'),e+=">"
310
- ;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 eu{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Gs.escape(this.toText())}toText(){return this.text}}var tu={MathNode:Qc,TextNode:eu,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",xl(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+xl(this.width)+'"/>'}toText(){
311
- return this.character?this.character:" "}},newDocumentFragment:Jc},nu=function(e,t,n){return!Bl[t][e]||!Bl[t][e].replace||55349===e.charCodeAt(0)||Jl.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.substr(4,2)||n.font&&"tt"===n.font.substr(4,2))||(e=Bl[t][e].replace),new tu.TextNode(e)},ru=function(e){return 1===e.length?e[0]:new tu.MathNode("mrow",e)},ou=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"
312
- ;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 Gs.contains(["\\imath","\\jmath"],o)?null:(Bl[r][o]&&Bl[r][o].replace&&(o=Bl[r][o].replace),dl(o,Cc.fontMap[n].fontName,r)?Cc.fontMap[n].variant:null)},iu=function(e,t,n){if(1===e.length){var r=su(e[0],t);return n&&r instanceof Qc&&"mo"===r.type&&(r.setAttribute("lspace","0em"),r.setAttribute("rspace","0em")),[r]}for(var o,i=[],a=0;a<e.length;a++){var s=su(e[a],t);if(s instanceof Qc&&o instanceof Qc){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 eu&&"."===l.text){o.children.push(...s.children);continue}}else if("mi"===o.type&&1===o.children.length){var c=o.children[0]
313
- ;if(c instanceof eu&&"̸"===c.text&&("mo"===s.type||"mi"===s.type||"mn"===s.type)){var u=s.children[0];u instanceof eu&&u.text.length>0&&(u.text=u.text.slice(0,1)+"̸"+u.text.slice(1),i.pop())}}}i.push(s),o=s}return i},au=function(e,t,n){return ru(iu(e,t,n))},su=function(e,t){if(!e)return new tu.MathNode("mrow");if(Oc[e.type])return Oc[e.type](e,t);throw new js("Got group of unknown type: '"+e.type+"'")};function lu(e,t,n,r,o){var i,a=iu(e,n);i=1===a.length&&a[0]instanceof Qc&&Gs.contains(["mrow","mtable"],a[0].type)?a[0]:new tu.MathNode("mrow",a);var s=new tu.MathNode("annotation",[new tu.TextNode(t)]);s.setAttribute("encoding","application/x-tex");var l=new tu.MathNode("semantics",[i,s]),c=new tu.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 Cc.makeSpan([u],[c])}var cu=function(e){return new vl({style:e.displayMode?rl.DISPLAY:rl.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})
314
- },uu=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=Cc.makeSpan(n,[e])}return e},hu={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":"="},du={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],
266
+ 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]}},dl={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],
267
+ 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]},pl={"Å":"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",
268
+ "а":"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 ml(e,t,n){if(!hl[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),o=hl[t][r];if(!o&&e[0]in pl&&(r=pl[e[0]].charCodeAt(0),o=hl[t][r]),o||"text"!==n||ll(r)&&(o=hl[t][77]),o)return{depth:o[0],height:o[1],italic:o[2],skew:o[3],width:o[4]}}var fl={};var gl=[[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]],vl=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],yl=function(e,t){return t.size<2?e:gl[e-1][t.size-1]};class _l{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,
269
+ this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||_l.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=vl[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 _l(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:yl(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,
270
+ textSize:e,sizeMultiplier:vl[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=yl(_l.BASESIZE,e);return this.size===t&&this.textSize===_l.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!==_l.BASESIZE?["sizing","reset-size"+this.size,"size"+_l.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!fl[t=e>=5?0:e>=3?1:2]){var n=fl[t]={
271
+ cssEmPerMu:dl.quad[t]/18};for(var r in dl)dl.hasOwnProperty(r)&&(n[r]=dl[r][t])}return fl[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}_l.BASESIZE=6;var bl={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},wl={ex:!0,em:!0,mu:!0},xl=function(e){return"string"!=typeof e&&(e=e.unit),e in bl||e in wl||"ex"===e},kl=function(e,t){var n;if(e.unit in bl)n=bl[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 qs("Invalid unit: '"+e.unit+"'");n=r.fontMetrics().quad}r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},Sl=function(e){return+e.toFixed(4)+"em"},Cl=function(e){return e.filter((e=>e)).join(" ")},Al=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,
272
+ 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)}},El=function(e){var t=document.createElement(e);for(var n in t.className=Cl(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},Tl=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+Ws.escape(Cl(this.classes))+'"');var n="";for(var r in this.style)this.style.hasOwnProperty(r)&&(n+=Ws.hyphenate(r)+":"+this.style[r]+";");for(var o in n&&(t+=' style="'+Ws.escape(n)+'"'),this.attributes)this.attributes.hasOwnProperty(o)&&(t+=" "+o+'="'+Ws.escape(this.attributes[o])+'"');t+=">";for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup();return t+="</"+e+">"};class Nl{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,
273
+ this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,Al.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return Ws.contains(this.classes,e)}toNode(){return El.call(this,"span")}toMarkup(){return Tl.call(this,"span")}}class Ml{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,Al.call(this,t,r),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return Ws.contains(this.classes,e)}toNode(){return El.call(this,"a")}toMarkup(){return Tl.call(this,"a")}}class Ll{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 Ws.contains(this.classes,e)}toNode(){var e=document.createElement("img")
274
+ ;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+=Ws.hyphenate(n)+":"+this.style[n]+";");return t&&(e+=' style="'+Ws.escape(t)+'"'),e+="'/>"}}var zl={"î":"ı̂","ï":"ı̈","í":"ı́","ì":"ı̀"};class Ol{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<al.length;t++)for(var n=al[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"),
275
+ /[îïíì]/.test(this.text)&&(this.text=zl[this.text])}hasClass(e){return Ws.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=Sl(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=Cl(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+=Ws.escape(Cl(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+=Ws.hyphenate(r)+":"+this.style[r]+";");n&&(e=!0,t+=' style="'+Ws.escape(n)+'"');var o=Ws.escape(this.text);return e?(t+=">",t+=o,t+="</span>"):o}}class Il{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){
276
+ 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 Pl{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",cl[this.pathName]),e}toMarkup(){return this.alternate?"<path d='"+this.alternate+"'/>":"<path d='"+cl[this.pathName]+"'/>"}}class Rl{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){
277
+ 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 Dl(e){if(e instanceof Ol)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}var Bl={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Fl={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},jl={math:{},text:{}};function Hl(e,t,n,r,o,i){jl[e][o]={font:t,group:n,replace:r},i&&r&&(jl[e][r]=jl[e][o])}var ql="math",Ul="text",$l="main",Gl="ams",Vl="accent-token",Wl="bin",Yl="close",Kl="mathord",Xl="op-token",Zl="open",Jl="rel",Ql="textord";Hl(ql,$l,Jl,"≡","\\equiv",!0),Hl(ql,$l,Jl,"≺","\\prec",!0),Hl(ql,$l,Jl,"≻","\\succ",!0),Hl(ql,$l,Jl,"∼","\\sim",!0),Hl(ql,$l,Jl,"⊥","\\perp"),Hl(ql,$l,Jl,"⪯","\\preceq",!0),
278
+ Hl(ql,$l,Jl,"⪰","\\succeq",!0),Hl(ql,$l,Jl,"≃","\\simeq",!0),Hl(ql,$l,Jl,"∣","\\mid",!0),Hl(ql,$l,Jl,"≪","\\ll",!0),Hl(ql,$l,Jl,"≫","\\gg",!0),Hl(ql,$l,Jl,"≍","\\asymp",!0),Hl(ql,$l,Jl,"∥","\\parallel"),Hl(ql,$l,Jl,"⋈","\\bowtie",!0),Hl(ql,$l,Jl,"⌣","\\smile",!0),Hl(ql,$l,Jl,"⊑","\\sqsubseteq",!0),Hl(ql,$l,Jl,"⊒","\\sqsupseteq",!0),Hl(ql,$l,Jl,"≐","\\doteq",!0),Hl(ql,$l,Jl,"⌢","\\frown",!0),Hl(ql,$l,Jl,"∋","\\ni",!0),Hl(ql,$l,Jl,"∝","\\propto",!0),Hl(ql,$l,Jl,"⊢","\\vdash",!0),Hl(ql,$l,Jl,"⊣","\\dashv",!0),Hl(ql,$l,Jl,"∋","\\owns"),Hl(ql,$l,"punct",".","\\ldotp"),Hl(ql,$l,"punct","⋅","\\cdotp"),Hl(ql,$l,Ql,"#","\\#"),Hl(Ul,$l,Ql,"#","\\#"),Hl(ql,$l,Ql,"&","\\&"),Hl(Ul,$l,Ql,"&","\\&"),Hl(ql,$l,Ql,"ℵ","\\aleph",!0),Hl(ql,$l,Ql,"∀","\\forall",!0),Hl(ql,$l,Ql,"ℏ","\\hbar",!0),Hl(ql,$l,Ql,"∃","\\exists",!0),Hl(ql,$l,Ql,"∇","\\nabla",!0),Hl(ql,$l,Ql,"♭","\\flat",!0),Hl(ql,$l,Ql,"ℓ","\\ell",!0),Hl(ql,$l,Ql,"♮","\\natural",!0),Hl(ql,$l,Ql,"♣","\\clubsuit",!0),Hl(ql,$l,Ql,"℘","\\wp",!0),Hl(ql,$l,Ql,"♯","\\sharp",!0),
279
+ Hl(ql,$l,Ql,"♢","\\diamondsuit",!0),Hl(ql,$l,Ql,"ℜ","\\Re",!0),Hl(ql,$l,Ql,"♡","\\heartsuit",!0),Hl(ql,$l,Ql,"ℑ","\\Im",!0),Hl(ql,$l,Ql,"♠","\\spadesuit",!0),Hl(ql,$l,Ql,"§","\\S",!0),Hl(Ul,$l,Ql,"§","\\S"),Hl(ql,$l,Ql,"¶","\\P",!0),Hl(Ul,$l,Ql,"¶","\\P"),Hl(ql,$l,Ql,"†","\\dag"),Hl(Ul,$l,Ql,"†","\\dag"),Hl(Ul,$l,Ql,"†","\\textdagger"),Hl(ql,$l,Ql,"‡","\\ddag"),Hl(Ul,$l,Ql,"‡","\\ddag"),Hl(Ul,$l,Ql,"‡","\\textdaggerdbl"),Hl(ql,$l,Yl,"⎱","\\rmoustache",!0),Hl(ql,$l,Zl,"⎰","\\lmoustache",!0),Hl(ql,$l,Yl,"⟯","\\rgroup",!0),Hl(ql,$l,Zl,"⟮","\\lgroup",!0),Hl(ql,$l,Wl,"∓","\\mp",!0),Hl(ql,$l,Wl,"⊖","\\ominus",!0),Hl(ql,$l,Wl,"⊎","\\uplus",!0),Hl(ql,$l,Wl,"⊓","\\sqcap",!0),Hl(ql,$l,Wl,"∗","\\ast"),Hl(ql,$l,Wl,"⊔","\\sqcup",!0),Hl(ql,$l,Wl,"◯","\\bigcirc",!0),Hl(ql,$l,Wl,"∙","\\bullet",!0),Hl(ql,$l,Wl,"‡","\\ddagger"),Hl(ql,$l,Wl,"≀","\\wr",!0),Hl(ql,$l,Wl,"⨿","\\amalg"),Hl(ql,$l,Wl,"&","\\And"),Hl(ql,$l,Jl,"⟵","\\longleftarrow",!0),Hl(ql,$l,Jl,"⇐","\\Leftarrow",!0),Hl(ql,$l,Jl,"⟸","\\Longleftarrow",!0),
280
+ Hl(ql,$l,Jl,"⟶","\\longrightarrow",!0),Hl(ql,$l,Jl,"⇒","\\Rightarrow",!0),Hl(ql,$l,Jl,"⟹","\\Longrightarrow",!0),Hl(ql,$l,Jl,"↔","\\leftrightarrow",!0),Hl(ql,$l,Jl,"⟷","\\longleftrightarrow",!0),Hl(ql,$l,Jl,"⇔","\\Leftrightarrow",!0),Hl(ql,$l,Jl,"⟺","\\Longleftrightarrow",!0),Hl(ql,$l,Jl,"↦","\\mapsto",!0),Hl(ql,$l,Jl,"⟼","\\longmapsto",!0),Hl(ql,$l,Jl,"↗","\\nearrow",!0),Hl(ql,$l,Jl,"↩","\\hookleftarrow",!0),Hl(ql,$l,Jl,"↪","\\hookrightarrow",!0),Hl(ql,$l,Jl,"↘","\\searrow",!0),Hl(ql,$l,Jl,"↼","\\leftharpoonup",!0),Hl(ql,$l,Jl,"⇀","\\rightharpoonup",!0),Hl(ql,$l,Jl,"↙","\\swarrow",!0),Hl(ql,$l,Jl,"↽","\\leftharpoondown",!0),Hl(ql,$l,Jl,"⇁","\\rightharpoondown",!0),Hl(ql,$l,Jl,"↖","\\nwarrow",!0),Hl(ql,$l,Jl,"⇌","\\rightleftharpoons",!0),Hl(ql,Gl,Jl,"≮","\\nless",!0),Hl(ql,Gl,Jl,"","\\@nleqslant"),Hl(ql,Gl,Jl,"","\\@nleqq"),Hl(ql,Gl,Jl,"⪇","\\lneq",!0),Hl(ql,Gl,Jl,"≨","\\lneqq",!0),Hl(ql,Gl,Jl,"","\\@lvertneqq"),Hl(ql,Gl,Jl,"⋦","\\lnsim",!0),Hl(ql,Gl,Jl,"⪉","\\lnapprox",!0),Hl(ql,Gl,Jl,"⊀","\\nprec",!0),
281
+ Hl(ql,Gl,Jl,"⋠","\\npreceq",!0),Hl(ql,Gl,Jl,"⋨","\\precnsim",!0),Hl(ql,Gl,Jl,"⪹","\\precnapprox",!0),Hl(ql,Gl,Jl,"≁","\\nsim",!0),Hl(ql,Gl,Jl,"","\\@nshortmid"),Hl(ql,Gl,Jl,"∤","\\nmid",!0),Hl(ql,Gl,Jl,"⊬","\\nvdash",!0),Hl(ql,Gl,Jl,"⊭","\\nvDash",!0),Hl(ql,Gl,Jl,"⋪","\\ntriangleleft"),Hl(ql,Gl,Jl,"⋬","\\ntrianglelefteq",!0),Hl(ql,Gl,Jl,"⊊","\\subsetneq",!0),Hl(ql,Gl,Jl,"","\\@varsubsetneq"),Hl(ql,Gl,Jl,"⫋","\\subsetneqq",!0),Hl(ql,Gl,Jl,"","\\@varsubsetneqq"),Hl(ql,Gl,Jl,"≯","\\ngtr",!0),Hl(ql,Gl,Jl,"","\\@ngeqslant"),Hl(ql,Gl,Jl,"","\\@ngeqq"),Hl(ql,Gl,Jl,"⪈","\\gneq",!0),Hl(ql,Gl,Jl,"≩","\\gneqq",!0),Hl(ql,Gl,Jl,"","\\@gvertneqq"),Hl(ql,Gl,Jl,"⋧","\\gnsim",!0),Hl(ql,Gl,Jl,"⪊","\\gnapprox",!0),Hl(ql,Gl,Jl,"⊁","\\nsucc",!0),Hl(ql,Gl,Jl,"⋡","\\nsucceq",!0),Hl(ql,Gl,Jl,"⋩","\\succnsim",!0),Hl(ql,Gl,Jl,"⪺","\\succnapprox",!0),Hl(ql,Gl,Jl,"≆","\\ncong",!0),Hl(ql,Gl,Jl,"","\\@nshortparallel"),Hl(ql,Gl,Jl,"∦","\\nparallel",!0),Hl(ql,Gl,Jl,"⊯","\\nVDash",!0),Hl(ql,Gl,Jl,"⋫","\\ntriangleright"),
282
+ Hl(ql,Gl,Jl,"⋭","\\ntrianglerighteq",!0),Hl(ql,Gl,Jl,"","\\@nsupseteqq"),Hl(ql,Gl,Jl,"⊋","\\supsetneq",!0),Hl(ql,Gl,Jl,"","\\@varsupsetneq"),Hl(ql,Gl,Jl,"⫌","\\supsetneqq",!0),Hl(ql,Gl,Jl,"","\\@varsupsetneqq"),Hl(ql,Gl,Jl,"⊮","\\nVdash",!0),Hl(ql,Gl,Jl,"⪵","\\precneqq",!0),Hl(ql,Gl,Jl,"⪶","\\succneqq",!0),Hl(ql,Gl,Jl,"","\\@nsubseteqq"),Hl(ql,Gl,Wl,"⊴","\\unlhd"),Hl(ql,Gl,Wl,"⊵","\\unrhd"),Hl(ql,Gl,Jl,"↚","\\nleftarrow",!0),Hl(ql,Gl,Jl,"↛","\\nrightarrow",!0),Hl(ql,Gl,Jl,"⇍","\\nLeftarrow",!0),Hl(ql,Gl,Jl,"⇏","\\nRightarrow",!0),Hl(ql,Gl,Jl,"↮","\\nleftrightarrow",!0),Hl(ql,Gl,Jl,"⇎","\\nLeftrightarrow",!0),Hl(ql,Gl,Jl,"△","\\vartriangle"),Hl(ql,Gl,Ql,"ℏ","\\hslash"),Hl(ql,Gl,Ql,"▽","\\triangledown"),Hl(ql,Gl,Ql,"◊","\\lozenge"),Hl(ql,Gl,Ql,"Ⓢ","\\circledS"),Hl(ql,Gl,Ql,"®","\\circledR"),Hl(Ul,Gl,Ql,"®","\\circledR"),Hl(ql,Gl,Ql,"∡","\\measuredangle",!0),Hl(ql,Gl,Ql,"∄","\\nexists"),Hl(ql,Gl,Ql,"℧","\\mho"),Hl(ql,Gl,Ql,"Ⅎ","\\Finv",!0),Hl(ql,Gl,Ql,"⅁","\\Game",!0),Hl(ql,Gl,Ql,"‵","\\backprime"),
283
+ Hl(ql,Gl,Ql,"▲","\\blacktriangle"),Hl(ql,Gl,Ql,"▼","\\blacktriangledown"),Hl(ql,Gl,Ql,"■","\\blacksquare"),Hl(ql,Gl,Ql,"⧫","\\blacklozenge"),Hl(ql,Gl,Ql,"★","\\bigstar"),Hl(ql,Gl,Ql,"∢","\\sphericalangle",!0),Hl(ql,Gl,Ql,"∁","\\complement",!0),Hl(ql,Gl,Ql,"ð","\\eth",!0),Hl(Ul,$l,Ql,"ð","ð"),Hl(ql,Gl,Ql,"╱","\\diagup"),Hl(ql,Gl,Ql,"╲","\\diagdown"),Hl(ql,Gl,Ql,"□","\\square"),Hl(ql,Gl,Ql,"□","\\Box"),Hl(ql,Gl,Ql,"◊","\\Diamond"),Hl(ql,Gl,Ql,"¥","\\yen",!0),Hl(Ul,Gl,Ql,"¥","\\yen",!0),Hl(ql,Gl,Ql,"✓","\\checkmark",!0),Hl(Ul,Gl,Ql,"✓","\\checkmark"),Hl(ql,Gl,Ql,"ℶ","\\beth",!0),Hl(ql,Gl,Ql,"ℸ","\\daleth",!0),Hl(ql,Gl,Ql,"ℷ","\\gimel",!0),Hl(ql,Gl,Ql,"ϝ","\\digamma",!0),Hl(ql,Gl,Ql,"ϰ","\\varkappa"),Hl(ql,Gl,Zl,"┌","\\@ulcorner",!0),Hl(ql,Gl,Yl,"┐","\\@urcorner",!0),Hl(ql,Gl,Zl,"└","\\@llcorner",!0),Hl(ql,Gl,Yl,"┘","\\@lrcorner",!0),Hl(ql,Gl,Jl,"≦","\\leqq",!0),Hl(ql,Gl,Jl,"⩽","\\leqslant",!0),Hl(ql,Gl,Jl,"⪕","\\eqslantless",!0),Hl(ql,Gl,Jl,"≲","\\lesssim",!0),Hl(ql,Gl,Jl,"⪅","\\lessapprox",!0),
284
+ Hl(ql,Gl,Jl,"≊","\\approxeq",!0),Hl(ql,Gl,Wl,"⋖","\\lessdot"),Hl(ql,Gl,Jl,"⋘","\\lll",!0),Hl(ql,Gl,Jl,"≶","\\lessgtr",!0),Hl(ql,Gl,Jl,"⋚","\\lesseqgtr",!0),Hl(ql,Gl,Jl,"⪋","\\lesseqqgtr",!0),Hl(ql,Gl,Jl,"≑","\\doteqdot"),Hl(ql,Gl,Jl,"≓","\\risingdotseq",!0),Hl(ql,Gl,Jl,"≒","\\fallingdotseq",!0),Hl(ql,Gl,Jl,"∽","\\backsim",!0),Hl(ql,Gl,Jl,"⋍","\\backsimeq",!0),Hl(ql,Gl,Jl,"⫅","\\subseteqq",!0),Hl(ql,Gl,Jl,"⋐","\\Subset",!0),Hl(ql,Gl,Jl,"⊏","\\sqsubset",!0),Hl(ql,Gl,Jl,"≼","\\preccurlyeq",!0),Hl(ql,Gl,Jl,"⋞","\\curlyeqprec",!0),Hl(ql,Gl,Jl,"≾","\\precsim",!0),Hl(ql,Gl,Jl,"⪷","\\precapprox",!0),Hl(ql,Gl,Jl,"⊲","\\vartriangleleft"),Hl(ql,Gl,Jl,"⊴","\\trianglelefteq"),Hl(ql,Gl,Jl,"⊨","\\vDash",!0),Hl(ql,Gl,Jl,"⊪","\\Vvdash",!0),Hl(ql,Gl,Jl,"⌣","\\smallsmile"),Hl(ql,Gl,Jl,"⌢","\\smallfrown"),Hl(ql,Gl,Jl,"≏","\\bumpeq",!0),Hl(ql,Gl,Jl,"≎","\\Bumpeq",!0),Hl(ql,Gl,Jl,"≧","\\geqq",!0),Hl(ql,Gl,Jl,"⩾","\\geqslant",!0),Hl(ql,Gl,Jl,"⪖","\\eqslantgtr",!0),Hl(ql,Gl,Jl,"≳","\\gtrsim",!0),Hl(ql,Gl,Jl,"⪆","\\gtrapprox",!0),
285
+ Hl(ql,Gl,Wl,"⋗","\\gtrdot"),Hl(ql,Gl,Jl,"⋙","\\ggg",!0),Hl(ql,Gl,Jl,"≷","\\gtrless",!0),Hl(ql,Gl,Jl,"⋛","\\gtreqless",!0),Hl(ql,Gl,Jl,"⪌","\\gtreqqless",!0),Hl(ql,Gl,Jl,"≖","\\eqcirc",!0),Hl(ql,Gl,Jl,"≗","\\circeq",!0),Hl(ql,Gl,Jl,"≜","\\triangleq",!0),Hl(ql,Gl,Jl,"∼","\\thicksim"),Hl(ql,Gl,Jl,"≈","\\thickapprox"),Hl(ql,Gl,Jl,"⫆","\\supseteqq",!0),Hl(ql,Gl,Jl,"⋑","\\Supset",!0),Hl(ql,Gl,Jl,"⊐","\\sqsupset",!0),Hl(ql,Gl,Jl,"≽","\\succcurlyeq",!0),Hl(ql,Gl,Jl,"⋟","\\curlyeqsucc",!0),Hl(ql,Gl,Jl,"≿","\\succsim",!0),Hl(ql,Gl,Jl,"⪸","\\succapprox",!0),Hl(ql,Gl,Jl,"⊳","\\vartriangleright"),Hl(ql,Gl,Jl,"⊵","\\trianglerighteq"),Hl(ql,Gl,Jl,"⊩","\\Vdash",!0),Hl(ql,Gl,Jl,"∣","\\shortmid"),Hl(ql,Gl,Jl,"∥","\\shortparallel"),Hl(ql,Gl,Jl,"≬","\\between",!0),Hl(ql,Gl,Jl,"⋔","\\pitchfork",!0),Hl(ql,Gl,Jl,"∝","\\varpropto"),Hl(ql,Gl,Jl,"◀","\\blacktriangleleft"),Hl(ql,Gl,Jl,"∴","\\therefore",!0),Hl(ql,Gl,Jl,"∍","\\backepsilon"),Hl(ql,Gl,Jl,"▶","\\blacktriangleright"),Hl(ql,Gl,Jl,"∵","\\because",!0),
286
+ Hl(ql,Gl,Jl,"⋘","\\llless"),Hl(ql,Gl,Jl,"⋙","\\gggtr"),Hl(ql,Gl,Wl,"⊲","\\lhd"),Hl(ql,Gl,Wl,"⊳","\\rhd"),Hl(ql,Gl,Jl,"≂","\\eqsim",!0),Hl(ql,$l,Jl,"⋈","\\Join"),Hl(ql,Gl,Jl,"≑","\\Doteq",!0),Hl(ql,Gl,Wl,"∔","\\dotplus",!0),Hl(ql,Gl,Wl,"∖","\\smallsetminus"),Hl(ql,Gl,Wl,"⋒","\\Cap",!0),Hl(ql,Gl,Wl,"⋓","\\Cup",!0),Hl(ql,Gl,Wl,"⩞","\\doublebarwedge",!0),Hl(ql,Gl,Wl,"⊟","\\boxminus",!0),Hl(ql,Gl,Wl,"⊞","\\boxplus",!0),Hl(ql,Gl,Wl,"⋇","\\divideontimes",!0),Hl(ql,Gl,Wl,"⋉","\\ltimes",!0),Hl(ql,Gl,Wl,"⋊","\\rtimes",!0),Hl(ql,Gl,Wl,"⋋","\\leftthreetimes",!0),Hl(ql,Gl,Wl,"⋌","\\rightthreetimes",!0),Hl(ql,Gl,Wl,"⋏","\\curlywedge",!0),Hl(ql,Gl,Wl,"⋎","\\curlyvee",!0),Hl(ql,Gl,Wl,"⊝","\\circleddash",!0),Hl(ql,Gl,Wl,"⊛","\\circledast",!0),Hl(ql,Gl,Wl,"⋅","\\centerdot"),Hl(ql,Gl,Wl,"⊺","\\intercal",!0),Hl(ql,Gl,Wl,"⋒","\\doublecap"),Hl(ql,Gl,Wl,"⋓","\\doublecup"),Hl(ql,Gl,Wl,"⊠","\\boxtimes",!0),Hl(ql,Gl,Jl,"⇢","\\dashrightarrow",!0),Hl(ql,Gl,Jl,"⇠","\\dashleftarrow",!0),Hl(ql,Gl,Jl,"⇇","\\leftleftarrows",!0),
287
+ Hl(ql,Gl,Jl,"⇆","\\leftrightarrows",!0),Hl(ql,Gl,Jl,"⇚","\\Lleftarrow",!0),Hl(ql,Gl,Jl,"↞","\\twoheadleftarrow",!0),Hl(ql,Gl,Jl,"↢","\\leftarrowtail",!0),Hl(ql,Gl,Jl,"↫","\\looparrowleft",!0),Hl(ql,Gl,Jl,"⇋","\\leftrightharpoons",!0),Hl(ql,Gl,Jl,"↶","\\curvearrowleft",!0),Hl(ql,Gl,Jl,"↺","\\circlearrowleft",!0),Hl(ql,Gl,Jl,"↰","\\Lsh",!0),Hl(ql,Gl,Jl,"⇈","\\upuparrows",!0),Hl(ql,Gl,Jl,"↿","\\upharpoonleft",!0),Hl(ql,Gl,Jl,"⇃","\\downharpoonleft",!0),Hl(ql,$l,Jl,"⊶","\\origof",!0),Hl(ql,$l,Jl,"⊷","\\imageof",!0),Hl(ql,Gl,Jl,"⊸","\\multimap",!0),Hl(ql,Gl,Jl,"↭","\\leftrightsquigarrow",!0),Hl(ql,Gl,Jl,"⇉","\\rightrightarrows",!0),Hl(ql,Gl,Jl,"⇄","\\rightleftarrows",!0),Hl(ql,Gl,Jl,"↠","\\twoheadrightarrow",!0),Hl(ql,Gl,Jl,"↣","\\rightarrowtail",!0),Hl(ql,Gl,Jl,"↬","\\looparrowright",!0),Hl(ql,Gl,Jl,"↷","\\curvearrowright",!0),Hl(ql,Gl,Jl,"↻","\\circlearrowright",!0),Hl(ql,Gl,Jl,"↱","\\Rsh",!0),Hl(ql,Gl,Jl,"⇊","\\downdownarrows",!0),Hl(ql,Gl,Jl,"↾","\\upharpoonright",!0),Hl(ql,Gl,Jl,"⇂","\\downharpoonright",!0),
288
+ Hl(ql,Gl,Jl,"⇝","\\rightsquigarrow",!0),Hl(ql,Gl,Jl,"⇝","\\leadsto"),Hl(ql,Gl,Jl,"⇛","\\Rrightarrow",!0),Hl(ql,Gl,Jl,"↾","\\restriction"),Hl(ql,$l,Ql,"‘","`"),Hl(ql,$l,Ql,"$","\\$"),Hl(Ul,$l,Ql,"$","\\$"),Hl(Ul,$l,Ql,"$","\\textdollar"),Hl(ql,$l,Ql,"%","\\%"),Hl(Ul,$l,Ql,"%","\\%"),Hl(ql,$l,Ql,"_","\\_"),Hl(Ul,$l,Ql,"_","\\_"),Hl(Ul,$l,Ql,"_","\\textunderscore"),Hl(ql,$l,Ql,"∠","\\angle",!0),Hl(ql,$l,Ql,"∞","\\infty",!0),Hl(ql,$l,Ql,"′","\\prime"),Hl(ql,$l,Ql,"△","\\triangle"),Hl(ql,$l,Ql,"Γ","\\Gamma",!0),Hl(ql,$l,Ql,"Δ","\\Delta",!0),Hl(ql,$l,Ql,"Θ","\\Theta",!0),Hl(ql,$l,Ql,"Λ","\\Lambda",!0),Hl(ql,$l,Ql,"Ξ","\\Xi",!0),Hl(ql,$l,Ql,"Π","\\Pi",!0),Hl(ql,$l,Ql,"Σ","\\Sigma",!0),Hl(ql,$l,Ql,"Υ","\\Upsilon",!0),Hl(ql,$l,Ql,"Φ","\\Phi",!0),Hl(ql,$l,Ql,"Ψ","\\Psi",!0),Hl(ql,$l,Ql,"Ω","\\Omega",!0),Hl(ql,$l,Ql,"A","Α"),Hl(ql,$l,Ql,"B","Β"),Hl(ql,$l,Ql,"E","Ε"),Hl(ql,$l,Ql,"Z","Ζ"),Hl(ql,$l,Ql,"H","Η"),Hl(ql,$l,Ql,"I","Ι"),Hl(ql,$l,Ql,"K","Κ"),Hl(ql,$l,Ql,"M","Μ"),Hl(ql,$l,Ql,"N","Ν"),Hl(ql,$l,Ql,"O","Ο"),
289
+ Hl(ql,$l,Ql,"P","Ρ"),Hl(ql,$l,Ql,"T","Τ"),Hl(ql,$l,Ql,"X","Χ"),Hl(ql,$l,Ql,"¬","\\neg",!0),Hl(ql,$l,Ql,"¬","\\lnot"),Hl(ql,$l,Ql,"⊤","\\top"),Hl(ql,$l,Ql,"⊥","\\bot"),Hl(ql,$l,Ql,"∅","\\emptyset"),Hl(ql,Gl,Ql,"∅","\\varnothing"),Hl(ql,$l,Kl,"α","\\alpha",!0),Hl(ql,$l,Kl,"β","\\beta",!0),Hl(ql,$l,Kl,"γ","\\gamma",!0),Hl(ql,$l,Kl,"δ","\\delta",!0),Hl(ql,$l,Kl,"ϵ","\\epsilon",!0),Hl(ql,$l,Kl,"ζ","\\zeta",!0),Hl(ql,$l,Kl,"η","\\eta",!0),Hl(ql,$l,Kl,"θ","\\theta",!0),Hl(ql,$l,Kl,"ι","\\iota",!0),Hl(ql,$l,Kl,"κ","\\kappa",!0),Hl(ql,$l,Kl,"λ","\\lambda",!0),Hl(ql,$l,Kl,"μ","\\mu",!0),Hl(ql,$l,Kl,"ν","\\nu",!0),Hl(ql,$l,Kl,"ξ","\\xi",!0),Hl(ql,$l,Kl,"ο","\\omicron",!0),Hl(ql,$l,Kl,"π","\\pi",!0),Hl(ql,$l,Kl,"ρ","\\rho",!0),Hl(ql,$l,Kl,"σ","\\sigma",!0),Hl(ql,$l,Kl,"τ","\\tau",!0),Hl(ql,$l,Kl,"υ","\\upsilon",!0),Hl(ql,$l,Kl,"ϕ","\\phi",!0),Hl(ql,$l,Kl,"χ","\\chi",!0),Hl(ql,$l,Kl,"ψ","\\psi",!0),Hl(ql,$l,Kl,"ω","\\omega",!0),Hl(ql,$l,Kl,"ε","\\varepsilon",!0),Hl(ql,$l,Kl,"ϑ","\\vartheta",!0),
290
+ Hl(ql,$l,Kl,"ϖ","\\varpi",!0),Hl(ql,$l,Kl,"ϱ","\\varrho",!0),Hl(ql,$l,Kl,"ς","\\varsigma",!0),Hl(ql,$l,Kl,"φ","\\varphi",!0),Hl(ql,$l,Wl,"∗","*",!0),Hl(ql,$l,Wl,"+","+"),Hl(ql,$l,Wl,"−","-",!0),Hl(ql,$l,Wl,"⋅","\\cdot",!0),Hl(ql,$l,Wl,"∘","\\circ",!0),Hl(ql,$l,Wl,"÷","\\div",!0),Hl(ql,$l,Wl,"±","\\pm",!0),Hl(ql,$l,Wl,"×","\\times",!0),Hl(ql,$l,Wl,"∩","\\cap",!0),Hl(ql,$l,Wl,"∪","\\cup",!0),Hl(ql,$l,Wl,"∖","\\setminus",!0),Hl(ql,$l,Wl,"∧","\\land"),Hl(ql,$l,Wl,"∨","\\lor"),Hl(ql,$l,Wl,"∧","\\wedge",!0),Hl(ql,$l,Wl,"∨","\\vee",!0),Hl(ql,$l,Ql,"√","\\surd"),Hl(ql,$l,Zl,"⟨","\\langle",!0),Hl(ql,$l,Zl,"∣","\\lvert"),Hl(ql,$l,Zl,"∥","\\lVert"),Hl(ql,$l,Yl,"?","?"),Hl(ql,$l,Yl,"!","!"),Hl(ql,$l,Yl,"⟩","\\rangle",!0),Hl(ql,$l,Yl,"∣","\\rvert"),Hl(ql,$l,Yl,"∥","\\rVert"),Hl(ql,$l,Jl,"=","="),Hl(ql,$l,Jl,":",":"),Hl(ql,$l,Jl,"≈","\\approx",!0),Hl(ql,$l,Jl,"≅","\\cong",!0),Hl(ql,$l,Jl,"≥","\\ge"),Hl(ql,$l,Jl,"≥","\\geq",!0),Hl(ql,$l,Jl,"←","\\gets"),Hl(ql,$l,Jl,">","\\gt",!0),Hl(ql,$l,Jl,"∈","\\in",!0),
291
+ Hl(ql,$l,Jl,"","\\@not"),Hl(ql,$l,Jl,"⊂","\\subset",!0),Hl(ql,$l,Jl,"⊃","\\supset",!0),Hl(ql,$l,Jl,"⊆","\\subseteq",!0),Hl(ql,$l,Jl,"⊇","\\supseteq",!0),Hl(ql,Gl,Jl,"⊈","\\nsubseteq",!0),Hl(ql,Gl,Jl,"⊉","\\nsupseteq",!0),Hl(ql,$l,Jl,"⊨","\\models"),Hl(ql,$l,Jl,"←","\\leftarrow",!0),Hl(ql,$l,Jl,"≤","\\le"),Hl(ql,$l,Jl,"≤","\\leq",!0),Hl(ql,$l,Jl,"<","\\lt",!0),Hl(ql,$l,Jl,"→","\\rightarrow",!0),Hl(ql,$l,Jl,"→","\\to"),Hl(ql,Gl,Jl,"≱","\\ngeq",!0),Hl(ql,Gl,Jl,"≰","\\nleq",!0),Hl(ql,$l,"spacing"," ","\\ "),Hl(ql,$l,"spacing"," ","\\space"),Hl(ql,$l,"spacing"," ","\\nobreakspace"),Hl(Ul,$l,"spacing"," ","\\ "),Hl(Ul,$l,"spacing"," "," "),Hl(Ul,$l,"spacing"," ","\\space"),Hl(Ul,$l,"spacing"," ","\\nobreakspace"),Hl(ql,$l,"spacing",null,"\\nobreak"),Hl(ql,$l,"spacing",null,"\\allowbreak"),Hl(ql,$l,"punct",",",","),Hl(ql,$l,"punct",";",";"),Hl(ql,Gl,Wl,"⊼","\\barwedge",!0),Hl(ql,Gl,Wl,"⊻","\\veebar",!0),Hl(ql,$l,Wl,"⊙","\\odot",!0),Hl(ql,$l,Wl,"⊕","\\oplus",!0),Hl(ql,$l,Wl,"⊗","\\otimes",!0),
292
+ Hl(ql,$l,Ql,"∂","\\partial",!0),Hl(ql,$l,Wl,"⊘","\\oslash",!0),Hl(ql,Gl,Wl,"⊚","\\circledcirc",!0),Hl(ql,Gl,Wl,"⊡","\\boxdot",!0),Hl(ql,$l,Wl,"△","\\bigtriangleup"),Hl(ql,$l,Wl,"▽","\\bigtriangledown"),Hl(ql,$l,Wl,"†","\\dagger"),Hl(ql,$l,Wl,"⋄","\\diamond"),Hl(ql,$l,Wl,"⋆","\\star"),Hl(ql,$l,Wl,"◃","\\triangleleft"),Hl(ql,$l,Wl,"▹","\\triangleright"),Hl(ql,$l,Zl,"{","\\{"),Hl(Ul,$l,Ql,"{","\\{"),Hl(Ul,$l,Ql,"{","\\textbraceleft"),Hl(ql,$l,Yl,"}","\\}"),Hl(Ul,$l,Ql,"}","\\}"),Hl(Ul,$l,Ql,"}","\\textbraceright"),Hl(ql,$l,Zl,"{","\\lbrace"),Hl(ql,$l,Yl,"}","\\rbrace"),Hl(ql,$l,Zl,"[","\\lbrack",!0),Hl(Ul,$l,Ql,"[","\\lbrack",!0),Hl(ql,$l,Yl,"]","\\rbrack",!0),Hl(Ul,$l,Ql,"]","\\rbrack",!0),Hl(ql,$l,Zl,"(","\\lparen",!0),Hl(ql,$l,Yl,")","\\rparen",!0),Hl(Ul,$l,Ql,"<","\\textless",!0),Hl(Ul,$l,Ql,">","\\textgreater",!0),Hl(ql,$l,Zl,"⌊","\\lfloor",!0),Hl(ql,$l,Yl,"⌋","\\rfloor",!0),Hl(ql,$l,Zl,"⌈","\\lceil",!0),Hl(ql,$l,Yl,"⌉","\\rceil",!0),Hl(ql,$l,Ql,"\\","\\backslash"),Hl(ql,$l,Ql,"∣","|"),
293
+ Hl(ql,$l,Ql,"∣","\\vert"),Hl(Ul,$l,Ql,"|","\\textbar",!0),Hl(ql,$l,Ql,"∥","\\|"),Hl(ql,$l,Ql,"∥","\\Vert"),Hl(Ul,$l,Ql,"∥","\\textbardbl"),Hl(Ul,$l,Ql,"~","\\textasciitilde"),Hl(Ul,$l,Ql,"\\","\\textbackslash"),Hl(Ul,$l,Ql,"^","\\textasciicircum"),Hl(ql,$l,Jl,"↑","\\uparrow",!0),Hl(ql,$l,Jl,"⇑","\\Uparrow",!0),Hl(ql,$l,Jl,"↓","\\downarrow",!0),Hl(ql,$l,Jl,"⇓","\\Downarrow",!0),Hl(ql,$l,Jl,"↕","\\updownarrow",!0),Hl(ql,$l,Jl,"⇕","\\Updownarrow",!0),Hl(ql,$l,Xl,"∐","\\coprod"),Hl(ql,$l,Xl,"⋁","\\bigvee"),Hl(ql,$l,Xl,"⋀","\\bigwedge"),Hl(ql,$l,Xl,"⨄","\\biguplus"),Hl(ql,$l,Xl,"⋂","\\bigcap"),Hl(ql,$l,Xl,"⋃","\\bigcup"),Hl(ql,$l,Xl,"∫","\\int"),Hl(ql,$l,Xl,"∫","\\intop"),Hl(ql,$l,Xl,"∬","\\iint"),Hl(ql,$l,Xl,"∭","\\iiint"),Hl(ql,$l,Xl,"∏","\\prod"),Hl(ql,$l,Xl,"∑","\\sum"),Hl(ql,$l,Xl,"⨂","\\bigotimes"),Hl(ql,$l,Xl,"⨁","\\bigoplus"),Hl(ql,$l,Xl,"⨀","\\bigodot"),Hl(ql,$l,Xl,"∮","\\oint"),Hl(ql,$l,Xl,"∯","\\oiint"),Hl(ql,$l,Xl,"∰","\\oiiint"),Hl(ql,$l,Xl,"⨆","\\bigsqcup"),Hl(ql,$l,Xl,"∫","\\smallint"),
294
+ Hl(Ul,$l,"inner","…","\\textellipsis"),Hl(ql,$l,"inner","…","\\mathellipsis"),Hl(Ul,$l,"inner","…","\\ldots",!0),Hl(ql,$l,"inner","…","\\ldots",!0),Hl(ql,$l,"inner","⋯","\\@cdots",!0),Hl(ql,$l,"inner","⋱","\\ddots",!0),Hl(ql,$l,Ql,"⋮","\\varvdots"),Hl(ql,$l,Vl,"ˊ","\\acute"),Hl(ql,$l,Vl,"ˋ","\\grave"),Hl(ql,$l,Vl,"¨","\\ddot"),Hl(ql,$l,Vl,"~","\\tilde"),Hl(ql,$l,Vl,"ˉ","\\bar"),Hl(ql,$l,Vl,"˘","\\breve"),Hl(ql,$l,Vl,"ˇ","\\check"),Hl(ql,$l,Vl,"^","\\hat"),Hl(ql,$l,Vl,"⃗","\\vec"),Hl(ql,$l,Vl,"˙","\\dot"),Hl(ql,$l,Vl,"˚","\\mathring"),Hl(ql,$l,Kl,"","\\@imath"),Hl(ql,$l,Kl,"","\\@jmath"),Hl(ql,$l,Ql,"ı","ı"),Hl(ql,$l,Ql,"ȷ","ȷ"),Hl(Ul,$l,Ql,"ı","\\i",!0),Hl(Ul,$l,Ql,"ȷ","\\j",!0),Hl(Ul,$l,Ql,"ß","\\ss",!0),Hl(Ul,$l,Ql,"æ","\\ae",!0),Hl(Ul,$l,Ql,"œ","\\oe",!0),Hl(Ul,$l,Ql,"ø","\\o",!0),Hl(Ul,$l,Ql,"Æ","\\AE",!0),Hl(Ul,$l,Ql,"Œ","\\OE",!0),Hl(Ul,$l,Ql,"Ø","\\O",!0),Hl(Ul,$l,Vl,"ˊ","\\'"),Hl(Ul,$l,Vl,"ˋ","\\`"),Hl(Ul,$l,Vl,"ˆ","\\^"),Hl(Ul,$l,Vl,"˜","\\~"),Hl(Ul,$l,Vl,"ˉ","\\="),Hl(Ul,$l,Vl,"˘","\\u"),
295
+ Hl(Ul,$l,Vl,"˙","\\."),Hl(Ul,$l,Vl,"¸","\\c"),Hl(Ul,$l,Vl,"˚","\\r"),Hl(Ul,$l,Vl,"ˇ","\\v"),Hl(Ul,$l,Vl,"¨",'\\"'),Hl(Ul,$l,Vl,"˝","\\H"),Hl(Ul,$l,Vl,"◯","\\textcircled");var ec={"--":!0,"---":!0,"``":!0,"''":!0};Hl(Ul,$l,Ql,"–","--",!0),Hl(Ul,$l,Ql,"–","\\textendash"),Hl(Ul,$l,Ql,"—","---",!0),Hl(Ul,$l,Ql,"—","\\textemdash"),Hl(Ul,$l,Ql,"‘","`",!0),Hl(Ul,$l,Ql,"‘","\\textquoteleft"),Hl(Ul,$l,Ql,"’","'",!0),Hl(Ul,$l,Ql,"’","\\textquoteright"),Hl(Ul,$l,Ql,"“","``",!0),Hl(Ul,$l,Ql,"“","\\textquotedblleft"),Hl(Ul,$l,Ql,"”","''",!0),Hl(Ul,$l,Ql,"”","\\textquotedblright"),Hl(ql,$l,Ql,"°","\\degree",!0),Hl(Ul,$l,Ql,"°","\\degree"),Hl(Ul,$l,Ql,"°","\\textdegree",!0),Hl(ql,$l,Ql,"£","\\pounds"),Hl(ql,$l,Ql,"£","\\mathsterling",!0),Hl(Ul,$l,Ql,"£","\\pounds"),Hl(Ul,$l,Ql,"£","\\textsterling",!0),Hl(ql,Gl,Ql,"✠","\\maltese"),Hl(Ul,Gl,Ql,"✠","\\maltese");for(var tc=0;tc<'0123456789/@."'.length;tc++){var nc='0123456789/@."'.charAt(tc);Hl(ql,$l,Ql,nc,nc)}for(var rc=0;rc<'0123456789!@*()-=+";:?/.,'.length;rc++){
296
+ var oc='0123456789!@*()-=+";:?/.,'.charAt(rc);Hl(Ul,$l,Ql,oc,oc)}for(var ic="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ac=0;ac<ic.length;ac++){var sc=ic.charAt(ac);Hl(ql,$l,Kl,sc,sc),Hl(Ul,$l,Ql,sc,sc)}Hl(ql,Gl,Ql,"C","ℂ"),Hl(Ul,Gl,Ql,"C","ℂ"),Hl(ql,Gl,Ql,"H","ℍ"),Hl(Ul,Gl,Ql,"H","ℍ"),Hl(ql,Gl,Ql,"N","ℕ"),Hl(Ul,Gl,Ql,"N","ℕ"),Hl(ql,Gl,Ql,"P","ℙ"),Hl(Ul,Gl,Ql,"P","ℙ"),Hl(ql,Gl,Ql,"Q","ℚ"),Hl(Ul,Gl,Ql,"Q","ℚ"),Hl(ql,Gl,Ql,"R","ℝ"),Hl(Ul,Gl,Ql,"R","ℝ"),Hl(ql,Gl,Ql,"Z","ℤ"),Hl(Ul,Gl,Ql,"Z","ℤ"),Hl(ql,$l,Kl,"h","ℎ"),Hl(Ul,$l,Kl,"h","ℎ");for(var lc="",cc=0;cc<ic.length;cc++){var uc=ic.charAt(cc);Hl(ql,$l,Kl,uc,lc=String.fromCharCode(55349,56320+cc)),Hl(Ul,$l,Ql,uc,lc),Hl(ql,$l,Kl,uc,lc=String.fromCharCode(55349,56372+cc)),Hl(Ul,$l,Ql,uc,lc),Hl(ql,$l,Kl,uc,lc=String.fromCharCode(55349,56424+cc)),Hl(Ul,$l,Ql,uc,lc),Hl(ql,$l,Kl,uc,lc=String.fromCharCode(55349,56580+cc)),Hl(Ul,$l,Ql,uc,lc),Hl(ql,$l,Kl,uc,lc=String.fromCharCode(55349,56736+cc)),Hl(Ul,$l,Ql,uc,lc),
297
+ Hl(ql,$l,Kl,uc,lc=String.fromCharCode(55349,56788+cc)),Hl(Ul,$l,Ql,uc,lc),Hl(ql,$l,Kl,uc,lc=String.fromCharCode(55349,56840+cc)),Hl(Ul,$l,Ql,uc,lc),Hl(ql,$l,Kl,uc,lc=String.fromCharCode(55349,56944+cc)),Hl(Ul,$l,Ql,uc,lc),cc<26&&(Hl(ql,$l,Kl,uc,lc=String.fromCharCode(55349,56632+cc)),Hl(Ul,$l,Ql,uc,lc),Hl(ql,$l,Kl,uc,lc=String.fromCharCode(55349,56476+cc)),Hl(Ul,$l,Ql,uc,lc))}Hl(ql,$l,Kl,"k",lc=String.fromCharCode(55349,56668)),Hl(Ul,$l,Ql,"k",lc);for(var hc=0;hc<10;hc++){var dc=hc.toString();Hl(ql,$l,Kl,dc,lc=String.fromCharCode(55349,57294+hc)),Hl(Ul,$l,Ql,dc,lc),Hl(ql,$l,Kl,dc,lc=String.fromCharCode(55349,57314+hc)),Hl(Ul,$l,Ql,dc,lc),Hl(ql,$l,Kl,dc,lc=String.fromCharCode(55349,57324+hc)),Hl(Ul,$l,Ql,dc,lc),Hl(ql,$l,Kl,dc,lc=String.fromCharCode(55349,57334+hc)),Hl(Ul,$l,Ql,dc,lc)}for(var pc=0;pc<"ÐÞþ".length;pc++){var mc="ÐÞþ".charAt(pc);Hl(ql,$l,Kl,mc,mc),Hl(Ul,$l,Ql,mc,mc)}
298
+ var fc=[["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"]],gc=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],vc=function(e,t,n){
299
+ return jl[n][e]&&jl[n][e].replace&&(e=jl[n][e].replace),{value:e,metrics:ml(e,t,n)}},yc=function(e,t,n,r,o){var i,a=vc(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 Ol(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 Ol(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},_c=(e,t)=>{if(Cl(e.classes)!==Cl(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},bc=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),
300
+ i.maxFontSize>r&&(r=i.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},wc=function(e,t,n,r){var o=new Nl(e,t,n,r);return bc(o),o},xc=(e,t,n,r)=>new Nl(e,t,n,r),kc=function(e){var t=new ul(e);return bc(t),t},Sc=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")},Cc={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"},
301
+ mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Ac={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Ec={fontMap:Cc,makeSymbol:yc,mathsym:function(e,t,n,r){return void 0===r&&(r=[]),"boldsymbol"===n.font&&vc(e,"Main-Bold",t).metrics?yc(e,"Main-Bold",t,n,r.concat(["mathbf"])):"\\"===e||"main"===jl[t][e].font?yc(e,"Main-Regular",t,n,r):yc(e,"AMS-Regular",t,n,r.concat(["amsrm"]))},makeSpan:wc,makeSvgSpan:xc,makeLineSpan:function(e,t,n){var r=wc([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=Sl(r.height),r.maxFontSize=1,r},makeAnchor:function(e,t,n,r){var o=new Ml(e,t,n,r);return bc(o),o},makeFragment:kc,wrapFragment:function(e,t){return e instanceof ul?wc([],[e],t):e},makeVList:function(e,t){for(var{children:n,depth:r}=function(e){if("individualShift"===e.positionType){
302
+ 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=wc(["pstrut"],[]);l.style.height=Sl(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{
303
+ var f=m.elem,g=m.wrapperClasses||[],v=m.wrapperStyle||{},y=wc(g,[l,f],void 0,v);y.style.top=Sl(-o-d-f.depth),m.marginLeft&&(y.style.marginLeft=m.marginLeft),m.marginRight&&(y.style.marginRight=m.marginRight),c.push(y),d+=f.height+f.depth}u=Math.min(u,d),h=Math.max(h,d)}var _,b=wc(["vlist"],c);if(b.style.height=Sl(h),u<0){var w=wc([],[]),x=wc(["vlist"],[w]);x.style.height=Sl(-u);var k=wc(["vlist-s"],[new Ol("​")]);_=[wc(["vlist-r"],[b,k]),wc(["vlist-r"],[x])]}else _=[wc(["vlist-r"],[b])];var S=wc(["vlist-t"],_);return 2===_.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[fc[o][2],fc[o][r]]}if(120782<=n&&n<=120831){var i=Math.floor((n-120782)/10);return[gc[i][2],gc[i][r]]}
304
+ if(120485===n||120486===n)return[fc[0][2],fc[0][r]];if(120486<n&&n<120782)return["",""];throw new qs("Unsupported character: "+e)}(o,r);return yc(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&&vc(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=Cc[s].fontName,h=[s]):(u=Sc(s,t.fontWeight,t.fontShape),h=[s,t.fontWeight,t.fontShape]);if(vc(o,u,r).metrics)return yc(o,u,r,t,i.concat(h));if(ec.hasOwnProperty(o)&&"Typewriter"===u.substr(0,10)){for(var p=[],m=0;m<o.length;m++)p.push(yc(o[m],u,r,t,i.concat(h)));return kc(p)}}if("mathord"===n)return yc(o,"Math-Italic",r,t,i.concat(["mathnormal"]));if("textord"===n){var f=jl[r][o]&&jl[r][o].font;if("ams"===f){var g=Sc("amsrm",t.fontWeight,t.fontShape);return yc(o,g,r,t,i.concat("amsrm",t.fontWeight,t.fontShape))}if("main"!==f&&f){var v=Sc(f,t.fontWeight,t.fontShape)
305
+ ;return yc(o,v,r,t,i.concat(v,t.fontWeight,t.fontShape))}var y=Sc("textrm",t.fontWeight,t.fontShape);return yc(o,y,r,t,i.concat(t.fontWeight,t.fontShape))}throw new Error("unexpected type: "+n+" in makeOrd")},makeGlue:(e,t)=>{var n=wc(["mspace"],[],t),r=kl(e,t);return n.style.marginRight=Sl(r),n},staticSvg:function(e,t){var[n,r,o]=Ac[e],i=new Pl(n),a=new Il([i],{width:Sl(r),height:Sl(o),style:"width:"+Sl(r),viewBox:"0 0 "+1e3*r+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),s=xc(["overlay"],[a],t);return s.height=o,s.style.height=Sl(o),s.style.width=Sl(r),s},svgData:Ac,tryCombineChars:e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof Ol&&r instanceof Ol&&_c(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}},Tc={number:3,unit:"mu"},Nc={number:4,unit:"mu"},Mc={number:5,unit:"mu"},Lc={mord:{mop:Tc,mbin:Nc,mrel:Mc,minner:Tc},mop:{mord:Tc,mop:Tc,mrel:Mc,minner:Tc},mbin:{mord:Nc,mop:Nc,mopen:Nc,minner:Nc},mrel:{
306
+ mord:Mc,mop:Mc,mopen:Mc,minner:Mc},mopen:{},mclose:{mop:Tc,mbin:Nc,mrel:Mc,minner:Tc},mpunct:{mord:Tc,mop:Tc,mrel:Mc,mopen:Tc,mclose:Tc,mpunct:Tc,minner:Tc},minner:{mord:Tc,mop:Tc,mbin:Nc,mrel:Mc,mopen:Tc,mpunct:Tc,minner:Tc}},zc={mord:{mop:Tc},mop:{mord:Tc,mop:Tc},mbin:{},mrel:{},mopen:{},mclose:{mop:Tc},mpunct:{},minner:{mop:Tc}},Oc={},Ic={},Pc={};function Rc(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)Oc[n[l]]=s;t&&(i&&(Ic[t]=i),a&&(Pc[t]=a))}function Dc(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;Rc({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var Bc=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e
307
+ },Fc=function(e){return"ordgroup"===e.type?e.body:[e]},jc=Ec.makeSpan,Hc=["leftmost","mbin","mopen","mrel","mop","mpunct"],qc=["rightmost","mrel","mclose","mpunct"],Uc={display:il.DISPLAY,text:il.TEXT,script:il.SCRIPT,scriptscript:il.SCRIPTSCRIPT},$c={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Gc=function(e,t,n,r){void 0===r&&(r=[null,null]);for(var o=[],i=0;i<e.length;i++){var a=Zc(e[i],t);if(a instanceof ul){var s=a.children;o.push(...s)}else o.push(a)}if(Ec.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(Uc[c.style]))}var u=jc([r[0]||"leftmost"],[],t),h=jc([r[1]||"rightmost"],[],t),d="root"===n;return Vc(o,((e,t)=>{var n=t.classes[0],r=e.classes[0];"mbin"===n&&Ws.contains(qc,r)?t.classes[0]="mord":"mbin"===r&&Ws.contains(Hc,n)&&(e.classes[0]="mord")}),{node:u},h,d),Vc(o,((e,t)=>{
308
+ var n=Kc(t),r=Kc(e),o=n&&r?e.hasClass("mtight")?zc[n][r]:Lc[n][r]:null;if(o)return Ec.makeGlue(o,l)}),{node:u},h,d),o},Vc=function e(t,n,r,o,i){o&&t.push(o);for(var a=0;a<t.length;a++){var s=t[a],l=Wc(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=jc(["leftmost"])),r.insertAfter=(e=>n=>{t.splice(e+1,0,n),a++})(a)}}o&&t.pop()},Wc=function(e){return e instanceof ul||e instanceof Ml||e instanceof Nl&&e.hasClass("enclosing")?e:null},Yc=function e(t,n){var r=Wc(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},Kc=function(e,t){return e?(t&&(e=Yc(e,t)),$c[e.classes[0]]||null):null},Xc=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return jc(t.concat(n))},Zc=function(e,t,n){if(!e)return jc();if(Ic[e.type]){var r=Ic[e.type](e,t);if(n&&t.size!==n.size){
309
+ r=jc(t.sizingClasses(n),[r],t);var o=t.sizeMultiplier/n.sizeMultiplier;r.height*=o,r.depth*=o}return r}throw new qs("Got group of unknown type: '"+e.type+"'")};function Jc(e,t){var n=jc(["base"],e,t),r=jc(["strut"]);return r.style.height=Sl(n.height+n.depth),n.depth&&(r.style.verticalAlign=Sl(-n.depth)),n.children.unshift(r),n}function Qc(e,t){var n=null;1===e.length&&"tag"===e[0].type&&(n=e[0].tag,e=e[0].body);var r,o=Gc(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(Jc(s,t)),s=[])}else o[l].hasClass("newline")&&(s.pop(),s.length>0&&(a.push(Jc(s,t)),s=[]),a.push(o[l]));s.length>0&&a.push(Jc(s,t)),n?((i=Jc(Gc(n,t,!0))).classes=["tag"],a.push(i)):r&&a.push(r);var u=jc(["katex-html"],a);if(u.setAttribute("aria-hidden","true"),i){
310
+ var h=i.children[0];h.style.height=Sl(u.height+u.depth),u.depth&&(h.style.verticalAlign=Sl(-u.depth))}return u}function eu(e){return new ul(e)}class tu{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=Cl(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+=Ws.escape(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+Ws.escape(Cl(this.classes))+'"'),e+=">"
311
+ ;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 nu{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ws.escape(this.toText())}toText(){return this.text}}var ru={MathNode:tu,TextNode:nu,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",Sl(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Sl(this.width)+'"/>'}toText(){
312
+ return this.character?this.character:" "}},newDocumentFragment:eu},ou=function(e,t,n){return!jl[t][e]||!jl[t][e].replace||55349===e.charCodeAt(0)||ec.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.substr(4,2)||n.font&&"tt"===n.font.substr(4,2))||(e=jl[t][e].replace),new ru.TextNode(e)},iu=function(e){return 1===e.length?e[0]:new ru.MathNode("mrow",e)},au=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"
313
+ ;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 Ws.contains(["\\imath","\\jmath"],o)?null:(jl[r][o]&&jl[r][o].replace&&(o=jl[r][o].replace),ml(o,Ec.fontMap[n].fontName,r)?Ec.fontMap[n].variant:null)},su=function(e,t,n){if(1===e.length){var r=cu(e[0],t);return n&&r instanceof tu&&"mo"===r.type&&(r.setAttribute("lspace","0em"),r.setAttribute("rspace","0em")),[r]}for(var o,i=[],a=0;a<e.length;a++){var s=cu(e[a],t);if(s instanceof tu&&o instanceof tu){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 nu&&"."===l.text){o.children.push(...s.children);continue}}else if("mi"===o.type&&1===o.children.length){var c=o.children[0]
314
+ ;if(c instanceof nu&&"̸"===c.text&&("mo"===s.type||"mi"===s.type||"mn"===s.type)){var u=s.children[0];u instanceof nu&&u.text.length>0&&(u.text=u.text.slice(0,1)+"̸"+u.text.slice(1),i.pop())}}}i.push(s),o=s}return i},lu=function(e,t,n){return iu(su(e,t,n))},cu=function(e,t){if(!e)return new ru.MathNode("mrow");if(Pc[e.type])return Pc[e.type](e,t);throw new qs("Got group of unknown type: '"+e.type+"'")};function uu(e,t,n,r,o){var i,a=su(e,n);i=1===a.length&&a[0]instanceof tu&&Ws.contains(["mrow","mtable"],a[0].type)?a[0]:new ru.MathNode("mrow",a);var s=new ru.MathNode("annotation",[new ru.TextNode(t)]);s.setAttribute("encoding","application/x-tex");var l=new ru.MathNode("semantics",[i,s]),c=new ru.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 Ec.makeSpan([u],[c])}var hu=function(e){return new _l({style:e.displayMode?il.DISPLAY:il.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})
315
+ },du=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=Ec.makeSpan(n,[e])}return e},pu={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":"="},mu={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],
315
316
  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"],
316
317
  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],
317
- xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},pu=function(e,t,n,r,o){var i,a=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(i=Cc.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 Il({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new Il({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new zl(l,{width:"100%",height:xl(a)});i=Cc.makeSvgSpan([],[c],o)}return i.height=a,i.style.height=xl(a),i},mu=function(e){var t=new tu.MathNode("mo",[new tu.TextNode(hu[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},fu=function(e,t){var{span:n,minWidth:r,height:o}=function(){var n=4e5,r=e.label.substr(1)
318
- ;if(Gs.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 Ol(i),u=new zl([c],{width:"100%",height:xl(a),viewBox:"0 0 "+n+" "+o,preserveAspectRatio:"none"});return{span:Cc.makeSvgSpan([],[u],t),minWidth:0,height:a}}var h,d,p,m=[],f=du[r],[g,v,y]=f,_=y/1e3,b=g.length;if(1===b)h=["hide-tail"],d=[f[3]];else if(2===b)h=["halfarrow-left","halfarrow-right"],d=["xMinYMin","xMaxYMin"];else{if(3!==b)throw new Error("Correct katexImagesData or update code here to support\n "+b+" children.");h=["brace-left","brace-center","brace-right"],d=["xMinYMin","xMidYMin","xMaxYMin"]}
319
- for(var w=0;w<b;w++){var x=new Ol(g[w]),k=new zl([x],{width:"400em",height:xl(_),viewBox:"0 0 "+n+" "+y,preserveAspectRatio:d[w]+" slice"}),S=Cc.makeSvgSpan([h[w]],[k],t);if(1===b)return{span:S,minWidth:v,height:_};S.style.height=xl(_),m.push(S)}return{span:Cc.makeSpan(["stretchy"],m,t),minWidth:v,height:_}}();return n.height=o,n.style.height=xl(o),r>0&&(n.style.minWidth=xl(r)),n};function gu(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 vu(e){var t=yu(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 yu(e){return e&&("atom"===e.type||Dl.hasOwnProperty(e.type))?e:null}var _u=(e,t)=>{var n,r,o;e&&"supsub"===e.type?(n=(r=gu(e.base,"accent")).base,e.base=n,o=function(e){if(e instanceof El)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(Kc(e,t)),e.base=r):n=(r=gu(e,"accent")).base;var i=Kc(n,t.havingCrampedStyle()),a=0
320
- ;if(r.isShifty&&Gs.isCharacterBox(n)){var s=Gs.getBaseElem(n);a=Rl(Kc(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=fu(r,t),l=Cc.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:l,wrapperClasses:["svg-align"],wrapperStyle:a>0?{width:"calc(100% - "+xl(2*a)+")",marginLeft:xl(2*a)}:void 0}]},t);else{var h,d;"\\vec"===r.label?(h=Cc.staticSvg("vec",t),d=Cc.svgData.vec[1]):((h=Rl(h=Cc.makeOrd({mode:r.mode,text:r.label},t,"textord"))).italic=0,d=h.width,c&&(u+=h.depth)),l=Cc.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=xl(m),"\\textcircled"===r.label&&(l.style.top=".2em"),l=Cc.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-u},{type:"elem",elem:l}]},t)}var f=Cc.makeSpan(["mord","accent"],[l],t);return o?(o.children[0]=f,
321
- o.height=Math.max(f.height,o.height),o.classes[0]="mord",o):f},bu=(e,t)=>{var n=e.isStretchy?mu(e.label):new tu.MathNode("mo",[nu(e.label,e.mode)]),r=new tu.MathNode("mover",[su(e.base,t),n]);return r.setAttribute("accent","true"),r},wu=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map((e=>"\\"+e)).join("|"));Ic({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=Pc(t[0]),r=!wu.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:_u,mathmlBuilder:bu}),Ic({type:"accent",
322
- 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:_u,mathmlBuilder:bu}),Ic({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=Kc(e.base,t),r=fu(e,t),o="\\utilde"===e.label?.12:0,i=Cc.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:o},{type:"elem",elem:n}]},t);return Cc.makeSpan(["mord","accentunder"],[i],t)},
323
- mathmlBuilder:(e,t)=>{var n=mu(e.label),r=new tu.MathNode("munder",[su(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var xu=e=>{var t=new tu.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Ic({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){
324
- var n,r=t.style,o=t.havingStyle(r.sup()),i=Cc.wrapFragment(Kc(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=Cc.wrapFragment(Kc(e.below,o,t),t)).classes.push(a+"-arrow-pad"));var s,l=fu(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=Cc.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=Cc.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"),Cc.makeSpan(["mrel","x-arrow"],[s],t)},mathmlBuilder(e,t){var n,r=mu(e.label);if(r.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var o=xu(su(e.body,t));if(e.below){
325
- var i=xu(su(e.below,t));n=new tu.MathNode("munderover",[r,i,o])}else n=new tu.MathNode("mover",[r,o])}else if(e.below){var a=xu(su(e.below,t));n=new tu.MathNode("munder",[r,a])}else n=xu(),n=new tu.MathNode("mover",[r,n]);return n}});var ku={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Su=e=>"textord"===e.type&&"@"===e.text;function Cu(e,t,n){var r=ku[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"}
326
- }}Ic({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=Cc.wrapFragment(Kc(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=xl(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new tu.MathNode("mrow",[su(e.label,t)]);return(n=new tu.MathNode("mpadded",[n])).setAttribute("width","0"),"left"===e.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),(n=new tu.MathNode("mstyle",[n])).setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),Ic({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=Cc.wrapFragment(Kc(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder:(e,t)=>new tu.MathNode("mrow",[su(e.fragment,t)])}),Ic({
327
- type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=gu(t[0],"ordgroup").body,o="",i=0;i<r.length;i++){o+=gu(r[i],"textord").text}var a,s=parseInt(o);if(isNaN(s))throw new js("\\@char has non-numeric argument "+o);if(s<0||s>=1114111)throw new js("\\@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 Au=(e,t)=>{var n=Uc(e.body,t.withColor(e.color),!1);return Cc.makeFragment(n)},Eu=(e,t)=>{var n=iu(e.body,t.withColor(e.color)),r=new tu.MathNode("mstyle",n);return r.setAttribute("mathcolor",e.color),r};Ic({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=gu(t[0],"color-token").color,o=t[1];return{type:"color",mode:n.mode,color:r,body:Dc(o)}},htmlBuilder:Au,mathmlBuilder:Eu}),Ic({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,
328
- argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,o=gu(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:Au,mathmlBuilder:Eu}),Ic({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&&gu(o,"size").value}},htmlBuilder(e,t){var n=Cc.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=xl(wl(e.size,t)))),n},mathmlBuilder(e,t){var n=new tu.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",xl(wl(e.size,t)))),n}});var Tu={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef",
329
- "\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Nu=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new js("Expected a control sequence",e);return t},Lu=(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)};Ic({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(Tu[r.text])return"\\global"!==n&&"\\\\globallong"!==n||(r.text=Tu[r.text]),gu(t.parseFunction(),"internal");throw new js("Invalid token after macro prefix",r)}}),Ic({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 js("Expected a control sequence",r)
330
- ;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 js('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==a+1)throw new js('Argument number "'+r.text+'" out of order');a++,s.push([])}else{if("EOF"===r.text)throw new js("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===Tu[n]),{type:"internal",mode:t.mode}}}),Ic({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=Nu(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)
331
- ;return Lu(t,r,o,"\\\\globallet"===n),{type:"internal",mode:t.mode}}}),Ic({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=Nu(t.gullet.popToken()),o=t.gullet.popToken(),i=t.gullet.popToken();return Lu(t,r,i,"\\\\globalfuture"===n),t.gullet.pushToken(i),t.gullet.pushToken(o),{type:"internal",mode:t.mode}}});var Mu=function(e,t,n){var r=dl(Bl.math[e]&&Bl.math[e].replace||e,t,n);if(!r)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return r},zu=function(e,t,n,r){var o=n.havingBaseStyle(t),i=Cc.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},Ou=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=xl(o),e.height-=o,e.depth+=o},Iu=function(e,t,n,r,o,i){var a=function(e,t,n,r){
332
- return Cc.makeSymbol(e,"Size"+t+"-Regular",n,r)}(e,t,o,r),s=zu(Cc.makeSpan(["delimsizing","size"+t],[a],r),rl.TEXT,r,i);return n&&Ou(s,r,rl.TEXT),s},Ru=function(e,t,n){var r;return r="Size1-Regular"===t?"delim-size1":"delim-size4",{type:"elem",elem:Cc.makeSpan(["delimsizinginner",r],[Cc.makeSpan([],[Cc.makeSymbol(e,t,n)])])}},Pu=function(e,t,n){var r=cl["Size4-Regular"][e.charCodeAt(0)]?cl["Size4-Regular"][e.charCodeAt(0)][4]:cl["Size1-Regular"][e.charCodeAt(0)][4],o=new Ol("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"
333
- ;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 zl([o],{width:xl(r),height:xl(t),style:"width:"+xl(r),viewBox:"0 0 "+1e3*r+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),a=Cc.makeSvgSpan([],[i],n);return a.height=t,a.style.height=xl(t),a.style.width=xl(r),{type:"elem",elem:a}},Du={type:"kern",size:-.008},Bu=["|","\\lvert","\\rvert","\\vert"],Fu=["\\|","\\lVert","\\rVert","\\Vert"],ju=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"):Gs.contains(Bu,e)?l="∣":Gs.contains(Fu,e)?l="∥":"["===e||"\\lbrack"===e?(a="⎡",l="⎢",c="⎣",u="Size4-Regular"):"]"===e||"\\rbrack"===e?(a="⎤",l="⎥",c="⎦",
334
- 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=Mu(a,u,o),d=h.height+h.depth,p=Mu(l,u,o),m=p.height+p.depth,f=Mu(c,u,o),g=f.height+f.depth,v=0,y=1;if(null!==s){var _=Mu(s,u,o);v=_.height+_.depth,y=2}var b=d+g+v,w=b+Math.max(0,Math.ceil((t-b)/(y*m)))*y*m,x=r.fontMetrics().axisHeight
335
- ;n&&(x*=r.sizeMultiplier);var k=w/2-x,S=[];if(S.push(Ru(c,u,o)),S.push(Du),null===s){var C=w-d-g+.016;S.push(Pu(l,C,r))}else{var A=(w-d-g-v)/2+.016;S.push(Pu(l,A,r)),S.push(Du),S.push(Ru(s,u,o)),S.push(Du),S.push(Pu(l,A,r))}S.push(Du),S.push(Ru(a,u,o));var E=r.havingBaseStyle(rl.TEXT),T=Cc.makeVList({positionType:"bottom",positionData:k,children:S},E);return zu(Cc.makeSpan(["delimsizing","mult"],[T],E),rl.TEXT,r,i)},Hu=function(e,t,n,r,o){var i=function(e,t,n){t*=1e3;var r="";switch(e){case"sqrtMain":r=function(e,t){
318
+ xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},fu=function(e,t,n,r,o){var i,a=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(i=Ec.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 Rl({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new Rl({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new Il(l,{width:"100%",height:Sl(a)});i=Ec.makeSvgSpan([],[c],o)}return i.height=a,i.style.height=Sl(a),i},gu=function(e){var t=new ru.MathNode("mo",[new ru.TextNode(pu[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},vu=function(e,t){var{span:n,minWidth:r,height:o}=function(){var n=4e5,r=e.label.substr(1)
319
+ ;if(Ws.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 Pl(i),u=new Il([c],{width:"100%",height:Sl(a),viewBox:"0 0 "+n+" "+o,preserveAspectRatio:"none"});return{span:Ec.makeSvgSpan([],[u],t),minWidth:0,height:a}}var h,d,p,m=[],f=mu[r],[g,v,y]=f,_=y/1e3,b=g.length;if(1===b)h=["hide-tail"],d=[f[3]];else if(2===b)h=["halfarrow-left","halfarrow-right"],d=["xMinYMin","xMaxYMin"];else{if(3!==b)throw new Error("Correct katexImagesData or update code here to support\n "+b+" children.");h=["brace-left","brace-center","brace-right"],d=["xMinYMin","xMidYMin","xMaxYMin"]}
320
+ for(var w=0;w<b;w++){var x=new Pl(g[w]),k=new Il([x],{width:"400em",height:Sl(_),viewBox:"0 0 "+n+" "+y,preserveAspectRatio:d[w]+" slice"}),S=Ec.makeSvgSpan([h[w]],[k],t);if(1===b)return{span:S,minWidth:v,height:_};S.style.height=Sl(_),m.push(S)}return{span:Ec.makeSpan(["stretchy"],m,t),minWidth:v,height:_}}();return n.height=o,n.style.height=Sl(o),r>0&&(n.style.minWidth=Sl(r)),n};function yu(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 _u(e){var t=bu(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 bu(e){return e&&("atom"===e.type||Fl.hasOwnProperty(e.type))?e:null}var wu=(e,t)=>{var n,r,o;e&&"supsub"===e.type?(n=(r=yu(e.base,"accent")).base,e.base=n,o=function(e){if(e instanceof Nl)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(Zc(e,t)),e.base=r):n=(r=yu(e,"accent")).base;var i=Zc(n,t.havingCrampedStyle()),a=0
321
+ ;if(r.isShifty&&Ws.isCharacterBox(n)){var s=Ws.getBaseElem(n);a=Dl(Zc(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=vu(r,t),l=Ec.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:l,wrapperClasses:["svg-align"],wrapperStyle:a>0?{width:"calc(100% - "+Sl(2*a)+")",marginLeft:Sl(2*a)}:void 0}]},t);else{var h,d;"\\vec"===r.label?(h=Ec.staticSvg("vec",t),d=Ec.svgData.vec[1]):((h=Dl(h=Ec.makeOrd({mode:r.mode,text:r.label},t,"textord"))).italic=0,d=h.width,c&&(u+=h.depth)),l=Ec.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=Sl(m),"\\textcircled"===r.label&&(l.style.top=".2em"),l=Ec.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-u},{type:"elem",elem:l}]},t)}var f=Ec.makeSpan(["mord","accent"],[l],t);return o?(o.children[0]=f,
322
+ o.height=Math.max(f.height,o.height),o.classes[0]="mord",o):f},xu=(e,t)=>{var n=e.isStretchy?gu(e.label):new ru.MathNode("mo",[ou(e.label,e.mode)]),r=new ru.MathNode("mover",[cu(e.base,t),n]);return r.setAttribute("accent","true"),r},ku=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map((e=>"\\"+e)).join("|"));Rc({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=Bc(t[0]),r=!ku.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:wu,mathmlBuilder:xu}),Rc({type:"accent",
323
+ 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:wu,mathmlBuilder:xu}),Rc({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=Zc(e.base,t),r=vu(e,t),o="\\utilde"===e.label?.12:0,i=Ec.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:o},{type:"elem",elem:n}]},t);return Ec.makeSpan(["mord","accentunder"],[i],t)},
324
+ mathmlBuilder:(e,t)=>{var n=gu(e.label),r=new ru.MathNode("munder",[cu(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var Su=e=>{var t=new ru.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Rc({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){
325
+ var n,r=t.style,o=t.havingStyle(r.sup()),i=Ec.wrapFragment(Zc(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=Ec.wrapFragment(Zc(e.below,o,t),t)).classes.push(a+"-arrow-pad"));var s,l=vu(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=Ec.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=Ec.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"),Ec.makeSpan(["mrel","x-arrow"],[s],t)},mathmlBuilder(e,t){var n,r=gu(e.label);if(r.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var o=Su(cu(e.body,t));if(e.below){
326
+ var i=Su(cu(e.below,t));n=new ru.MathNode("munderover",[r,i,o])}else n=new ru.MathNode("mover",[r,o])}else if(e.below){var a=Su(cu(e.below,t));n=new ru.MathNode("munder",[r,a])}else n=Su(),n=new ru.MathNode("mover",[r,n]);return n}});var Cu={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Au=e=>"textord"===e.type&&"@"===e.text;function Eu(e,t,n){var r=Cu[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"}
327
+ }}Rc({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=Ec.wrapFragment(Zc(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=Sl(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new ru.MathNode("mrow",[cu(e.label,t)]);return(n=new ru.MathNode("mpadded",[n])).setAttribute("width","0"),"left"===e.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),(n=new ru.MathNode("mstyle",[n])).setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),Rc({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=Ec.wrapFragment(Zc(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder:(e,t)=>new ru.MathNode("mrow",[cu(e.fragment,t)])}),Rc({
328
+ type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=yu(t[0],"ordgroup").body,o="",i=0;i<r.length;i++){o+=yu(r[i],"textord").text}var a,s=parseInt(o);if(isNaN(s))throw new qs("\\@char has non-numeric argument "+o);if(s<0||s>=1114111)throw new qs("\\@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 Tu=(e,t)=>{var n=Gc(e.body,t.withColor(e.color),!1);return Ec.makeFragment(n)},Nu=(e,t)=>{var n=su(e.body,t.withColor(e.color)),r=new ru.MathNode("mstyle",n);return r.setAttribute("mathcolor",e.color),r};Rc({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=yu(t[0],"color-token").color,o=t[1];return{type:"color",mode:n.mode,color:r,body:Fc(o)}},htmlBuilder:Tu,mathmlBuilder:Nu}),Rc({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,
329
+ argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,o=yu(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:Tu,mathmlBuilder:Nu}),Rc({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&&yu(o,"size").value}},htmlBuilder(e,t){var n=Ec.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=Sl(kl(e.size,t)))),n},mathmlBuilder(e,t){var n=new ru.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",Sl(kl(e.size,t)))),n}});var Mu={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef",
330
+ "\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Lu=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new qs("Expected a control sequence",e);return t},zu=(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)};Rc({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(Mu[r.text])return"\\global"!==n&&"\\\\globallong"!==n||(r.text=Mu[r.text]),yu(t.parseFunction(),"internal");throw new qs("Invalid token after macro prefix",r)}}),Rc({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 qs("Expected a control sequence",r)
331
+ ;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 qs('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==a+1)throw new qs('Argument number "'+r.text+'" out of order');a++,s.push([])}else{if("EOF"===r.text)throw new qs("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===Mu[n]),{type:"internal",mode:t.mode}}}),Rc({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=Lu(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)
332
+ ;return zu(t,r,o,"\\\\globallet"===n),{type:"internal",mode:t.mode}}}),Rc({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=Lu(t.gullet.popToken()),o=t.gullet.popToken(),i=t.gullet.popToken();return zu(t,r,i,"\\\\globalfuture"===n),t.gullet.pushToken(i),t.gullet.pushToken(o),{type:"internal",mode:t.mode}}});var Ou=function(e,t,n){var r=ml(jl.math[e]&&jl.math[e].replace||e,t,n);if(!r)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return r},Iu=function(e,t,n,r){var o=n.havingBaseStyle(t),i=Ec.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},Pu=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=Sl(o),e.height-=o,e.depth+=o},Ru=function(e,t,n,r,o,i){var a=function(e,t,n,r){
333
+ return Ec.makeSymbol(e,"Size"+t+"-Regular",n,r)}(e,t,o,r),s=Iu(Ec.makeSpan(["delimsizing","size"+t],[a],r),il.TEXT,r,i);return n&&Pu(s,r,il.TEXT),s},Du=function(e,t,n){var r;return r="Size1-Regular"===t?"delim-size1":"delim-size4",{type:"elem",elem:Ec.makeSpan(["delimsizinginner",r],[Ec.makeSpan([],[Ec.makeSymbol(e,t,n)])])}},Bu=function(e,t,n){var r=hl["Size4-Regular"][e.charCodeAt(0)]?hl["Size4-Regular"][e.charCodeAt(0)][4]:hl["Size1-Regular"][e.charCodeAt(0)][4],o=new Pl("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"
334
+ ;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 Il([o],{width:Sl(r),height:Sl(t),style:"width:"+Sl(r),viewBox:"0 0 "+1e3*r+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),a=Ec.makeSvgSpan([],[i],n);return a.height=t,a.style.height=Sl(t),a.style.width=Sl(r),{type:"elem",elem:a}},Fu={type:"kern",size:-.008},ju=["|","\\lvert","\\rvert","\\vert"],Hu=["\\|","\\lVert","\\rVert","\\Vert"],qu=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"):Ws.contains(ju,e)?l="∣":Ws.contains(Hu,e)?l="∥":"["===e||"\\lbrack"===e?(a="⎡",l="⎢",c="⎣",u="Size4-Regular"):"]"===e||"\\rbrack"===e?(a="⎤",l="⎥",c="⎦",
335
+ 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=Ou(a,u,o),d=h.height+h.depth,p=Ou(l,u,o),m=p.height+p.depth,f=Ou(c,u,o),g=f.height+f.depth,v=0,y=1;if(null!==s){var _=Ou(s,u,o);v=_.height+_.depth,y=2}var b=d+g+v,w=b+Math.max(0,Math.ceil((t-b)/(y*m)))*y*m,x=r.fontMetrics().axisHeight
336
+ ;n&&(x*=r.sizeMultiplier);var k=w/2-x,S=[];if(S.push(Du(c,u,o)),S.push(Fu),null===s){var C=w-d-g+.016;S.push(Bu(l,C,r))}else{var A=(w-d-g-v)/2+.016;S.push(Bu(l,A,r)),S.push(Fu),S.push(Du(s,u,o)),S.push(Fu),S.push(Bu(l,A,r))}S.push(Fu),S.push(Du(a,u,o));var E=r.havingBaseStyle(il.TEXT),T=Ec.makeVList({positionType:"bottom",positionData:k,children:S},E);return Iu(Ec.makeSpan(["delimsizing","mult"],[T],E),il.TEXT,r,i)},Uu=function(e,t,n,r,o){var i=function(e,t,n){t*=1e3;var r="";switch(e){case"sqrtMain":r=function(e,t){
336
337
  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){
337
338
  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){
338
339
  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){
339
340
  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){
340
- 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 Ol(e,i),s=new zl([a],{width:"400em",height:xl(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"})
341
- ;return Cc.makeSvgSpan(["hide-tail"],[s],o)},qu=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],Uu=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],$u=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Gu=[0,1.2,1.8,2.4,3],Vu=[{type:"small",style:rl.SCRIPTSCRIPT},{type:"small",style:rl.SCRIPT},{type:"small",style:rl.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Wu=[{type:"small",style:rl.SCRIPTSCRIPT},{type:"small",style:rl.SCRIPT},{type:"small",style:rl.TEXT},{type:"stack"}],Yu=[{type:"small",style:rl.SCRIPTSCRIPT},{type:"small",style:rl.SCRIPT},{type:"small",style:rl.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{
342
- type:"stack"}],Ku=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.")},Xu=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=Mu(e,Ku(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]},Zu=function(e,t,n,r,o,i){var a;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),a=Gs.contains($u,e)?Vu:Gs.contains(qu,e)?Yu:Wu;var s=Xu(e,t,a,r);return"small"===s.type?function(e,t,n,r,o,i){var a=Cc.makeSymbol(e,"Main-Regular",o,r),s=zu(a,t,r,i);return n&&Ou(s,r,t),s}(e,s.style,n,r,o,i):"large"===s.type?Iu(e,s.size,n,r,o,i):ju(e,t,n,r,o,i)},Ju={sqrtImage:function(e,t){
343
- var n,r,o=t.havingBaseSizing(),i=Xu("\\surd",e*o.sizeMultiplier,Yu,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=Hu("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*Gu[i.size],c=(Gu[i.size]+s)/a,l=(Gu[i.size]+s+.08)/a,(n=Hu("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=Hu("sqrtTall",l,u,s,t)).style.minWidth="0.742em",r=1.056),n.height=c,n.style.height=xl(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"),Gs.contains(qu,e)||Gs.contains($u,e))return Iu(e,t,!1,n,r,o);if(Gs.contains(Uu,e))return ju(e,Gu[t],!1,n,r,o);throw new js("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:Gu,customSizedDelim:Zu,leftRightDelim:function(e,t,n,r,o,i){
344
- 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 Zu(e,c,!0,r,o,i)}},Qu={"\\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}
345
- },eh=["(","\\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 th(e,t){var n=yu(e);if(n&&Gs.contains(eh,n.text))return n;throw new js(n?"Invalid delimiter '"+n.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function nh(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Ic({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=th(t[0],e);return{type:"delimsizing",
346
- mode:e.parser.mode,size:Qu[e.funcName].size,mclass:Qu[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?Cc.makeSpan([e.mclass]):Ju.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(nu(e.delim,e.mode));var n=new tu.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=xl(Ju.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}}),Ic({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 js("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:th(t[0],e).text,color:n}}}),Ic({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=th(t[0],e),r=e.parser;++r.leftrightDepth;var o=r.parseExpression(!1)
347
- ;--r.leftrightDepth,r.expect("\\right",!1);var i=gu(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:o,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,t)=>{nh(e);for(var n,r,o=Uc(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?Yc(t,["mopen"]):Ju.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]=Ju.leftRightDelim(u.delim,i,a,u.options,e.mode,[]))}if("."===e.right)r=Yc(t,["mclose"]);else{var h=e.rightColor?t.withColor(e.rightColor):t;r=Ju.leftRightDelim(e.right,i,a,h,e.mode,["mclose"])}return o.push(r),Cc.makeSpan(["minner"],o,t)},mathmlBuilder:(e,t)=>{nh(e);var n=iu(e.body,t);if("."!==e.left){var r=new tu.MathNode("mo",[nu(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if("."!==e.right){var o=new tu.MathNode("mo",[nu(e.right,e.mode)])
348
- ;o.setAttribute("fence","true"),e.rightColor&&o.setAttribute("mathcolor",e.rightColor),n.push(o)}return ru(n)}}),Ic({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=th(t[0],e);if(!e.parser.leftrightDepth)throw new js("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if("."===e.delim)n=Yc(t,[]);else{n=Ju.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?nu("|","text"):nu(e.delim,e.mode),r=new tu.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var rh=(e,t)=>{var n,r,o=Cc.wrapFragment(Kc(e.body,t),t),i=e.label.substr(1),a=t.sizeMultiplier,s=0,l=Gs.isCharacterBox(e.body);if("sout"===i)(n=Cc.makeSpan(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/a,s=-.5*t.fontMetrics().xHeight;else if("phase"===i){var c=wl({
349
- number:.6,unit:"pt"},t),u=wl({number:.35,unit:"ex"},t);a/=t.havingBaseSizing().sizeMultiplier;var h=o.height+o.depth+c+u;o.style.paddingLeft=xl(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 zl([new Ol("phase",p)],{width:"400em",height:xl(d/1e3),viewBox:"0 0 400000 "+d,preserveAspectRatio:"xMinYMin slice"});(n=Cc.makeSvgSpan(["hide-tail"],[m],t)).style.height=xl(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=pu(o,i,f,g,t),/fbox|boxed|fcolorbox/.test(i)?(n.style.borderStyle="solid",n.style.borderWidth=xl(v)):"angl"===i&&.049!==v&&(n.style.borderTopWidth=xl(v),n.style.borderRightWidth=xl(v)),
350
- s=o.depth+g,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)r=Cc.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:s},{type:"elem",elem:o,shift:0}]},t);else{var y=/cancel|phase/.test(i)?["svg-align"]:[];r=Cc.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:n,shift:s,wrapperClasses:y}]},t)}return/cancel/.test(i)&&(r.height=o.height,r.depth=o.depth),/cancel/.test(i)&&!l?Cc.makeSpan(["mord","cancel-lap"],[r],t):Cc.makeSpan(["mord"],[r],t)},oh=(e,t)=>{var n=0,r=new tu.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[su(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":
351
- 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};Ic({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:r,funcName:o}=e,i=gu(t[0],"color-token").color,a=t[1];return{type:"enclose",mode:r.mode,label:o,backgroundColor:i,body:a}},htmlBuilder:rh,mathmlBuilder:oh}),Ic({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,
352
- argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:o}=e,i=gu(t[0],"color-token").color,a=gu(t[1],"color-token").color,s=t[2];return{type:"enclose",mode:r.mode,label:o,backgroundColor:a,borderColor:i,body:s}},htmlBuilder:rh,mathmlBuilder:oh}),Ic({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]}}}),Ic({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:rh,mathmlBuilder:oh}),Ic({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 ih={};function ah(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,
353
- handler:o},l=0;l<n.length;++l)ih[n[l]]=s;i&&(zc[t]=i),a&&(Oc[t]=a)}var sh={};function lh(e,t){sh[e]=t}function ch(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 uh=e=>{if(!e.parser.settings.displayMode)throw new js("{"+e.envName+"} can be used only in display mode.")};function hh(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function dh(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 js("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var m=[],f=[m],g=[],v=[],y=null!=l?[]:void 0;function _(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function b(){
354
- y&&(e.gullet.macros.get("\\df@tag")?(y.push(e.subparse([new Fs("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):y.push(Boolean(l)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(_(),v.push(ch(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 js("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){b(),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 js("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),b(),v.push(ch(e)),m=[],f.push(m),_()}}return e.gullet.endGroup(),
355
- 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:y,leqno:d}}function ph(e){return"d"===e.substr(0,1)?"display":"text"}var mh=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(rl.SCRIPT).sizeMultiplier/t.sizeMultiplier*.2778);var d="CD"===e.colSeparationType?wl({number:3,unit:"ex"},t):12*u,p=3*u,m=e.arraystretch*d,f=.7*m,g=.3*m,v=0;function y(e){for(var t=0;t<e.length;++t)t>0&&(v+=.25),l.push({pos:v,isDashed:e[t]})}for(y(i[0]),n=0;n<e.body.length;++n){var _=e.body[n],b=f,w=g;a<_.length&&(a=_.length);var x=new Array(_.length);for(r=0;r<_.length;++r){var k=Kc(_[r],t);w<k.depth&&(w=k.depth),b<k.height&&(b=k.height),x[r]=k}var S=e.rowGaps[n],C=0;S&&(C=wl(S,t))>0&&(w<(C+=g)&&(w=C),C=0),e.addJot&&(w+=p),x.height=b,
356
- x.depth=w,v+=b,x.pos=v,v+=w+C,s[n]=x,y(i[n+1])}var A,E,T=v/2+t.fontMetrics().axisHeight,N=e.cols||[],L=[],M=[];if(e.tags&&e.tags.some((e=>e)))for(n=0;n<o;++n){var z=s[n],O=z.pos-T,I=e.tags[n],R=void 0;(R=!0===I?Cc.makeSpan(["eqn-num"],[],t):!1===I?Cc.makeSpan([],[],t):Cc.makeSpan([],Uc(I,t,!0),t)).depth=z.depth,R.height=z.height,M.push({type:"elem",elem:R,shift:O})}for(r=0,E=0;r<a||E<N.length;++r,++E){for(var P=N[E]||{},D=!0;"separator"===P.type;){if(D||((A=Cc.makeSpan(["arraycolsep"],[])).style.width=xl(t.fontMetrics().doubleRuleSep),L.push(A)),"|"!==P.separator&&":"!==P.separator)throw new js("Invalid separator type: "+P.separator);var B="|"===P.separator?"solid":"dashed",F=Cc.makeSpan(["vertical-separator"],[],t);F.style.height=xl(v),F.style.borderRightWidth=xl(c),F.style.borderRightStyle=B,F.style.margin="0 "+xl(-c/2);var j=v-T;j&&(F.style.verticalAlign=xl(-j)),L.push(F),P=N[++E]||{},D=!1}if(!(r>=a)){var H=void 0
357
- ;(r>0||e.hskipBeforeAndAfter)&&0!==(H=Gs.deflt(P.pregap,h))&&((A=Cc.makeSpan(["arraycolsep"],[])).style.width=xl(H),L.push(A));var q=[];for(n=0;n<o;++n){var U=s[n],$=U[r];if($){var G=U.pos-T;$.depth=U.depth,$.height=U.height,q.push({type:"elem",elem:$,shift:G})}}q=Cc.makeVList({positionType:"individualShift",children:q},t),q=Cc.makeSpan(["col-align-"+(P.align||"c")],[q]),L.push(q),(r<a-1||e.hskipBeforeAndAfter)&&0!==(H=Gs.deflt(P.postgap,h))&&((A=Cc.makeSpan(["arraycolsep"],[])).style.width=xl(H),L.push(A))}}if(s=Cc.makeSpan(["mtable"],L),l.length>0){for(var V=Cc.makeLineSpan("hline",t,c),W=Cc.makeLineSpan("hdashline",t,c),Y=[{type:"elem",elem:s,shift:0}];l.length>0;){var K=l.pop(),X=K.pos-T;K.isDashed?Y.push({type:"elem",elem:W,shift:X}):Y.push({type:"elem",elem:V,shift:X})}s=Cc.makeVList({positionType:"individualShift",children:Y},t)}if(0===M.length)return Cc.makeSpan(["mord"],[s],t);var Z=Cc.makeVList({positionType:"individualShift",children:M},t);return Z=Cc.makeSpan(["tag"],[Z],t),Cc.makeFragment([s,Z])
358
- },fh={c:"center ",l:"left ",r:"right "},gh=function(e,t){for(var n=[],r=new tu.MathNode("mtd",[],["mtr-glue"]),o=new tu.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 tu.MathNode("mtd",[su(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 tu.MathNode("mtr",s))}var c=new tu.MathNode("mtable",n),u=.5===e.arraystretch?.1:.16+e.arraystretch-1+(e.addJot?.09:0);c.setAttribute("rowspacing",xl(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 y=g;y<v;y++)"align"===p[y].type?(d+=fh[p[y].align],f&&(m+="none "),f=!0):"separator"===p[y].type&&f&&(m+="|"===p[y].separator?"solid ":"dashed ",f=!1);c.setAttribute("columnalign",d.trim()),/[sd]/.test(m)&&c.setAttribute("columnlines",m.trim())}if("align"===e.colSeparationType){
359
- for(var _=e.cols||[],b="",w=1;w<_.length;w++)b+=w%2?"0em ":"1em ";c.setAttribute("columnspacing",b.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 tu.MathNode("menclose",[c])).setAttribute("notation",h.trim()),e.arraystretch&&e.arraystretch<1&&(c=new tu.MathNode("mstyle",[c])).setAttribute("scriptlevel","1"),c},vh=function(e,t){-1===e.envName.indexOf("ed")&&uh(e);var n,r=[],o=e.envName.indexOf("at")>-1?"alignat":"align",i="split"===e.envName,a=dh(e.parser,{cols:r,addJot:!0,autoTag:i?void 0:hh(e.envName),emptySingleRow:!0,
360
- 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+=gu(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=gu(e[t],"styling");gu(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 js("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};ah({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=(yu(t[0])?[t[0]]:gu(t[0],"ordgroup").body).map((function(e){var t=vu(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"}
361
- ;throw new js("Unknown column alignment: "+t,e)})),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return dh(e.parser,r,ph(e.envName))},htmlBuilder:mh,mathmlBuilder:gh}),ah({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 js("Expected l or c or r",o.nextToken);o.consume(),o.consumeSpaces(),o.expect("]"),o.consume(),r.cols=[{type:"align",align:n}]}}var i=dh(e.parser,r,ph(e.envName)),a=Math.max(0,...i.body.map((e=>e.length)));return i.cols=new Array(a).fill({type:"align",align:n}),t?{
362
- type:"leftright",mode:e.mode,body:[i],left:t[0],right:t[1],rightColor:void 0}:i},htmlBuilder:mh,mathmlBuilder:gh}),ah({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t=dh(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:mh,mathmlBuilder:gh}),ah({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=(yu(t[0])?[t[0]]:gu(t[0],"ordgroup").body).map((function(e){var t=vu(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new js("Unknown column alignment: "+t,e)}));if(n.length>1)throw new js("{subarray} can contain only one column");var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if((r=dh(e.parser,r,"script")).body.length>0&&r.body[0].length>1)throw new js("{subarray} can contain only one column");return r},htmlBuilder:mh,mathmlBuilder:gh}),ah({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=dh(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{
363
- type:"align",align:"l",pregap:0,postgap:0}]},ph(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:mh,mathmlBuilder:gh}),ah({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:vh,htmlBuilder:mh,mathmlBuilder:gh}),ah({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){Gs.contains(["gather","gather*"],e.envName)&&uh(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:hh(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return dh(e.parser,t,"display")},htmlBuilder:mh,mathmlBuilder:gh}),ah({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:vh,htmlBuilder:mh,mathmlBuilder:gh}),ah({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){uh(e);var t={autoTag:hh(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno}
364
- ;return dh(e.parser,t,"display")},htmlBuilder:mh,mathmlBuilder:gh}),ah({type:"array",names:["CD"],props:{numArgs:0},handler:e=>(uh(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 js("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(Su(l[u])){i.push(c);var h=vu(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 js('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
365
- }if(Su(l[f]))throw new js("Missing a "+h+" character to complete a CD arrow.",l[f]);d[p].body.push(l[f])}if(m)throw new js("Missing a "+h+" character to complete a CD arrow.",l[u])}}var g={type:"styling",body:[Cu(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:mh,mathmlBuilder:gh}),lh("\\nonumber","\\gdef\\@eqnsw{0}"),lh("\\notag","\\nonumber"),Ic({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new js(e.funcName+" valid only within array environment")}});var yh=ih;Ic({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,
366
- argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];if("ordgroup"!==o.type)throw new js("Invalid environment name",o);for(var i="",a=0;a<o.body.length;++a)i+=gu(o.body[a],"textord").text;if("\\begin"===r){if(!yh.hasOwnProperty(i))throw new js("No such environment: "+i,o);var s=yh[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=gu(n.parseFunction(),"environment");if(p.name!==i)throw new js("Mismatch: \\begin{"+i+"} matched by \\end{"+p.name+"}",d);return h}return{type:"environment",mode:n.mode,name:i,nameGroup:o}}});var _h=Cc.makeSpan;function bh(e,t){var n=Uc(e.body,t,!0);return _h([e.mclass],n,t)}function wh(e,t){var n,r=iu(e.body,t);return"minner"===e.mclass?n=new tu.MathNode("mpadded",r):"mord"===e.mclass?e.isCharacterBox?(n=r[0]).type="mi":n=new tu.MathNode("mi",r):(e.isCharacterBox?(n=r[0]).type="mo":n=new tu.MathNode("mo",r),"mbin"===e.mclass?(n.attributes.lspace="0.22em",
367
- 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}Ic({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:Dc(o),isCharacterBox:Gs.isCharacterBox(o)}},htmlBuilder:bh,mathmlBuilder:wh});var xh=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};Ic({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:xh(t[0]),body:Dc(t[1]),isCharacterBox:Gs.isCharacterBox(t[1])}}}),Ic({type:"mclass",names:["\\stackrel","\\overset","\\underset"],
368
- props:{numArgs:2},handler(e,t){var n,{parser:r,funcName:o}=e,i=t[1],a=t[0];n="\\stackrel"!==o?xh(i):"mrel";var s={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==o,body:Dc(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:Gs.isCharacterBox(l)}},htmlBuilder:bh,mathmlBuilder:wh});var kh=(e,t)=>{var n=e.font,r=t.withFont(n);return Kc(e.body,r)},Sh=(e,t)=>{var n=e.font,r=t.withFont(n);return su(e.body,r)},Ch={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Ic({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=Pc(t[0]),i=r;return i in Ch&&(i=Ch[i]),{type:"font",mode:n.mode,font:i.slice(1),body:o}},
369
- htmlBuilder:kh,mathmlBuilder:Sh}),Ic({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0],o=Gs.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:xh(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:o}}}),Ic({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:kh,mathmlBuilder:Sh});var Ah=(e,t)=>{var n=t;return"display"===e?n=n.id>=rl.SCRIPT.id?n.text():rl.DISPLAY:"text"===e&&n.size===rl.DISPLAY.size?n=rl.TEXT:"script"===e?n=rl.SCRIPT:"scriptscript"===e&&(n=rl.SCRIPTSCRIPT),n},Eh=(e,t)=>{var n,r=Ah(e.size,t.style),o=r.fracNum(),i=r.fracDen();n=t.havingStyle(o);var a=Kc(e.numer,n,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm
370
- ;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,y,_=Kc(e.denom,n,t);if(e.hasBarLine?(e.barSize?(u=wl(e.barSize,t),c=Cc.makeLineSpan("frac-line",t,u)):c=Cc.makeLineSpan("frac-line",t),u=c.height,h=c.height):(c=null,u=0,h=t.fontMetrics().defaultRuleThickness),r.size===rl.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 b=t.fontMetrics().axisHeight;d-a.depth-(b+.5*u)<p&&(d+=p-(d-a.depth-(b+.5*u))),b-.5*u-(_.height-m)<p&&(m+=p-(b-.5*u-(_.height-m)));var w=-(b-.5*u);f=Cc.makeVList({positionType:"individualShift",children:[{type:"elem",elem:_,shift:m},{type:"elem",elem:c,shift:w},{type:"elem",elem:a,shift:-d}]},t)}else{var x=d-a.depth-(_.height-m);x<p&&(d+=.5*(p-x),m+=.5*(p-x)),f=Cc.makeVList({positionType:"individualShift",children:[{type:"elem",elem:_,shift:m},{type:"elem",elem:a,shift:-d}]},t)}
371
- return n=t.havingStyle(r),f.height*=n.sizeMultiplier/t.sizeMultiplier,f.depth*=n.sizeMultiplier/t.sizeMultiplier,g=r.size===rl.DISPLAY.size?t.fontMetrics().delim1:r.size===rl.SCRIPTSCRIPT.size?t.havingStyle(rl.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,v=null==e.leftDelim?Yc(t,["mopen"]):Ju.customSizedDelim(e.leftDelim,g,!0,t.havingStyle(r),e.mode,["mopen"]),y=e.continued?Cc.makeSpan([]):null==e.rightDelim?Yc(t,["mclose"]):Ju.customSizedDelim(e.rightDelim,g,!0,t.havingStyle(r),e.mode,["mclose"]),Cc.makeSpan(["mord"].concat(n.sizingClasses(t)),[v,Cc.makeSpan(["mfrac"],[f]),y],t)},Th=(e,t)=>{var n=new tu.MathNode("mfrac",[su(e.numer,t),su(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var r=wl(e.barSize,t);n.setAttribute("linethickness",xl(r))}}else n.setAttribute("linethickness","0px");var o=Ah(e.size,t.style);if(o.size!==t.style.size){n=new tu.MathNode("mstyle",[n]);var i=o.size===rl.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",i),n.setAttribute("scriptlevel","0")}
372
- if(null!=e.leftDelim||null!=e.rightDelim){var a=[];if(null!=e.leftDelim){var s=new tu.MathNode("mo",[new tu.TextNode(e.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),a.push(s)}if(a.push(n),null!=e.rightDelim){var l=new tu.MathNode("mo",[new tu.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),a.push(l)}return ru(a)}return n};Ic({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"}
373
- return{type:"genfrac",mode:r.mode,continued:!1,numer:i,denom:a,hasBarLine:n,leftDelim:s,rightDelim:l,size:c,barSize:null}},htmlBuilder:Eh,mathmlBuilder:Th}),Ic({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}}}),Ic({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 Nh=["display","text","script","scriptscript"],Lh=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};Ic({type:"genfrac",names:["\\genfrac"],
374
- 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=Pc(t[0]),s="atom"===a.type&&"open"===a.family?Lh(a.text):null,l=Pc(t[1]),c="atom"===l.type&&"close"===l.family?Lh(l.text):null,u=gu(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=gu(p.body[0],"textord");d=Nh[Number(m.text)]}}else p=gu(p,"textord"),d=Nh[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:Eh,mathmlBuilder:Th}),Ic({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:gu(t[0],"size").value,token:o}}}),Ic({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{
375
- 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}(gu(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:Eh,mathmlBuilder:Th});var Mh=(e,t)=>{var n,r,o=t.style;"supsub"===e.type?(n=e.sup?Kc(e.sup,t.havingStyle(o.sup()),t):Kc(e.sub,t.havingStyle(o.sub()),t),r=gu(e.base,"horizBrace")):r=gu(e,"horizBrace");var i,a=Kc(r.base,t.havingBaseStyle(rl.DISPLAY)),s=fu(r,t);if(r.isOver?(i=Cc.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=Cc.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){
376
- var l=Cc.makeSpan(["mord",r.isOver?"mover":"munder"],[i],t);i=r.isOver?Cc.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},t):Cc.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 Cc.makeSpan(["mord",r.isOver?"mover":"munder"],[i],t)};Ic({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:Mh,mathmlBuilder:(e,t)=>{var n=mu(e.label);return new tu.MathNode(e.isOver?"mover":"munder",[su(e.base,t),n])}}),Ic({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],o=gu(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:o})?{type:"href",mode:n.mode,href:o,body:Dc(r)}:n.formatUnsupportedCmd("\\href")},
377
- htmlBuilder:(e,t)=>{var n=Uc(e.body,t,!1);return Cc.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=au(e.body,t);return n instanceof Qc||(n=new Qc("mrow",[n])),n.setAttribute("href",e.href),n}}),Ic({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=gu(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:Dc(s)}}}),Ic({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:Dc(t[0])}},htmlBuilder(e,t){var n=Uc(e.body,t,!1);return Cc.makeFragment(n)},mathmlBuilder:(e,t)=>new tu.MathNode("mrow",iu(e.body,t))}),Ic({type:"html",
378
- 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=gu(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 js("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:Dc(s)}:r.formatUnsupportedCmd(o)},htmlBuilder:(e,t)=>{var n=Uc(e.body,t,!1),r=["enclosing"]
379
- ;e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var o=Cc.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)=>au(e.body,t)}),Ic({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Dc(t[0]),mathml:Dc(t[1])}},htmlBuilder:(e,t)=>{var n=Uc(e.html,t,!1);return Cc.makeFragment(n)},mathmlBuilder:(e,t)=>au(e.mathml,t)});var zh=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 js("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!bl(n))throw new js("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};Ic({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{
380
- 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=gu(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=zh(h);break;case"height":i=zh(h);break;case"totalheight":a=zh(h);break;default:throw new js("Invalid key: '"+u[0]+"' in \\includegraphics.")}}}var d=gu(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=wl(e.height,t),r=0;e.totalheight.number>0&&(r=wl(e.totalheight,t)-n);var o=0;e.width.number>0&&(o=wl(e.width,t));var i={height:xl(n+r)};o>0&&(i.width=xl(o)),r>0&&(i.verticalAlign=xl(-r));var a=new Nl(e.src,e.alt,i);return a.height=n,a.depth=r,a},mathmlBuilder:(e,t)=>{
381
- var n=new tu.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var r=wl(e.height,t),o=0;if(e.totalheight.number>0&&(o=wl(e.totalheight,t)-r,n.setAttribute("valign",xl(-o))),n.setAttribute("height",xl(r+o)),e.width.number>0){var i=wl(e.width,t);n.setAttribute("width",xl(i))}return n.setAttribute("src",e.src),n}}),Ic({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=gu(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)=>Cc.makeGlue(e.dimension,t),mathmlBuilder(e,t){var n=wl(e.dimension,t)
382
- ;return new tu.SpaceNode(n)}}),Ic({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=Cc.makeSpan([],[Kc(e.body,t)]),n=Cc.makeSpan(["inner"],[n],t)):n=Cc.makeSpan(["inner"],[Kc(e.body,t)]);var r=Cc.makeSpan(["fix"],[]),o=Cc.makeSpan([e.alignment],[n,r],t),i=Cc.makeSpan(["strut"]);return i.style.height=xl(o.height+o.depth),o.depth&&(i.style.verticalAlign=xl(-o.depth)),o.children.unshift(i),o=Cc.makeSpan(["thinbox"],[o],t),Cc.makeSpan(["mord","vbox"],[o],t)},mathmlBuilder:(e,t)=>{var n=new tu.MathNode("mpadded",[su(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}}),Ic({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,o=r.mode
383
- ;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}}}),Ic({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new js("Mismatched "+e.funcName)}});var Oh=(e,t)=>{switch(t.style.size){case rl.DISPLAY.size:return e.display;case rl.TEXT.size:return e.text;case rl.SCRIPT.size:return e.script;case rl.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Ic({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Dc(t[0]),text:Dc(t[1]),script:Dc(t[2]),scriptscript:Dc(t[3])}},htmlBuilder:(e,t)=>{var n=Oh(e,t),r=Uc(n,t,!1);return Cc.makeFragment(r)},mathmlBuilder:(e,t)=>{var n=Oh(e,t);return au(n,t)}});var Ih=(e,t,n,r,o,i,a)=>{e=Cc.makeSpan([],[e]);var s,l,c,u=n&&Gs.isCharacterBox(n);if(t){var h=Kc(t,r.havingStyle(o.sup()),r);l={elem:h,
384
- kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-h.depth)}}if(n){var d=Kc(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=Cc.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:xl(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:xl(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(s){var m=e.height-a;c=Cc.makeVList({positionType:"top",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:xl(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e}]},r)}else{if(!l)return e;var f=e.depth+a;c=Cc.makeVList({positionType:"bottom",positionData:f,children:[{type:"elem",elem:e},{type:"kern",size:l.kern},{
385
- type:"elem",elem:l.elem,marginLeft:xl(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}var g=[c];if(s&&0!==i&&!u){var v=Cc.makeSpan(["mspace"],[],r);v.style.marginRight=xl(i),g.unshift(v)}return Cc.makeSpan(["mop","op-limits"],g,r)},Rh=["\\smallint"],Ph=(e,t)=>{var n,r,o,i=!1;"supsub"===e.type?(n=e.sup,r=e.sub,o=gu(e.base,"op"),i=!0):o=gu(e,"op");var a,s=t.style,l=!1;if(s.size===rl.DISPLAY.size&&o.symbol&&!Gs.contains(Rh,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=Cc.makeSymbol(o.name,c,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),u.length>0){var h=a.italic,d=Cc.staticSvg(u+"Size"+(l?"2":"1"),t);a=Cc.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=Uc(o.body,t,!0)
386
- ;1===p.length&&p[0]instanceof Ml?(a=p[0]).classes[0]="mop":a=Cc.makeSpan(["mop"],p,t)}else{for(var m=[],f=1;f<o.name.length;f++)m.push(Cc.mathsym(o.name[f],o.mode,t));a=Cc.makeSpan(["mop"],m,t)}var g=0,v=0;return(a instanceof Ml||"\\oiint"===o.name||"\\oiiint"===o.name)&&!o.suppressBaseShift&&(g=(a.height-a.depth)/2-t.fontMetrics().axisHeight,v=a.italic),i?Ih(a,n,r,t,s,v,g):(g&&(a.style.position="relative",a.style.top=xl(g)),a)},Dh=(e,t)=>{var n;if(e.symbol)n=new Qc("mo",[nu(e.name,e.mode)]),Gs.contains(Rh,e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Qc("mo",iu(e.body,t));else{n=new Qc("mi",[new eu(e.name.slice(1))]);var r=new Qc("mo",[nu("⁡","text")]);n=e.parentIsSupSub?new Qc("mrow",[n,r]):Jc([n,r])}return n},Bh={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Ic({type:"op",
387
- 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=Bh[o]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:o}},htmlBuilder:Ph,mathmlBuilder:Dh}),Ic({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:Dc(r)}},htmlBuilder:Ph,mathmlBuilder:Dh});var Fh={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Ic({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"],
388
- 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:Ph,mathmlBuilder:Dh}),Ic({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:Ph,mathmlBuilder:Dh}),Ic({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=Fh[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Ph,mathmlBuilder:Dh});var jh=(e,t)=>{var n,r,o,i,a=!1;if("supsub"===e.type?(n=e.sup,r=e.sub,o=gu(e.base,"operatorname"),a=!0):o=gu(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=Uc(s,t.withFont("mathrm"),!0),c=0;c<l.length;c++){
389
- var u=l[c];u instanceof Ml&&(u.text=u.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}i=Cc.makeSpan(["mop"],l,t)}else i=Cc.makeSpan(["mop"],[],t);return a?Ih(i,n,r,t,t.style,0,0):i};function Hh(e,t,n){for(var r=Uc(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 Cc.makeFragment(r)}Ic({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:Dc(o),alwaysHandleSupSub:"\\operatornamewithlimits"===r,limits:!1,parentIsSupSub:!1}},htmlBuilder:jh,mathmlBuilder:(e,t)=>{for(var n=iu(e.body,t.withFont("mathrm")),r=!0,o=0;o<n.length;o++){var i=n[o];if(i instanceof tu.SpaceNode);else if(i instanceof tu.MathNode)switch(i.type){case"mi":case"mn":case"ms":
390
- case"mspace":case"mtext":break;case"mo":var a=i.children[0];1===i.children.length&&a instanceof tu.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 tu.TextNode(s)]}var l=new tu.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new tu.MathNode("mo",[nu("⁡","text")]);return e.parentIsSupSub?new tu.MathNode("mrow",[l,c]):tu.newDocumentFragment([l,c])}}),lh("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),Rc({type:"ordgroup",htmlBuilder:(e,t)=>e.semisimple?Cc.makeFragment(Uc(e.body,t,!1)):Cc.makeSpan(["mord"],Uc(e.body,t,!0),t),mathmlBuilder:(e,t)=>au(e.body,t,!0)}),Ic({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=Kc(e.body,t.havingCrampedStyle()),r=Cc.makeLineSpan("overline-line",t),o=t.fontMetrics().defaultRuleThickness,i=Cc.makeVList({positionType:"firstBaseline",
391
- children:[{type:"elem",elem:n},{type:"kern",size:3*o},{type:"elem",elem:r},{type:"kern",size:o}]},t);return Cc.makeSpan(["mord","overline"],[i],t)},mathmlBuilder(e,t){var n=new tu.MathNode("mo",[new tu.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new tu.MathNode("mover",[su(e.body,t),n]);return r.setAttribute("accent","true"),r}}),Ic({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:Dc(r)}},htmlBuilder:(e,t)=>{var n=Uc(e.body,t.withPhantom(),!1);return Cc.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=iu(e.body,t);return new tu.MathNode("mphantom",n)}}),Ic({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=Cc.makeSpan([],[Kc(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
392
- ;return n=Cc.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t),Cc.makeSpan(["mord"],[n],t)},mathmlBuilder:(e,t)=>{var n=iu(Dc(e.body),t),r=new tu.MathNode("mphantom",n),o=new tu.MathNode("mpadded",[r]);return o.setAttribute("height","0px"),o.setAttribute("depth","0px"),o}}),Ic({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=Cc.makeSpan(["inner"],[Kc(e.body,t.withPhantom())]),r=Cc.makeSpan(["fix"],[]);return Cc.makeSpan(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=iu(Dc(e.body),t),r=new tu.MathNode("mphantom",n),o=new tu.MathNode("mpadded",[r]);return o.setAttribute("width","0px"),o}}),Ic({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=gu(t[0],"size").value,o=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:o}},htmlBuilder(e,t){var n=Kc(e.body,t),r=wl(e.dy,t)
393
- ;return Cc.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new tu.MathNode("mpadded",[su(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}}),Ic({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),Ic({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=gu(t[0],"size"),a=gu(t[1],"size");return{type:"rule",mode:r.mode,shift:o&&gu(o,"size").value,width:i.value,height:a.value}},htmlBuilder(e,t){var n=Cc.makeSpan(["mord","rule"],[],t),r=wl(e.width,t),o=wl(e.height,t),i=e.shift?wl(e.shift,t):0;return n.style.borderRightWidth=xl(r),n.style.borderTopWidth=xl(o),n.style.bottom=xl(i),n.width=r,n.height=o+i,n.depth=-i,n.maxFontSize=1.125*o*t.sizeMultiplier,n},mathmlBuilder(e,t){
394
- var n=wl(e.width,t),r=wl(e.height,t),o=e.shift?wl(e.shift,t):0,i=t.color&&t.getColor()||"black",a=new tu.MathNode("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",xl(n)),a.setAttribute("height",xl(r));var s=new tu.MathNode("mpadded",[a]);return o>=0?s.setAttribute("height",xl(o)):(s.setAttribute("height",xl(o)),s.setAttribute("depth",xl(-o))),s.setAttribute("voffset",xl(o)),s}});var qh=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];Ic({type:"sizing",names:qh,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:qh.indexOf(r)+1,body:i}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return Hh(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=iu(e.body,n),o=new tu.MathNode("mstyle",r);return o.setAttribute("mathsize",xl(n.sizeMultiplier)),o}}),Ic({type:"smash",names:["\\smash"],props:{
395
- numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,o=!1,i=!1,a=n[0]&&gu(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=Cc.makeSpan([],[Kc(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=Cc.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t);return Cc.makeSpan(["mord"],[i],t)},mathmlBuilder:(e,t)=>{var n=new tu.MathNode("mpadded",[su(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),Ic({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){
396
- 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=Kc(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=Cc.wrapFragment(n,t);var r=t.fontMetrics().defaultRuleThickness,o=r;t.style.id<rl.TEXT.id&&(o=t.fontMetrics().xHeight);var i=r+o/4,a=n.height+n.depth+i+r,{span:s,ruleWidth:l,advanceWidth:c}=Ju.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=xl(c);var d=Cc.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(rl.SCRIPTSCRIPT),m=Kc(e.index,p,t),f=.6*(d.height-d.depth),g=Cc.makeVList({positionType:"shift",positionData:-f,children:[{type:"elem",elem:m}]},t),v=Cc.makeSpan(["root"],[g]);return Cc.makeSpan(["mord","sqrt"],[v,d],t)}return Cc.makeSpan(["mord","sqrt"],[d],t)},mathmlBuilder(e,t){
397
- var{body:n,index:r}=e;return r?new tu.MathNode("mroot",[su(n,t),su(r,t)]):new tu.MathNode("msqrt",[su(n,t)])}});var Uh={display:rl.DISPLAY,text:rl.TEXT,script:rl.SCRIPT,scriptscript:rl.SCRIPTSCRIPT};Ic({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=Uh[e.style],r=t.havingStyle(n).withFont("");return Hh(e.body,r,t)},mathmlBuilder(e,t){var n=Uh[e.style],r=t.havingStyle(n),o=iu(e.body,r),i=new tu.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}});Rc({type:"supsub",htmlBuilder(e,t){var n=function(e,t){var n=e.base
398
- ;return n?"op"===n.type?n.limits&&(t.style.size===rl.DISPLAY.size||n.alwaysHandleSupSub)?Ph:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(t.style.size===rl.DISPLAY.size||n.limits)?jh:null:"accent"===n.type?Gs.isCharacterBox(n.base)?_u:null:"horizBrace"===n.type&&!e.sub===n.isOver?Mh:null:null}(e,t);if(n)return n(e,t);var r,o,i,{base:a,sup:s,sub:l}=e,c=Kc(a,t),u=t.fontMetrics(),h=0,d=0,p=a&&Gs.isCharacterBox(a);if(s){var m=t.havingStyle(t.style.sup());r=Kc(s,m,t),p||(h=c.height-m.fontMetrics().supDrop*m.sizeMultiplier/t.sizeMultiplier)}if(l){var f=t.havingStyle(t.style.sub());o=Kc(l,f,t),p||(d=c.depth+f.fontMetrics().subDrop*f.sizeMultiplier/t.sizeMultiplier)}i=t.style===rl.DISPLAY?u.sup1:t.style.cramped?u.sup3:u.sup2;var g,v=t.sizeMultiplier,y=xl(.5/u.ptPerEm/v),_=null;if(o){var b=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof Ml||b)&&(_=xl(-c.italic))}if(r&&o){h=Math.max(h,i,r.depth+.25*u.xHeight),d=Math.max(d,u.sub2)
399
- ;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:y,marginLeft:_},{type:"elem",elem:r,shift:-h,marginRight:y}];g=Cc.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:_,marginRight:y}];g=Cc.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=Cc.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:r,marginRight:y}]},t)}var C=Wc(c,"right")||"mord";return Cc.makeSpan([C],[c,Cc.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=[su(e.base,t)]
400
- ;if(e.sub&&i.push(su(e.sub,t)),e.sup&&i.push(su(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===rl.DISPLAY||a&&"operatorname"===a.type&&a.alwaysHandleSupSub&&(t.style===rl.DISPLAY||a.limits)?"munderover":"msubsup"}else{var s=e.base;o=s&&"op"===s.type&&s.limits&&(t.style===rl.DISPLAY||s.alwaysHandleSupSub)||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(s.limits||t.style===rl.DISPLAY)?"munder":"msub"}else{var l=e.base;o=l&&"op"===l.type&&l.limits&&(t.style===rl.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===rl.DISPLAY)?"mover":"msup"}return new tu.MathNode(o,i)}}),Rc({type:"atom",htmlBuilder:(e,t)=>Cc.mathsym(e.text,e.mode,t,["m"+e.family]),mathmlBuilder(e,t){var n=new tu.MathNode("mo",[nu(e.text,e.mode)]);if("bin"===e.family){var r=ou(e,t);"bold-italic"===r&&n.setAttribute("mathvariant",r)
401
- }else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var $h={mi:"italic",mn:"normal",mtext:"normal"};Rc({type:"mathord",htmlBuilder:(e,t)=>Cc.makeOrd(e,t,"mathord"),mathmlBuilder(e,t){var n=new tu.MathNode("mi",[nu(e.text,e.mode,t)]),r=ou(e,t)||"italic";return r!==$h[n.type]&&n.setAttribute("mathvariant",r),n}}),Rc({type:"textord",htmlBuilder:(e,t)=>Cc.makeOrd(e,t,"textord"),mathmlBuilder(e,t){var n,r=nu(e.text,e.mode,t),o=ou(e,t)||"normal";return n="text"===e.mode?new tu.MathNode("mtext",[r]):/[0-9]/.test(e.text)?new tu.MathNode("mn",[r]):"\\prime"===e.text?new tu.MathNode("mo",[r]):new tu.MathNode("mi",[r]),o!==$h[n.type]&&n.setAttribute("mathvariant",o),n}});var Gh={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Vh={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Rc({type:"spacing",htmlBuilder(e,t){if(Vh.hasOwnProperty(e.text)){var n=Vh[e.text].className||""
402
- ;if("text"===e.mode){var r=Cc.makeOrd(e,t,"textord");return r.classes.push(n),r}return Cc.makeSpan(["mspace",n],[Cc.mathsym(e.text,e.mode,t)],t)}if(Gh.hasOwnProperty(e.text))return Cc.makeSpan(["mspace",Gh[e.text]],[],t);throw new js('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){if(!Vh.hasOwnProperty(e.text)){if(Gh.hasOwnProperty(e.text))return new tu.MathNode("mspace");throw new js('Unknown type of space "'+e.text+'"')}return new tu.MathNode("mtext",[new tu.TextNode(" ")])}});var Wh=()=>{var e=new tu.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};Rc({type:"tag",mathmlBuilder(e,t){var n=new tu.MathNode("mtable",[new tu.MathNode("mtr",[Wh(),new tu.MathNode("mtd",[au(e.body,t)]),Wh(),new tu.MathNode("mtd",[au(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var Yh={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Kh={"\\textbf":"textbf","\\textmd":"textmd"},Xh={"\\textit":"textit","\\textup":"textup"},Zh=(e,t)=>{var n=e.font
403
- ;return n?Yh[n]?t.withTextFontFamily(Yh[n]):Kh[n]?t.withTextFontWeight(Kh[n]):t.withTextFontShape(Xh[n]):t};Ic({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:Dc(o),font:r}},htmlBuilder(e,t){var n=Zh(e,t),r=Uc(e.body,n,!0);return Cc.makeSpan(["mord","text"],r,n)},mathmlBuilder(e,t){var n=Zh(e,t);return au(e.body,n)}}),Ic({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=Kc(e.body,t),r=Cc.makeLineSpan("underline-line",t),o=t.fontMetrics().defaultRuleThickness,i=Cc.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 Cc.makeSpan(["mord","underline"],[i],t)
404
- },mathmlBuilder(e,t){var n=new tu.MathNode("mo",[new tu.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new tu.MathNode("munder",[su(e.body,t),n]);return r.setAttribute("accentunder","true"),r}}),Ic({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=Kc(e.body,t),r=t.fontMetrics().axisHeight,o=.5*(n.height-r-(n.depth+r));return Cc.makeVList({positionType:"shift",positionData:o,children:[{type:"elem",elem:n}]},t)},mathmlBuilder:(e,t)=>new tu.MathNode("mpadded",[su(e.body,t)],["vcenter"])}),Ic({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new js("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=Jh(e),r=[],o=t.havingStyle(t.style.text()),i=0;i<n.length;i++){var a=n[i];"~"===a&&(a="\\textasciitilde"),r.push(Cc.makeSymbol(a,"Typewriter-Regular",e.mode,o,["mord","texttt"]))}
405
- return Cc.makeSpan(["mord","text"].concat(o.sizingClasses(t)),Cc.tryCombineChars(r),o)},mathmlBuilder(e,t){var n=new tu.TextNode(Jh(e)),r=new tu.MathNode("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var Jh=e=>e.body.replace(/ /g,e.star?"␣":" "),Qh=Mc,ed=new RegExp("[̀-ͯ]+$");class td{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 Fs("EOF",new Bs(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new js("Unexpected character: '"+e[t]+"'",new Fs(e[t],new Bs(this,t,t+1)));var r=n[6]||n[3]||(n[2]?"\\ ":" ")
406
- ;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 Fs(r,new Bs(this,t,this.tokenRegex.lastIndex))}}class nd{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 js("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){
407
- 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 rd=sh;lh("\\noexpand",(function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}})),lh("\\expandafter",(function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}})),lh("\\@firstoftwo",(function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}})),lh("\\@secondoftwo",(function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}})),lh("\\@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}})),
408
- lh("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),lh("\\TextOrMath",(function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}}));var od={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};lh("\\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 js("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(null==(r=od[n.text])||r>=t)throw new js("Invalid base-"+t+" digit "+n.text);for(var o;null!=(o=od[e.future().text])&&o<t;)r*=t,r+=o,e.popToken()}return"\\@char{"+r+"}"}));var id=(e,t,n)=>{var r=e.consumeArg().tokens;if(1!==r.length)throw new js("\\newcommand's first argument must be a macro name");var o=r[0].text,i=e.isDefined(o)
409
- ;if(i&&!t)throw new js("\\newcommand{"+o+"} attempting to redefine "+o+"; use \\renewcommand");if(!i&&!n)throw new js("\\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 js("Invalid number of arguments: "+s);a=parseInt(s),r=e.consumeArg().tokens}return e.macros.set(o,{tokens:r,numArgs:a}),""};lh("\\newcommand",(e=>id(e,!1,!0))),lh("\\renewcommand",(e=>id(e,!0,!1))),lh("\\providecommand",(e=>id(e,!0,!0))),lh("\\message",(e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map((e=>e.text)).join("")),""})),lh("\\errmessage",(e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map((e=>e.text)).join("")),""})),lh("\\show",(e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Qh[n],Bl.math[n],Bl.text[n]),""})),lh("\\bgroup","{"),lh("\\egroup","}"),
410
- lh("~","\\nobreakspace"),lh("\\lq","`"),lh("\\rq","'"),lh("\\aa","\\r a"),lh("\\AA","\\r A"),lh("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),lh("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),lh("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),lh("ℬ","\\mathscr{B}"),lh("ℰ","\\mathscr{E}"),lh("ℱ","\\mathscr{F}"),lh("ℋ","\\mathscr{H}"),lh("ℐ","\\mathscr{I}"),lh("ℒ","\\mathscr{L}"),lh("ℳ","\\mathscr{M}"),lh("ℛ","\\mathscr{R}"),lh("ℭ","\\mathfrak{C}"),lh("ℌ","\\mathfrak{H}"),lh("ℨ","\\mathfrak{Z}"),lh("\\Bbbk","\\Bbb{k}"),lh("·","\\cdotp"),lh("\\llap","\\mathllap{\\textrm{#1}}"),lh("\\rlap","\\mathrlap{\\textrm{#1}}"),lh("\\clap","\\mathclap{\\textrm{#1}}"),lh("\\mathstrut","\\vphantom{(}"),lh("\\underbar","\\underline{\\text{#1}}"),lh("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),lh("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),lh("\\ne","\\neq"),lh("≠","\\neq"),
411
- lh("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),lh("∉","\\notin"),lh("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),lh("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),lh("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),lh("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),lh("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),lh("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),lh("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),lh("⟂","\\perp"),lh("‼","\\mathclose{!\\mkern-0.8mu!}"),lh("∌","\\notni"),lh("⌜","\\ulcorner"),lh("⌝","\\urcorner"),lh("⌞","\\llcorner"),lh("⌟","\\lrcorner"),lh("©","\\copyright"),lh("®","\\textregistered"),lh("️","\\textregistered"),lh("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),
412
- lh("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),lh("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),lh("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),lh("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),lh("⋮","\\vdots"),lh("\\varGamma","\\mathit{\\Gamma}"),lh("\\varDelta","\\mathit{\\Delta}"),lh("\\varTheta","\\mathit{\\Theta}"),lh("\\varLambda","\\mathit{\\Lambda}"),lh("\\varXi","\\mathit{\\Xi}"),lh("\\varPi","\\mathit{\\Pi}"),lh("\\varSigma","\\mathit{\\Sigma}"),lh("\\varUpsilon","\\mathit{\\Upsilon}"),lh("\\varPhi","\\mathit{\\Phi}"),lh("\\varPsi","\\mathit{\\Psi}"),lh("\\varOmega","\\mathit{\\Omega}"),lh("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),lh("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),lh("\\boxed","\\fbox{$\\displaystyle{#1}$}"),lh("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),lh("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),
413
- lh("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var ad={",":"\\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",
414
- "\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};lh("\\dots",(function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in ad?t=ad[n]:("\\not"===n.substr(0,4)||n in Bl.math&&Gs.contains(["bin","rel"],Bl.math[n].group))&&(t="\\dotsb"),t}));var sd={")":!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};lh("\\dotso",(function(e){return e.future().text in sd?"\\ldots\\,":"\\ldots"})),lh("\\dotsc",(function(e){var t=e.future().text;return t in sd&&","!==t?"\\ldots\\,":"\\ldots"})),lh("\\cdots",(function(e){return e.future().text in sd?"\\@cdots\\,":"\\@cdots"})),lh("\\dotsb","\\cdots"),lh("\\dotsm","\\cdots"),lh("\\dotsi","\\!\\cdots"),lh("\\dotsx","\\ldots\\,"),lh("\\DOTSI","\\relax"),lh("\\DOTSB","\\relax"),lh("\\DOTSX","\\relax"),lh("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),lh("\\,","\\tmspace+{3mu}{.1667em}"),lh("\\thinspace","\\,"),
415
- lh("\\>","\\mskip{4mu}"),lh("\\:","\\tmspace+{4mu}{.2222em}"),lh("\\medspace","\\:"),lh("\\;","\\tmspace+{5mu}{.2777em}"),lh("\\thickspace","\\;"),lh("\\!","\\tmspace-{3mu}{.1667em}"),lh("\\negthinspace","\\!"),lh("\\negmedspace","\\tmspace-{4mu}{.2222em}"),lh("\\negthickspace","\\tmspace-{5mu}{.277em}"),lh("\\enspace","\\kern.5em "),lh("\\enskip","\\hskip.5em\\relax"),lh("\\quad","\\hskip1em\\relax"),lh("\\qquad","\\hskip2em\\relax"),lh("\\tag","\\@ifstar\\tag@literal\\tag@paren"),lh("\\tag@paren","\\tag@literal{({#1})}"),lh("\\tag@literal",(e=>{if(e.macros.get("\\df@tag"))throw new js("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"})),lh("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),lh("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),lh("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),
416
- lh("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),lh("\\pmb","\\html@mathml{\\@binrel{#1}{\\mathrlap{#1}\\kern0.5px#1}}{\\mathbf{#1}}"),lh("\\newline","\\\\\\relax"),lh("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var ld=xl(cl["Main-Regular"]["T".charCodeAt(0)][1]-.7*cl["Main-Regular"]["A".charCodeAt(0)][1]);lh("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+ld+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),lh("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+ld+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),lh("\\hspace","\\@ifstar\\@hspacer\\@hspace"),lh("\\@hspace","\\hskip #1\\relax"),lh("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),lh("\\ordinarycolon",":"),lh("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),lh("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),
417
- lh("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),lh("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),lh("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),lh("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),lh("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),lh("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),lh("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),lh("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),
418
- lh("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),lh("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),lh("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),lh("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),lh("∷","\\dblcolon"),lh("∹","\\eqcolon"),lh("≔","\\coloneqq"),lh("≕","\\eqqcolon"),lh("⩴","\\Coloneqq"),lh("\\ratio","\\vcentcolon"),lh("\\coloncolon","\\dblcolon"),lh("\\colonequals","\\coloneqq"),lh("\\coloncolonequals","\\Coloneqq"),lh("\\equalscolon","\\eqqcolon"),lh("\\equalscoloncolon","\\Eqqcolon"),lh("\\colonminus","\\coloneq"),lh("\\coloncolonminus","\\Coloneq"),lh("\\minuscolon","\\eqcolon"),lh("\\minuscoloncolon","\\Eqcolon"),lh("\\coloncolonapprox","\\Colonapprox"),lh("\\coloncolonsim","\\Colonsim"),
419
- lh("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),lh("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),lh("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),lh("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),lh("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),lh("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),lh("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),lh("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),lh("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),lh("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),lh("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),lh("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),lh("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),lh("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),lh("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),lh("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),
420
- lh("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),lh("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),lh("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),lh("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),lh("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),lh("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),lh("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),lh("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),lh("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),lh("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),lh("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),lh("\\imath","\\html@mathml{\\@imath}{ı}"),lh("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),lh("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),lh("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),lh("⟦","\\llbracket"),lh("⟧","\\rrbracket"),lh("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),
421
- lh("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),lh("⦃","\\lBrace"),lh("⦄","\\rBrace"),lh("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),lh("⦵","\\minuso"),lh("\\darr","\\downarrow"),lh("\\dArr","\\Downarrow"),lh("\\Darr","\\Downarrow"),lh("\\lang","\\langle"),lh("\\rang","\\rangle"),lh("\\uarr","\\uparrow"),lh("\\uArr","\\Uparrow"),lh("\\Uarr","\\Uparrow"),lh("\\N","\\mathbb{N}"),lh("\\R","\\mathbb{R}"),lh("\\Z","\\mathbb{Z}"),lh("\\alef","\\aleph"),lh("\\alefsym","\\aleph"),lh("\\Alpha","\\mathrm{A}"),lh("\\Beta","\\mathrm{B}"),lh("\\bull","\\bullet"),lh("\\Chi","\\mathrm{X}"),lh("\\clubs","\\clubsuit"),lh("\\cnums","\\mathbb{C}"),lh("\\Complex","\\mathbb{C}"),lh("\\Dagger","\\ddagger"),lh("\\diamonds","\\diamondsuit"),lh("\\empty","\\emptyset"),lh("\\Epsilon","\\mathrm{E}"),lh("\\Eta","\\mathrm{H}"),lh("\\exist","\\exists"),lh("\\harr","\\leftrightarrow"),
422
- lh("\\hArr","\\Leftrightarrow"),lh("\\Harr","\\Leftrightarrow"),lh("\\hearts","\\heartsuit"),lh("\\image","\\Im"),lh("\\infin","\\infty"),lh("\\Iota","\\mathrm{I}"),lh("\\isin","\\in"),lh("\\Kappa","\\mathrm{K}"),lh("\\larr","\\leftarrow"),lh("\\lArr","\\Leftarrow"),lh("\\Larr","\\Leftarrow"),lh("\\lrarr","\\leftrightarrow"),lh("\\lrArr","\\Leftrightarrow"),lh("\\Lrarr","\\Leftrightarrow"),lh("\\Mu","\\mathrm{M}"),lh("\\natnums","\\mathbb{N}"),lh("\\Nu","\\mathrm{N}"),lh("\\Omicron","\\mathrm{O}"),lh("\\plusmn","\\pm"),lh("\\rarr","\\rightarrow"),lh("\\rArr","\\Rightarrow"),lh("\\Rarr","\\Rightarrow"),lh("\\real","\\Re"),lh("\\reals","\\mathbb{R}"),lh("\\Reals","\\mathbb{R}"),lh("\\Rho","\\mathrm{P}"),lh("\\sdot","\\cdot"),lh("\\sect","\\S"),lh("\\spades","\\spadesuit"),lh("\\sub","\\subset"),lh("\\sube","\\subseteq"),lh("\\supe","\\supseteq"),lh("\\Tau","\\mathrm{T}"),lh("\\thetasym","\\vartheta"),lh("\\weierp","\\wp"),lh("\\Zeta","\\mathrm{Z}"),lh("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),
423
- lh("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),lh("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),lh("\\bra","\\mathinner{\\langle{#1}|}"),lh("\\ket","\\mathinner{|{#1}\\rangle}"),lh("\\braket","\\mathinner{\\langle{#1}\\rangle}"),lh("\\Bra","\\left\\langle#1\\right|"),lh("\\Ket","\\left|#1\\right\\rangle"),lh("\\angln","{\\angl n}"),lh("\\blue","\\textcolor{##6495ed}{#1}"),lh("\\orange","\\textcolor{##ffa500}{#1}"),lh("\\pink","\\textcolor{##ff00af}{#1}"),lh("\\red","\\textcolor{##df0030}{#1}"),lh("\\green","\\textcolor{##28ae7b}{#1}"),lh("\\gray","\\textcolor{gray}{#1}"),lh("\\purple","\\textcolor{##9d38bd}{#1}"),lh("\\blueA","\\textcolor{##ccfaff}{#1}"),lh("\\blueB","\\textcolor{##80f6ff}{#1}"),lh("\\blueC","\\textcolor{##63d9ea}{#1}"),lh("\\blueD","\\textcolor{##11accd}{#1}"),lh("\\blueE","\\textcolor{##0c7f99}{#1}"),lh("\\tealA","\\textcolor{##94fff5}{#1}"),lh("\\tealB","\\textcolor{##26edd5}{#1}"),lh("\\tealC","\\textcolor{##01d1c1}{#1}"),lh("\\tealD","\\textcolor{##01a995}{#1}"),
424
- lh("\\tealE","\\textcolor{##208170}{#1}"),lh("\\greenA","\\textcolor{##b6ffb0}{#1}"),lh("\\greenB","\\textcolor{##8af281}{#1}"),lh("\\greenC","\\textcolor{##74cf70}{#1}"),lh("\\greenD","\\textcolor{##1fab54}{#1}"),lh("\\greenE","\\textcolor{##0d923f}{#1}"),lh("\\goldA","\\textcolor{##ffd0a9}{#1}"),lh("\\goldB","\\textcolor{##ffbb71}{#1}"),lh("\\goldC","\\textcolor{##ff9c39}{#1}"),lh("\\goldD","\\textcolor{##e07d10}{#1}"),lh("\\goldE","\\textcolor{##a75a05}{#1}"),lh("\\redA","\\textcolor{##fca9a9}{#1}"),lh("\\redB","\\textcolor{##ff8482}{#1}"),lh("\\redC","\\textcolor{##f9685d}{#1}"),lh("\\redD","\\textcolor{##e84d39}{#1}"),lh("\\redE","\\textcolor{##bc2612}{#1}"),lh("\\maroonA","\\textcolor{##ffbde0}{#1}"),lh("\\maroonB","\\textcolor{##ff92c6}{#1}"),lh("\\maroonC","\\textcolor{##ed5fa6}{#1}"),lh("\\maroonD","\\textcolor{##ca337c}{#1}"),lh("\\maroonE","\\textcolor{##9e034e}{#1}"),lh("\\purpleA","\\textcolor{##ddd7ff}{#1}"),lh("\\purpleB","\\textcolor{##c6b9fc}{#1}"),lh("\\purpleC","\\textcolor{##aa87ff}{#1}"),
425
- lh("\\purpleD","\\textcolor{##7854ab}{#1}"),lh("\\purpleE","\\textcolor{##543b78}{#1}"),lh("\\mintA","\\textcolor{##f5f9e8}{#1}"),lh("\\mintB","\\textcolor{##edf2df}{#1}"),lh("\\mintC","\\textcolor{##e0e5cc}{#1}"),lh("\\grayA","\\textcolor{##f6f7f7}{#1}"),lh("\\grayB","\\textcolor{##f0f1f2}{#1}"),lh("\\grayC","\\textcolor{##e3e5e6}{#1}"),lh("\\grayD","\\textcolor{##d6d8da}{#1}"),lh("\\grayE","\\textcolor{##babec2}{#1}"),lh("\\grayF","\\textcolor{##888d93}{#1}"),lh("\\grayG","\\textcolor{##626569}{#1}"),lh("\\grayH","\\textcolor{##3b3e40}{#1}"),lh("\\grayI","\\textcolor{##21242c}{#1}"),lh("\\kaBlue","\\textcolor{##314453}{#1}"),lh("\\kaGreen","\\textcolor{##71B307}{#1}");var cd={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class ud{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 nd(rd,t.macros),this.mode=n,this.stack=[]}feed(e){
426
- this.lexer=new td(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:r,end:n}=this.consumeArg(["]"]))}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new Fs("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 js("Extra }",r)
427
- }else if("EOF"===r.text)throw new js("Unexpected end of input in a macro argument, expected '"+(e&&n?e[a]:"}")+"'",r);if(e&&n)if((0===i||1===i&&"{"===e[a])&&r.text===e[a]){if(++a===e.length){t.splice(-a,a);break}}else a=0}while(0!==i||n);return"{"===o.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:o,end:r}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new js("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 js("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 js("Undefined control sequence: "+n);return this.pushToken(t),t}if(this.expansionCount++,
428
- this.expansionCount>this.settings.maxExpand)throw new js("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){if(0===a)throw new js("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 js("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 Fs)return e.treatAsRelax&&(e.text="\\relax"),this.stack.pop()}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Fs(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 Fs&&(r.treatAsRelax&&(r.noexpand=!1,r.treatAsRelax=!1),t.push(this.stack.pop()))}
429
- 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;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 td(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)||Qh.hasOwnProperty(e)||Bl.math.hasOwnProperty(e)||Bl.text.hasOwnProperty(e)||cd.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:Qh.hasOwnProperty(e)&&!Qh[e].primitive}}var hd={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",
430
- math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},dd={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","ḉ":"ḉ","č":"č","ĉ":"ĉ","ċ":"ċ","ç":"ç","ď":"ď","ḋ":"ḋ","ḑ":"ḑ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ḝ":"ḝ","ě":"ě","ê":"ê","ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ȩ":"ȩ","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ģ":"ģ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","ḩ":"ḩ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ķ":"ķ","ĺ":"ĺ","ľ":"ľ","ļ":"ļ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ņ":"ņ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ",
341
+ 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 Pl(e,i),s=new Il([a],{width:"400em",height:Sl(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"})
342
+ ;return Ec.makeSvgSpan(["hide-tail"],[s],o)},$u=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],Gu=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],Vu=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Wu=[0,1.2,1.8,2.4,3],Yu=[{type:"small",style:il.SCRIPTSCRIPT},{type:"small",style:il.SCRIPT},{type:"small",style:il.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Ku=[{type:"small",style:il.SCRIPTSCRIPT},{type:"small",style:il.SCRIPT},{type:"small",style:il.TEXT},{type:"stack"}],Xu=[{type:"small",style:il.SCRIPTSCRIPT},{type:"small",style:il.SCRIPT},{type:"small",style:il.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{
343
+ type:"stack"}],Zu=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.")},Ju=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=Ou(e,Zu(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]},Qu=function(e,t,n,r,o,i){var a;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),a=Ws.contains(Vu,e)?Yu:Ws.contains($u,e)?Xu:Ku;var s=Ju(e,t,a,r);return"small"===s.type?function(e,t,n,r,o,i){var a=Ec.makeSymbol(e,"Main-Regular",o,r),s=Iu(a,t,r,i);return n&&Pu(s,r,t),s}(e,s.style,n,r,o,i):"large"===s.type?Ru(e,s.size,n,r,o,i):qu(e,t,n,r,o,i)},eh={sqrtImage:function(e,t){
344
+ var n,r,o=t.havingBaseSizing(),i=Ju("\\surd",e*o.sizeMultiplier,Xu,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=Uu("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*Wu[i.size],c=(Wu[i.size]+s)/a,l=(Wu[i.size]+s+.08)/a,(n=Uu("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=Uu("sqrtTall",l,u,s,t)).style.minWidth="0.742em",r=1.056),n.height=c,n.style.height=Sl(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"),Ws.contains($u,e)||Ws.contains(Vu,e))return Ru(e,t,!1,n,r,o);if(Ws.contains(Gu,e))return qu(e,Wu[t],!1,n,r,o);throw new qs("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:Wu,customSizedDelim:Qu,leftRightDelim:function(e,t,n,r,o,i){
345
+ 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 Qu(e,c,!0,r,o,i)}},th={"\\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}
346
+ },nh=["(","\\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 rh(e,t){var n=bu(e);if(n&&Ws.contains(nh,n.text))return n;throw new qs(n?"Invalid delimiter '"+n.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function oh(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Rc({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=rh(t[0],e);return{type:"delimsizing",
347
+ mode:e.parser.mode,size:th[e.funcName].size,mclass:th[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?Ec.makeSpan([e.mclass]):eh.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(ou(e.delim,e.mode));var n=new ru.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=Sl(eh.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}}),Rc({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 qs("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:rh(t[0],e).text,color:n}}}),Rc({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=rh(t[0],e),r=e.parser;++r.leftrightDepth;var o=r.parseExpression(!1)
348
+ ;--r.leftrightDepth,r.expect("\\right",!1);var i=yu(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:o,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,t)=>{oh(e);for(var n,r,o=Gc(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?Xc(t,["mopen"]):eh.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]=eh.leftRightDelim(u.delim,i,a,u.options,e.mode,[]))}if("."===e.right)r=Xc(t,["mclose"]);else{var h=e.rightColor?t.withColor(e.rightColor):t;r=eh.leftRightDelim(e.right,i,a,h,e.mode,["mclose"])}return o.push(r),Ec.makeSpan(["minner"],o,t)},mathmlBuilder:(e,t)=>{oh(e);var n=su(e.body,t);if("."!==e.left){var r=new ru.MathNode("mo",[ou(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if("."!==e.right){var o=new ru.MathNode("mo",[ou(e.right,e.mode)])
349
+ ;o.setAttribute("fence","true"),e.rightColor&&o.setAttribute("mathcolor",e.rightColor),n.push(o)}return iu(n)}}),Rc({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=rh(t[0],e);if(!e.parser.leftrightDepth)throw new qs("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if("."===e.delim)n=Xc(t,[]);else{n=eh.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?ou("|","text"):ou(e.delim,e.mode),r=new ru.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var ih=(e,t)=>{var n,r,o=Ec.wrapFragment(Zc(e.body,t),t),i=e.label.substr(1),a=t.sizeMultiplier,s=0,l=Ws.isCharacterBox(e.body);if("sout"===i)(n=Ec.makeSpan(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/a,s=-.5*t.fontMetrics().xHeight;else if("phase"===i){var c=kl({
350
+ number:.6,unit:"pt"},t),u=kl({number:.35,unit:"ex"},t);a/=t.havingBaseSizing().sizeMultiplier;var h=o.height+o.depth+c+u;o.style.paddingLeft=Sl(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 Il([new Pl("phase",p)],{width:"400em",height:Sl(d/1e3),viewBox:"0 0 400000 "+d,preserveAspectRatio:"xMinYMin slice"});(n=Ec.makeSvgSpan(["hide-tail"],[m],t)).style.height=Sl(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=fu(o,i,f,g,t),/fbox|boxed|fcolorbox/.test(i)?(n.style.borderStyle="solid",n.style.borderWidth=Sl(v)):"angl"===i&&.049!==v&&(n.style.borderTopWidth=Sl(v),n.style.borderRightWidth=Sl(v)),
351
+ s=o.depth+g,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)r=Ec.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:s},{type:"elem",elem:o,shift:0}]},t);else{var y=/cancel|phase/.test(i)?["svg-align"]:[];r=Ec.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:n,shift:s,wrapperClasses:y}]},t)}return/cancel/.test(i)&&(r.height=o.height,r.depth=o.depth),/cancel/.test(i)&&!l?Ec.makeSpan(["mord","cancel-lap"],[r],t):Ec.makeSpan(["mord"],[r],t)},ah=(e,t)=>{var n=0,r=new ru.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[cu(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":
352
+ 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};Rc({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:r,funcName:o}=e,i=yu(t[0],"color-token").color,a=t[1];return{type:"enclose",mode:r.mode,label:o,backgroundColor:i,body:a}},htmlBuilder:ih,mathmlBuilder:ah}),Rc({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,
353
+ argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:o}=e,i=yu(t[0],"color-token").color,a=yu(t[1],"color-token").color,s=t[2];return{type:"enclose",mode:r.mode,label:o,backgroundColor:a,borderColor:i,body:s}},htmlBuilder:ih,mathmlBuilder:ah}),Rc({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]}}}),Rc({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:ih,mathmlBuilder:ah}),Rc({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 sh={};function lh(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,
354
+ handler:o},l=0;l<n.length;++l)sh[n[l]]=s;i&&(Ic[t]=i),a&&(Pc[t]=a)}var ch={};function uh(e,t){ch[e]=t}function hh(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 dh=e=>{if(!e.parser.settings.displayMode)throw new qs("{"+e.envName+"} can be used only in display mode.")};function ph(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function mh(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 qs("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var m=[],f=[m],g=[],v=[],y=null!=l?[]:void 0;function _(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function b(){
355
+ y&&(e.gullet.macros.get("\\df@tag")?(y.push(e.subparse([new Hs("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):y.push(Boolean(l)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(_(),v.push(hh(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 qs("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){b(),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 qs("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),b(),v.push(hh(e)),m=[],f.push(m),_()}}return e.gullet.endGroup(),
356
+ 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:y,leqno:d}}function fh(e){return"d"===e.substr(0,1)?"display":"text"}var gh=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(il.SCRIPT).sizeMultiplier/t.sizeMultiplier*.2778);var d="CD"===e.colSeparationType?kl({number:3,unit:"ex"},t):12*u,p=3*u,m=e.arraystretch*d,f=.7*m,g=.3*m,v=0;function y(e){for(var t=0;t<e.length;++t)t>0&&(v+=.25),l.push({pos:v,isDashed:e[t]})}for(y(i[0]),n=0;n<e.body.length;++n){var _=e.body[n],b=f,w=g;a<_.length&&(a=_.length);var x=new Array(_.length);for(r=0;r<_.length;++r){var k=Zc(_[r],t);w<k.depth&&(w=k.depth),b<k.height&&(b=k.height),x[r]=k}var S=e.rowGaps[n],C=0;S&&(C=kl(S,t))>0&&(w<(C+=g)&&(w=C),C=0),e.addJot&&(w+=p),x.height=b,
357
+ x.depth=w,v+=b,x.pos=v,v+=w+C,s[n]=x,y(i[n+1])}var A,E,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,I=e.tags[n],P=void 0;(P=!0===I?Ec.makeSpan(["eqn-num"],[],t):!1===I?Ec.makeSpan([],[],t):Ec.makeSpan([],Gc(I,t,!0),t)).depth=z.depth,P.height=z.height,L.push({type:"elem",elem:P,shift:O})}for(r=0,E=0;r<a||E<N.length;++r,++E){for(var R=N[E]||{},D=!0;"separator"===R.type;){if(D||((A=Ec.makeSpan(["arraycolsep"],[])).style.width=Sl(t.fontMetrics().doubleRuleSep),M.push(A)),"|"!==R.separator&&":"!==R.separator)throw new qs("Invalid separator type: "+R.separator);var B="|"===R.separator?"solid":"dashed",F=Ec.makeSpan(["vertical-separator"],[],t);F.style.height=Sl(v),F.style.borderRightWidth=Sl(c),F.style.borderRightStyle=B,F.style.margin="0 "+Sl(-c/2);var j=v-T;j&&(F.style.verticalAlign=Sl(-j)),M.push(F),R=N[++E]||{},D=!1}if(!(r>=a)){var H=void 0
358
+ ;(r>0||e.hskipBeforeAndAfter)&&0!==(H=Ws.deflt(R.pregap,h))&&((A=Ec.makeSpan(["arraycolsep"],[])).style.width=Sl(H),M.push(A));var q=[];for(n=0;n<o;++n){var U=s[n],$=U[r];if($){var G=U.pos-T;$.depth=U.depth,$.height=U.height,q.push({type:"elem",elem:$,shift:G})}}q=Ec.makeVList({positionType:"individualShift",children:q},t),q=Ec.makeSpan(["col-align-"+(R.align||"c")],[q]),M.push(q),(r<a-1||e.hskipBeforeAndAfter)&&0!==(H=Ws.deflt(R.postgap,h))&&((A=Ec.makeSpan(["arraycolsep"],[])).style.width=Sl(H),M.push(A))}}if(s=Ec.makeSpan(["mtable"],M),l.length>0){for(var V=Ec.makeLineSpan("hline",t,c),W=Ec.makeLineSpan("hdashline",t,c),Y=[{type:"elem",elem:s,shift:0}];l.length>0;){var K=l.pop(),X=K.pos-T;K.isDashed?Y.push({type:"elem",elem:W,shift:X}):Y.push({type:"elem",elem:V,shift:X})}s=Ec.makeVList({positionType:"individualShift",children:Y},t)}if(0===L.length)return Ec.makeSpan(["mord"],[s],t);var Z=Ec.makeVList({positionType:"individualShift",children:L},t);return Z=Ec.makeSpan(["tag"],[Z],t),Ec.makeFragment([s,Z])
359
+ },vh={c:"center ",l:"left ",r:"right "},yh=function(e,t){for(var n=[],r=new ru.MathNode("mtd",[],["mtr-glue"]),o=new ru.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 ru.MathNode("mtd",[cu(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 ru.MathNode("mtr",s))}var c=new ru.MathNode("mtable",n),u=.5===e.arraystretch?.1:.16+e.arraystretch-1+(e.addJot?.09:0);c.setAttribute("rowspacing",Sl(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 y=g;y<v;y++)"align"===p[y].type?(d+=vh[p[y].align],f&&(m+="none "),f=!0):"separator"===p[y].type&&f&&(m+="|"===p[y].separator?"solid ":"dashed ",f=!1);c.setAttribute("columnalign",d.trim()),/[sd]/.test(m)&&c.setAttribute("columnlines",m.trim())}if("align"===e.colSeparationType){
360
+ for(var _=e.cols||[],b="",w=1;w<_.length;w++)b+=w%2?"0em ":"1em ";c.setAttribute("columnspacing",b.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 ru.MathNode("menclose",[c])).setAttribute("notation",h.trim()),e.arraystretch&&e.arraystretch<1&&(c=new ru.MathNode("mstyle",[c])).setAttribute("scriptlevel","1"),c},_h=function(e,t){-1===e.envName.indexOf("ed")&&dh(e);var n,r=[],o=e.envName.indexOf("at")>-1?"alignat":"align",i="split"===e.envName,a=mh(e.parser,{cols:r,addJot:!0,autoTag:i?void 0:ph(e.envName),emptySingleRow:!0,
361
+ 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+=yu(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=yu(e[t],"styling");yu(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 qs("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};lh({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=(bu(t[0])?[t[0]]:yu(t[0],"ordgroup").body).map((function(e){var t=_u(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"}
362
+ ;throw new qs("Unknown column alignment: "+t,e)})),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return mh(e.parser,r,fh(e.envName))},htmlBuilder:gh,mathmlBuilder:yh}),lh({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 qs("Expected l or c or r",o.nextToken);o.consume(),o.consumeSpaces(),o.expect("]"),o.consume(),r.cols=[{type:"align",align:n}]}}var i=mh(e.parser,r,fh(e.envName)),a=Math.max(0,...i.body.map((e=>e.length)));return i.cols=new Array(a).fill({type:"align",align:n}),t?{
363
+ type:"leftright",mode:e.mode,body:[i],left:t[0],right:t[1],rightColor:void 0}:i},htmlBuilder:gh,mathmlBuilder:yh}),lh({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t=mh(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:gh,mathmlBuilder:yh}),lh({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=(bu(t[0])?[t[0]]:yu(t[0],"ordgroup").body).map((function(e){var t=_u(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new qs("Unknown column alignment: "+t,e)}));if(n.length>1)throw new qs("{subarray} can contain only one column");var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if((r=mh(e.parser,r,"script")).body.length>0&&r.body[0].length>1)throw new qs("{subarray} can contain only one column");return r},htmlBuilder:gh,mathmlBuilder:yh}),lh({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=mh(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{
364
+ type:"align",align:"l",pregap:0,postgap:0}]},fh(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:gh,mathmlBuilder:yh}),lh({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:_h,htmlBuilder:gh,mathmlBuilder:yh}),lh({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){Ws.contains(["gather","gather*"],e.envName)&&dh(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:ph(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return mh(e.parser,t,"display")},htmlBuilder:gh,mathmlBuilder:yh}),lh({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:_h,htmlBuilder:gh,mathmlBuilder:yh}),lh({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){dh(e);var t={autoTag:ph(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno}
365
+ ;return mh(e.parser,t,"display")},htmlBuilder:gh,mathmlBuilder:yh}),lh({type:"array",names:["CD"],props:{numArgs:0},handler:e=>(dh(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 qs("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(Au(l[u])){i.push(c);var h=_u(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 qs('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
366
+ }if(Au(l[f]))throw new qs("Missing a "+h+" character to complete a CD arrow.",l[f]);d[p].body.push(l[f])}if(m)throw new qs("Missing a "+h+" character to complete a CD arrow.",l[u])}}var g={type:"styling",body:[Eu(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:gh,mathmlBuilder:yh}),uh("\\nonumber","\\gdef\\@eqnsw{0}"),uh("\\notag","\\nonumber"),Rc({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new qs(e.funcName+" valid only within array environment")}});var bh=sh;Rc({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,
367
+ argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];if("ordgroup"!==o.type)throw new qs("Invalid environment name",o);for(var i="",a=0;a<o.body.length;++a)i+=yu(o.body[a],"textord").text;if("\\begin"===r){if(!bh.hasOwnProperty(i))throw new qs("No such environment: "+i,o);var s=bh[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=yu(n.parseFunction(),"environment");if(p.name!==i)throw new qs("Mismatch: \\begin{"+i+"} matched by \\end{"+p.name+"}",d);return h}return{type:"environment",mode:n.mode,name:i,nameGroup:o}}});var wh=Ec.makeSpan;function xh(e,t){var n=Gc(e.body,t,!0);return wh([e.mclass],n,t)}function kh(e,t){var n,r=su(e.body,t);return"minner"===e.mclass?n=new ru.MathNode("mpadded",r):"mord"===e.mclass?e.isCharacterBox?(n=r[0]).type="mi":n=new ru.MathNode("mi",r):(e.isCharacterBox?(n=r[0]).type="mo":n=new ru.MathNode("mo",r),"mbin"===e.mclass?(n.attributes.lspace="0.22em",
368
+ 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}Rc({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:Fc(o),isCharacterBox:Ws.isCharacterBox(o)}},htmlBuilder:xh,mathmlBuilder:kh});var Sh=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};Rc({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Sh(t[0]),body:Fc(t[1]),isCharacterBox:Ws.isCharacterBox(t[1])}}}),Rc({type:"mclass",names:["\\stackrel","\\overset","\\underset"],
369
+ props:{numArgs:2},handler(e,t){var n,{parser:r,funcName:o}=e,i=t[1],a=t[0];n="\\stackrel"!==o?Sh(i):"mrel";var s={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==o,body:Fc(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:Ws.isCharacterBox(l)}},htmlBuilder:xh,mathmlBuilder:kh});var Ch=(e,t)=>{var n=e.font,r=t.withFont(n);return Zc(e.body,r)},Ah=(e,t)=>{var n=e.font,r=t.withFont(n);return cu(e.body,r)},Eh={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Rc({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=Bc(t[0]),i=r;return i in Eh&&(i=Eh[i]),{type:"font",mode:n.mode,font:i.slice(1),body:o}},
370
+ htmlBuilder:Ch,mathmlBuilder:Ah}),Rc({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0],o=Ws.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:Sh(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:o}}}),Rc({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:Ch,mathmlBuilder:Ah});var Th=(e,t)=>{var n=t;return"display"===e?n=n.id>=il.SCRIPT.id?n.text():il.DISPLAY:"text"===e&&n.size===il.DISPLAY.size?n=il.TEXT:"script"===e?n=il.SCRIPT:"scriptscript"===e&&(n=il.SCRIPTSCRIPT),n},Nh=(e,t)=>{var n,r=Th(e.size,t.style),o=r.fracNum(),i=r.fracDen();n=t.havingStyle(o);var a=Zc(e.numer,n,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm
371
+ ;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,y,_=Zc(e.denom,n,t);if(e.hasBarLine?(e.barSize?(u=kl(e.barSize,t),c=Ec.makeLineSpan("frac-line",t,u)):c=Ec.makeLineSpan("frac-line",t),u=c.height,h=c.height):(c=null,u=0,h=t.fontMetrics().defaultRuleThickness),r.size===il.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 b=t.fontMetrics().axisHeight;d-a.depth-(b+.5*u)<p&&(d+=p-(d-a.depth-(b+.5*u))),b-.5*u-(_.height-m)<p&&(m+=p-(b-.5*u-(_.height-m)));var w=-(b-.5*u);f=Ec.makeVList({positionType:"individualShift",children:[{type:"elem",elem:_,shift:m},{type:"elem",elem:c,shift:w},{type:"elem",elem:a,shift:-d}]},t)}else{var x=d-a.depth-(_.height-m);x<p&&(d+=.5*(p-x),m+=.5*(p-x)),f=Ec.makeVList({positionType:"individualShift",children:[{type:"elem",elem:_,shift:m},{type:"elem",elem:a,shift:-d}]},t)}
372
+ return n=t.havingStyle(r),f.height*=n.sizeMultiplier/t.sizeMultiplier,f.depth*=n.sizeMultiplier/t.sizeMultiplier,g=r.size===il.DISPLAY.size?t.fontMetrics().delim1:r.size===il.SCRIPTSCRIPT.size?t.havingStyle(il.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,v=null==e.leftDelim?Xc(t,["mopen"]):eh.customSizedDelim(e.leftDelim,g,!0,t.havingStyle(r),e.mode,["mopen"]),y=e.continued?Ec.makeSpan([]):null==e.rightDelim?Xc(t,["mclose"]):eh.customSizedDelim(e.rightDelim,g,!0,t.havingStyle(r),e.mode,["mclose"]),Ec.makeSpan(["mord"].concat(n.sizingClasses(t)),[v,Ec.makeSpan(["mfrac"],[f]),y],t)},Mh=(e,t)=>{var n=new ru.MathNode("mfrac",[cu(e.numer,t),cu(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var r=kl(e.barSize,t);n.setAttribute("linethickness",Sl(r))}}else n.setAttribute("linethickness","0px");var o=Th(e.size,t.style);if(o.size!==t.style.size){n=new ru.MathNode("mstyle",[n]);var i=o.size===il.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",i),n.setAttribute("scriptlevel","0")}
373
+ if(null!=e.leftDelim||null!=e.rightDelim){var a=[];if(null!=e.leftDelim){var s=new ru.MathNode("mo",[new ru.TextNode(e.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),a.push(s)}if(a.push(n),null!=e.rightDelim){var l=new ru.MathNode("mo",[new ru.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),a.push(l)}return iu(a)}return n};Rc({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"}
374
+ return{type:"genfrac",mode:r.mode,continued:!1,numer:i,denom:a,hasBarLine:n,leftDelim:s,rightDelim:l,size:c,barSize:null}},htmlBuilder:Nh,mathmlBuilder:Mh}),Rc({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}}}),Rc({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 Lh=["display","text","script","scriptscript"],zh=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};Rc({type:"genfrac",names:["\\genfrac"],
375
+ 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=Bc(t[0]),s="atom"===a.type&&"open"===a.family?zh(a.text):null,l=Bc(t[1]),c="atom"===l.type&&"close"===l.family?zh(l.text):null,u=yu(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=yu(p.body[0],"textord");d=Lh[Number(m.text)]}}else p=yu(p,"textord"),d=Lh[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:Nh,mathmlBuilder:Mh}),Rc({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:yu(t[0],"size").value,token:o}}}),Rc({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{
376
+ 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}(yu(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:Nh,mathmlBuilder:Mh});var Oh=(e,t)=>{var n,r,o=t.style;"supsub"===e.type?(n=e.sup?Zc(e.sup,t.havingStyle(o.sup()),t):Zc(e.sub,t.havingStyle(o.sub()),t),r=yu(e.base,"horizBrace")):r=yu(e,"horizBrace");var i,a=Zc(r.base,t.havingBaseStyle(il.DISPLAY)),s=vu(r,t);if(r.isOver?(i=Ec.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=Ec.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){
377
+ var l=Ec.makeSpan(["mord",r.isOver?"mover":"munder"],[i],t);i=r.isOver?Ec.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},t):Ec.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 Ec.makeSpan(["mord",r.isOver?"mover":"munder"],[i],t)};Rc({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:Oh,mathmlBuilder:(e,t)=>{var n=gu(e.label);return new ru.MathNode(e.isOver?"mover":"munder",[cu(e.base,t),n])}}),Rc({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],o=yu(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:o})?{type:"href",mode:n.mode,href:o,body:Fc(r)}:n.formatUnsupportedCmd("\\href")},
378
+ htmlBuilder:(e,t)=>{var n=Gc(e.body,t,!1);return Ec.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=lu(e.body,t);return n instanceof tu||(n=new tu("mrow",[n])),n.setAttribute("href",e.href),n}}),Rc({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=yu(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:Fc(s)}}}),Rc({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:Fc(t[0])}},htmlBuilder(e,t){var n=Gc(e.body,t,!1);return Ec.makeFragment(n)},mathmlBuilder:(e,t)=>new ru.MathNode("mrow",su(e.body,t))}),Rc({type:"html",
379
+ 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=yu(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 qs("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:Fc(s)}:r.formatUnsupportedCmd(o)},htmlBuilder:(e,t)=>{var n=Gc(e.body,t,!1),r=["enclosing"]
380
+ ;e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var o=Ec.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)=>lu(e.body,t)}),Rc({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Fc(t[0]),mathml:Fc(t[1])}},htmlBuilder:(e,t)=>{var n=Gc(e.html,t,!1);return Ec.makeFragment(n)},mathmlBuilder:(e,t)=>lu(e.mathml,t)});var Ih=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 qs("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!xl(n))throw new qs("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};Rc({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{
381
+ 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=yu(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=Ih(h);break;case"height":i=Ih(h);break;case"totalheight":a=Ih(h);break;default:throw new qs("Invalid key: '"+u[0]+"' in \\includegraphics.")}}}var d=yu(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=kl(e.height,t),r=0;e.totalheight.number>0&&(r=kl(e.totalheight,t)-n);var o=0;e.width.number>0&&(o=kl(e.width,t));var i={height:Sl(n+r)};o>0&&(i.width=Sl(o)),r>0&&(i.verticalAlign=Sl(-r));var a=new Ll(e.src,e.alt,i);return a.height=n,a.depth=r,a},mathmlBuilder:(e,t)=>{
382
+ var n=new ru.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var r=kl(e.height,t),o=0;if(e.totalheight.number>0&&(o=kl(e.totalheight,t)-r,n.setAttribute("valign",Sl(-o))),n.setAttribute("height",Sl(r+o)),e.width.number>0){var i=kl(e.width,t);n.setAttribute("width",Sl(i))}return n.setAttribute("src",e.src),n}}),Rc({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=yu(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)=>Ec.makeGlue(e.dimension,t),mathmlBuilder(e,t){var n=kl(e.dimension,t)
383
+ ;return new ru.SpaceNode(n)}}),Rc({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=Ec.makeSpan([],[Zc(e.body,t)]),n=Ec.makeSpan(["inner"],[n],t)):n=Ec.makeSpan(["inner"],[Zc(e.body,t)]);var r=Ec.makeSpan(["fix"],[]),o=Ec.makeSpan([e.alignment],[n,r],t),i=Ec.makeSpan(["strut"]);return i.style.height=Sl(o.height+o.depth),o.depth&&(i.style.verticalAlign=Sl(-o.depth)),o.children.unshift(i),o=Ec.makeSpan(["thinbox"],[o],t),Ec.makeSpan(["mord","vbox"],[o],t)},mathmlBuilder:(e,t)=>{var n=new ru.MathNode("mpadded",[cu(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}}),Rc({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,o=r.mode
384
+ ;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}}}),Rc({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new qs("Mismatched "+e.funcName)}});var Ph=(e,t)=>{switch(t.style.size){case il.DISPLAY.size:return e.display;case il.TEXT.size:return e.text;case il.SCRIPT.size:return e.script;case il.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Rc({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Fc(t[0]),text:Fc(t[1]),script:Fc(t[2]),scriptscript:Fc(t[3])}},htmlBuilder:(e,t)=>{var n=Ph(e,t),r=Gc(n,t,!1);return Ec.makeFragment(r)},mathmlBuilder:(e,t)=>{var n=Ph(e,t);return lu(n,t)}});var Rh=(e,t,n,r,o,i,a)=>{e=Ec.makeSpan([],[e]);var s,l,c,u=n&&Ws.isCharacterBox(n);if(t){var h=Zc(t,r.havingStyle(o.sup()),r);l={elem:h,
385
+ kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-h.depth)}}if(n){var d=Zc(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=Ec.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:Sl(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:Sl(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(s){var m=e.height-a;c=Ec.makeVList({positionType:"top",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:Sl(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e}]},r)}else{if(!l)return e;var f=e.depth+a;c=Ec.makeVList({positionType:"bottom",positionData:f,children:[{type:"elem",elem:e},{type:"kern",size:l.kern},{
386
+ type:"elem",elem:l.elem,marginLeft:Sl(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}var g=[c];if(s&&0!==i&&!u){var v=Ec.makeSpan(["mspace"],[],r);v.style.marginRight=Sl(i),g.unshift(v)}return Ec.makeSpan(["mop","op-limits"],g,r)},Dh=["\\smallint"],Bh=(e,t)=>{var n,r,o,i=!1;"supsub"===e.type?(n=e.sup,r=e.sub,o=yu(e.base,"op"),i=!0):o=yu(e,"op");var a,s=t.style,l=!1;if(s.size===il.DISPLAY.size&&o.symbol&&!Ws.contains(Dh,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=Ec.makeSymbol(o.name,c,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),u.length>0){var h=a.italic,d=Ec.staticSvg(u+"Size"+(l?"2":"1"),t);a=Ec.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=Gc(o.body,t,!0)
387
+ ;1===p.length&&p[0]instanceof Ol?(a=p[0]).classes[0]="mop":a=Ec.makeSpan(["mop"],p,t)}else{for(var m=[],f=1;f<o.name.length;f++)m.push(Ec.mathsym(o.name[f],o.mode,t));a=Ec.makeSpan(["mop"],m,t)}var g=0,v=0;return(a instanceof Ol||"\\oiint"===o.name||"\\oiiint"===o.name)&&!o.suppressBaseShift&&(g=(a.height-a.depth)/2-t.fontMetrics().axisHeight,v=a.italic),i?Rh(a,n,r,t,s,v,g):(g&&(a.style.position="relative",a.style.top=Sl(g)),a)},Fh=(e,t)=>{var n;if(e.symbol)n=new tu("mo",[ou(e.name,e.mode)]),Ws.contains(Dh,e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new tu("mo",su(e.body,t));else{n=new tu("mi",[new nu(e.name.slice(1))]);var r=new tu("mo",[ou("⁡","text")]);n=e.parentIsSupSub?new tu("mrow",[n,r]):eu([n,r])}return n},jh={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Rc({type:"op",
388
+ 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=jh[o]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:o}},htmlBuilder:Bh,mathmlBuilder:Fh}),Rc({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:Fc(r)}},htmlBuilder:Bh,mathmlBuilder:Fh});var Hh={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Rc({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"],
389
+ 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:Bh,mathmlBuilder:Fh}),Rc({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:Bh,mathmlBuilder:Fh}),Rc({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=Hh[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Bh,mathmlBuilder:Fh});var qh=(e,t)=>{var n,r,o,i,a=!1;if("supsub"===e.type?(n=e.sup,r=e.sub,o=yu(e.base,"operatorname"),a=!0):o=yu(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=Gc(s,t.withFont("mathrm"),!0),c=0;c<l.length;c++){
390
+ var u=l[c];u instanceof Ol&&(u.text=u.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}i=Ec.makeSpan(["mop"],l,t)}else i=Ec.makeSpan(["mop"],[],t);return a?Rh(i,n,r,t,t.style,0,0):i};function Uh(e,t,n){for(var r=Gc(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 Ec.makeFragment(r)}Rc({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:Fc(o),alwaysHandleSupSub:"\\operatornamewithlimits"===r,limits:!1,parentIsSupSub:!1}},htmlBuilder:qh,mathmlBuilder:(e,t)=>{for(var n=su(e.body,t.withFont("mathrm")),r=!0,o=0;o<n.length;o++){var i=n[o];if(i instanceof ru.SpaceNode);else if(i instanceof ru.MathNode)switch(i.type){case"mi":case"mn":case"ms":
391
+ case"mspace":case"mtext":break;case"mo":var a=i.children[0];1===i.children.length&&a instanceof ru.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 ru.TextNode(s)]}var l=new ru.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new ru.MathNode("mo",[ou("⁡","text")]);return e.parentIsSupSub?new ru.MathNode("mrow",[l,c]):ru.newDocumentFragment([l,c])}}),uh("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),Dc({type:"ordgroup",htmlBuilder:(e,t)=>e.semisimple?Ec.makeFragment(Gc(e.body,t,!1)):Ec.makeSpan(["mord"],Gc(e.body,t,!0),t),mathmlBuilder:(e,t)=>lu(e.body,t,!0)}),Rc({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=Zc(e.body,t.havingCrampedStyle()),r=Ec.makeLineSpan("overline-line",t),o=t.fontMetrics().defaultRuleThickness,i=Ec.makeVList({positionType:"firstBaseline",
392
+ children:[{type:"elem",elem:n},{type:"kern",size:3*o},{type:"elem",elem:r},{type:"kern",size:o}]},t);return Ec.makeSpan(["mord","overline"],[i],t)},mathmlBuilder(e,t){var n=new ru.MathNode("mo",[new ru.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new ru.MathNode("mover",[cu(e.body,t),n]);return r.setAttribute("accent","true"),r}}),Rc({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:Fc(r)}},htmlBuilder:(e,t)=>{var n=Gc(e.body,t.withPhantom(),!1);return Ec.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=su(e.body,t);return new ru.MathNode("mphantom",n)}}),Rc({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=Ec.makeSpan([],[Zc(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
393
+ ;return n=Ec.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t),Ec.makeSpan(["mord"],[n],t)},mathmlBuilder:(e,t)=>{var n=su(Fc(e.body),t),r=new ru.MathNode("mphantom",n),o=new ru.MathNode("mpadded",[r]);return o.setAttribute("height","0px"),o.setAttribute("depth","0px"),o}}),Rc({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=Ec.makeSpan(["inner"],[Zc(e.body,t.withPhantom())]),r=Ec.makeSpan(["fix"],[]);return Ec.makeSpan(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=su(Fc(e.body),t),r=new ru.MathNode("mphantom",n),o=new ru.MathNode("mpadded",[r]);return o.setAttribute("width","0px"),o}}),Rc({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=yu(t[0],"size").value,o=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:o}},htmlBuilder(e,t){var n=Zc(e.body,t),r=kl(e.dy,t)
394
+ ;return Ec.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new ru.MathNode("mpadded",[cu(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}}),Rc({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),Rc({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=yu(t[0],"size"),a=yu(t[1],"size");return{type:"rule",mode:r.mode,shift:o&&yu(o,"size").value,width:i.value,height:a.value}},htmlBuilder(e,t){var n=Ec.makeSpan(["mord","rule"],[],t),r=kl(e.width,t),o=kl(e.height,t),i=e.shift?kl(e.shift,t):0;return n.style.borderRightWidth=Sl(r),n.style.borderTopWidth=Sl(o),n.style.bottom=Sl(i),n.width=r,n.height=o+i,n.depth=-i,n.maxFontSize=1.125*o*t.sizeMultiplier,n},mathmlBuilder(e,t){
395
+ var n=kl(e.width,t),r=kl(e.height,t),o=e.shift?kl(e.shift,t):0,i=t.color&&t.getColor()||"black",a=new ru.MathNode("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",Sl(n)),a.setAttribute("height",Sl(r));var s=new ru.MathNode("mpadded",[a]);return o>=0?s.setAttribute("height",Sl(o)):(s.setAttribute("height",Sl(o)),s.setAttribute("depth",Sl(-o))),s.setAttribute("voffset",Sl(o)),s}});var $h=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];Rc({type:"sizing",names:$h,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:$h.indexOf(r)+1,body:i}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return Uh(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=su(e.body,n),o=new ru.MathNode("mstyle",r);return o.setAttribute("mathsize",Sl(n.sizeMultiplier)),o}}),Rc({type:"smash",names:["\\smash"],props:{
396
+ numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,o=!1,i=!1,a=n[0]&&yu(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=Ec.makeSpan([],[Zc(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=Ec.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t);return Ec.makeSpan(["mord"],[i],t)},mathmlBuilder:(e,t)=>{var n=new ru.MathNode("mpadded",[cu(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),Rc({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){
397
+ 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=Zc(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=Ec.wrapFragment(n,t);var r=t.fontMetrics().defaultRuleThickness,o=r;t.style.id<il.TEXT.id&&(o=t.fontMetrics().xHeight);var i=r+o/4,a=n.height+n.depth+i+r,{span:s,ruleWidth:l,advanceWidth:c}=eh.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=Sl(c);var d=Ec.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(il.SCRIPTSCRIPT),m=Zc(e.index,p,t),f=.6*(d.height-d.depth),g=Ec.makeVList({positionType:"shift",positionData:-f,children:[{type:"elem",elem:m}]},t),v=Ec.makeSpan(["root"],[g]);return Ec.makeSpan(["mord","sqrt"],[v,d],t)}return Ec.makeSpan(["mord","sqrt"],[d],t)},mathmlBuilder(e,t){
398
+ var{body:n,index:r}=e;return r?new ru.MathNode("mroot",[cu(n,t),cu(r,t)]):new ru.MathNode("msqrt",[cu(n,t)])}});var Gh={display:il.DISPLAY,text:il.TEXT,script:il.SCRIPT,scriptscript:il.SCRIPTSCRIPT};Rc({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=Gh[e.style],r=t.havingStyle(n).withFont("");return Uh(e.body,r,t)},mathmlBuilder(e,t){var n=Gh[e.style],r=t.havingStyle(n),o=su(e.body,r),i=new ru.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}});Dc({type:"supsub",htmlBuilder(e,t){var n=function(e,t){var n=e.base
399
+ ;return n?"op"===n.type?n.limits&&(t.style.size===il.DISPLAY.size||n.alwaysHandleSupSub)?Bh:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(t.style.size===il.DISPLAY.size||n.limits)?qh:null:"accent"===n.type?Ws.isCharacterBox(n.base)?wu:null:"horizBrace"===n.type&&!e.sub===n.isOver?Oh:null:null}(e,t);if(n)return n(e,t);var r,o,i,{base:a,sup:s,sub:l}=e,c=Zc(a,t),u=t.fontMetrics(),h=0,d=0,p=a&&Ws.isCharacterBox(a);if(s){var m=t.havingStyle(t.style.sup());r=Zc(s,m,t),p||(h=c.height-m.fontMetrics().supDrop*m.sizeMultiplier/t.sizeMultiplier)}if(l){var f=t.havingStyle(t.style.sub());o=Zc(l,f,t),p||(d=c.depth+f.fontMetrics().subDrop*f.sizeMultiplier/t.sizeMultiplier)}i=t.style===il.DISPLAY?u.sup1:t.style.cramped?u.sup3:u.sup2;var g,v=t.sizeMultiplier,y=Sl(.5/u.ptPerEm/v),_=null;if(o){var b=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof Ol||b)&&(_=Sl(-c.italic))}if(r&&o){h=Math.max(h,i,r.depth+.25*u.xHeight),d=Math.max(d,u.sub2)
400
+ ;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:y,marginLeft:_},{type:"elem",elem:r,shift:-h,marginRight:y}];g=Ec.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:_,marginRight:y}];g=Ec.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=Ec.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:r,marginRight:y}]},t)}var C=Kc(c,"right")||"mord";return Ec.makeSpan([C],[c,Ec.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=[cu(e.base,t)]
401
+ ;if(e.sub&&i.push(cu(e.sub,t)),e.sup&&i.push(cu(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===il.DISPLAY||a&&"operatorname"===a.type&&a.alwaysHandleSupSub&&(t.style===il.DISPLAY||a.limits)?"munderover":"msubsup"}else{var s=e.base;o=s&&"op"===s.type&&s.limits&&(t.style===il.DISPLAY||s.alwaysHandleSupSub)||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(s.limits||t.style===il.DISPLAY)?"munder":"msub"}else{var l=e.base;o=l&&"op"===l.type&&l.limits&&(t.style===il.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===il.DISPLAY)?"mover":"msup"}return new ru.MathNode(o,i)}}),Dc({type:"atom",htmlBuilder:(e,t)=>Ec.mathsym(e.text,e.mode,t,["m"+e.family]),mathmlBuilder(e,t){var n=new ru.MathNode("mo",[ou(e.text,e.mode)]);if("bin"===e.family){var r=au(e,t);"bold-italic"===r&&n.setAttribute("mathvariant",r)
402
+ }else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var Vh={mi:"italic",mn:"normal",mtext:"normal"};Dc({type:"mathord",htmlBuilder:(e,t)=>Ec.makeOrd(e,t,"mathord"),mathmlBuilder(e,t){var n=new ru.MathNode("mi",[ou(e.text,e.mode,t)]),r=au(e,t)||"italic";return r!==Vh[n.type]&&n.setAttribute("mathvariant",r),n}}),Dc({type:"textord",htmlBuilder:(e,t)=>Ec.makeOrd(e,t,"textord"),mathmlBuilder(e,t){var n,r=ou(e.text,e.mode,t),o=au(e,t)||"normal";return n="text"===e.mode?new ru.MathNode("mtext",[r]):/[0-9]/.test(e.text)?new ru.MathNode("mn",[r]):"\\prime"===e.text?new ru.MathNode("mo",[r]):new ru.MathNode("mi",[r]),o!==Vh[n.type]&&n.setAttribute("mathvariant",o),n}});var Wh={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Yh={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Dc({type:"spacing",htmlBuilder(e,t){if(Yh.hasOwnProperty(e.text)){var n=Yh[e.text].className||""
403
+ ;if("text"===e.mode){var r=Ec.makeOrd(e,t,"textord");return r.classes.push(n),r}return Ec.makeSpan(["mspace",n],[Ec.mathsym(e.text,e.mode,t)],t)}if(Wh.hasOwnProperty(e.text))return Ec.makeSpan(["mspace",Wh[e.text]],[],t);throw new qs('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){if(!Yh.hasOwnProperty(e.text)){if(Wh.hasOwnProperty(e.text))return new ru.MathNode("mspace");throw new qs('Unknown type of space "'+e.text+'"')}return new ru.MathNode("mtext",[new ru.TextNode(" ")])}});var Kh=()=>{var e=new ru.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};Dc({type:"tag",mathmlBuilder(e,t){var n=new ru.MathNode("mtable",[new ru.MathNode("mtr",[Kh(),new ru.MathNode("mtd",[lu(e.body,t)]),Kh(),new ru.MathNode("mtd",[lu(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var Xh={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Zh={"\\textbf":"textbf","\\textmd":"textmd"},Jh={"\\textit":"textit","\\textup":"textup"},Qh=(e,t)=>{var n=e.font
404
+ ;return n?Xh[n]?t.withTextFontFamily(Xh[n]):Zh[n]?t.withTextFontWeight(Zh[n]):t.withTextFontShape(Jh[n]):t};Rc({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:Fc(o),font:r}},htmlBuilder(e,t){var n=Qh(e,t),r=Gc(e.body,n,!0);return Ec.makeSpan(["mord","text"],r,n)},mathmlBuilder(e,t){var n=Qh(e,t);return lu(e.body,n)}}),Rc({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=Zc(e.body,t),r=Ec.makeLineSpan("underline-line",t),o=t.fontMetrics().defaultRuleThickness,i=Ec.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 Ec.makeSpan(["mord","underline"],[i],t)
405
+ },mathmlBuilder(e,t){var n=new ru.MathNode("mo",[new ru.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new ru.MathNode("munder",[cu(e.body,t),n]);return r.setAttribute("accentunder","true"),r}}),Rc({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=Zc(e.body,t),r=t.fontMetrics().axisHeight,o=.5*(n.height-r-(n.depth+r));return Ec.makeVList({positionType:"shift",positionData:o,children:[{type:"elem",elem:n}]},t)},mathmlBuilder:(e,t)=>new ru.MathNode("mpadded",[cu(e.body,t)],["vcenter"])}),Rc({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new qs("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=ed(e),r=[],o=t.havingStyle(t.style.text()),i=0;i<n.length;i++){var a=n[i];"~"===a&&(a="\\textasciitilde"),r.push(Ec.makeSymbol(a,"Typewriter-Regular",e.mode,o,["mord","texttt"]))}
406
+ return Ec.makeSpan(["mord","text"].concat(o.sizingClasses(t)),Ec.tryCombineChars(r),o)},mathmlBuilder(e,t){var n=new ru.TextNode(ed(e)),r=new ru.MathNode("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var ed=e=>e.body.replace(/ /g,e.star?"␣":" "),td=Oc,nd=new RegExp("[̀-ͯ]+$");class rd{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 Hs("EOF",new js(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new qs("Unexpected character: '"+e[t]+"'",new Hs(e[t],new js(this,t,t+1)));var r=n[6]||n[3]||(n[2]?"\\ ":" ")
407
+ ;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 Hs(r,new js(this,t,this.tokenRegex.lastIndex))}}class od{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 qs("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){
408
+ 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 id=ch;uh("\\noexpand",(function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}})),uh("\\expandafter",(function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}})),uh("\\@firstoftwo",(function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}})),uh("\\@secondoftwo",(function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}})),uh("\\@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}})),
409
+ uh("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),uh("\\TextOrMath",(function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}}));var ad={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};uh("\\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 qs("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(null==(r=ad[n.text])||r>=t)throw new qs("Invalid base-"+t+" digit "+n.text);for(var o;null!=(o=ad[e.future().text])&&o<t;)r*=t,r+=o,e.popToken()}return"\\@char{"+r+"}"}));var sd=(e,t,n)=>{var r=e.consumeArg().tokens;if(1!==r.length)throw new qs("\\newcommand's first argument must be a macro name");var o=r[0].text,i=e.isDefined(o)
410
+ ;if(i&&!t)throw new qs("\\newcommand{"+o+"} attempting to redefine "+o+"; use \\renewcommand");if(!i&&!n)throw new qs("\\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 qs("Invalid number of arguments: "+s);a=parseInt(s),r=e.consumeArg().tokens}return e.macros.set(o,{tokens:r,numArgs:a}),""};uh("\\newcommand",(e=>sd(e,!1,!0))),uh("\\renewcommand",(e=>sd(e,!0,!1))),uh("\\providecommand",(e=>sd(e,!0,!0))),uh("\\message",(e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map((e=>e.text)).join("")),""})),uh("\\errmessage",(e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map((e=>e.text)).join("")),""})),uh("\\show",(e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),td[n],jl.math[n],jl.text[n]),""})),uh("\\bgroup","{"),uh("\\egroup","}"),
411
+ uh("~","\\nobreakspace"),uh("\\lq","`"),uh("\\rq","'"),uh("\\aa","\\r a"),uh("\\AA","\\r A"),uh("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),uh("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),uh("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),uh("ℬ","\\mathscr{B}"),uh("ℰ","\\mathscr{E}"),uh("ℱ","\\mathscr{F}"),uh("ℋ","\\mathscr{H}"),uh("ℐ","\\mathscr{I}"),uh("ℒ","\\mathscr{L}"),uh("ℳ","\\mathscr{M}"),uh("ℛ","\\mathscr{R}"),uh("ℭ","\\mathfrak{C}"),uh("ℌ","\\mathfrak{H}"),uh("ℨ","\\mathfrak{Z}"),uh("\\Bbbk","\\Bbb{k}"),uh("·","\\cdotp"),uh("\\llap","\\mathllap{\\textrm{#1}}"),uh("\\rlap","\\mathrlap{\\textrm{#1}}"),uh("\\clap","\\mathclap{\\textrm{#1}}"),uh("\\mathstrut","\\vphantom{(}"),uh("\\underbar","\\underline{\\text{#1}}"),uh("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),uh("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),uh("\\ne","\\neq"),uh("≠","\\neq"),
412
+ uh("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),uh("∉","\\notin"),uh("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),uh("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),uh("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),uh("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),uh("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),uh("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),uh("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),uh("⟂","\\perp"),uh("‼","\\mathclose{!\\mkern-0.8mu!}"),uh("∌","\\notni"),uh("⌜","\\ulcorner"),uh("⌝","\\urcorner"),uh("⌞","\\llcorner"),uh("⌟","\\lrcorner"),uh("©","\\copyright"),uh("®","\\textregistered"),uh("️","\\textregistered"),uh("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),
413
+ uh("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),uh("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),uh("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),uh("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),uh("⋮","\\vdots"),uh("\\varGamma","\\mathit{\\Gamma}"),uh("\\varDelta","\\mathit{\\Delta}"),uh("\\varTheta","\\mathit{\\Theta}"),uh("\\varLambda","\\mathit{\\Lambda}"),uh("\\varXi","\\mathit{\\Xi}"),uh("\\varPi","\\mathit{\\Pi}"),uh("\\varSigma","\\mathit{\\Sigma}"),uh("\\varUpsilon","\\mathit{\\Upsilon}"),uh("\\varPhi","\\mathit{\\Phi}"),uh("\\varPsi","\\mathit{\\Psi}"),uh("\\varOmega","\\mathit{\\Omega}"),uh("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),uh("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),uh("\\boxed","\\fbox{$\\displaystyle{#1}$}"),uh("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),uh("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),
414
+ uh("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var ld={",":"\\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",
415
+ "\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};uh("\\dots",(function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in ld?t=ld[n]:("\\not"===n.substr(0,4)||n in jl.math&&Ws.contains(["bin","rel"],jl.math[n].group))&&(t="\\dotsb"),t}));var cd={")":!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};uh("\\dotso",(function(e){return e.future().text in cd?"\\ldots\\,":"\\ldots"})),uh("\\dotsc",(function(e){var t=e.future().text;return t in cd&&","!==t?"\\ldots\\,":"\\ldots"})),uh("\\cdots",(function(e){return e.future().text in cd?"\\@cdots\\,":"\\@cdots"})),uh("\\dotsb","\\cdots"),uh("\\dotsm","\\cdots"),uh("\\dotsi","\\!\\cdots"),uh("\\dotsx","\\ldots\\,"),uh("\\DOTSI","\\relax"),uh("\\DOTSB","\\relax"),uh("\\DOTSX","\\relax"),uh("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),uh("\\,","\\tmspace+{3mu}{.1667em}"),uh("\\thinspace","\\,"),
416
+ uh("\\>","\\mskip{4mu}"),uh("\\:","\\tmspace+{4mu}{.2222em}"),uh("\\medspace","\\:"),uh("\\;","\\tmspace+{5mu}{.2777em}"),uh("\\thickspace","\\;"),uh("\\!","\\tmspace-{3mu}{.1667em}"),uh("\\negthinspace","\\!"),uh("\\negmedspace","\\tmspace-{4mu}{.2222em}"),uh("\\negthickspace","\\tmspace-{5mu}{.277em}"),uh("\\enspace","\\kern.5em "),uh("\\enskip","\\hskip.5em\\relax"),uh("\\quad","\\hskip1em\\relax"),uh("\\qquad","\\hskip2em\\relax"),uh("\\tag","\\@ifstar\\tag@literal\\tag@paren"),uh("\\tag@paren","\\tag@literal{({#1})}"),uh("\\tag@literal",(e=>{if(e.macros.get("\\df@tag"))throw new qs("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"})),uh("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),uh("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),uh("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),
417
+ uh("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),uh("\\pmb","\\html@mathml{\\@binrel{#1}{\\mathrlap{#1}\\kern0.5px#1}}{\\mathbf{#1}}"),uh("\\newline","\\\\\\relax"),uh("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var ud=Sl(hl["Main-Regular"]["T".charCodeAt(0)][1]-.7*hl["Main-Regular"]["A".charCodeAt(0)][1]);uh("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+ud+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),uh("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+ud+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),uh("\\hspace","\\@ifstar\\@hspacer\\@hspace"),uh("\\@hspace","\\hskip #1\\relax"),uh("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),uh("\\ordinarycolon",":"),uh("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),uh("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),
418
+ uh("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),uh("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),uh("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),uh("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),uh("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),uh("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),uh("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),uh("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),
419
+ uh("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),uh("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),uh("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),uh("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),uh("∷","\\dblcolon"),uh("∹","\\eqcolon"),uh("≔","\\coloneqq"),uh("≕","\\eqqcolon"),uh("⩴","\\Coloneqq"),uh("\\ratio","\\vcentcolon"),uh("\\coloncolon","\\dblcolon"),uh("\\colonequals","\\coloneqq"),uh("\\coloncolonequals","\\Coloneqq"),uh("\\equalscolon","\\eqqcolon"),uh("\\equalscoloncolon","\\Eqqcolon"),uh("\\colonminus","\\coloneq"),uh("\\coloncolonminus","\\Coloneq"),uh("\\minuscolon","\\eqcolon"),uh("\\minuscoloncolon","\\Eqcolon"),uh("\\coloncolonapprox","\\Colonapprox"),uh("\\coloncolonsim","\\Colonsim"),
420
+ uh("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),uh("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),uh("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),uh("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),uh("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),uh("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),uh("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),uh("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),uh("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),uh("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),uh("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),uh("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),uh("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),uh("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),uh("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),uh("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),
421
+ uh("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),uh("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),uh("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),uh("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),uh("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),uh("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),uh("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),uh("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),uh("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),uh("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),uh("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),uh("\\imath","\\html@mathml{\\@imath}{ı}"),uh("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),uh("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),uh("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),uh("⟦","\\llbracket"),uh("⟧","\\rrbracket"),uh("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),
422
+ uh("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),uh("⦃","\\lBrace"),uh("⦄","\\rBrace"),uh("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),uh("⦵","\\minuso"),uh("\\darr","\\downarrow"),uh("\\dArr","\\Downarrow"),uh("\\Darr","\\Downarrow"),uh("\\lang","\\langle"),uh("\\rang","\\rangle"),uh("\\uarr","\\uparrow"),uh("\\uArr","\\Uparrow"),uh("\\Uarr","\\Uparrow"),uh("\\N","\\mathbb{N}"),uh("\\R","\\mathbb{R}"),uh("\\Z","\\mathbb{Z}"),uh("\\alef","\\aleph"),uh("\\alefsym","\\aleph"),uh("\\Alpha","\\mathrm{A}"),uh("\\Beta","\\mathrm{B}"),uh("\\bull","\\bullet"),uh("\\Chi","\\mathrm{X}"),uh("\\clubs","\\clubsuit"),uh("\\cnums","\\mathbb{C}"),uh("\\Complex","\\mathbb{C}"),uh("\\Dagger","\\ddagger"),uh("\\diamonds","\\diamondsuit"),uh("\\empty","\\emptyset"),uh("\\Epsilon","\\mathrm{E}"),uh("\\Eta","\\mathrm{H}"),uh("\\exist","\\exists"),uh("\\harr","\\leftrightarrow"),
423
+ uh("\\hArr","\\Leftrightarrow"),uh("\\Harr","\\Leftrightarrow"),uh("\\hearts","\\heartsuit"),uh("\\image","\\Im"),uh("\\infin","\\infty"),uh("\\Iota","\\mathrm{I}"),uh("\\isin","\\in"),uh("\\Kappa","\\mathrm{K}"),uh("\\larr","\\leftarrow"),uh("\\lArr","\\Leftarrow"),uh("\\Larr","\\Leftarrow"),uh("\\lrarr","\\leftrightarrow"),uh("\\lrArr","\\Leftrightarrow"),uh("\\Lrarr","\\Leftrightarrow"),uh("\\Mu","\\mathrm{M}"),uh("\\natnums","\\mathbb{N}"),uh("\\Nu","\\mathrm{N}"),uh("\\Omicron","\\mathrm{O}"),uh("\\plusmn","\\pm"),uh("\\rarr","\\rightarrow"),uh("\\rArr","\\Rightarrow"),uh("\\Rarr","\\Rightarrow"),uh("\\real","\\Re"),uh("\\reals","\\mathbb{R}"),uh("\\Reals","\\mathbb{R}"),uh("\\Rho","\\mathrm{P}"),uh("\\sdot","\\cdot"),uh("\\sect","\\S"),uh("\\spades","\\spadesuit"),uh("\\sub","\\subset"),uh("\\sube","\\subseteq"),uh("\\supe","\\supseteq"),uh("\\Tau","\\mathrm{T}"),uh("\\thetasym","\\vartheta"),uh("\\weierp","\\wp"),uh("\\Zeta","\\mathrm{Z}"),uh("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),
424
+ uh("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),uh("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),uh("\\bra","\\mathinner{\\langle{#1}|}"),uh("\\ket","\\mathinner{|{#1}\\rangle}"),uh("\\braket","\\mathinner{\\langle{#1}\\rangle}"),uh("\\Bra","\\left\\langle#1\\right|"),uh("\\Ket","\\left|#1\\right\\rangle"),uh("\\angln","{\\angl n}"),uh("\\blue","\\textcolor{##6495ed}{#1}"),uh("\\orange","\\textcolor{##ffa500}{#1}"),uh("\\pink","\\textcolor{##ff00af}{#1}"),uh("\\red","\\textcolor{##df0030}{#1}"),uh("\\green","\\textcolor{##28ae7b}{#1}"),uh("\\gray","\\textcolor{gray}{#1}"),uh("\\purple","\\textcolor{##9d38bd}{#1}"),uh("\\blueA","\\textcolor{##ccfaff}{#1}"),uh("\\blueB","\\textcolor{##80f6ff}{#1}"),uh("\\blueC","\\textcolor{##63d9ea}{#1}"),uh("\\blueD","\\textcolor{##11accd}{#1}"),uh("\\blueE","\\textcolor{##0c7f99}{#1}"),uh("\\tealA","\\textcolor{##94fff5}{#1}"),uh("\\tealB","\\textcolor{##26edd5}{#1}"),uh("\\tealC","\\textcolor{##01d1c1}{#1}"),uh("\\tealD","\\textcolor{##01a995}{#1}"),
425
+ uh("\\tealE","\\textcolor{##208170}{#1}"),uh("\\greenA","\\textcolor{##b6ffb0}{#1}"),uh("\\greenB","\\textcolor{##8af281}{#1}"),uh("\\greenC","\\textcolor{##74cf70}{#1}"),uh("\\greenD","\\textcolor{##1fab54}{#1}"),uh("\\greenE","\\textcolor{##0d923f}{#1}"),uh("\\goldA","\\textcolor{##ffd0a9}{#1}"),uh("\\goldB","\\textcolor{##ffbb71}{#1}"),uh("\\goldC","\\textcolor{##ff9c39}{#1}"),uh("\\goldD","\\textcolor{##e07d10}{#1}"),uh("\\goldE","\\textcolor{##a75a05}{#1}"),uh("\\redA","\\textcolor{##fca9a9}{#1}"),uh("\\redB","\\textcolor{##ff8482}{#1}"),uh("\\redC","\\textcolor{##f9685d}{#1}"),uh("\\redD","\\textcolor{##e84d39}{#1}"),uh("\\redE","\\textcolor{##bc2612}{#1}"),uh("\\maroonA","\\textcolor{##ffbde0}{#1}"),uh("\\maroonB","\\textcolor{##ff92c6}{#1}"),uh("\\maroonC","\\textcolor{##ed5fa6}{#1}"),uh("\\maroonD","\\textcolor{##ca337c}{#1}"),uh("\\maroonE","\\textcolor{##9e034e}{#1}"),uh("\\purpleA","\\textcolor{##ddd7ff}{#1}"),uh("\\purpleB","\\textcolor{##c6b9fc}{#1}"),uh("\\purpleC","\\textcolor{##aa87ff}{#1}"),
426
+ uh("\\purpleD","\\textcolor{##7854ab}{#1}"),uh("\\purpleE","\\textcolor{##543b78}{#1}"),uh("\\mintA","\\textcolor{##f5f9e8}{#1}"),uh("\\mintB","\\textcolor{##edf2df}{#1}"),uh("\\mintC","\\textcolor{##e0e5cc}{#1}"),uh("\\grayA","\\textcolor{##f6f7f7}{#1}"),uh("\\grayB","\\textcolor{##f0f1f2}{#1}"),uh("\\grayC","\\textcolor{##e3e5e6}{#1}"),uh("\\grayD","\\textcolor{##d6d8da}{#1}"),uh("\\grayE","\\textcolor{##babec2}{#1}"),uh("\\grayF","\\textcolor{##888d93}{#1}"),uh("\\grayG","\\textcolor{##626569}{#1}"),uh("\\grayH","\\textcolor{##3b3e40}{#1}"),uh("\\grayI","\\textcolor{##21242c}{#1}"),uh("\\kaBlue","\\textcolor{##314453}{#1}"),uh("\\kaGreen","\\textcolor{##71B307}{#1}");var hd={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class dd{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 od(id,t.macros),this.mode=n,this.stack=[]}feed(e){
427
+ this.lexer=new rd(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:r,end:n}=this.consumeArg(["]"]))}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new Hs("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 qs("Extra }",r)
428
+ }else if("EOF"===r.text)throw new qs("Unexpected end of input in a macro argument, expected '"+(e&&n?e[a]:"}")+"'",r);if(e&&n)if((0===i||1===i&&"{"===e[a])&&r.text===e[a]){if(++a===e.length){t.splice(-a,a);break}}else a=0}while(0!==i||n);return"{"===o.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:o,end:r}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new qs("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 qs("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 qs("Undefined control sequence: "+n);return this.pushToken(t),t}if(this.expansionCount++,
429
+ this.expansionCount>this.settings.maxExpand)throw new qs("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){if(0===a)throw new qs("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 qs("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 Hs)return e.treatAsRelax&&(e.text="\\relax"),this.stack.pop()}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Hs(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 Hs&&(r.treatAsRelax&&(r.noexpand=!1,r.treatAsRelax=!1),t.push(this.stack.pop()))}
430
+ 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;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 rd(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)||td.hasOwnProperty(e)||jl.math.hasOwnProperty(e)||jl.text.hasOwnProperty(e)||hd.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:td.hasOwnProperty(e)&&!td[e].primitive}}var pd={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",
431
+ math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},md={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","ḉ":"ḉ","č":"č","ĉ":"ĉ","ċ":"ċ","ç":"ç","ď":"ď","ḋ":"ḋ","ḑ":"ḑ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ḝ":"ḝ","ě":"ě","ê":"ê","ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ȩ":"ȩ","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ģ":"ģ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","ḩ":"ḩ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ķ":"ķ","ĺ":"ĺ","ľ":"ľ","ļ":"ļ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ņ":"ņ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ",
431
432
  "ŏ":"ŏ","ǒ":"ǒ","ô":"ô","ố":"ố","ồ":"ồ","ỗ":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","ṕ":"ṕ","ṗ":"ṗ","ŕ":"ŕ","ř":"ř","ṙ":"ṙ","ŗ":"ŗ","ś":"ś","ṥ":"ṥ","š":"š","ṧ":"ṧ","ŝ":"ŝ","ṡ":"ṡ","ş":"ş","ẗ":"ẗ","ť":"ť","ṫ":"ṫ","ţ":"ţ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","ṹ":"ṹ","ū":"ū","ṻ":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","ṽ":"ṽ","ẃ":"ẃ","ẁ":"ẁ","ẅ":"ẅ","ŵ":"ŵ","ẇ":"ẇ","ẘ":"ẘ","ẍ":"ẍ","ẋ":"ẋ","ý":"ý","ỳ":"ỳ","ÿ":"ÿ","ỹ":"ỹ","ȳ":"ȳ","ŷ":"ŷ","ẏ":"ẏ","ẙ":"ẙ","ź":"ź","ž":"ž","ẑ":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","Ắ":"Ắ","Ằ":"Ằ","Ẵ":"Ẵ","Ǎ":"Ǎ","Â":"Â","Ấ":"Ấ","Ầ":"Ầ","Ẫ":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","Ḃ":"Ḃ","Ć":"Ć","Ḉ":"Ḉ","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ç":"Ç","Ď":"Ď","Ḋ":"Ḋ","Ḑ":"Ḑ","É":"É","È":"È","Ë":"Ë","Ẽ":"Ẽ","Ē":"Ē","Ḗ":"Ḗ","Ḕ":"Ḕ","Ĕ":"Ĕ","Ḝ":"Ḝ","Ě":"Ě","Ê":"Ê","Ế":"Ế","Ề":"Ề","Ễ":"Ễ","Ė":"Ė","Ȩ":"Ȩ","Ḟ":"Ḟ","Ǵ":"Ǵ",
432
433
  "Ḡ":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","Ģ":"Ģ","Ḧ":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","Ḣ":"Ḣ","Ḩ":"Ḩ","Í":"Í","Ì":"Ì","Ï":"Ï","Ḯ":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","Ḱ":"Ḱ","Ǩ":"Ǩ","Ķ":"Ķ","Ĺ":"Ĺ","Ľ":"Ľ","Ļ":"Ļ","Ḿ":"Ḿ","Ṁ":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","Ṅ":"Ṅ","Ņ":"Ņ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","Ṍ":"Ṍ","Ṏ":"Ṏ","Ȭ":"Ȭ","Ō":"Ō","Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ","Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ŗ":"Ŗ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ş":"Ş","Ť":"Ť","Ṫ":"Ṫ","Ţ":"Ţ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ",
433
- "έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"};class pd{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new ud(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 js("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"),
434
- this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Fs("}")),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!==pd.endOfExpression.indexOf(r.text))break;if(t&&r.text===t)break;if(e&&Qh[r.text]&&Qh[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 js("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},
435
- ["\\\\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 js("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};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 js("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 js("Double superscript",o);t=this.handleSupSubscript("superscript")
436
- }else if("_"===o.text){if(n)throw new js("Double subscript",o);n=this.handleSupSubscript("subscript")}else{if("'"!==o.text)break;if(t)throw new js("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}}}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=Qh[r];if(!o)return null;if(this.consume(),t&&"atom"!==t&&!o.allowedInArgument)throw new js("Got function '"+r+"' with no arguments"+(t?" as "+t:""),n);if("text"===this.mode&&!o.allowedInText)throw new js("Can't use function '"+r+"' in text mode",n);if("math"===this.mode&&!1===o.allowedInMath)throw new js("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,
437
- breakOnTokenText:o},a=Qh[e];if(a&&a.handler)return a.handler(i,t,n);throw new js("No function handler for "+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(0===n)return{args:[],optArgs:[]};for(var r=[],o=[],i=0;i<n;i++){var a=t.argTypes&&t.argTypes[i],s=i<t.numOptionalArgs;(t.primitive&&null==a||"sqrt"===t.type&&1===i&&null==o[0])&&(a="primitive");var l=this.parseGroupOfType("argument to '"+e+"'",a,s);if(s)o.push(l);else{if(null==l)throw new js("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":
438
- if(n)throw new js("A primitive argument cannot be optional");var i=this.parseGroup(e);if(null==i)throw new js("Expected group as "+e,this.fetch());return i;case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new js("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 js("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 js("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,
439
- color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),!(t=e||"{"===this.gullet.future().text?this.parseStringGroup("size",e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;e||0!==t.text.length||(t.text="0pt",n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new js("Invalid size: '"+t.text+"'",t);var o={number:+(r[1]+r[2]),unit:r[3]};if(!bl(o))throw new js("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()
440
- ;var o=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var i={type:"ordgroup",mode:this.mode,loc:n.loc,body:o};return t&&this.switchMode(r),i}parseGroup(e,t){var n,r=this.fetch(),o=r.text;if("{"===o||"\\begingroup"===o){this.consume();var i="{"===o?"}":"\\endgroup";this.gullet.beginGroup();var a=this.parseExpression(!1,i),s=this.fetch();this.expect(i),this.gullet.endGroup(),n={type:"ordgroup",mode:this.mode,loc:Bs.range(r,s),body:a,semisimple:"\\begingroup"===o||void 0}}else if(null==(n=this.parseFunction(t,e)||this.parseSymbol())&&"\\"===o[0]&&!cd.hasOwnProperty(o)){if(this.settings.throwOnError)throw new js("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:Bs.range(r,e[n+2]),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:Bs.range(r,e[n+1]),text:"--"}),
441
- t-=1)),"'"!==o&&"`"!==o||e[n+1].text!==o||(e.splice(n,2,{type:"textord",mode:"text",loc:Bs.range(r,e[n+1]),text:o+o}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r="*"===n.charAt(0);if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new js("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:n=n.slice(1,-1),star:r}}dd.hasOwnProperty(t[0])&&!Bl[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=dd[t[0]]+t.substr(1));var o,i=ed.exec(t);if(i&&("i"===(t=t.substring(0,i.index))?t="ı":"j"===t&&(t="ȷ")),Bl[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)
442
- ;var a,s=Bl[this.mode][t].group,l=Bs.range(e);if(Pl.hasOwnProperty(s)){var c=s;a={type:"atom",mode:this.mode,family:c,loc:l,text:t}}else a={type:s,mode:this.mode,loc:l,text:t};o=a}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(al(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:Bs.range(e),text:t}}if(this.consume(),i)for(var u=0;u<i[0].length;u++){var h=i[0][u];if(!hd[h])throw new js("Unknown accent ' "+h+"'",e);var d=hd[h][this.mode]||hd[h].text;if(!d)throw new js("Accent "+h+" unsupported in "+this.mode+" mode",e);o={type:"accent",mode:this.mode,loc:Bs.range(e),label:d,isStretchy:!1,isShifty:!0,base:o}}return o}}pd.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var md=function(e,t){
443
- if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new pd(e,t);delete n.gullet.macros.current["\\df@tag"];var r=n.parse();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 js("\\tag works only in display equations");r=[{type:"tag",mode:"text",body:r,tag:n.subparse([new Fs("\\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 fd=function(e,t,n){if(n.throwOnError||!(e instanceof js))throw e;var r=Cc.makeSpan(["katex-error"],[new Ml(t)]);return r.setAttribute("title",e.toString()),r.setAttribute("style","color:"+n.errorColor),r},gd=function(e,t){var n=new Ys(t);try{return function(e,t,n){var r,o=cu(n);if("mathml"===n.output)return lu(e,t,o,n.displayMode,!0)
444
- ;if("html"===n.output){var i=Zc(e,o);r=Cc.makeSpan(["katex"],[i])}else{var a=lu(e,t,o,n.displayMode,!1),s=Zc(e,o);r=Cc.makeSpan(["katex"],[a,s])}return uu(r,n)}(md(e,n),e,n)}catch(t){return fd(t,e,n)}},vd=function(e,t){return gd(e,t).toMarkup()},yd={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,
434
+ "έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"};class fd{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new dd(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 qs("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"),
435
+ this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Hs("}")),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!==fd.endOfExpression.indexOf(r.text))break;if(t&&r.text===t)break;if(e&&td[r.text]&&td[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 qs("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},
436
+ ["\\\\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 qs("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};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 qs("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 qs("Double superscript",o);t=this.handleSupSubscript("superscript")
437
+ }else if("_"===o.text){if(n)throw new qs("Double subscript",o);n=this.handleSupSubscript("subscript")}else{if("'"!==o.text)break;if(t)throw new qs("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}}}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=td[r];if(!o)return null;if(this.consume(),t&&"atom"!==t&&!o.allowedInArgument)throw new qs("Got function '"+r+"' with no arguments"+(t?" as "+t:""),n);if("text"===this.mode&&!o.allowedInText)throw new qs("Can't use function '"+r+"' in text mode",n);if("math"===this.mode&&!1===o.allowedInMath)throw new qs("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,
438
+ breakOnTokenText:o},a=td[e];if(a&&a.handler)return a.handler(i,t,n);throw new qs("No function handler for "+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(0===n)return{args:[],optArgs:[]};for(var r=[],o=[],i=0;i<n;i++){var a=t.argTypes&&t.argTypes[i],s=i<t.numOptionalArgs;(t.primitive&&null==a||"sqrt"===t.type&&1===i&&null==o[0])&&(a="primitive");var l=this.parseGroupOfType("argument to '"+e+"'",a,s);if(s)o.push(l);else{if(null==l)throw new qs("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":
439
+ if(n)throw new qs("A primitive argument cannot be optional");var i=this.parseGroup(e);if(null==i)throw new qs("Expected group as "+e,this.fetch());return i;case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new qs("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 qs("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 qs("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,
440
+ color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),!(t=e||"{"===this.gullet.future().text?this.parseStringGroup("size",e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;e||0!==t.text.length||(t.text="0pt",n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new qs("Invalid size: '"+t.text+"'",t);var o={number:+(r[1]+r[2]),unit:r[3]};if(!xl(o))throw new qs("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()
441
+ ;var o=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var i={type:"ordgroup",mode:this.mode,loc:n.loc,body:o};return t&&this.switchMode(r),i}parseGroup(e,t){var n,r=this.fetch(),o=r.text;if("{"===o||"\\begingroup"===o){this.consume();var i="{"===o?"}":"\\endgroup";this.gullet.beginGroup();var a=this.parseExpression(!1,i),s=this.fetch();this.expect(i),this.gullet.endGroup(),n={type:"ordgroup",mode:this.mode,loc:js.range(r,s),body:a,semisimple:"\\begingroup"===o||void 0}}else if(null==(n=this.parseFunction(t,e)||this.parseSymbol())&&"\\"===o[0]&&!hd.hasOwnProperty(o)){if(this.settings.throwOnError)throw new qs("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:js.range(r,e[n+2]),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:js.range(r,e[n+1]),text:"--"}),
442
+ t-=1)),"'"!==o&&"`"!==o||e[n+1].text!==o||(e.splice(n,2,{type:"textord",mode:"text",loc:js.range(r,e[n+1]),text:o+o}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r="*"===n.charAt(0);if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new qs("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:n=n.slice(1,-1),star:r}}md.hasOwnProperty(t[0])&&!jl[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=md[t[0]]+t.substr(1));var o,i=nd.exec(t);if(i&&("i"===(t=t.substring(0,i.index))?t="ı":"j"===t&&(t="ȷ")),jl[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)
443
+ ;var a,s=jl[this.mode][t].group,l=js.range(e);if(Bl.hasOwnProperty(s)){var c=s;a={type:"atom",mode:this.mode,family:c,loc:l,text:t}}else a={type:s,mode:this.mode,loc:l,text:t};o=a}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(ll(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:js.range(e),text:t}}if(this.consume(),i)for(var u=0;u<i[0].length;u++){var h=i[0][u];if(!pd[h])throw new qs("Unknown accent ' "+h+"'",e);var d=pd[h][this.mode]||pd[h].text;if(!d)throw new qs("Accent "+h+" unsupported in "+this.mode+" mode",e);o={type:"accent",mode:this.mode,loc:js.range(e),label:d,isStretchy:!1,isShifty:!0,base:o}}return o}}fd.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var gd=function(e,t){
444
+ if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new fd(e,t);delete n.gullet.macros.current["\\df@tag"];var r=n.parse();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 qs("\\tag works only in display equations");r=[{type:"tag",mode:"text",body:r,tag:n.subparse([new Hs("\\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 vd=function(e,t,n){if(n.throwOnError||!(e instanceof qs))throw e;var r=Ec.makeSpan(["katex-error"],[new Ol(t)]);return r.setAttribute("title",e.toString()),r.setAttribute("style","color:"+n.errorColor),r},yd=function(e,t){var n=new Xs(t);try{return function(e,t,n){var r,o=hu(n);if("mathml"===n.output)return uu(e,t,o,n.displayMode,!0)
445
+ ;if("html"===n.output){var i=Qc(e,o);r=Ec.makeSpan(["katex"],[i])}else{var a=uu(e,t,o,n.displayMode,!1),s=Qc(e,o);r=Ec.makeSpan(["katex"],[a,s])}return du(r,n)}(gd(e,n),e,n)}catch(t){return vd(t,e,n)}},_d=function(e,t){return yd(e,t).toMarkup()},bd={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,
445
446
  describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:"Remove only spaces, ' and \" from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids",type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{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",
446
447
  type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},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,
447
448
  describe:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,describe:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",describe:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,describe:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,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,
@@ -513,144 +514,145 @@ var o=new Array(r+1).join("#"),i="";if(e.hasChildNodes()){i=o+" ";for(var a=e.ch
513
514
  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":
514
515
  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){
515
516
  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=""
516
- ;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(W)}(yd);var _d=yd.exports;const bd=Rs(window);function wd(){return[{type:"output",filter:function(e){return e.replace(/<a href=/g,'<a target="_blank" href=')}}]}let xd;function kd(e){return"{math:"+e.toString()+"}"}function Sd(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
517
- ;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=kd(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=bd.sanitize(function(e){return xd||(xd=new _d.Converter({extensions:[wd],simplifiedAutoLink:!0,literalMidWordUnderscores:!0,strikethrough:!0})),xd.makeHtml(e)}(t.content)),r=function(e,t){return t.reduce(((e,t)=>{let n;try{n=t.inline?vd(t.expression):vd(t.expression,{displayMode:!0})}catch(e){n=Ds(t.expression)}return e.replace(kd(t.id),n)}),e)}(n,t.mathBlocks);return r}function Cd({markdown:e="",textClass:t={},textStyle:n={}}){const r=ao((()=>e?Sd(e):""),[e]),o=io();ro((()=>{!function(e,{className:t}={}){const n=Array.from(e.getElementsByTagName("a"));for(let e of n){const n=Fa(e);n&&(t?n.className=t:n.style.width="350px")}}(o.current,{className:"w-full md:w-[380px]"})}),[e]);return vo("div",{
518
- className:"w-full break-words cursor-text",dir:"auto",lang:"",children:vo("div",{className:Vr("styled-text",t),"data-testid":"styled-text",ref:o,dangerouslySetInnerHTML:{__html:r},style:n})})}function Ad({annotation:e,tags:t}){const n=ci(),r=n.defaultAuthority(),o=ao((()=>!ri(e.user,r)),[e,r]),i=e=>n.getLink("search.tag",{tag:e});return vo("ul",{className:"TagList","aria-label":"Annotation tags",children:t.map((e=>vo("li",{className:"TagList__item",children:[o&&vo("a",{className:"TagList__link",href:i(e),lang:"",target:"_blank",rel:"noopener noreferrer","aria-label":`Tag: ${e}`,title:`View annotations with tag: ${e}`,children:e}),!o&&vo("span",{className:"TagList__text","aria-label":`Tag: ${e}`,lang:"",children:e})]},e)))})}bd.addHook("afterSanitizeAttributes",(e=>{"target"in e&&e.setAttribute("target","_blank")}));var Ed=si((function({annotation:e,settings:t}){var n,r
519
- ;const[o,i]=to(!0),[a,s]=to(!1),l=ci().getDraft(e),c=o?"More":"Less",u=null!==(n=null==l?void 0:l.tags)&&void 0!==n?n:e.tags,h=null!==(r=null==l?void 0:l.text)&&void 0!==r?r:e.text,d=h.length>0,p=u.length>0,m=ii(["annotationFontFamily"],t);return vo("div",{className:"hyp-u-vertical-spacing--2",children:[d&&vo(Oa,{collapse:o,collapsedHeight:400,inlineControls:!1,onCollapsibleChanged:s,onToggleCollapsed:i,overflowThreshold:20,children:vo(Cd,{textStyle:m,markdown:h,textClass:{AnnotationBody__text:!0,"p-redacted-content":Oi(e)}})}),a&&vo("div",{className:"hyp-u-layout-row--justify-right",children:vo(So,{expanded:!o,onClick:()=>i(!o),title:`Toggle visibility of full annotation text: Show ${c}`,children:c})}),p&&vo(Ad,{annotation:e,tags:u})]})}),["settings"]);const Td=0,Nd=1;function Ld(e,t,n,r){let o=e.selectionStart,i=e.selectionEnd;return o>=t+n?(o+=r.length-n,i+=r.length-n):i<=t||(o<=t&&i>=t+n?i+=r.length-n:o<t&&i<t+n?o=t:o<t+n&&i>t+n?i+=r.length-n:t<o&&t+n>i&&(o=t,i=t+n)),{
520
- text:e.text.slice(0,t)+r+e.text.slice(t+n),selectionStart:o,selectionEnd:i}}function Md(e,t=Td){const n=e.text.slice(e.selectionStart,e.selectionEnd);let r,o="";if(t===Nd&&(o="!"),n.match(/[a-z]+:\/\/.*/)){const t="Description";return r=Ld(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=Ld(e,e.selectionStart,n.length,t+i+")"),r.selectionStart=e.selectionStart+t.length,r.selectionEnd=r.selectionStart+i.length,r}}function zd(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=Ld(e,e.selectionStart,0,r),a.selectionStart=a.selectionEnd-r.length),o===t&&i===n?(a=Ld(a,a.selectionStart-t.length,t.length,""),a=Ld(a,a.selectionEnd,n.length,"")):(a=Ld(a,a.selectionStart,0,t),a=Ld(a,a.selectionEnd,0,n)),a}
521
- function Od(e,t){const n=e.indexOf("\n",t);return n<0?e.length:n}function Id(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=Od(e.text,t);for(;i<=Od(e.text,n);){const t=i===e.text.length,a=i-o,s=Od((e=r(e,o,i)).text,o)-o;if(n+=s-a,t)break;o=o+s+1,i=Od(e.text,o)}return e}function Rd(e,t){const n=e.selectionStart,r=e.selectionEnd;let o=!0;return Id(e,n,r,((e,n)=>(e.text.slice(n,n+t.length)!==t&&(o=!1),e))),Id(e,n,r,o?(e,n)=>Ld(e,n,t.length,""):(e,n)=>e.text.slice(n,n+t.length)===t?e:Ld(e,n,0,t))}const Pd={bold:"b",italic:"i",link:"l",quote:"q",image:"g",numlist:"o",list:"u"};function Dd({buttonRef:e,disabled:t=!1,iconName:n="",label:r,onClick:o,shortcutKey:i,tabIndex:a,title:s=""}){const l=ao((()=>((e=window.navigator.userAgent)=>e.indexOf("Mac OS")>=0)()?"Cmd":"Ctrl"),[]);let c=s;i&&(c+=` (${l}-${i.toUpperCase()})`);const u={buttonRef:e,disabled:t,icon:n,onClick:o,tabIndex:a,title:c};return r?vo(So,{classes:"font-normal TransparentButton",...u,children:r}):vo(ko,{
522
- classes:"MarkdownEditor__toolbar-button",...u})}function Bd({isPreviewing:e,onCommand:t,onTogglePreview:n}){const r=0,o=1,i=2,a=3,s=4,l=5,c=6,u=7,h=8,d=9,p=10,[m,f]=to(0),g=io([]).current;if(0===g.length)for(let e=0;e<=p;e++)g.push({current:null});const v=e=>m===e?0:-1;return vo("div",{className:"hyp-u-layout-row hyp-u-border--left hyp-u-border--right hyp-u-border--top hyp-u-bg-color--white MarkdownEditor__toolbar",role:"toolbar","aria-label":"Markdown editor toolbar",onKeyDown:t=>{let n=0;const r=p-1;e&&(n=h);let o=null;switch(Do(t.key)){case"ArrowLeft":o=m<=n?r:m-1;break;case"ArrowRight":o=m>=r?n:m+1;break;case"Home":o=n;break;case"End":o=r}var i;null!==o&&(f(i=o),g[i].current.focus(),t.preventDefault())},children:[vo(Dd,{disabled:e,iconName:"format-bold",onClick:()=>t("bold"),shortcutKey:Pd.bold,buttonRef:g[r],tabIndex:v(r),title:"Bold"}),vo(Dd,{disabled:e,iconName:"format-italic",onClick:()=>t("italic"),shortcutKey:Pd.italic,buttonRef:g[o],tabIndex:v(o),title:"Italic"}),vo(Dd,{disabled:e,
523
- iconName:"format-quote",onClick:()=>t("quote"),shortcutKey:Pd.quote,buttonRef:g[i],tabIndex:v(i),title:"Quote"}),vo(Dd,{disabled:e,iconName:"link",onClick:()=>t("link"),shortcutKey:Pd.link,buttonRef:g[a],tabIndex:v(a),title:"Insert link"}),vo(Dd,{disabled:e,iconName:"image",onClick:()=>t("image"),shortcutKey:Pd.image,buttonRef:g[s],tabIndex:v(s),title:"Insert image"}),vo(Dd,{disabled:e,iconName:"format-functions",onClick:()=>t("math"),buttonRef:g[l],tabIndex:v(l),title:"Insert math (LaTeX is supported)"}),vo(Dd,{disabled:e,iconName:"format-list-numbered",onClick:()=>t("numlist"),shortcutKey:Pd.numlist,buttonRef:g[c],tabIndex:v(c),title:"Numbered list"}),vo(Dd,{disabled:e,iconName:"format-list-unordered",onClick:()=>t("list"),shortcutKey:Pd.list,buttonRef:g[u],tabIndex:v(u),title:"Bulleted list"}),vo("span",{className:"hyp-u-stretch"}),vo("div",{className:"hyp-u-layout-row--center",children:vo(Po,{href:"https://web.hypothes.is/help/formatting-annotations-with-markdown/",target:"_blank",
524
- classes:"text-tiny IconOnlyLink",linkRef:g[h],tabIndex:v(h),title:"Formatting help","aria-label":"Formatting help",children:vo(Ro,{name:"help"})})}),vo(Dd,{label:e?"Write":"Preview",onClick:n,buttonRef:g[d],tabIndex:v(d)})]})}function Fd({label:e="",onEditText:t=(()=>{}),text:n="",textStyle:r={}}){const[o,i]=to(!1),a=io(null);ro((()=>{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)?zd(e,"$$","$$","Insert LaTeX"):zd(e,"\\(","\\)","Insert LaTeX")};switch(e){case"bold":n((e=>zd(e,"**","**","Bold")));break;case"italic":n((e=>zd(e,"*","*","Italic")));break;case"quote":n((e=>Rd(e,"> ")));break;case"link":n((e=>Md(e)));break;case"image":n((e=>Md(e,Nd)));break;case"math":n(r)
525
- ;break;case"numlist":n((e=>Rd(e,"1. ")));break;case"list":n((e=>Rd(e,"* ")));break;default:throw new Error(`Unknown toolbar command "${e}"`)}}(e,a.current),t({text:a.current.value}))};return vo("div",{className:"leading-none",children:[vo(Bd,{onCommand:s,isPreviewing:o,onTogglePreview:()=>i(!o)}),o?vo(Cd,{markdown:n,textClass:{"hyp-u-border":!0,"hyp-u-bg-color--grey-1":!0,"hyp-u-padding":!0},textStyle:r}):vo("textarea",{"aria-label":e,className:"MarkdownEditor__input",dir:"auto",ref:a,onClick:e=>e.stopPropagation(),onKeyDown:e=>{if(e.ctrlKey||e.metaKey)for(let[t,n]of Object.entries(Pd))n===Do(e.key)&&(e.stopPropagation(),e.preventDefault(),s(t))},onInput:e=>{t({text:e.target.value})},value:n,style:r})]})}const jd=e=>e;function Hd({activeItem:e=-1,id:t,itemPrefixId:n,list:r,listFormatter:o=jd,onSelectItem:i,open:a=!1}){const s=ao((()=>r.map(((t,r)=>{const a=n?{id:`${n}${r}`}:{};return vo("li",{role:"option","aria-selected":(e===r).toString(),className:Vr({"is-selected":e===r},"AutocompleteList__li"),
526
- 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 vo("div",{className:Vr({"is-hidden":c},"AutocompleteList"),children:vo("ul",{className:"AutocompleteList__items",tabIndex:-1,"aria-label":"Suggestions",role:"listbox",...l,children:s})})}let qd=0;var Ud=si((function({onAddTag:e,onRemoveTag:t,onTagInput:n,tagList:r,tags:o}){const i=io(),[a,s]=to([]),[l,c]=to(-1),[u,h]=to(!1),[d]=to((()=>(++qd,`TagEditor-${qd}`))),p=io();Fo(p,u,(()=>{h(!1)}));const m=()=>i.current.value.trim(),f=()=>m()&&m().length>0,g=()=>{i.current.value="",null==n||n("")},v=t=>{e(t)&&(h(!1),c(-1),g(),i.current.focus())},y=e=>{let t=l+e;t<-1?t=a.length-1:t>=a.length&&(t=-1),c(t)},_=l>=0?`${d}-AutocompleteList-item-${l}`:"";return vo("div",{className:"TagEditor",children:[vo("ul",{className:"TagEditor__tags","aria-label":"Suggested tags for annotation",children:r.map((e=>vo("li",{className:"TagEditor__item","aria-label":`Tag: ${e}`,children:[vo("span",{lang:"",
527
- className:"TagEditor__edit",children:e}),vo("button",{onClick:()=>{t(e)},"aria-label":`Remove Tag: ${e}`,title:`Remove Tag: ${e}`,className:"TagEditor__delete",children:vo(Ro,{name:"cancel"})})]},`${e}`)))}),vo("span",{id:d,className:"TagEditor__combobox-wrapper",ref:p,role:"combobox","aria-expanded":u.toString(),"aria-owns":`${d}-AutocompleteList`,"aria-haspopup":"listbox",children:[vo("input",{onInput:()=>{null==n||n(m()),(()=>{if(f()){const e=o.filter(m());s(((e,t)=>{const n=[];return e.forEach((e=>{t.indexOf(e)<0&&n.push(e)})),n.sort()})(e,r)),h(e.length>0)}else h(!1);c(-1)})()},onKeyDown:e=>{switch(Do(e.key)){case"ArrowUp":y(-1),e.preventDefault();break;case"ArrowDown":y(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)},ref:i,placeholder:"Add new tags",className:"TagEditor__input",type:"text",
528
- autoComplete:"off","aria-autocomplete":"list","aria-activedescendant":_,"aria-controls":`${d}-AutocompleteList`,dir:"auto"}),vo(Hd,{id:`${d}-AutocompleteList`,list:a,listFormatter:e=>{const t=m().toLowerCase(),n=e.toLowerCase().indexOf(t);if(-1===n)return vo("span",{children:e});const r=e.slice(0,n),o=e.slice(n,n+t.length),i=e.slice(n+t.length);return vo("span",{children:[vo("strong",{children:r}),o,vo("strong",{children:i})]})},open:u,onSelectItem:e=>{e&&v(e)},itemPrefixId:`${d}-AutocompleteList-item-`,activeItem:l})]})]})}),["tags"]);function $d(){return vo("div",{className:"hyp-u-padding--top hyp-u-border--top text-sm leading-none",children:vo(Po,{classes:"hyp-u-layout-row--align-center p-link--muted",href:"http://creativecommons.org/publicdomain/zero/1.0/",target:"_blank",title:"View more information about the Creative Commons Public Domain dedication",children:[vo(Ro,{name:"cc-std",classes:"text-tiny"}),vo(Ro,{name:"cc-zero",classes:"hyp-u-margin--left--1 text-tiny"}),vo("div",{
529
- className:"hyp-u-margin--left--2",children:"Annotations can be freely reused by anyone for any purpose."})]})})}function Gd(e){return null!==e.offsetParent}function Vd({className:e,closeMenu:t,children:n,visible:r}){const o=io();ro((()=>{let e=null;return r&&(e=setTimeout((()=>{const e=o.current.querySelector('[role^="menuitem"]');e&&e.focus()}))),()=>{clearTimeout(e)}}),[r]);return vo("div",{role:"menu",className:e,ref:o,onKeyDown:e=>{const n=Array.from(o.current.querySelectorAll('[role^="menuitem"]')).filter(Gd);let r=n.findIndex((e=>e.contains(document.activeElement))),i=!1;switch(Do(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})}function Wd({className:e}){return vo("svg",{className:Vr("Menu__arrow",e),width:15,height:8,children:vo("path",{d:"M0 8 L7 0 L15 8",
530
- stroke:"currentColor",strokeWidth:"2"})})}let Yd=!1;const Kd=()=>{};function Xd({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]=to(i);"boolean"==typeof s&&(h=s,d=l||Kd);const p=io(h);ro((()=>{"function"==typeof l&&p.current!==h&&(p.current=h,l(h))}),[h,l]);const f=e=>{if("mousedown"===e.type)Yd=!0;else if("click"===e.type&&Yd)return Yd=!1,e.stopPropagation(),void e.preventDefault();d(!h)},g=so((()=>d(!1)),[d]),v=io();Fo(v,h,g);const y=e=>e.stopPropagation();return vo("div",{className:"Menu",ref:v,style:{position:r?"relative":"static"},onClick:y,onMouseDown:y,children:[vo("button",{"aria-expanded":h?"true":"false","aria-haspopup":!0,className:"Menu__toggle",onMouseDown:f,onClick:f,"aria-label":u,title:u,children:vo("span",{className:"Menu__toggle-wrapper",children:[a,c&&vo("span",{className:Vr("Menu__toggle-arrow",h&&"is-open"),children:vo(_o,{name:"expand-menu",className:"Menu__toggle-icon"
531
- })})]})}),h&&vo(m,{children:[vo(Wd,{className:t}),vo("div",{className:Vr("Menu__content",`Menu__content--align-${e}`,o),role:"menu",tabIndex:-1,onClick:g,onKeyDown:e=>{const t=Do(e.key);"Enter"!==t&&" "!==t||setTimeout((()=>{g()}))},children:vo(Vd,{visible:!0,children:n})})]})]})}function Zd({children:e,visible:t}){const n=io(),[r,o]=to(t?"auto":0),[i,a]=to(t);ro((()=>{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 vo("div",{ontransitionend:so((()=>{t?o("auto"):a(!1)}),[o,t]),ref:n,style:{display:i?"":"none",height:r,overflow:"auto"===r?"visible":"hidden",transition:"height 0.15s ease-in"},children:e})}function Jd({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=t||a,f=t&&a,g=io();let v=null,y=null;t&&"blank"!==t&&(y=d?vo("img",{className:"MenuItem__icon",
532
- alt:n,src:t}):vo(_o,{name:t,className:"MenuItem__icon"}));const _=a?null:y,b=a?y:null;let w;const x="boolean"==typeof s,k="boolean"==typeof i;ro((()=>()=>{clearTimeout(v)}),[]);const S=e=>{switch(Do(e.key)){case"ArrowRight":u&&(e.stopPropagation(),e.preventDefault(),u(e));break;case"Enter":case" ":c&&c(e)}};return w=e?vo("a",{ref:g,className:Vr("MenuItem",{"is-submenu":a,"is-disabled":r}),href:e,target:"_blank",tabIndex:-1,rel:"noopener noreferrer",role:"menuitem",onKeyDown:S,children:[p&&vo("div",{className:"MenuItem__icon-container",children:_}),vo("span",{className:"MenuItem__label",children:l}),f&&vo("div",{className:"MenuItem__icon-container",children:b})]}):vo("div",{ref:g,className:Vr("MenuItem",{"is-submenu":a,"is-disabled":r,"is-expanded":o,"is-selected":i}),tabIndex:-1,onKeyDown:S,onClick:c,role:k?"menuitemradio":"menuitem","aria-checked":k?i:void 0,"aria-haspopup":x,"aria-expanded":x?s:void 0,children:[p&&vo("div",{className:"MenuItem__icon-container",children:_}),vo("span",{
533
- className:"MenuItem__label",children:l}),f&&vo("div",{className:"MenuItem__icon-container",children:b}),x&&vo("div",{role:"none",icon:s?"collapse-menu":"expand-menu",className:"MenuItem__toggle",onClick:u,title:`Show actions for ${l}`,children:vo(_o,{name:s?"collapse-menu":"expand-menu",className:"MenuItem__toggle-icon"})})]}),vo(m,{children:[w,x&&vo(Zd,{visible:s,children:vo(Vd,{closeMenu:e=>{u&&u(e),v=setTimeout((()=>{g.current.focus()}))},visible:s,className:"MenuItem__submenu",children:h})})]})}var Qd=si((function({annotation:e,isDisabled:t,onSave:n,settings:r}){const o=ci(),i=o.getDraft(e),a=o.getGroup(e.group);if(!a)return null;const s=i?i.isPrivate:!ka(e.permissions),l=s?"Only Me":a.name,c=t=>{o.createDraft(e,{...i,isPrivate:"private"===t}),Ei(e)||o.setDefault("annotationPrivacy",t)},u=ii(["ctaTextColor","ctaBackgroundColor"],r),h=vo("div",{className:"annotation-publish-button__menu-label",style:u,children:vo(Ro,{name:"expand-menu"})});return vo("div",{
534
- className:"hyp-u-layout-row hyp-u-horizontal-spacing--4",children:[vo("div",{className:"annotation-publish-button",children:[vo(So,{classes:"PublishControlButton","data-testid":"publish-control-button",style:u,onClick:n,disabled:t,size:"large",variant:"primary",children:["Post to ",l]}),vo("div",{className:"annotation-publish-button__menu-wrapper",style:u,children:vo(Xd,{arrowClass:"annotation-publish-button__menu-arrow",containerPositioned:!1,contentClass:"annotation-publish-button__menu-content",label:h,menuIndicator:!1,title:"Change annotation sharing setting",align:"left",children:[vo(Jd,{icon:"open"===a.type?"public":"groups",label:a.name,isSelected:!s,onClick:()=>c("shared")}),vo(Jd,{icon:"lock",label:"Only Me",isSelected:s,onClick:()=>c("private")})]})})]}),vo("div",{children:vo(So,{icon:"cancel",onClick:()=>{o.removeDraft(e),Ni(e)&&o.removeAnnotations([e])},size:"large",children:"Cancel"})})]})}),["settings"]);var ep=si((function({annotation:e,annotationsService:t,settings:n,tags:r,toastMessenger:o}){
535
- const[i,a]=to(null),s=ci(),l=s.getDraft(e),c=s.getGroup(e.group);if(!l)return null;const u=!l.isPrivate&&c&&"private"!==c.type,h=l.tags,d=l.text,p=!d&&!h.length,m=({tags:e})=>{s.createDraft(l.annotation,{...l,tags:e})},f=e=>{if(!e||h.indexOf(e)>=0)return!1;const t=[...h,e];return r.store(t),m({tags:t}),!0},g=async()=>{i&&f(i);try{await t.save(e)}catch(e){o.error("Saving annotation failed")}};return vo("div",{className:"hyp-u-vertical-spacing AnnotationEditor",onKeyDown:e=>{const t=Do(e.key);p||(e.metaKey||e.ctrlKey)&&"Enter"===t&&(e.stopPropagation(),e.preventDefault(),g())},children:[vo(Fd,{textStyle:ii(["annotationFontFamily"],n),label:"Annotation body",text:d,onEditText:({text:e})=>{s.createDraft(l.annotation,{...l,text:e})}}),vo(Ud,{onAddTag:f,onRemoveTag:e=>{const t=[...h],n=t.indexOf(e);return n>=0&&(t.splice(n,1),m({tags:t}),!0)},onTagInput:a,tagList:h}),vo("div",{className:"hyp-u-layout-row annotation__form-actions",children:vo(Qd,{annotation:e,isDisabled:p,onSave:g})}),u&&vo($d,{})]})
536
- }),["annotationsService","settings","tags","toastMessenger"]);function tp(e,t,n){var r;return(n||t)&&null!==(r=e.user_info)&&void 0!==r&&r.display_name?e.user_info.display_name:ni(e.user)}function np({domain:e,link:t,title:n}){return vo("div",{className:"hyp-u-layout-row hyp-u-horizontal-spacing--2",children:[vo("div",{className:"text-color-text-light",children:['on "',t?vo(Po,{href:t,target:"_blank",children:n}):vo("span",{children:n}),'"']}),e&&vo("span",{className:"text-color-text-light",children:["(",e,")"]})]})}function rp({annotation:e}){const t=ci().getGroup(e.group),n=null==t?void 0:t.links.html,r=Sa(e.permissions);return vo("div",{className:"hyp-u-layout-row--align-baseline",children:[t&&n&&vo(Po,{classes:"hyp-u-layout-row--align-baseline hyp-u-horizontal-spacing--2 p-link--muted p-link--hover-muted",href:t.links.html,target:"_blank",children:["open"===t.type?vo(Ro,{classes:"text-tiny",name:"public"}):vo(Ro,{classes:"text-tiny",name:"groups"}),vo("span",{children:t.name})]}),r&&!n&&vo("span",{
537
- className:"hyp-u-layout-row--align-baseline text-color-text-light",children:vo("span",{"data-testid":"private-info",children:"Only me"})})]})}let op={};function ip(e,t){return t-e}function ap(e,t,n=window.Intl){const r=JSON.stringify(t);let o=op[r];return o||(o=op[r]=new n.DateTimeFormat(void 0,t)),o.format(e)}const sp=[{test:(e,t)=>ip(e,t)<3e4,formatter:()=>"Just now",nextUpdate:1e3},{test:(e,t)=>ip(e,t)<6e4,formatter:function(e,t){return`${Math.floor(ip(e,t)/1e3)} secs ago`},nextUpdate:1e3},{test:(e,t)=>ip(e,t)<36e5,formatter:function(e,t){const n=Math.floor(ip(e,t)/6e4);return`${n} min${n>1?"s":""} ago`},nextUpdate:6e4},{test:(e,t)=>ip(e,t)<864e5,formatter:function(e,t){const n=Math.floor(ip(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 ap(e,{month:"short",day:"numeric"},n)},nextUpdate:null}],lp={test:()=>!0,formatter:function(e,t,n){return ap(e,{day:"numeric",month:"short",year:"numeric"},n)},nextUpdate:null}
538
- ;function cp(e,t){for(let n of sp)if(n.test(e,t))return n;return lp}function up(e){return!isNaN(e.valueOf())}function hp(e,t){let n;const r=new Date(e),o=()=>{const e=function(e,t){if(!e||!up(e)||!up(t))return null;let n=cp(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 dp(e,t,n){return e?cp(e,t).formatter(e,t,n):""}function pp(e,t){return ap(e,{year:"numeric",month:"short",day:"2-digit",weekday:"long",hour:"2-digit",minute:"2-digit"},t)}function mp({annotationCreated:e,annotationUpdated:t,annotationUrl:n,withEditedTimestamp:r}){const[o,i]=to((()=>new Date)),a=ao((()=>new Date(e)),[e]),s=ao((()=>r&&new Date(t)),[t,r]),l=ao((()=>({absolute:pp(a),relative:dp(a,o)})),[a,o]),c=ao((()=>s?{absolute:pp(s),relative:dp(s,o)}:{}),[s,o]);ro((()=>hp(s?t:e,(()=>i(new Date)))),[e,t,a,s,o]);const u=c&&c.relative!==l.relative?`edited ${c.relative}`:"edited";return vo("div",{
539
- children:[r&&vo("span",{className:"text-color-text-light text-sm italic","data-testid":"timestamp-edited",title:c.absolute,children:["(",u,")"," "]}),n?vo(Po,{classes:"p-link--muted p-link--hover-muted",target:"_blank",title:l.absolute,href:n,children:l.relative}):vo("span",{className:"color-text-color-light","data-testid":"timestamp-created",title:l.absolute,children:l.relative})]})}function fp({authorLink:e,displayName:t}){const n=vo("h3",{className:"text-color-text font-bold",children:t});return e?vo(Po,{href:e,target:"_blank",children:n}):vo("div",{children:n})}var gp=si((function({annotation:e,isEditing:t,replyCount:n,threadIsCollapsed:r,settings:o}){var i;const a=ci(),s=a.defaultAuthority(),l=a.isFeatureEnabled("client_display_names"),c=ri(e.user,s),u=tp(e,c,l),h=(()=>{var t;return c?null!==(t=o.usernameUrl&&`${o.usernameUrl}${ni(e.user)}`)&&void 0!==t?t:void 0:a.getLink("user",{user:e.user})
540
- })(),d=Ei(e)&&r,p=Sa(e.permissions),m=(null===(i=e.links)||void 0===i?void 0:i.html)||"",f=!t&&e.created,g=ao((()=>function(e){if(!e.updated||!e.created||e.updated===e.created)return!1;const t=new Date(e.created).getTime(),n=new Date(e.updated).getTime();return!isNaN(t)&&!isNaN(n)&&n-t>2e3}(e)&&!d),[e,d]),v=`${n} ${n>1?"replies":"reply"}`,y=n>0&&d,_=!Ei(e),b=function(e){return{domain:Ci(e),titleText:Ai(e),titleLink:Si(e)}}(e),w=m&&b.titleLink?b.titleLink:"",x="sidebar"!==a.route()&&b.titleText;return vo("header",{children:[vo("div",{className:"hyp-u-layout-row--align-baseline hyp-u-horizontal-spacing--2 flex-wrap-reverse",children:[p&&!t&&vo(Ro,{classes:"text-tiny",name:"lock",title:"This annotation is visible only to you"}),vo(fp,{authorLink:h,displayName:u}),y&&vo(Co,{onClick:()=>a.setExpanded(e.id,!0),title:"Expand replies",children:v}),f&&vo("div",{className:"hyp-u-layout-row--justify-right hyp-u-stretch",children:vo(mp,{annotationCreated:e.created,annotationUpdated:e.updated,annotationUrl:m,
541
- withEditedTimestamp:g})})]}),_&&vo("div",{className:"hyp-u-layout-row--align-baseline hyp-u-horizontal-spacing--2 flex-wrap-reverse",children:[vo(rp,{annotation:e}),!t&&Ii(e)&&vo(Ro,{name:"highlight",title:"This is a highlight. Click 'edit' to add a note or tag.",classes:"text-tiny text-color-text-light"}),x&&vo(np,{domain:b.domain,link:w,title:b.titleText})]})]})}),["settings"]);var vp=si((function({annotation:e,isFocused:t,settings:n={}}){return vo("div",{className:Vr({"is-orphan":Ri(e)}),children:vo(Oa,{collapsedHeight:35,inlineControls:!0,overflowThreshold:20,children:vo("blockquote",{className:Vr("p-quoted-text",{"is-focused":t,"p-redacted-content":Ri(e)}),dir:"auto",lang:"",style:ii(["selectionFontFamily"],n),children:Fi(e)})})})}),["settings"]);function yp({onToggleReplies:e,replyCount:t,threadIsCollapsed:n}){const r=`${n?"Show replies":"Hide replies"} (${t})`;return vo(Co,{onClick:e,title:r,children:r})}
542
- var _p=si((function({annotation:e,hasAppliedFilter:t,isReply:n,onToggleReplies:r,replyCount:o,threadIsCollapsed:i,annotationsService:a}){const s=n&&i,l=ci(),c=e&&!!Fi(e),u=e&&l.isAnnotationFocused(e.$tag),h=e&&l.isSavingAnnotation(e),d=e&&!!l.getDraft(e)&&!h,p=l.profile().userid,f=!h&&!d,g=!n&&!t&&o>0;return vo("article",{className:Vr("hyp-u-vertical-spacing",{"is-collapsed":i,"is-focused":u}),children:[e&&vo(m,{children:[vo(gp,{annotation:e,isEditing:d,replyCount:o,threadIsCollapsed:i}),c&&vo(vp,{annotation:e,isFocused:u}),!s&&!d&&vo(Ed,{annotation:e}),d&&vo(ep,{annotation:e})]}),!e&&!s&&vo("div",{children:vo("em",{children:"Message not available."})}),!s&&vo("footer",{children:vo("div",{className:"hyp-u-layout-row",children:[g&&vo(yp,{onToggleReplies:r,replyCount:o,threadIsCollapsed:i}),h&&vo("div",{className:"hyp-u-layout-row--justify-right hyp-u-stretch","data-testid":"saving-message",children:"Saving..."}),e&&f&&Ti(e)&&vo(To,{classes:"hyp-u-stretch",children:vo(La,{annotation:e,onReply:()=>{
543
- e&&Ti(e)&&a.reply(e,p)}})})]})})]})}),["annotationsService"]);var bp=si((function({annotation:e,api:t,toastMessenger:n}){const r=ci(),o=function(e){return e.moderation?e.moderation.flagCount:null}(e);return null!==o&&(o>0||e.hidden)?vo("div",{className:Vr("flex gap-x-3 bg-grey-1 text-color-text font-semibold","mb-2 ",{"-mt-3 -ml-3 -mr-3":!Ei(e),"-mr-3":Ei(e)}),children:[vo("div",{className:Vr("p-3 text-white",{"bg-red-error":!e.hidden,"bg-grey-6":e.hidden}),children:vo(Ro,{name:e.hidden?"hide":"flag"})}),vo("div",{className:"self-center grow",children:[!e.hidden&&vo("span",{children:["Flagged for review by ",o," ",1===o?"user":"users"]}),e.hidden&&vo("span",{children:"Hidden from users"})]}),vo("div",{className:"self-center pr-2",children:vo(So,{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)
544
- })).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 wp({annotation:e,...t}){const n=ci(),r=e&&n.isSavingAnnotation(e),o=e&&!!n.getDraft(e)&&!r;return e?vo("div",{className:"Thread__top-annotation-header",children:vo(gp,{annotation:e,isEditing:o,...t})}):null}var xp=si((function e({thread:t,threadsService:n}){const r=!t.collapsed,o=Wi(t)>0,i=!!t.parent,a=t.collapsed?"collapsed":"expand-menu",s=t.collapsed?"Expand replies":"Collapse replies",l=t.children.filter((e=>Yi(e)>0)),c=ci(),u=c.hasAppliedFilter(),h=so((()=>c.setExpanded(t.id,!!t.collapsed)),[c,t.id,t.collapsed]),d=ao((()=>t.visible&&vo(m,{children:[t.annotation&&vo(bp,{annotation:t.annotation}),vo(_p,{annotation:t.annotation,hasAppliedFilter:u,isReply:!!t.parent,onToggleReplies:h,replyCount:t.replyCount,threadIsCollapsed:t.collapsed})]
545
- })),[u,h,t.annotation,t.parent,t.replyCount,t.collapsed,t.visible]);return vo("section",{className:Vr("Thread",{"Thread--reply":t.depth>0,"is-collapsed":t.collapsed}),children:[i&&vo("div",{className:"Thread__collapse",children:vo("div",{className:"Thread__collapse-button-container",children:vo(ko,{classes:"NonResponsiveIconButton",expanded:!t.collapsed,icon:a,title:s,onClick:h,size:"medium",variant:"light"})})}),vo("div",{className:"Thread__content",children:[d,o&&vo(m,{children:[!t.parent&&vo(wp,{annotation:t.annotation,replyCount:t.replyCount,threadIsCollapsed:t.collapsed}),vo("div",{className:"Thread__hidden-toggle-button-container",children:vo(So,{onClick:()=>n.forceVisible(t),children:["Show ",Wi(t)," more in conversation"]})})]}),r&&vo("ul",{className:"Thread__children",children:l.map((t=>vo("li",{children:vo(e,{thread:t,threadsService:n})},t.id)))})]})]})}),["threadsService"]);var kp=si((function({frameSync:e,thread:t}){
546
- const n=ci(),r=t.annotation&&t.annotation.$tag,o=r&&n.isAnnotationFocused(r),i=ao((()=>fa((t=>{const n=t?[t]:[];e.focusAnnotations(n)}),10)),[e]),a=so((t=>{e.scrollToAnnotation(t)}),[e]),s=ao((()=>vo(xp,{thread:t})),[t]);return vo("div",{onClick:e=>{var t;(t=e.target).closest("button")||t.closest("a")||a(r)},onMouseEnter:()=>i(r),onMouseLeave:()=>i(null),className:Vr("ThreadCard p-3",{"is-focused":o}),children:s},t.id)}),["frameSync"]);function Sp(){const e=document.querySelector(".js-thread-list-scroll-root");if(!e)throw new Error("Scroll container is missing");return e}function Cp(e){return Math.max(e-e%50,0)}function Ap({threads:e}){const[t,n]=to(0),[r,o]=to(0);oo((()=>{const e=new ga,t=Sp();n(t.clientHeight),o(Cp(t.scrollTop));const r=fa((()=>{n(t.clientHeight),o(Cp(t.scrollTop))}),10,{maxWait:100});return e.add(t,"scroll",r),e.add(window,"resize",r),()=>{e.removeAll(),r.cancel()}}),[])
547
- ;const[i,a]=to({}),[s,l]=to(null),c=e,{offscreenLowerHeight:u,offscreenUpperHeight:h,visibleThreads:d}=ao((()=>function(e,t,n,r,o=va){const{defaultHeight:i,marginAbove:a,marginBelow:s}=o,l=[];let c=0,u=0,h=0;return e.forEach((e=>{const o=t[e.id]||i;c+o<n-a?u+=o:c<n+r+s?l.push(e):h+=o,c+=o})),{visibleThreads:l,offscreenUpperHeight:u,offscreenLowerHeight:h}}(c,i,r,t)),[c,i,r,t]),p=ci(),m=(()=>{const e=p.unsavedAnnotations();return e.length?e[e.length-1].$tag:null})();return ro((()=>{m&&(p.setForcedVisible(m,!0),l(m))}),[p,m]),ro((()=>{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[e.id]||va.defaultHeight)(t)),0);Sp().scrollTop=t}),[s,c,i]),ro((()=>{a((e=>{const t={};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=ya(r);o!==e[n]&&(t[n]=o)}return 0===Object.keys(t).length?e:{...e,...t}}))}),[d]),vo("div",{children:[vo("div",{style:{height:h}
548
- }),d.map((e=>vo("div",{className:"ThreadList__card",id:e.id,children:vo(kp,{thread:e})},e.id))),vo("div",{style:{height:u}})]})}function Ep({errorType:e,onLoginRequest:t,showClearSelection:n=!1}){const r=ci(),o=r.isLoggedIn();return vo("div",{className:"mb-4",children:vo(Go,{icon:"restricted",title:"annotation"===e?"Annotation unavailable":"Group unavailable",children:[vo("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.`}),vo("div",{className:"hyp-u-layout-row--justify-right hyp-u-horizontal-spacing",children:[n&&vo(So,{variant:o?"primary":void 0,onClick:()=>r.clearSelection(),children:"Show all annotations"}),!o&&vo(So,{variant:"primary",onClick:t,
549
- children:"Log in"})]})]})})}var Tp=si((function({loadAnnotationsService:e,onLogin:t}){const n=ci(),r=n.routeParams().id,o=ea(),i=n.profile().userid,[a,s]=to(!1);return ro((()=>{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))),t.id!==r&&n.highlightAnnotations([r]))})).catch((()=>{s(!0)}))}),[r,i,e,n]),vo(m,{children:[a&&vo(Ep,{errorType:"annotation",onLoginRequest:t}),vo(Ap,{threads:o.children})]})}),["loadAnnotationsService"]);function Np({actionButton:e,additionalCount:t=0,entitySingular:n="annotation",entityPlural:r="annotations",filterQuery:o,focusDisplayName:i,resultCount:a}){return vo("div",{className:"FilterStatus",children:ci().isLoading()?vo("div",{className:"hyp-u-layout-row--center",children:vo(Wo,{})}):vo("div",{className:"hyp-u-layout-row--align-center",children:[vo("div",{className:"FilterStatus__text",children:[a>0&&vo("span",{children:"Showing "}),vo("span",{className:"filter-facet",
550
- children:[a>0?a:"No"," ",1===a?n:r]}),o&&vo("span",{children:[" ","for"," ",vo("span",{className:"filter-facet--pre",children:`'${o}'`})]}),i&&vo("span",{children:[" ","by ",vo("span",{className:"filter-facet",children:i})]}),t>0&&vo("span",{className:"filter-facet--muted",children:[" ","(and ",t," more)"]})]}),vo("div",{children:e})]})})}function Lp({filterState:e,rootThread:t}){const n=ci(),r=n.directLinkedAnnotationId(),o=n.annotationCount(),i=(t.children||[]).filter((e=>e.annotation&&e.visible)).length-e.selectedCount,a=!e.focusConfigured&&!r?`Show all (${o})`:"Show all",s=vo(So,{title:a,variant:"primary",onClick:()=>n.clearSelection(),icon:"cancel",children:a});return vo(Np,{resultCount:e.selectedCount,additionalCount:i,actionButton:s})}function Mp({filterState:e,rootThread:t}){const n=ci(),r=Yi(t)-e.forcedVisibleCount,o=vo(So,{icon:"cancel",variant:"primary",title:"Clear search",onClick:()=>n.clearSelection(),children:"Clear search"});return vo(Np,{actionButton:o,additionalCount:e.forcedVisibleCount,
551
- entitySingular:"result",entityPlural:"results",filterQuery:e.filterQuery,focusDisplayName:e.focusDisplayName,resultCount:r})}function zp({filterState:e,rootThread:t}){const n=ci(),r=Yi(t)-e.forcedVisibleCount,o={};e.forcedVisibleCount>0?(o.onClick=()=>n.clearSelection(),o.title="Reset filters"):(o.onClick=()=>n.toggleFocusMode(),o.title=e.focusActive?"Show all":`Show only ${e.focusDisplayName}`);const i=e.focusActive?e.focusDisplayName:"",a=vo(So,{variant:"primary",...o,children:o.title});return vo(Np,{resultCount:r,actionButton:a,additionalCount:e.forcedVisibleCount,filterQuery:e.filterQuery,focusDisplayName:i})}function Op(){const e=ea(),t=ci(),n=t.focusState(),r=t.forcedVisibleThreads().length,o=t.filterQuery(),i=t.selectedAnnotations().length,a=ao((()=>({filterQuery:o,focusActive:n.active,focusConfigured:n.configured,focusDisplayName:n.displayName,forcedVisibleCount:r,selectedCount:i})),[n,r,o,i]);return a.selectedCount>0?vo(Lp,{filterState:a,rootThread:e}):a.filterQuery?vo(Mp,{filterState:a,rootThread:e
552
- }):a.focusConfigured?vo(zp,{filterState:a,rootThread:e}):null}function Ip({onLogin:e}){const t=ci();return vo("div",{className:"LoggedOutMessage",children:[vo("span",{children:["This is a public annotation created with Hypothesis. ",vo("br",{}),"To reply or make your own annotations on this document,"," ",vo("a",{className:"LoggedOutMessage__link",href:t.getLink("signup"),target:"_blank",rel:"noopener noreferrer",children:"create a free account"})," ","or"," ",vo(Co,{classes:"InlineLinkButton InlineLinkButton--underlined",onClick:e,variant:"dark",children:"log in"}),"."]}),vo("div",{className:"LoggedOutMessage__logo",children:vo("a",{href:"https://hypothes.is","aria-label":"Hypothesis homepage",title:"Hypothesis homepage",children:vo(Ro,{name:"logo",classes:"w-16 h-16 hyp-u-color--grey-7"})})})]})}function Rp(e,t,n){e.self===e?e.scrollTo(t,n):(e.scrollLeft=t,e.scrollTop=n)}function Pp(e){var t=e._scrollSettings;if(t){var n=t.maxSynchronousAlignments,r=function(e,t){
553
- 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),y=u.top-(n.top-t.scrollTop);r=v+s*f-t.clientWidth*f,o=y+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,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 Rp(e,r.x,r.y),
554
- e._scrollSettings=null,t.end("complete");var a=1-t.ease(i);if(Rp(e,r.x-r.differenceX*a,r.y-r.differenceY*a),o>=t.time)return t.endIterations++,t.scrollAncestor&&Pp(t.scrollAncestor),void Pp(e);!function(e){if("requestAnimationFrame"in window)return window.requestAnimationFrame(e);setTimeout(e,16)}(Pp.bind(null,e))}}function Dp(e){return e.self===e}function Bp(e){return"pageXOffset"in e||(e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth)&&"hidden"!==getComputedStyle(e).overflow}function Fp(){return!0}function jp(e){if(e.assignedSlot)return jp(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 Hp=function(e,t,n){if(e){"function"==typeof t&&(n=t,t=null),t||(t={}),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||{}
555
- ;var r=jp(e),o=1,i=t.validTarget||Fp,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,Bp):Bp(r))&&(o++,s.push(r)),!(r=jp(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||Dp,maxSynchronousAlignments:h,end:u,scrollAncestor:r},"cancellable"in n&&!n.cancellable||(i=u.bind(null,"canceled"),
556
- t.addEventListener("touchstart",i,c),t.addEventListener("wheel",i,c)),a&&Pp(t),i}(e,r,t,s[o+1],l)),null)}function l(e){--o||n&&n(e)}};function qp({children:e,icon:t="",panelName:n,title:r,onActiveChanged:o}){const i=ci(),a=i.isSidebarPanelOpen(n),s=io(null),l=io(a);ro((()=>{l.current!==a&&(l.current=a,a&&s.current&&Hp(s.current),"function"==typeof o&&o(a))}),[a,o]);const c=so((()=>{i.toggleSidebarPanel(n,!1)}),[i,n]);return vo(Zd,{visible:a,children:vo("div",{ref:s,className:"mb-4",children:vo(Go,{title:r,icon:t,onClose:c,children:e})})})}function Up({onLogin:e,onSignUp:t}){return ci().isLoggedIn()?null:vo(qp,{icon:"restricted",title:"Login needed",panelName:"loginPrompt",children:[vo("p",{children:"Please log in to create annotations or highlights."}),vo(To,{children:[vo(So,{title:"Sign up",onClick:t,children:"Sign up"}),vo(So,{title:"Log in",variant:"primary",onClick:e,children:"Log in"})]})]})}function $p({children:e,count:t,isWaitingToAnchor:n,isSelected:r,label:o,onSelect:i}){const a=()=>{r||i()
557
- },s=t>0?`${o} (${t} available)`:o;return vo(So,{classes:Vr("text-color-text","SelectionTab",{"is-selected":r}),onClick:a,onMouseDown:a,pressed:!!r,role:"tab",tabIndex:0,title:s,children:vo(m,{children:[e,t>0&&!n&&vo("span",{className:"text-tiny",style:"position:relative;bottom:3px;left:2px",children:t})]})})}var Gp=si((function({annotationsService:e,isLoading:t,settings:n}){const r=ci(),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 vo("div",{className:"hyp-u-vertical-spacing--4 SelectionTabs__container",children:[vo("div",{className:"hyp-u-layout-row hyp-u-horizontal-spacing--6 SelectionTabs",role:"tablist",children:[vo($p,{count:a,isWaitingToAnchor:l,isSelected:"annotation"===o,label:"Annotations",onSelect:()=>c("annotation"),children:"Annotations"}),vo($p,{count:i,isWaitingToAnchor:l,isSelected:"note"===o,label:"Page notes",onSelect:()=>c("note"),
558
- children:"Page Notes"}),s>0&&vo($p,{count:s,isWaitingToAnchor:l,isSelected:"orphan"===o,label:"Orphans",onSelect:()=>c("orphan"),children:"Orphans"})]}),"note"===o&&n.enableExperimentalNewNoteButton&&vo("div",{className:"hyp-u-layout-row--justify-right",children:vo(So,{"data-testid":"new-note-button",icon:"add",onClick:()=>e.createPageNote(),variant:"primary",style:ii(["ctaBackgroundColor"],n),children:"New note"})}),!t&&h&&vo(Eo,{classes:"text-center",children:vo("span",{"data-testid":"notes-unavailable-message",children:"There are no page notes in this group."})}),!t&&u&&vo(Eo,{classes:"text-center",children:vo("span",{"data-testid":"annotations-unavailable-message",children:["There are no annotations in this group.",vo("br",{}),"Create one by selecting some text and clicking the"," ",vo(Ro,{classes:"m-0.5 inline -mt-0.5",name:"annotate",title:"Annotate"})," ","button."]})})]})}),["annotationsService","settings"]);var Vp=si((function({frameSync:e,onLogin:t,onSignUp:n,loadAnnotationsService:r,streamer:o}){
559
- const i=ea(),a=ci(),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?Gi(d):"annotation",m=a.searchUris(),f=a.hasSidebarOpened(),g=a.profile().userid,v=d&&!1===d.$orphan?d.$tag:null,y=!(c||!h)&&!d,_=a.directLinkedGroupFetchFailed(),b=y||_,w=!b,x=!b&&!l,k=h&&!u&&!y&&!c,S=io(s);ro((()=>{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]),ro((()=>{v?(e.focusAnnotations([v]),e.scrollToAnnotation(v),a.selectTab(p)):d&&a.selectTab(p)}),[p,e,d,v,a]);const C=a.hasFetchedProfile();return ro((()=>{C&&(f||u)&&o.connect({applyUpdatesImmediately:!1})}),[C,u,f,o]),vo("div",{children:[vo("h2",{className:"sr-only",children:"Annotations"}),w&&vo(Op,{}),vo(Up,{onLogin:t,onSignUp:n}),y&&vo(Ep,{errorType:"annotation",onLoginRequest:t,showClearSelection:!0}),_&&vo(Ep,{
560
- errorType:"group",onLoginRequest:t}),x&&vo(Gp,{isLoading:c}),vo(Ap,{threads:i.children}),k&&vo(Ip,{onLogin:t})]})}),["frameSync","loadAnnotationsService","streamer"]);var Wp=si((function({api:e,toastMessenger:t}){const n=ci(),r=n.routeParams().q,o=so((async t=>{const r={_separate_replies:!0,offset:0,limit:20,...xi(t)};try{n.annotationFetchStarted();const t=await e.search(r);n.addAnnotations([...t.rows,...t.replies])}finally{n.annotationFetchFinished()}}),[e,n]);return ro((()=>{n.setSortKey("Newest"),n.clearAnnotations(),o(r).catch((e=>{t.error(`Unable to fetch annotations: ${e.message}`)}))}),[r,o,n,t]),vo(Ap,{threads:ea().children})}),["api","toastMessenger"]);class Yp{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.1004.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||a,
561
- 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 Kp(e){const t=P(e);return!(null==t||!t.authority)&&t.authority!==e.authDomain}function Xp({commandName:e,iconName:t}){return vo("span",{className:"whitespace-nowrap",children:[vo(Ro,{name:t,classes:Vr("mx-1 -mt-1","text-color-text-light inline")}),vo("em",{children:e})]})}var Zp=si((function({settings:e}){const t=!Kp(e);return vo("ol",{className:"list-decimal pl-10 space-y-2",children:[vo("li",{children:["To create an annotation, select text and then select the"," ",vo(Xp,{iconName:"annotate",commandName:"Annotate"})," ","button."]}),vo("li",{
562
- children:["To create a highlight (",vo(Po,{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"," ",vo(Xp,{iconName:"highlight",commandName:"Highlight"})," ","button."]}),t&&vo("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"," ",vo(Po,{classes:"underline hover:underline",href:"https://web.hypothes.is/help/how-to-join-a-private-group/",target:"_blank",children:"join link"}),")."]}),vo("li",{children:["To reply to an annotation, select the"," ",vo(Xp,{iconName:"reply",commandName:"Reply"})," button."]})]})}),["settings"]);var Jp=si((function({toastMessenger:e,versionData:t}){return vo("div",{className:"hyp-u-vertical-spacing",children:[vo("dl",{className:"VersionInfo",children:[vo("dt",{className:"VersionInfo__key",children:"Version"}),vo("dd",{
563
- className:"VersionInfo__value",children:t.version}),vo("dt",{className:"VersionInfo__key",children:"User Agent"}),vo("dd",{className:"VersionInfo__value",children:t.userAgent}),vo("dt",{className:"VersionInfo__key",children:"URL"}),vo("dd",{className:"VersionInfo__value",children:t.urls}),vo("dt",{className:"VersionInfo__key",children:"Fingerprint"}),vo("dd",{className:"VersionInfo__value",children:t.fingerprint}),vo("dt",{className:"VersionInfo__key",children:"Account"}),vo("dd",{className:"VersionInfo__value",children:t.account}),vo("dt",{className:"VersionInfo__key",children:"Date"}),vo("dd",{className:"VersionInfo__value",children:t.timestamp})]}),vo("div",{className:"hyp-u-layout-row--justify-center",children:vo(So,{onClick:()=>{try{Ca(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 Qp({children:e,onClick:t}){return vo(Co,{
564
- classes:"leading-none text-brand",onClick:t,children:[e,vo(Ro,{classes:"ml-1",name:"arrow-right"})]})}function em({linkText:e,url:t}){return vo("div",{className:"flex-1 border-r last-of-type:border-r-0",children:vo(Po,{href:t,classes:"flex items-center justify-center space-x-2 text-color-text-light text-lg font-medium",target:"_blank",children:[vo("span",{children:e})," ",vo(Ro,{name:"external",classes:"w-3 h-3"})]})})}var tm=si((function({auth:e,session:t}){const n=ci(),r=n.frames(),o=n.mainFrame(),i=!!n.profile().preferences.show_sidebar_tutorial,[a,s]=to("tutorial"),l=ao((()=>{const t=e||{status:"logged-out"},n=[...r].sort(((e,t)=>e===o?-1:t===o?1:0));return new Yp(t,n)}),[e,r,o]),c=`https://web.hypothes.is/get-help/?sys_info=${l.asEncodedURLString()}`,u=(e,t)=>{e.preventDefault(),s(t)};return vo(qp,{title:"Help",panelName:"help",onActiveChanged:so((e=>{!e&&i&&t.dismissSidebarTutorial()}),[t,i]),children:vo("div",{className:"space-y-4",children:[vo("div",{className:"flex items-center",children:[vo("h3",{
565
- className:"grow text-lg font-medium","data-testid":"subpanel-title",children:{tutorial:"Getting started",versionInfo:"About this version"}[a]}),"versionInfo"===a&&vo(Qp,{onClick:e=>u(e,"tutorial"),children:"Getting started"}),"tutorial"===a&&vo(Qp,{onClick:e=>u(e,"versionInfo"),children:"About this version"})]}),vo("div",{className:"border-y py-4",children:["tutorial"===a&&vo(Zp,{}),"versionInfo"===a&&vo(Jp,{versionData:l})]}),vo("div",{className:"flex items-center",children:[vo(em,{linkText:"Help topics",url:"https://web.hypothes.is/help/"}),vo(em,{linkText:"New support ticket",url:c})]})]})})}),["session"]),nm={exports:{}};function rm(){}rm.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},
566
- 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}},nm.exports=rm;var om=nm.exports.TinyEmitter=rm;class im extends Error{constructor(e){super(`Results size exceeds ${e}`)}}function am(e){return 0===e?50:200}class sm extends om{constructor(e,{getPageSize:t=am,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)),
567
- this._maxResults&&t.total>this._maxResults)return this.emit("error",new im(this._maxResults)),void this.emit("end");const i=t.rows.concat(t.replies||[]);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 lm({defaultOption:e,icon:t,onSelect:n,options:r,selectedOption:o,title:i}){const a=[e,...r],s=null!=o?o:e,l=vo("span",{className:"FilterSelect__menu-label",children:[t&&vo(Ro,{name:t,classes:"text-xl hyp-u-margin--right--3"}),s.display]});return vo(Xd,{label:l,title:i,contentClass:"FilterSelect__menu",children:a.map((e=>vo(Jd,{onClick:()=>n(e),isSelected:e.value===s.value,label:e.display},e.value)))})}function cm(){
568
- const e=ci(),t=e.getFilter("user"),n=function(){const e=ci(),t=e.allAnnotations(),n=e.defaultAuthority(),r=e.isFeatureEnabled("client_display_names"),o=e.getFocusFilters(),i=ni(e.profile().userid);return ao((()=>{const e={};if(t.forEach((t=>{const o=ni(t.user);e[o]=tp(t,ri(t.user,n),r)})),o.user){const t=ni(o.user.value)||o.user.value;e[t]=o.user.display}const a=Object.keys(e).map((t=>({display:t===i?`${e[t]} (Me)`:e[t],value:t})));return a.sort(((e,t)=>i===e.value?-1:i===t.value?1:e.display.localeCompare(t.display))),a}),[t,i,n,r,o.user])}();return vo(lm,{defaultOption:{value:"",display:"Everybody"},icon:"profile",onSelect:t=>e.setFilter("user",t),options:n,selectedOption:t,title:"Filter by user"})}function um({forcedVisibleCount:e,isFiltered:t,isLoading:n,resultCount:r}){const o=ea(),i=n?r:Yi(o),a=o.children.length>0,s=t&&e>0,l=i-e,c=o.children.length;return vo("div",{className:"hyp-u-layout-row NotebookResultCount",children:[n&&vo(Wo,{size:"small"}),!n&&vo("h2",{children:[!a&&vo("strong",{
569
- children:"No results"}),a&&t&&vo("strong",{children:[l," ",1===l?"result":"results"]}),a&&!t&&vo("strong",{children:[c," ",1===c?"thread":"threads"]})]}),s&&vo("h3",{children:["(and ",e," more)"]}),!t&&a&&vo("h3",{children:["(",i," ",1===i?"annotation":"annotations",")"]})]})}function hm({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),null==n||n.blur()};return vo("div",{className:"PaginationNavigation",children:[vo("div",{className:"PaginationNavigation__relative PaginationNavigation__prev",children:o&&vo(So,{classes:"PaginationPageButton",icon:"arrow-left",title:"Go to previous page",onClick:t=>a(e-1,t.target),variant:"dark",children:"prev"})}),vo("ul",{className:"PaginationNavigation__pages",children:i.map(((t,n)=>vo("li",{
570
- children:null===t?vo("div",{className:"PaginationNavigation__gap",children:"..."}):vo(So,{classes:"PaginationPageButton",title:`Go to page ${t}`,pressed:t===e,onClick:e=>a(t,e.target),variant:"dark",children:t.toString()},`page-${n}`)},n)))}),vo("div",{className:"PaginationNavigation__relative PaginationNavigation__next",children:r&&vo(So,{classes:"PaginationPageButton",icon:"arrow-right",iconPosition:"right",title:"Go to next page",onClick:t=>a(e+1,t.target),variant:"dark",children:"next"})})]})}function dm({currentPage:e,isLoading:t,onChangePage:n,threads:r,pageSize:o=25}){const{paginatedThreads:i,totalPages:a}=ao((()=>{const t=r.filter((e=>Yi(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 vo(m,{children:[vo(Ap,{threads:i}),!t&&vo(hm,{currentPage:e,onChangePage:n,totalPages:a})]})}var pm=si((function({loadAnnotationsService:e,streamer:t}){var n
571
- ;const r=ci(),o=r.getFilterValues(),i=r.focusedGroup(),a=r.forcedVisibleThreads().length,s=r.hasAppliedFilter(),l=r.isLoading(),c=r.annotationResultCount(),u=r.pendingUpdateCount(),h=ea(),d=null!==(n=null==i?void 0:i.name)&&void 0!==n?n:"",p=(null==i?void 0:i.id)||r.directLinkedGroupId(),m=io(1),[f,g]=to(1),[v,y]=to(!1),_=e=>{e instanceof im&&y(!0)},b=r.hasFetchedProfile();ro((()=>{b&&t.connect({applyUpdatesImmediately:!1})}),[b,t]),ro((()=>{r.setSortKey("Newest"),p&&e.load({groupId:p,sortBy:"updated",sortOrder:"desc",maxResults:5e3,onError:_,streamFilterBy:"group"})}),[e,p,r]);const w=e=>{g(e)};ro((()=>{w(1)}),[o,i]);const x=io(null);oo((()=>{f!==m.current&&(x.current&&Hp(x.current),m.current=f)}),[f]);const k=`Show ${u} new or updated ${u>1?"annotations":"annotation"}`;return vo("div",{className:"NotebookView",children:[vo("header",{className:"NotebookView__heading",ref:x,children:vo("h1",{className:"NotebookView__group-name",children:d})}),vo("div",{className:"NotebookView__filters",children:vo(cm,{})
572
- }),vo("div",{className:"NotebookView__results hyp-u-layout-row--align-center text-lg font-medium",children:[u>0&&!s&&vo(ko,{icon:"refresh",onClick:()=>t.applyPendingUpdates(),variant:"primary",title:k}),vo(um,{forcedVisibleCount:a,isFiltered:s,isLoading:l,resultCount:c})]}),vo("div",{className:"NotebookView__items",children:[v&&vo("div",{className:"NotebookView__messages",children:vo(Go,{title:"Too many results to show",children:["This preview of the Notebook can show"," ",vo("strong",{children:["up to ",5e3," results"]})," at a time (there are"," ",c," to show here)."," ",vo("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."]})}),vo(dm,{currentPage:f,isLoading:l,onChangePage:w,threads:h.children})]})]})}),["loadAnnotationsService","streamer"])
573
- ;var mm=si((function({toastMessenger:e}){const t=ci(),n=t.mainFrame(),r=t.focusedGroup(),o=`Share Annotations in ${r&&r.name||"..."}`,i=r&&n,a=i&&(s=n.uri,l=r.id,_a(s)?`https://hyp.is/go?url=${encodeURIComponent(s)}&group=${l}`:null);var s,l;return vo(qp,{title:o,panelName:"shareGroupAnnotations",children:[!i&&vo("div",{className:"flex flex-row items-center justify-center",children:vo(Wo,{})}),i&&vo("div",{className:"text-color-text-light space-y-3",children:a?vo(m,{children:[vo("div",{className:"text-color-text font-medium","data-testid":"sharing-intro",children:"private"===r.type?vo("p",{children:"Use this link to share these annotations with other group members:"}):vo("p",{children:"Use this link to share these annotations with anyone:"})}),vo("div",{children:vo(Xo,{children:[vo(Ko,{"aria-label":"Use this URL to share these annotations",type:"text",value:a,readOnly:!0}),vo(ko,{icon:"copy",onClick:()=>{try{Ca(a),e.success("Copied share link to clipboard")}catch(t){e.error("Unable to copy link")}},
574
- title:"Copy share link",variant:"dark"})]})}),vo("p",{"data-testid":"sharing-details",children:["private"===r.type?vo("span",{children:["Annotations in the private group"," ",vo("em",{children:r.name})," are only visible to group members."]}):vo("span",{children:["Anyone using this link may view the annotations in the group"," ",vo("em",{children:r.name}),"."]})," ",vo("span",{children:["Private (",vo(Ro,{name:"lock",classes:"inline -mt-0.5"})," ",vo("em",{children:"Only Me"}),") annotations are only visible to you."]})]}),vo(Ea,{shareURI:a})]}):vo("p",{"data-testid":"no-sharing",children:"These annotations cannot be shared because this document is not available on the web."})})]})}),["toastMessenger"]);function fm({message:e,onDismiss:t}){const n=e.type.charAt(0).toUpperCase()+e.type.slice(1),r="notice"===e.type?"cancel":e.type;return vo("li",{className:Vr("toast-message-container",{"is-dismissed":e.isDismissed}),onClick:()=>t(e.id),children:vo("div",{className:Vr("toast-message",`toast-message--${e.type}`),
575
- children:[vo("div",{className:"toast-message__type",children:vo(Ro,{name:r,classes:"toast-message__icon"})}),vo("div",{className:"toast-message__message",children:[vo("strong",{children:[n,": "]}),e.message,e.moreInfoURL&&vo("div",{className:"toast-message__link",children:vo("a",{href:e.moreInfoURL,onClick:e=>e.stopPropagation(),target:"_new",children:"More info"})})]})]})})}var gm=si((function({toastMessenger:e}){return vo("div",{children:vo("ul",{"aria-live":"polite","aria-relevant":"additions",className:"ToastMessages",children:ci().getToastMessages().map((t=>vo(fm,{message:t,onDismiss:t=>e.dismiss(t)},t.id)))})})}),["toastMessenger"]);function vm(e){return e.organization&&e.organization.name}function ym(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]=Object.assign({},e.organization),t[n].groups=[]),function(e,t){const n=Object.assign({},e),r=t.groups
576
- ;!r.length&&e.organization.logo&&(n.logo=e.organization.logo),r.push(n)}(e,t[n])})),t}function _m(e){const t=ym(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 bm({heading:e,children:t}){return vo(m,{children:[e&&vo("h2",{className:"MenuSection__heading",children:e}),vo("ul",{className:"MenuSection__content",children:x(t).map((e=>vo("li",{children:e},e.key)))})]})}var wm=si((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=ci(),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 vo(Jd,{icon:t.logo||"blank",iconAlt:vm(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,
577
- onToggleSubmenu:h,submenu:vo(m,{children:[vo("ul",{children:[i&&vo("li",{children:vo(Jd,{href:i,icon:"external",isSubmenuItem:!0,label:"View group activity"})}),i&&vo("li",{children:vo(Jd,{onClick:()=>(e=>{try{Ca(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&&vo("li",{children:vo(Jd,{icon:"leave",isSubmenuItem:!0,label:"Leave group",onClick:async()=>{const e=`Are you sure you want to leave the group "${t.name}"?`;await ei({title:"Leave group?",message:e,confirmAction:"Leave"})&&n.leave(t.id)}})})]}),!s&&vo("p",{className:"GroupListItem__footer",children:"This group is restricted to specific URLs."})]})})}),["groups","toastMessenger"]);function xm({expandedGroup:e,onExpandGroup:t,groups:n,heading:r}){return vo(bm,{heading:r,children:n.map((n=>vo(wm,{isExpanded:n===e,onExpand:e=>t(e?n:null),group:n},n.id)))})}var km=si((function({settings:e}){
578
- const t=ci(),n=t.getCurrentlyViewingGroups(),r=t.getFeaturedGroups(),o=t.getMyGroups(),i=t.focusedGroup(),a=t.profile().userid,s=ao((()=>_m(o)),[o]),l=ao((()=>_m(r)),[r]),c=ao((()=>_m(n)),[n]),u=t.defaultAuthority(),h=a&&!ri(a,u),d=t.getLink("groups.new"),[p,m]=to(null);let f;if(i){const t=i.organization.logo||function(e){const t=P(e);return t&&t.icon?t.icon:null}(e)||"",n=vm(i)?vm(i):"";f=vo("span",{className:"GroupList__menu-label",children:[t&&vo("img",{className:"GroupList__menu-icon",src:t,alt:n}),i.name]})}else f=vo("span",{children:""});return!!Kp(e)&&n.length+r.length+o.length<2?f:vo(Xd,{align:"left",contentClass:"GroupList__content",label:f,onOpenChanged:()=>m(null),title:i?`Select group (now viewing: ${i.name})`:"Select group",children:[c.length>0&&vo(xm,{expandedGroup:p,onExpandGroup:m,heading:"Currently Viewing",groups:c}),l.length>0&&vo(xm,{expandedGroup:p,onExpandGroup:m,heading:"Featured Groups",groups:l}),s.length>0&&vo(xm,{expandedGroup:p,onExpandGroup:m,heading:"My Groups",groups:s
579
- }),h&&vo(Jd,{icon:"add",href:d,label:"New private group"})]})}),["settings"]);function Sm({alwaysExpanded:e,query:t,onSearch:n}){const r=ci().isLoading(),o=io(),[i,a]=to(t),[s,l]=to(t);return t!==i&&(l(t),a(t)),vo("form",{action:"#",className:"SearchInput__form",name:"searchForm",onSubmit:e=>{e.preventDefault(),(o.current.value||i)&&n(o.current.value)},children:[vo("input",{"aria-label":"Search",className:Vr("SearchInput__input",{"is-expanded":e||t}),dir:"auto",type:"text",name:"query",placeholder:r?"Loading…":"Search…",disabled:r,ref:o,value:s||"",onInput:e=>l(e.target.value)}),!r&&vo("div",{className:"SearchInput__button-container",children:vo(ko,{icon:"search",onClick:()=>o.current.focus(),size:"small",title:"Search annotations"})}),r&&vo("div",{style:"margin:0.5em 0",children:vo(Wo,{size:"small"})})]})}function Cm(){const e=ci(),t=e.sortKey(),n=e.sortKeys().map((n=>vo(Jd,{label:n,onClick:()=>e.setSortKey(n),isSelected:n===t},n))),r=vo("span",{className:"TopBar__menu-label",children:vo(Ro,{name:"sort",
580
- classes:"TopBar__menu-icon"})});return vo("div",{className:"SortMenu",children:vo(Xd,{label:r,title:`Sort by ${t}`,align:"right",menuIndicator:!1,children:n})})}var Am=si((function({router:e}){return vo(Sm,{query:ci().routeParams().q,onSearch:t=>{e.navigate("stream",{q:t})},alwaysExpanded:!0})}),["router"]);var Em=si((function({auth:e,frameSync:t,onLogout:n,settings:r}){const o=ci(),i=o.defaultAuthority(),a=ri(e.userid,i),s=P(r),l=o.isFeatureEnabled("notebook_launch"),[c,u]=to(!1),h=e=>s&&!!s[e],d=!a||h("onProfileRequestProvided"),p=!a||h("onLogoutRequestProvided"),m=()=>{t.notifyHost("openNotebook",o.focusedGroupId())},f=()=>a&&t.notifyHost("profileRequested"),g=(()=>{const t={};return d&&(a||(t.href=o.getLink("user",{user:e.username})),t.onClick=f),t})(),v=vo("span",{className:"TopBar__menu-label",children:vo(Ro,{name:"profile",classes:"TopBar__menu-icon"})});return vo("div",{className:"UserMenu",onKeyDown:e=>{"n"===e.key&&(m(),u(!1))},children:vo(Xd,{label:v,title:e.displayName,align:"right",open:c,
581
- onOpenChanged:u,children:[vo(bm,{children:[vo(Jd,{label:e.displayName,isDisabled:!d,...g}),!a&&vo(Jd,{label:"Account settings",href:o.getLink("account.settings")}),l&&vo(Jd,{label:"Open notebook",onClick:()=>m()})]}),p&&vo(bm,{children:vo(Jd,{label:"Log out",onClick:n})})]})})}),["frameSync","settings"]);var Tm=si((function({auth:e,frameSync:t,isSidebar:n,onLogin:r,onLogout:o,onSignUp:i,settings:a,streamer:s}){const l=!Kp(a),c=ii(["accentColor"],a),u=ci(),h=u.filterQuery(),d=u.pendingUpdateCount(),p=u.isSidebarPanelOpen("help"),f=u.isSidebarPanelOpen("shareGroupAnnotations"),g=()=>{const e=P(a);e&&e.onHelpRequestProvided?t.notifyHost("helpRequested"):u.toggleSidebarPanel("help")},v=vo(m,{children:["unknown"===e.status&&vo("span",{className:"TopBar__login-links",children:""}),"logged-out"===e.status&&vo("span",{className:"TopBar__login-links text-lg font-medium hyp-u-horizontal-spacing--2",children:[vo(Co,{classes:"InlineLinkButton",onClick:i,style:c,variant:"primary",children:"Sign up"}),vo("div",{
582
- children:"/"}),vo(Co,{classes:"InlineLinkButton",onClick:r,style:c,variant:"primary",children:"Log in"})]}),"logged-in"===e.status&&vo(Em,{auth:e,onLogout:o})]});return vo("div",{className:"TopBar",children:[!n&&vo("div",{className:"TopBar__inner content",children:[vo(Am,{}),vo("div",{className:"hyp-u-stretch"}),vo(ko,{icon:"help",expanded:p,onClick:g,size:"small",title:"Help"}),v]}),n&&vo("div",{className:"TopBar__inner content",children:[vo(km,{}),vo("div",{className:"hyp-u-stretch"}),d>0&&vo(ko,{icon:"refresh",onClick:()=>s.applyPendingUpdates(),size:"small",variant:"primary",title:`Show ${d} new/updated ${1===d?"annotation":"annotations"}`}),vo(Sm,{query:h||null,onSearch:u.setFilterQuery}),vo(Cm,{}),l&&vo(ko,{icon:"share",expanded:f,onClick:()=>{u.toggleSidebarPanel("shareGroupAnnotations")},size:"small",title:"Share annotations on this page"}),vo(ko,{icon:"help",expanded:p,onClick:g,size:"small",title:"Help"}),v]})]})}),["frameSync","settings","streamer"])
583
- ;var Nm=si((function({auth:e,frameSync:t,settings:n,session:r,toastMessenger:o}){const i=ci(),a=i.hasFetchedProfile(),s=i.profile(),l=i.route(),c=ao((()=>a?function(e){const t=ti(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",displayName:n,userid:e.userid,username:t.username}}return{status:"logged-out"}}(s):{status:"unknown"}),[a,s]),u=ao((()=>ii(["appBackgroundColor"],n)),[n]),h="clean"===n.theme,d="sidebar"===l;ro((()=>{(function(e,t,n){const r="object"==typeof t.preferences&&!!t.preferences.show_sidebar_tutorial,o=P(n)||{onHelpRequestProvided:!1};return e&&!o.onHelpRequestProvided&&r})(d,s,n)&&i.openSidebarPanel("help")}),[d,s,n,i]);const p=async()=>{if(P(n))t.notifyHost("loginRequested");else try{await e.login(),i.closeSidebarPanel("loginPrompt"),i.clearGroups(),r.reload()}catch(e){o.error(e.message)}},m=()=>{P(n)?t.notifyHost("signupRequested"):window.open(i.getLink("signup"))};return vo("div",{
584
- className:Vr("HypothesisApp","js-thread-list-scroll-root",{"theme-clean":h,"HypothesisApp--notebook":"notebook"===l}),style:u,children:["notebook"!==l&&vo(Tm,{auth:c,onLogin:p,onSignUp:m,onLogout:async()=>{await(async()=>{const e=i.countDrafts();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?"),ei({title:"Discard drafts?",message:t,confirmAction:"Discard"})})()&&(i.clearGroups(),i.removeAnnotations(i.unsavedAnnotations()),i.discardAllDrafts(),P(n)?t.notifyHost("logoutRequested"):r.logout())},isSidebar:d}),vo("div",{className:"HypothesisApp__content",children:[vo(gm,{}),vo(tm,{auth:"logged-in"===c.status?c:{}}),vo(mm,{}),l&&vo("main",{children:["annotation"===l&&vo(Tp,{onLogin:p}),"notebook"===l&&vo(pm,{}),"stream"===l&&vo(Wp,{}),"sidebar"===l&&vo(Vp,{onLogin:p,onSignUp:m})]})]})]})}),["auth","frameSync","session","settings","toastMessenger"])
585
- ;function Lm({error:e}){return vo("div",{className:"LaunchErrorPanel",children:vo(Go,{title:"Unable to start Hypothesis",children:e.message})})}class Mm{constructor(e,t){this._api=e,this._store=t}_applyDraftChanges(e){const t={},n=this._store.getDraft(e);return n&&(t.tags=n.tags,t.text=n.text,t.permissions=n.isPrivate?ba(e.user):wa(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,a=o.user_info,s="s:"+H(8),l=Object.assign({created:t.toISOString(),group:r,permissions:xa(i,r,n),tags:[],text:"",updated:t.toISOString(),user:i,user_info:a,$tag:s,hidden:!1,links:{},document:{title:""}},e);return Ii(l)&&(l.permissions=ba(i)),l}create(e,t=new Date){const n=this._initialize(e,t);this._store.addAnnotations([n]),this._store.deleteNewAndEmptyDrafts(),Ii(n)||this._store.createDraft(n,{tags:n.tags,text:n.text,isPrivate:!Li(n)}),
586
- Pi(n)?this._store.selectTab("note"):Di(n)&&this._store.selectTab("annotation"),(n.references||[]).forEach((e=>{this._store.setExpanded(e,!0)}))}createPageNote(){const e=this._store.mainFrame();if(!this._store.isLoggedIn())return void this._store.openSidebarPanel("loginPrompt");if(!e)return;const t={target:[],uri:e.uri};this.create(t)}async delete(e){await this._api.annotation.delete({id:e.id}),this._store.removeAnnotations([e])}async flag(e){await this._api.annotation.flag({id:e.id}),this._store.updateFlagStatus(e.id,!0)}reply(e,t){const n={group:e.group,permissions:Li(e)?wa(t,e.group):ba(t),references:(e.references||[]).concat(e.id),target:[{source:e.target[0].source}],uri:e.uri};this.create(n)}async save(e){let t;const n=this._applyDraftChanges(e);let r;t=Ti(e)?this._api.annotation.update({id:e.id},n):this._api.annotation.create({},n),this._store.annotationSaveStarted(e);try{r=await t}finally{this._store.annotationSaveFinished(e)}return Object.keys(e).forEach((t=>{"$"===t[0]&&(r[t]=e[t])})),
587
- this._store.removeDraft(e),this._store.addAnnotations([r]),r}}Mm.$inject=["api","store"];class zm 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 Om(e,t){let n,r;try{n=await fetch(e,t)}catch(t){throw new zm(e,null,t.message)}if(204===n.status)return null;try{r=await n.json()}catch(t){throw new zm(e,n,"Failed to parse response")}var o;if(!n.ok)throw new zm(e,n,null===(o=r)||void 0===o?void 0:o.reason);return r}function Im(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}}function Rm(e){const t={};for(const n in e)e.hasOwnProperty(n)&&"$"!==n[0]&&(t[n]=e[n]);return t}class Pm{constructor(e,t,n){const r=e.routes();this._clientId=null;const o=()=>this._clientId,i=e=>function(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){
588
- return async(a,s)=>{o();try{const[o,l]=await Promise.all([e,n()]),c=function(e,t){let n=e;return t.split(".").forEach((e=>{n=n[e]})),n}(o,t),u={"Content-Type":"application/json","Hypothesis-Client-Version":"1.1004.0"};l&&(u.Authorization="Bearer "+l);const h=r();h&&(u["X-Client-Id"]=h);const{url:d,unusedParams:p}=Im(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 Om(m.toString(),{body:s?JSON.stringify(Rm(s)):null,headers:u,method:c.method})}finally{i()}}}(r,e,{getAccessToken:t.getAccessToken,getClientId:o,onRequestStarted:n.apiRequestStarted,onRequestFinished:n.apiRequestFinished});this.search=i("search"),this.annotation={create:i("annotation.create"),delete:i("annotation.delete"),get:i("annotation.read"),update:i("annotation.update"),flag:i("annotation.flag"),hide:i("annotation.hide"),unhide:i("annotation.unhide")},this.group={member:{delete:i("group.member.delete")},read:i("group.read")},
589
- 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}}Pm.$inject=["apiRoutes","auth","store"];var Dm={};function Bm(e,t){"boolean"==typeof t&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var Fm=Bm;Bm.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},Bm.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},Bm.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=(new Date).getTime()
590
- ;if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var n=this._timeouts.shift();if(void 0===n){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1)}var r=this;return this._timer=setTimeout((function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout((function(){r._operationTimeoutCb(r._attempts)}),r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)}),n),this._options.unref&&this._timer.unref(),!0},Bm.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)},Bm.prototype.try=function(e){
591
- console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},Bm.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},Bm.prototype.start=Bm.prototype.try,Bm.prototype.errors=function(){return this._errors},Bm.prototype.attempts=function(){return this._attempts},Bm.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var o=this._errors[r],i=o.message,a=(e[i]||0)+1;e[i]=a,a>=n&&(t=o,n=a)}return t},function(e){var t=Fm;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))
592
- ;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);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}}}(Dm);var jm=Dm;function Hm(e,t){return new Promise(((n,r)=>{const o=jm.operation(t);o.attempt((async()=>{try{const t=await e();o.retry(),n(t)}catch(e){o.retry(e)||r(e)}}))}))}function qm(e){return Hm((()=>Om(e)))}class Um{constructor(e){this._apiUrl=e.apiUrl,this._routeCache=null,this._linkCache=null}routes(){
593
- return this._routeCache||(this._routeCache=qm(this._apiUrl).then((e=>e.links))),this._routeCache}links(){return this._linkCache||(this._linkCache=this.routes().then((e=>qm(e.links.url)))),this._linkCache}}Um.$inject=["settings"];class $m extends Error{constructor(e,t){super(e),this.cause=t}}class Gm{constructor(e){this.clientId=e.clientId,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 $m("Failed to revoke access token",e)}}authorize(e,t){const n=H(16),r=new Promise(((t,r)=>{e.addEventListener("message",(function o(i){
594
- "object"==typeof i.data&&i.data.state===n&&("authorization_response"===i.data.type&&t(i.data),"authorization_canceled"===i.data.type&&r(new Error("Authorization window was closed")),e.removeEventListener("message",o))}))})),o=new URL(this.authorizationEndpoint);return o.searchParams.set("client_id",this.clientId),o.searchParams.set("origin",e.location.origin),o.searchParams.set("response_mode","web_message"),o.searchParams.set("response_type","code"),o.searchParams.set("state",n),t.location=o.toString(),r.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 Om(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 $m("Failed to fetch access token",e)}return{accessToken:t.access_token,expiresAt:Date.now()+1e3*(t.expires_in-10),refreshToken:t.refresh_token}}static openAuthPopupWindow(e){
595
- const t=`left=${e.screen.width/2-237.5},top=${e.screen.height/2-215},width=475,height=430`,n=e.open("about:blank","Log in to Hypothesis",t);if(!n)throw new Error("Failed to open login window");return n}}class Vm extends om{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;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 Gm({clientId:r.oauthClientId,authorizationEndpoint:e["oauth.authorize"],revokeEndpoint:e["oauth.revoke"],tokenEndpoint:l}),s},m=()=>{var e;return null===(e=P(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)
596
- ;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){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=Gm.openAuthPopupWindow(e),n=await p(),r=await n.authorize(e,t);i=r,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}}
597
- Vm.$inject=["$window","apiRoutes","localStorage","settings","toastMessenger"];class Wm{constructor(e,t){this._annotationsService=e,this._store=t,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),Hm((()=>this._annotationsService.save(t))).catch((()=>{this._failed.add(n)})).finally((()=>{this._saving.delete(n)})))}))}))}isSaving(){return this._saving.size>0}}Wm.$inject=["annotationsService","store"];var Ym=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;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};function Km(e,t,n){
598
- const r=Array.isArray(t),o=()=>r?t.map((e=>e())):t();let i=o();return e((()=>{const e=o();if(r?Ym(e,i):e===i)return;const t=i;i=e,n(e,t)}))}class Xm{constructor(e,t){this._frameSync=e,this._store=t}init(){const e=()=>this._store.profile().features;Km(this._store.subscribe,[e,()=>this._store.frames()],(()=>{this._frameSync.notifyHost("featureFlagsUpdated",e()||{})}))}}function Zm(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())}Xm.$inject=["frameSync","store"];class Jm{constructor({hostFrame:e,source:t}){this._hostFrame=e,this._source=t,this._listeners=new ga}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),
599
- !t)throw new Error("Invalid request of channel/port");const n=H(6);return new Promise(((t,r)=>{const o=()=>{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;Zm(o,{frame1:this._source,frame2:e,type:"offer",requestId:n})&&(clearInterval(i),clearTimeout(a),this._listeners.remove(s),t(l[0]))}));o()}))}}function Qm(e,t,n=[],r=-1){e.postMessage({protocol:"frame-rpc",version:"1.0.0",arguments:n,method:t,sequence:r})}class ef{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 ga,this._listeners.add(t,"unload",(()=>{this._port&&(Qm(this._port,"close"),t!==t.parent&&function(e){const t=e.match(/\bAppleWebKit\/([0-9]+)\b/)
600
- ;return!!t&&!(parseInt(t[1])<=537)}(e)&&t.parent.postMessage({type:"hypothesisPortClosed"},"*",[this._port]))})),this._pendingCalls=[],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(),Qm(e,"connect");for(let[e,t]of this._pendingCalls)this.call(e,...t);this._pendingCalls=[]}destroy(){this._port&&(Qm(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)),Qm(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){
601
- if("close"===t.method){if(this._receivedCloseEvent)return;this._receivedCloseEvent=!0}const e=this._methods.get(t.method);if(!e)return;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 tf({$tag:e,target:t,uri:n}){return{$tag:e,target:t,uri:n}}function nf(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 rf{constructor(e,t,n){this._window=e,this._annotationsService=t,this._store=n,this._portFinder=new Jm({hostFrame:this._window.parent,source:"sidebar"}),this._listeners=new ga,this._hostRPC=new ef,this._guestRPC=new Map,this._nextGuestId=0,this._inFrame=new Set,this._highlightsVisible=!1,this._setupSyncToGuests(),this._setupHostEvents()}_setupSyncToGuests(){let e=0
602
- ;Km(this._store.subscribe,[()=>this._store.allAnnotations(),()=>this._store.frames()],(([t,n],[r])=>{let o=0;const i=new Set,a=[];t.forEach((e=>{Ei(e)||(Li(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=nf(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(tf))}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))}))}_connectGuest(e){const t=new ef;++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({
603
- id:e.frameIdentifier,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=fa((()=>{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=>{
604
- this._store.toggleSelectedAnnotations(this._store.findIDsForTags(e))})),t.on("openSidebar",(()=>{this._hostRPC.call("openSidebar")})),t.on("closeSidebar",(()=>{this._hostRPC.call("closeSidebar")})),t.connect(e),t.call("setHighlightsVisible",this._highlightsVisible)}_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)))}))}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;Zm(t,{frame1:"guest",frame2:"sidebar",type:"offer"})&&this._connectGuest(n[0])}))}notifyHost(e,...t){this._hostRPC.call(e,...t)}focusAnnotations(e){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(),
605
- this._listeners.removeAll()}}function of(e){return Object.keys(e).reduce(((e,t)=>(e[t]=t,e)),{})}rf.$inject=["$window","annotationsService","store"];const af={id:"__default__",name:"__DEFAULT__",logo:"data:image/svg+xml;utf8,"+encodeURIComponent(Jo)};const sf=["organization","scopes"];class lf{constructor(e,t,n,r,o,i){this._store=e,this._api=t,this._auth=n,this._settings=o,this._toastMessenger=i,this._serviceConfig=P(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));return o?"__world__"===r||"__world__"===n?e:e.filter((e=>"__world__"!==e.id)):e}_setupAutoReload(){this._reloadSetUp||(this._reloadSetUp=!0,Km(this._store.subscribe,(()=>this._mainURI()),(()=>{
606
- this.load()})),Km(this._store.subscribe,[()=>this._store.hasFetchedProfile(),()=>this._store.profile().userid],((e,[t])=>{t&&this.load()})))}_addGroupsToStore(e,t){!function(e){e.forEach((e=>{e.organization&&"object"==typeof e.organization||(e.organization=af)}))}(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:sf})}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()),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
607
- ;i&&(a=this._fetchGroup(i).then((e=>(this._store.clearDirectLinkedGroupFetchFailed(),e))).catch((()=>(this._store.setDirectLinkedGroupFetchFailed(),null))));const s={expand:sf},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:sf}),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}async _loadServiceSpecifiedGroups(e){const t=await this._api.profile.groups.read({expand:sf});let n;const r=async e=>{try{return await this._fetchGroup(e)}catch(e){return n=e,null}
608
- },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;if(null!==(e=this._serviceConfig)&&void 0!==e&&e.groups){let e=[];try{e=await this._serviceConfig.groups}catch(e){this._toastMessenger.error(`Unable to fetch group configuration: ${e.message}`)}return this._loadServiceSpecifiedGroups(e)}return this._loadGroupsForUserAndDocument()}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=>!Ei(e))).map((e=>({...e,group:n})));e.length&&this._store.addAnnotations(e),this._store.setDefault("focusedGroup",n)}}leave(e){return this._api.group.member.delete({pubid:e,userid:"me"})}}lf.$inject=["store","api","auth","session","settings","toastMessenger"];class cf{
609
- 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 sm(this._api.search,s),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)})),
610
- 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}),Ei(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),!Ei(t)){const e=t.id;this._streamFilter.addClause("/references","one_of",e,!0).addClause("/id","equals",e,!0),this._streamer.setConfig("filter",{filter:this._streamFilter.getFilter()}),this._streamer.connect()}return r}}cf.$inject=["api","store","streamer","streamFilter"];class uf{constructor(){this._store={}}getItem(e){return e in this._store?this._store[e]:null}
611
- setItem(e,t){this._store[e]=t}removeItem(e){delete this._store[e]}}class hf{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 uf}}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)}}hf.$inject=["$window"];const df={annotationPrivacy:"hypothesis.privacy",focusedGroup:"hypothesis.groups.focus"};class pf{constructor(e,t){this._storage=e,this._store=t}init(){Object.keys(df).forEach((e=>{const t=this._storage.getItem(df[e]);this._store.setDefault(e,t)})),Km(this._store.subscribe,(()=>this._store.getDefaults()),((e,t)=>{for(let n in e)t[n]!==e[n]&&n in df&&this._storage.setItem(df[n],e[n])}))}}pf.$inject=["localStorage","store"];class mf{constructor(e,t){this._window=e,
517
+ ;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(W)}(bd);var wd=bd.exports;const xd=Ds(window);function kd(){return[{type:"output",filter:function(e){return e.replace(/<a href=/g,'<a target="_blank" href=')}}]}let Sd;function Cd(e){return"{math:"+e.toString()+"}"}function Ad(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
518
+ ;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=Cd(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=xd.sanitize(function(e){return Sd||(Sd=new wd.Converter({extensions:[kd],simplifiedAutoLink:!0,literalMidWordUnderscores:!0,strikethrough:!0})),Sd.makeHtml(e)}(t.content)),r=function(e,t){return t.reduce(((e,t)=>{let n;try{n=t.inline?_d(t.expression):_d(t.expression,{displayMode:!0})}catch(e){n=Fs(t.expression)}return e.replace(Cd(t.id),n)}),e)}(n,t.mathBlocks);return r}function Ed({markdown:e="",textClass:t={},textStyle:n={}}){const r=lo((()=>e?Ad(e):""),[e]),o=so();io((()=>{!function(e,{className:t}={}){const n=Array.from(e.getElementsByTagName("a"));for(let e of n){const n=Ha(e);n&&(t?n.className=t:n.style.width="350px")}}(o.current,{className:"w-full md:w-[380px]"})}),[e]);return _o("div",{
519
+ className:"w-full break-words cursor-text",dir:"auto",lang:"",children:_o("div",{className:Yr("styled-text",t),"data-testid":"styled-text",ref:o,dangerouslySetInnerHTML:{__html:r},style:n})})}function Td({children:e}){return _o("ul",{className:"flex flex-wrap gap-2 leading-none","aria-label":"Annotation tags",children:e})}function Nd({href:e,onRemoveTag:t,tag:n}){return _o("li",{className:"flex items-center border rounded-sm bg-grey-0",children:[_o("div",{className:"grow px-1.5 py-1 touch:p-2",children:e?_o(Bo,{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}):_o("span",{className:"text-color-text-light cursor-default","aria-label":`Tag: ${n}`,lang:"",children:n})}),t&&_o("button",{className:Yr("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","hyp-u-outline-on-keyboard-focus--inset"),onClick:()=>{t(n)},
520
+ title:`Remove tag: ${n}`,children:_o(Do,{classes:"font-base",name:"cancel",title:`Remove ${n}`})})]})}xd.addHook("afterSanitizeAttributes",(e=>{"target"in e&&e.setAttribute("target","_blank")}));var Md=ci((function({annotation:e,settings:t}){var n,r;const[o,i]=ro(!0),[a,s]=ro(!1),l=hi(),c=l.defaultAuthority(),u=l.getDraft(e),h=o?"More":"Less",d=null!==(n=null==u?void 0:u.tags)&&void 0!==n?n:e.tags,p=null!==(r=null==u?void 0:u.text)&&void 0!==r?r:e.text,m=p.length>0,f=d.length>0,g=si(["annotationFontFamily"],t),v=lo((()=>e&&!ii(null==e?void 0:e.user,c)),[e,c]),y=e=>l.getLink("search.tag",{tag:e});return _o("div",{className:"space-y-4",children:[m&&_o(Pa,{collapse:o,collapsedHeight:400,inlineControls:!1,onCollapsibleChanged:s,onToggleCollapsed:i,overflowThreshold:20,children:_o(Ed,{textStyle:g,markdown:p,textClass:{"p-redacted-content":Pi(e)}})}),(a||f)&&_o("div",{className:"flex flex-row gap-x-2",children:[_o("div",{className:"grow",children:f&&_o(Td,{children:d.map((e=>_o(Nd,{tag:e,href:v?y(e):void 0},e)))})
521
+ }),a&&_o("div",{children:_o(Ao,{classes:Yr("-mt-3","text-grey-7 font-normal"),expanded:!o,onClick:()=>i(!o),title:`Toggle visibility of full annotation text: Show ${h}`,children:_o("div",{className:"flex items-center gap-x-2",children:[_o(Do,{classes:"!text-tiny",name:o?"expand":"collapse",title:o?"expand":"collapse"}),_o("div",{children:h})]})})})]})]})}),["settings"]);const Ld=0,zd=1;function Od(e,t,n,r){let o=e.selectionStart,i=e.selectionEnd;return o>=t+n?(o+=r.length-n,i+=r.length-n):i<=t||(o<=t&&i>=t+n?i+=r.length-n:o<t&&i<t+n?o=t:o<t+n&&i>t+n?i+=r.length-n:t<o&&t+n>i&&(o=t,i=t+n)),{text:e.text.slice(0,t)+r+e.text.slice(t+n),selectionStart:o,selectionEnd:i}}function Id(e,t=Ld){const n=e.text.slice(e.selectionStart,e.selectionEnd);let r,o="";if(t===zd&&(o="!"),n.match(/[a-z]+:\/\/.*/)){const t="Description";return r=Od(e,e.selectionStart,n.length,o+"["+t+"]("+n+")"),r.selectionStart=e.selectionStart+o.length+1,r.selectionEnd=r.selectionStart+t.length,r}{
522
+ const t=o+"["+n+"](",i="http://insert-your-link-here.com";return r=Od(e,e.selectionStart,n.length,t+i+")"),r.selectionStart=e.selectionStart+t.length,r.selectionEnd=r.selectionStart+i.length,r}}function Pd(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=Od(e,e.selectionStart,0,r),a.selectionStart=a.selectionEnd-r.length),o===t&&i===n?(a=Od(a,a.selectionStart-t.length,t.length,""),a=Od(a,a.selectionEnd,n.length,"")):(a=Od(a,a.selectionStart,0,t),a=Od(a,a.selectionEnd,0,n)),a}function Rd(e,t){const n=e.indexOf("\n",t);return n<0?e.length:n}function Dd(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=Rd(e.text,t);for(;i<=Rd(e.text,n);){const t=i===e.text.length,a=i-o,s=Rd((e=r(e,o,i)).text,o)-o;if(n+=s-a,t)break;o=o+s+1,i=Rd(e.text,o)}return e}function Bd(e,t){const n=e.selectionStart,r=e.selectionEnd;let o=!0
523
+ ;return Dd(e,n,r,((e,n)=>(e.text.slice(n,n+t.length)!==t&&(o=!1),e))),Dd(e,n,r,o?(e,n)=>Od(e,n,t.length,""):(e,n)=>e.text.slice(n,n+t.length)===t?e:Od(e,n,0,t))}const Fd={bold:"b",italic:"i",link:"l",quote:"q",image:"g",numlist:"o",list:"u"};function jd({buttonRef:e,disabled:t=!1,iconName:n="",label:r,onClick:o,shortcutKey:i,tabIndex:a,title:s=""}){const l=lo((()=>((e=window.navigator.userAgent)=>e.indexOf("Mac OS")>=0)()?"Cmd":"Ctrl"),[]);let c=s;i&&(c+=` (${l}-${i.toUpperCase()})`);const u={buttonRef:e,disabled:t,icon:n,onClick:o,tabIndex:a,title:c};return r?_o(Ao,{classes:"font-normal TransparentButton",...u,children:r}):_o(Co,{classes:"MarkdownEditor__toolbar-button",...u})}function Hd({isPreviewing:e,onCommand:t,onTogglePreview:n}){const r=0,o=1,i=2,a=3,s=4,l=5,c=6,u=7,h=8,d=9,p=10,[m,f]=ro(0),g=so([]).current;if(0===g.length)for(let e=0;e<=p;e++)g.push({current:null});const v=e=>m===e?0:-1;return _o("div",{
524
+ className:"hyp-u-layout-row hyp-u-border--left hyp-u-border--right hyp-u-border--top hyp-u-bg-color--white MarkdownEditor__toolbar",role:"toolbar","aria-label":"Markdown editor toolbar",onKeyDown:t=>{let n=0;const r=p-1;e&&(n=h);let o=null;switch(Fo(t.key)){case"ArrowLeft":o=m<=n?r:m-1;break;case"ArrowRight":o=m>=r?n:m+1;break;case"Home":o=n;break;case"End":o=r}var i;null!==o&&(f(i=o),g[i].current.focus(),t.preventDefault())},children:[_o(jd,{disabled:e,iconName:"format-bold",onClick:()=>t("bold"),shortcutKey:Fd.bold,buttonRef:g[r],tabIndex:v(r),title:"Bold"}),_o(jd,{disabled:e,iconName:"format-italic",onClick:()=>t("italic"),shortcutKey:Fd.italic,buttonRef:g[o],tabIndex:v(o),title:"Italic"}),_o(jd,{disabled:e,iconName:"format-quote",onClick:()=>t("quote"),shortcutKey:Fd.quote,buttonRef:g[i],tabIndex:v(i),title:"Quote"}),_o(jd,{disabled:e,iconName:"link",onClick:()=>t("link"),shortcutKey:Fd.link,buttonRef:g[a],tabIndex:v(a),title:"Insert link"}),_o(jd,{disabled:e,iconName:"image",onClick:()=>t("image"),
525
+ shortcutKey:Fd.image,buttonRef:g[s],tabIndex:v(s),title:"Insert image"}),_o(jd,{disabled:e,iconName:"format-functions",onClick:()=>t("math"),buttonRef:g[l],tabIndex:v(l),title:"Insert math (LaTeX is supported)"}),_o(jd,{disabled:e,iconName:"format-list-numbered",onClick:()=>t("numlist"),shortcutKey:Fd.numlist,buttonRef:g[c],tabIndex:v(c),title:"Numbered list"}),_o(jd,{disabled:e,iconName:"format-list-unordered",onClick:()=>t("list"),shortcutKey:Fd.list,buttonRef:g[u],tabIndex:v(u),title:"Bulleted list"}),_o("span",{className:"hyp-u-stretch"}),_o("div",{className:"hyp-u-layout-row--center",children:_o(Bo,{href:"https://web.hypothes.is/help/formatting-annotations-with-markdown/",target:"_blank",classes:"text-tiny IconOnlyLink",linkRef:g[h],tabIndex:v(h),title:"Formatting help","aria-label":"Formatting help",children:_o(Do,{name:"help"})})}),_o(jd,{label:e?"Write":"Preview",onClick:n,buttonRef:g[d],tabIndex:v(d)})]})}function qd({label:e="",onEditText:t=(()=>{}),text:n="",textStyle:r={}}){
526
+ const[o,i]=ro(!1),a=so(null);io((()=>{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)?Pd(e,"$$","$$","Insert LaTeX"):Pd(e,"\\(","\\)","Insert LaTeX")};switch(e){case"bold":n((e=>Pd(e,"**","**","Bold")));break;case"italic":n((e=>Pd(e,"*","*","Italic")));break;case"quote":n((e=>Bd(e,"> ")));break;case"link":n((e=>Id(e)));break;case"image":n((e=>Id(e,zd)));break;case"math":n(r);break;case"numlist":n((e=>Bd(e,"1. ")));break;case"list":n((e=>Bd(e,"* ")));break;default:throw new Error(`Unknown toolbar command "${e}"`)}}(e,a.current),t({text:a.current.value}))};return _o("div",{className:"leading-none",children:[_o(Hd,{onCommand:s,isPreviewing:o,onTogglePreview:()=>i(!o)
527
+ }),o?_o(Ed,{markdown:n,textClass:{"hyp-u-border":!0,"hyp-u-bg-color--grey-1":!0,"hyp-u-padding":!0},textStyle:r}):_o("textarea",{"aria-label":e,className:"MarkdownEditor__input",dir:"auto",ref:a,onClick:e=>e.stopPropagation(),onKeyDown:e=>{if(e.ctrlKey||e.metaKey)for(let[t,n]of Object.entries(Fd))n===Fo(e.key)&&(e.stopPropagation(),e.preventDefault(),s(t))},onInput:e=>{t({text:e.target.value})},value:n,style:r})]})}const Ud=e=>e;function $d({activeItem:e=-1,id:t,itemPrefixId:n,list:r,listFormatter:o=Ud,onSelectItem:i,open:a=!1}){const s=lo((()=>r.map(((t,r)=>{const a=n?{id:`${n}${r}`}:{};return _o("li",{role:"option","aria-selected":(e===r).toString(),className:Yr({"is-selected":e===r},"AutocompleteList__li"),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 _o("div",{className:Yr({"is-hidden":c},"AutocompleteList"),children:_o("ul",{className:"AutocompleteList__items",tabIndex:-1,"aria-label":"Suggestions",role:"listbox",...l,children:s
528
+ })})}let Gd=0;var Vd=ci((function({onAddTag:e,onRemoveTag:t,onTagInput:n,tagList:r,tags:o}){const i=so(),[a,s]=ro([]),[l,c]=ro(-1),[u,h]=ro(!1),[d]=ro((()=>(++Gd,`TagEditor-${Gd}`))),p=so();Ho(p,u,(()=>{h(!1)}));const m=()=>i.current.value.trim(),f=()=>m()&&m().length>0,g=()=>{i.current.value="",null==n||n("")},v=t=>{e(t)&&(h(!1),c(-1),g(),i.current.focus())},y=e=>{let t=l+e;t<-1?t=a.length-1:t>=a.length&&(t=-1),c(t)},_=l>=0?`${d}-AutocompleteList-item-${l}`:"";return _o("div",{className:"TagEditor space-y-4",children:[_o(Td,{children:r.map((e=>_o(Nd,{onRemoveTag:t,tag:e},e)))}),_o("div",{id:d,className:"TagEditor__combobox-wrapper",ref:p,role:"combobox","aria-expanded":u.toString(),"aria-owns":`${d}-AutocompleteList`,"aria-haspopup":"listbox",children:[_o("input",{onInput:()=>{null==n||n(m()),(()=>{if(f()){const e=o.filter(m());s(((e,t)=>{const n=[];return e.forEach((e=>{t.indexOf(e)<0&&n.push(e)})),n.sort()})(e,r)),h(e.length>0)}else h(!1);c(-1)})()},onKeyDown:e=>{switch(Fo(e.key)){case"ArrowUp":y(-1),
529
+ e.preventDefault();break;case"ArrowDown":y(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)},ref:i,placeholder:"Add new tags",className:"TagEditor__input",type:"text",autoComplete:"off","aria-autocomplete":"list","aria-activedescendant":_,"aria-controls":`${d}-AutocompleteList`,dir:"auto"}),_o($d,{id:`${d}-AutocompleteList`,list:a,listFormatter:e=>{const t=m().toLowerCase(),n=e.toLowerCase().indexOf(t);if(-1===n)return _o("span",{children:e});const r=e.slice(0,n),o=e.slice(n,n+t.length),i=e.slice(n+t.length);return _o("span",{children:[_o("strong",{children:r}),o,_o("strong",{children:i})]})},open:u,onSelectItem:e=>{e&&v(e)},itemPrefixId:`${d}-AutocompleteList-item-`,activeItem:l})]})]})}),["tags"]);function Wd(){return _o("div",{className:"hyp-u-padding--top hyp-u-border--top text-sm leading-none",children:_o(Bo,{
530
+ classes:"hyp-u-layout-row--align-center p-link--muted",href:"http://creativecommons.org/publicdomain/zero/1.0/",target:"_blank",title:"View more information about the Creative Commons Public Domain dedication",children:[_o(Do,{name:"cc-std",classes:"text-tiny"}),_o(Do,{name:"cc-zero",classes:"hyp-u-margin--left--1 text-tiny"}),_o("div",{className:"hyp-u-margin--left--2",children:"Annotations can be freely reused by anyone for any purpose."})]})})}function Yd(e){return null!==e.offsetParent}function Kd({className:e,closeMenu:t,children:n,visible:r}){const o=so();io((()=>{let e=null;return r&&(e=setTimeout((()=>{const e=o.current.querySelector('[role^="menuitem"]');e&&e.focus()}))),()=>{clearTimeout(e)}}),[r]);return _o("div",{role:"menu",className:e,ref:o,onKeyDown:e=>{const n=Array.from(o.current.querySelectorAll('[role^="menuitem"]')).filter(Yd);let r=n.findIndex((e=>e.contains(document.activeElement))),i=!1;switch(Fo(e.key)){case"ArrowLeft":case"Escape":t&&(t(e),i=!0);break;case"ArrowUp":r-=1,
531
+ 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})}function Xd({className:e}){return _o("svg",{className:Yr("Menu__arrow",e),width:15,height:8,children:_o("path",{d:"M0 8 L7 0 L15 8",stroke:"currentColor",strokeWidth:"2"})})}let Zd=!1;const Jd=()=>{};function Qd({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]=ro(i);"boolean"==typeof s&&(h=s,d=l||Jd);const p=so(h);io((()=>{"function"==typeof l&&p.current!==h&&(p.current=h,l(h))}),[h,l]);const f=e=>{if("mousedown"===e.type)Zd=!0;else if("click"===e.type&&Zd)return Zd=!1,e.stopPropagation(),void e.preventDefault();d(!h)},g=co((()=>d(!1)),[d]),v=so();Ho(v,h,g);const y=e=>e.stopPropagation();return _o("div",{className:"Menu",ref:v,style:{position:r?"relative":"static"},onClick:y,
532
+ onMouseDown:y,children:[_o("button",{"aria-expanded":h?"true":"false","aria-haspopup":!0,className:"Menu__toggle",onMouseDown:f,onClick:f,"aria-label":u,title:u,children:_o("span",{className:"Menu__toggle-wrapper",children:[a,c&&_o("span",{className:Yr("Menu__toggle-arrow",h&&"is-open"),children:_o(wo,{name:"expand-menu",className:"Menu__toggle-icon"})})]})}),h&&_o(m,{children:[_o(Xd,{className:t}),_o("div",{className:Yr("Menu__content",`Menu__content--align-${e}`,o),role:"menu",tabIndex:-1,onClick:g,onKeyDown:e=>{const t=Fo(e.key);"Enter"!==t&&" "!==t||setTimeout((()=>{g()}))},children:_o(Kd,{visible:!0,children:n})})]})]})}function ep({children:e,visible:t}){const n=so(),[r,o]=ro(t?"auto":0),[i,a]=ro(t);io((()=>{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 _o("div",{ontransitionend:co((()=>{t?o("auto"):a(!1)}),[o,t]),ref:n,style:{display:i?"":"none",height:r,
533
+ overflow:"auto"===r?"visible":"hidden",transition:"height 0.15s ease-in"},children:e})}function tp({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=t||a,f=t&&a,g=so();let v=null,y=null;t&&"blank"!==t&&(y=d?_o("img",{className:"MenuItem__icon",alt:n,src:t}):_o(wo,{name:t,className:"MenuItem__icon"}));const _=a?null:y,b=a?y:null;let w;const x="boolean"==typeof s,k="boolean"==typeof i;io((()=>()=>{clearTimeout(v)}),[]);const S=e=>{switch(Fo(e.key)){case"ArrowRight":u&&(e.stopPropagation(),e.preventDefault(),u(e));break;case"Enter":case" ":c&&c(e)}};return w=e?_o("a",{ref:g,className:Yr("MenuItem",{"is-submenu":a,"is-disabled":r}),href:e,target:"_blank",tabIndex:-1,rel:"noopener noreferrer",role:"menuitem",onKeyDown:S,children:[p&&_o("div",{className:"MenuItem__icon-container",children:_}),_o("span",{className:"MenuItem__label",children:l}),f&&_o("div",{
534
+ className:"MenuItem__icon-container",children:b})]}):_o("div",{ref:g,className:Yr("MenuItem",{"is-submenu":a,"is-disabled":r,"is-expanded":o,"is-selected":i}),tabIndex:-1,onKeyDown:S,onClick:c,role:k?"menuitemradio":"menuitem","aria-checked":k?i:void 0,"aria-haspopup":x,"aria-expanded":x?s:void 0,children:[p&&_o("div",{className:"MenuItem__icon-container",children:_}),_o("span",{className:"MenuItem__label",children:l}),f&&_o("div",{className:"MenuItem__icon-container",children:b}),x&&_o("div",{role:"none",icon:s?"collapse-menu":"expand-menu",className:"MenuItem__toggle",onClick:u,title:`Show actions for ${l}`,children:_o(wo,{name:s?"collapse-menu":"expand-menu",className:"MenuItem__toggle-icon"})})]}),_o(m,{children:[w,x&&_o(ep,{visible:s,children:_o(Kd,{closeMenu:e=>{u&&u(e),v=setTimeout((()=>{g.current.focus()}))},visible:s,className:"MenuItem__submenu",children:h})})]})}var np=ci((function({annotation:e,isDisabled:t,onSave:n,settings:r}){const o=hi(),i=o.getDraft(e),a=o.getGroup(e.group);if(!a)return null
535
+ ;const s=i?i.isPrivate:!Ca(e.permissions),l=s?"Only Me":a.name,c=t=>{o.createDraft(e,{...i,isPrivate:"private"===t}),Ni(e)||o.setDefault("annotationPrivacy",t)},u=si(["ctaTextColor","ctaBackgroundColor"],r),h=_o("div",{className:"annotation-publish-button__menu-label",style:u,children:_o(Do,{name:"expand-menu"})});return _o("div",{className:"hyp-u-layout-row hyp-u-horizontal-spacing--4",children:[_o("div",{className:"annotation-publish-button",children:[_o(Ao,{classes:"PublishControlButton","data-testid":"publish-control-button",style:u,onClick:n,disabled:t,size:"large",variant:"primary",children:["Post to ",l]}),_o("div",{className:"annotation-publish-button__menu-wrapper",style:u,children:_o(Qd,{arrowClass:"annotation-publish-button__menu-arrow",containerPositioned:!1,contentClass:"annotation-publish-button__menu-content",label:h,menuIndicator:!1,title:"Change annotation sharing setting",align:"left",children:[_o(tp,{icon:"open"===a.type?"public":"groups",label:a.name,isSelected:!s,onClick:()=>c("shared")
536
+ }),_o(tp,{icon:"lock",label:"Only Me",isSelected:s,onClick:()=>c("private")})]})})]}),_o("div",{children:_o(Ao,{icon:"cancel",onClick:()=>{o.removeDraft(e),Li(e)&&o.removeAnnotations([e])},size:"large",children:"Cancel"})})]})}),["settings"]);var rp=ci((function({annotation:e,annotationsService:t,settings:n,tags:r,toastMessenger:o}){const[i,a]=ro(null),s=hi(),l=s.getDraft(e),c=s.getGroup(e.group);if(!l)return null;const u=!l.isPrivate&&c&&"private"!==c.type,h=l.tags,d=l.text,p=!d&&!h.length,m=({tags:e})=>{s.createDraft(l.annotation,{...l,tags:e})},f=e=>{if(!e||h.indexOf(e)>=0)return!1;const t=[...h,e];return r.store(t),m({tags:t}),!0},g=async()=>{i&&f(i);try{await t.save(e)}catch(e){o.error("Saving annotation failed")}};return _o("div",{className:"hyp-u-vertical-spacing AnnotationEditor",onKeyDown:e=>{const t=Fo(e.key);p||(e.metaKey||e.ctrlKey)&&"Enter"===t&&(e.stopPropagation(),e.preventDefault(),g())},children:[_o(qd,{textStyle:si(["annotationFontFamily"],n),label:"Annotation body",text:d,
537
+ onEditText:({text:e})=>{s.createDraft(l.annotation,{...l,text:e})}}),_o(Vd,{onAddTag:f,onRemoveTag:e=>{const t=[...h],n=t.indexOf(e);return n>=0&&(t.splice(n,1),m({tags:t}),!0)},onTagInput:a,tagList:h}),_o("div",{className:"hyp-u-layout-row annotation__form-actions",children:_o(np,{annotation:e,isDisabled:p,onSave:g})}),u&&_o(Wd,{})]})}),["annotationsService","settings","tags","toastMessenger"]);function op(e,t,n){var r;return(n||t)&&null!==(r=e.user_info)&&void 0!==r&&r.display_name?e.user_info.display_name:oi(e.user)}function ip({domain:e,link:t,title:n}){return _o("div",{className:"hyp-u-layout-row hyp-u-horizontal-spacing--2",children:[_o("div",{className:"text-color-text-light",children:['on "',t?_o(Bo,{href:t,target:"_blank",children:n}):_o("span",{children:n}),'"']}),e&&_o("span",{className:"text-color-text-light",children:["(",e,")"]})]})}function ap({annotation:e}){const t=hi().getGroup(e.group),n=null==t?void 0:t.links.html,r=Aa(e.permissions);return _o("div",{
538
+ className:"hyp-u-layout-row--align-baseline",children:[t&&n&&_o(Bo,{classes:"hyp-u-layout-row--align-baseline hyp-u-horizontal-spacing--2 p-link--muted p-link--hover-muted",href:t.links.html,target:"_blank",children:["open"===t.type?_o(Do,{classes:"text-tiny",name:"public"}):_o(Do,{classes:"text-tiny",name:"groups"}),_o("span",{children:t.name})]}),r&&!n&&_o("span",{className:"hyp-u-layout-row--align-baseline text-color-text-light",children:_o("span",{"data-testid":"private-info",children:"Only me"})})]})}let sp={};function lp(e,t){return t-e}function cp(e,t,n=window.Intl){const r=JSON.stringify(t);let o=sp[r];return o||(o=sp[r]=new n.DateTimeFormat(void 0,t)),o.format(e)}const up=[{test:(e,t)=>lp(e,t)<3e4,formatter:()=>"Just now",nextUpdate:1e3},{test:(e,t)=>lp(e,t)<6e4,formatter:function(e,t){return`${Math.floor(lp(e,t)/1e3)} secs ago`},nextUpdate:1e3},{test:(e,t)=>lp(e,t)<36e5,formatter:function(e,t){const n=Math.floor(lp(e,t)/6e4);return`${n} min${n>1?"s":""} ago`},nextUpdate:6e4},{
539
+ test:(e,t)=>lp(e,t)<864e5,formatter:function(e,t){const n=Math.floor(lp(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 cp(e,{month:"short",day:"numeric"},n)},nextUpdate:null}],hp={test:()=>!0,formatter:function(e,t,n){return cp(e,{day:"numeric",month:"short",year:"numeric"},n)},nextUpdate:null};function dp(e,t){for(let n of up)if(n.test(e,t))return n;return hp}function pp(e){return!isNaN(e.valueOf())}function mp(e,t){let n;const r=new Date(e),o=()=>{const e=function(e,t){if(!e||!pp(e)||!pp(t))return null;let n=dp(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 fp(e,t,n){return e?dp(e,t).formatter(e,t,n):""}function gp(e,t){return cp(e,{year:"numeric",month:"short",day:"2-digit",weekday:"long",hour:"2-digit",minute:"2-digit"},t)}
540
+ function vp({annotationCreated:e,annotationUpdated:t,annotationUrl:n,withEditedTimestamp:r}){const[o,i]=ro((()=>new Date)),a=lo((()=>new Date(e)),[e]),s=lo((()=>r&&new Date(t)),[t,r]),l=lo((()=>({absolute:gp(a),relative:fp(a,o)})),[a,o]),c=lo((()=>s?{absolute:gp(s),relative:fp(s,o)}:{}),[s,o]);io((()=>mp(s?t:e,(()=>i(new Date)))),[e,t,a,s,o]);const u=c&&c.relative!==l.relative?`edited ${c.relative}`:"edited";return _o("div",{children:[r&&_o("span",{className:"text-color-text-light text-sm italic","data-testid":"timestamp-edited",title:c.absolute,children:["(",u,")"," "]}),n?_o(Bo,{classes:"p-link--muted p-link--hover-muted",target:"_blank",title:l.absolute,href:n,children:l.relative}):_o("span",{className:"color-text-color-light","data-testid":"timestamp-created",title:l.absolute,children:l.relative})]})}function yp({authorLink:e,displayName:t}){const n=_o("h3",{className:"text-color-text font-bold",children:t});return e?_o(Bo,{href:e,target:"_blank",children:n}):_o("div",{children:n})}
541
+ var _p=ci((function({annotation:e,isEditing:t,replyCount:n,threadIsCollapsed:r,settings:o}){var i;const a=hi(),s=a.defaultAuthority(),l=a.isFeatureEnabled("client_display_names"),c=ii(e.user,s),u=op(e,c,l),h=(()=>{var t;return c?null!==(t=o.usernameUrl&&`${o.usernameUrl}${oi(e.user)}`)&&void 0!==t?t:void 0:a.getLink("user",{user:e.user})})(),d=Ni(e)&&r,p=Aa(e.permissions),m=(null===(i=e.links)||void 0===i?void 0:i.html)||"",f=!t&&e.created,g=lo((()=>function(e){if(!e.updated||!e.created||e.updated===e.created)return!1;const t=new Date(e.created).getTime(),n=new Date(e.updated).getTime();return!isNaN(t)&&!isNaN(n)&&n-t>2e3}(e)&&!d),[e,d]),v=`${n} ${n>1?"replies":"reply"}`,y=n>0&&d,_=!Ni(e),b=function(e){return{domain:Ei(e),titleText:Ti(e),titleLink:Ai(e)}}(e),w=m&&b.titleLink?b.titleLink:"",x="sidebar"!==a.route()&&b.titleText;return _o("header",{children:[_o("div",{className:"hyp-u-layout-row--align-baseline hyp-u-horizontal-spacing--2 flex-wrap-reverse",children:[p&&!t&&_o(Do,{classes:"text-tiny",
542
+ name:"lock",title:"This annotation is visible only to you"}),_o(yp,{authorLink:h,displayName:u}),y&&_o(Eo,{onClick:()=>a.setExpanded(e.id,!0),title:"Expand replies",children:v}),f&&_o("div",{className:"hyp-u-layout-row--justify-right hyp-u-stretch",children:_o(vp,{annotationCreated:e.created,annotationUpdated:e.updated,annotationUrl:m,withEditedTimestamp:g})})]}),_&&_o("div",{className:"hyp-u-layout-row--align-baseline hyp-u-horizontal-spacing--2 flex-wrap-reverse",children:[_o(ap,{annotation:e}),!t&&Ri(e)&&_o(Do,{name:"highlight",title:"This is a highlight. Click 'edit' to add a note or tag.",classes:"text-tiny text-color-text-light"}),x&&_o(ip,{domain:b.domain,link:w,title:b.titleText})]})]})}),["settings"]);var bp=ci((function({annotation:e,isFocused:t,settings:n={}}){return _o("div",{className:Yr({"is-orphan":Di(e)}),children:_o(Pa,{collapsedHeight:35,inlineControls:!0,overflowThreshold:20,children:_o("blockquote",{className:Yr("p-quoted-text",{"is-focused":t,"p-redacted-content":Di(e)}),dir:"auto",
543
+ lang:"",style:si(["selectionFontFamily"],n),children:Hi(e)})})})}),["settings"]);function wp({onToggleReplies:e,replyCount:t,threadIsCollapsed:n}){const r=`${n?"Show replies":"Hide replies"} (${t})`;return _o(Eo,{onClick:e,title:r,children:r})}var xp=ci((function({annotation:e,hasAppliedFilter:t,isReply:n,onToggleReplies:r,replyCount:o,threadIsCollapsed:i,annotationsService:a}){const s=n&&i,l=hi(),c=e&&!!Hi(e),u=e&&l.isAnnotationFocused(e.$tag),h=e&&l.isSavingAnnotation(e),d=e&&!!l.getDraft(e)&&!h,p=l.profile().userid,f=!h&&!d,g=!n&&!t&&o>0;return _o("article",{className:Yr("hyp-u-vertical-spacing",{"is-collapsed":i,"is-focused":u}),children:[e&&_o(m,{children:[_o(_p,{annotation:e,isEditing:d,replyCount:o,threadIsCollapsed:i}),c&&_o(bp,{annotation:e,isFocused:u}),!s&&!d&&_o(Md,{annotation:e}),d&&_o(rp,{annotation:e})]}),!e&&!s&&_o("div",{children:_o("em",{children:"Message not available."})}),!s&&_o("footer",{children:_o("div",{className:"hyp-u-layout-row",children:[g&&_o(wp,{onToggleReplies:r,replyCount:o,
544
+ threadIsCollapsed:i}),h&&_o("div",{className:"hyp-u-layout-row--justify-right hyp-u-stretch","data-testid":"saving-message",children:"Saving..."}),e&&f&&Mi(e)&&_o(Mo,{classes:"hyp-u-stretch",children:_o(za,{annotation:e,onReply:()=>{e&&Mi(e)&&a.reply(e,p)}})})]})})]})}),["annotationsService"]);var kp=ci((function({annotation:e,api:t,toastMessenger:n}){const r=hi(),o=function(e){return e.moderation?e.moderation.flagCount:null}(e);return null!==o&&(o>0||e.hidden)?_o("div",{className:Yr("flex gap-x-3 bg-grey-1 text-color-text font-semibold","mb-2 ",{"-mt-3 -ml-3 -mr-3":!Ni(e),"-mr-3":Ni(e)}),children:[_o("div",{className:Yr("p-3 text-white",{"bg-red-error":!e.hidden,"bg-grey-6":e.hidden}),children:_o(Do,{name:e.hidden?"hide":"flag"})}),_o("div",{className:"self-center grow",children:[!e.hidden&&_o("span",{children:["Flagged for review by ",o," ",1===o?"user":"users"]}),e.hidden&&_o("span",{children:"Hidden from users"})]}),_o("div",{className:"self-center pr-2",children:_o(Ao,{classes:"py-1 bg-slate-1",
545
+ 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 Sp({annotation:e,...t}){const n=hi(),r=e&&n.isSavingAnnotation(e),o=e&&!!n.getDraft(e)&&!r;return e?_o("div",{className:"Thread__top-annotation-header",children:_o(_p,{annotation:e,isEditing:o,...t})}):null}var Cp=ci((function e({thread:t,threadsService:n}){
546
+ const r=!t.collapsed,o=Ki(t)>0,i=!!t.parent,a=t.collapsed?"collapsed":"expand-menu",s=t.collapsed?"Expand replies":"Collapse replies",l=t.children.filter((e=>Xi(e)>0)),c=hi(),u=c.hasAppliedFilter(),h=co((()=>c.setExpanded(t.id,!!t.collapsed)),[c,t.id,t.collapsed]),d=lo((()=>t.visible&&_o(m,{children:[t.annotation&&_o(kp,{annotation:t.annotation}),_o(xp,{annotation:t.annotation,hasAppliedFilter:u,isReply:!!t.parent,onToggleReplies:h,replyCount:t.replyCount,threadIsCollapsed:t.collapsed})]})),[u,h,t.annotation,t.parent,t.replyCount,t.collapsed,t.visible]);return _o("section",{className:Yr("Thread",{"Thread--reply":t.depth>0,"is-collapsed":t.collapsed}),children:[i&&_o("div",{className:"Thread__collapse",children:_o("div",{className:"Thread__collapse-button-container",children:_o(Co,{classes:"NonResponsiveIconButton",expanded:!t.collapsed,icon:a,title:s,onClick:h,size:"medium",variant:"light"})})}),_o("div",{className:"Thread__content",children:[d,o&&_o(m,{children:[!t.parent&&_o(Sp,{annotation:t.annotation,
547
+ replyCount:t.replyCount,threadIsCollapsed:t.collapsed}),_o("div",{className:"Thread__hidden-toggle-button-container",children:_o(Ao,{onClick:()=>n.forceVisible(t),children:["Show ",Ki(t)," more in conversation"]})})]}),r&&_o("ul",{className:"Thread__children",children:l.map((t=>_o("li",{children:_o(e,{thread:t,threadsService:n})},t.id)))})]})]})}),["threadsService"]);var Ap=ci((function({frameSync:e,thread:t}){const n=hi(),r=t.annotation&&t.annotation.$tag,o=r&&n.isAnnotationFocused(r),i=lo((()=>va((t=>{const n=t?[t]:[];e.focusAnnotations(n)}),10)),[e]),a=co((t=>{e.scrollToAnnotation(t)}),[e]),s=lo((()=>_o(Cp,{thread:t})),[t]);return _o("div",{onClick:e=>{var t;(t=e.target).closest("button")||t.closest("a")||a(r)},onMouseEnter:()=>i(r),onMouseLeave:()=>i(null),className:Yr("ThreadCard p-3",{"is-focused":o}),children:s},t.id)}),["frameSync"]);function Ep(){const e=document.querySelector(".js-thread-list-scroll-root");if(!e)throw new Error("Scroll container is missing");return e}function Tp(e){
548
+ return Math.max(e-e%50,0)}function Np({threads:e}){const[t,n]=ro(0),[r,o]=ro(0);ao((()=>{const e=new ya,t=Ep();n(t.clientHeight),o(Tp(t.scrollTop));const r=va((()=>{n(t.clientHeight),o(Tp(t.scrollTop))}),10,{maxWait:100});return e.add(t,"scroll",r),e.add(window,"resize",r),()=>{e.removeAll(),r.cancel()}}),[]);const[i,a]=ro({}),[s,l]=ro(null),c=e,{offscreenLowerHeight:u,offscreenUpperHeight:h,visibleThreads:d}=lo((()=>function(e,t,n,r,o=_a){const{defaultHeight:i,marginAbove:a,marginBelow:s}=o,l=[];let c=0,u=0,h=0;return e.forEach((e=>{const o=t[e.id]||i;c+o<n-a?u+=o:c<n+r+s?l.push(e):h+=o,c+=o})),{visibleThreads:l,offscreenUpperHeight:u,offscreenLowerHeight:h}}(c,i,r,t)),[c,i,r,t]),p=hi(),m=(()=>{const e=p.unsavedAnnotations();return e.length?e[e.length-1].$tag:null})();return io((()=>{m&&(p.setForcedVisible(m,!0),l(m))}),[p,m]),io((()=>{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[e.id]||_a.defaultHeight)(t)),0);Ep().scrollTop=t
549
+ }),[s,c,i]),io((()=>{a((e=>{const t={};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=ba(r);o!==e[n]&&(t[n]=o)}return 0===Object.keys(t).length?e:{...e,...t}}))}),[d]),_o("div",{children:[_o("div",{style:{height:h}}),d.map((e=>_o("div",{className:"ThreadList__card",id:e.id,children:_o(Ap,{thread:e})},e.id))),_o("div",{style:{height:u}})]})}function Mp({errorType:e,onLoginRequest:t,showClearSelection:n=!1}){const r=hi(),o=r.isLoggedIn();return _o("div",{className:"mb-4",children:_o(Wo,{icon:"restricted",title:"annotation"===e?"Annotation unavailable":"Group unavailable",children:[_o("p",{
550
+ 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.`}),_o("div",{className:"hyp-u-layout-row--justify-right hyp-u-horizontal-spacing",children:[n&&_o(Ao,{variant:o?"primary":void 0,onClick:()=>r.clearSelection(),children:"Show all annotations"}),!o&&_o(Ao,{variant:"primary",onClick:t,children:"Log in"})]})]})})}var Lp=ci((function({loadAnnotationsService:e,onLogin:t}){const n=hi(),r=n.routeParams().id,o=na(),i=n.profile().userid,[a,s]=ro(!1);return io((()=>{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))),t.id!==r&&n.highlightAnnotations([r]))})).catch((()=>{s(!0)}))
551
+ }),[r,i,e,n]),_o(m,{children:[a&&_o(Mp,{errorType:"annotation",onLoginRequest:t}),_o(Np,{threads:o.children})]})}),["loadAnnotationsService"]);function zp({actionButton:e,additionalCount:t=0,entitySingular:n="annotation",entityPlural:r="annotations",filterQuery:o,focusDisplayName:i,resultCount:a}){return _o("div",{className:"FilterStatus",children:hi().isLoading()?_o("div",{className:"hyp-u-layout-row--center",children:_o(Ko,{})}):_o("div",{className:"hyp-u-layout-row--align-center",children:[_o("div",{className:"FilterStatus__text",children:[a>0&&_o("span",{children:"Showing "}),_o("span",{className:"filter-facet",children:[a>0?a:"No"," ",1===a?n:r]}),o&&_o("span",{children:[" ","for"," ",_o("span",{className:"filter-facet--pre",children:`'${o}'`})]}),i&&_o("span",{children:[" ","by ",_o("span",{className:"filter-facet",children:i})]}),t>0&&_o("span",{className:"filter-facet--muted",children:[" ","(and ",t," more)"]})]}),_o("div",{children:e})]})})}function Op({filterState:e,rootThread:t}){
552
+ const n=hi(),r=n.directLinkedAnnotationId(),o=n.annotationCount(),i=(t.children||[]).filter((e=>e.annotation&&e.visible)).length-e.selectedCount,a=!e.focusConfigured&&!r?`Show all (${o})`:"Show all",s=_o(Ao,{title:a,variant:"primary",onClick:()=>n.clearSelection(),icon:"cancel",children:a});return _o(zp,{resultCount:e.selectedCount,additionalCount:i,actionButton:s})}function Ip({filterState:e,rootThread:t}){const n=hi(),r=Xi(t)-e.forcedVisibleCount,o=_o(Ao,{icon:"cancel",variant:"primary",title:"Clear search",onClick:()=>n.clearSelection(),children:"Clear search"});return _o(zp,{actionButton:o,additionalCount:e.forcedVisibleCount,entitySingular:"result",entityPlural:"results",filterQuery:e.filterQuery,focusDisplayName:e.focusDisplayName,resultCount:r})}function Pp({filterState:e,rootThread:t}){const n=hi(),r=Xi(t)-e.forcedVisibleCount,o={};e.forcedVisibleCount>0?(o.onClick=()=>n.clearSelection(),o.title="Reset filters"):(o.onClick=()=>n.toggleFocusMode(),
553
+ o.title=e.focusActive?"Show all":`Show only ${e.focusDisplayName}`);const i=e.focusActive?e.focusDisplayName:"",a=_o(Ao,{variant:"primary",...o,children:o.title});return _o(zp,{resultCount:r,actionButton:a,additionalCount:e.forcedVisibleCount,filterQuery:e.filterQuery,focusDisplayName:i})}function Rp(){const e=na(),t=hi(),n=t.focusState(),r=t.forcedVisibleThreads().length,o=t.filterQuery(),i=t.selectedAnnotations().length,a=lo((()=>({filterQuery:o,focusActive:n.active,focusConfigured:n.configured,focusDisplayName:n.displayName,forcedVisibleCount:r,selectedCount:i})),[n,r,o,i]);return a.selectedCount>0?_o(Op,{filterState:a,rootThread:e}):a.filterQuery?_o(Ip,{filterState:a,rootThread:e}):a.focusConfigured?_o(Pp,{filterState:a,rootThread:e}):null}function Dp({onLogin:e}){const t=hi();return _o("div",{className:"LoggedOutMessage",children:[_o("span",{children:["This is a public annotation created with Hypothesis. ",_o("br",{}),"To reply or make your own annotations on this document,"," ",_o("a",{
554
+ className:"LoggedOutMessage__link",href:t.getLink("signup"),target:"_blank",rel:"noopener noreferrer",children:"create a free account"})," ","or"," ",_o(Eo,{classes:"InlineLinkButton InlineLinkButton--underlined",onClick:e,variant:"dark",children:"log in"}),"."]}),_o("div",{className:"LoggedOutMessage__logo",children:_o("a",{href:"https://hypothes.is","aria-label":"Hypothesis homepage",title:"Hypothesis homepage",children:_o(Do,{name:"logo",classes:"w-16 h-16 hyp-u-color--grey-7"})})})]})}function Bp(e,t,n){e.self===e?e.scrollTo(t,n):(e.scrollLeft=t,e.scrollTop=n)}function Fp(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,
555
+ 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),y=u.top-(n.top-t.scrollTop);r=v+s*f-t.clientWidth*f,o=y+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,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 Bp(e,r.x,r.y),e._scrollSettings=null,t.end("complete");var a=1-t.ease(i);if(Bp(e,r.x-r.differenceX*a,r.y-r.differenceY*a),o>=t.time)return t.endIterations++,t.scrollAncestor&&Fp(t.scrollAncestor),void Fp(e);!function(e){if("requestAnimationFrame"in window)return window.requestAnimationFrame(e);setTimeout(e,16)}(Fp.bind(null,e))}}function jp(e){return e.self===e
556
+ }function Hp(e){return"pageXOffset"in e||(e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth)&&"hidden"!==getComputedStyle(e).overflow}function qp(){return!0}function Up(e){if(e.assignedSlot)return Up(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 $p=function(e,t,n){if(e){"function"==typeof t&&(n=t,t=null),t||(t={}),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=Up(e),o=1,i=t.validTarget||qp,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,Hp):Hp(r))&&(o++,s.push(r)),!(r=Up(r))){l("complete");break}return s.reduce(((n,r,o)=>function(e,t,n,r,o){
557
+ 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||jp,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&&Fp(t),i}(e,r,t,s[o+1],l)),null)}function l(e){--o||n&&n(e)}};function Gp({children:e,icon:t="",panelName:n,title:r,onActiveChanged:o}){const i=hi(),a=i.isSidebarPanelOpen(n),s=so(null),l=so(a);io((()=>{l.current!==a&&(l.current=a,a&&s.current&&$p(s.current),"function"==typeof o&&o(a))}),[a,o])
558
+ ;const c=co((()=>{i.toggleSidebarPanel(n,!1)}),[i,n]);return _o(ep,{visible:a,children:_o("div",{ref:s,className:"mb-4",children:_o(Wo,{title:r,icon:t,onClose:c,children:e})})})}function Vp({onLogin:e,onSignUp:t}){return hi().isLoggedIn()?null:_o(Gp,{icon:"restricted",title:"Login needed",panelName:"loginPrompt",children:[_o("p",{children:"Please log in to create annotations or highlights."}),_o(Mo,{children:[_o(Ao,{title:"Sign up",onClick:t,children:"Sign up"}),_o(Ao,{title:"Log in",variant:"primary",onClick:e,children:"Log in"})]})]})}function Wp({children:e,count:t,isWaitingToAnchor:n,isSelected:r,label:o,onSelect:i}){const a=()=>{r||i()},s=t>0?`${o} (${t} available)`:o;return _o(Ao,{classes:Yr("text-color-text","SelectionTab",{"is-selected":r}),onClick:a,onMouseDown:a,pressed:!!r,role:"tab",tabIndex:0,title:s,children:_o(m,{children:[e,t>0&&!n&&_o("span",{className:"text-tiny",style:"position:relative;bottom:3px;left:2px",children:t})]})})}
559
+ var Yp=ci((function({annotationsService:e,isLoading:t,settings:n}){const r=hi(),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 _o("div",{className:"hyp-u-vertical-spacing--4 SelectionTabs__container",children:[_o("div",{className:"hyp-u-layout-row hyp-u-horizontal-spacing--6 SelectionTabs",role:"tablist",children:[_o(Wp,{count:a,isWaitingToAnchor:l,isSelected:"annotation"===o,label:"Annotations",onSelect:()=>c("annotation"),children:"Annotations"}),_o(Wp,{count:i,isWaitingToAnchor:l,isSelected:"note"===o,label:"Page notes",onSelect:()=>c("note"),children:"Page Notes"}),s>0&&_o(Wp,{count:s,isWaitingToAnchor:l,isSelected:"orphan"===o,label:"Orphans",onSelect:()=>c("orphan"),children:"Orphans"})]}),"note"===o&&n.enableExperimentalNewNoteButton&&_o("div",{className:"hyp-u-layout-row--justify-right",children:_o(Ao,{"data-testid":"new-note-button",
560
+ icon:"add",onClick:()=>e.createPageNote(),variant:"primary",style:si(["ctaBackgroundColor"],n),children:"New note"})}),!t&&h&&_o(No,{classes:"text-center",children:_o("span",{"data-testid":"notes-unavailable-message",children:"There are no page notes in this group."})}),!t&&u&&_o(No,{classes:"text-center",children:_o("span",{"data-testid":"annotations-unavailable-message",children:["There are no annotations in this group.",_o("br",{}),"Create one by selecting some text and clicking the"," ",_o(Do,{classes:"m-0.5 inline -mt-0.5",name:"annotate",title:"Annotate"})," ","button."]})})]})}),["annotationsService","settings"]);var Kp=ci((function({frameSync:e,onLogin:t,onSignUp:n,loadAnnotationsService:r,streamer:o}){
561
+ const i=na(),a=hi(),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?Wi(d):"annotation",m=a.searchUris(),f=a.hasSidebarOpened(),g=a.profile().userid,v=d&&!1===d.$orphan?d.$tag:null,y=!(c||!h)&&!d,_=a.directLinkedGroupFetchFailed(),b=y||_,w=!b,x=!b&&!l,k=h&&!u&&!y&&!c,S=so(s);io((()=>{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]),io((()=>{v?(e.focusAnnotations([v]),e.scrollToAnnotation(v),a.selectTab(p)):d&&a.selectTab(p)}),[p,e,d,v,a]);const C=a.hasFetchedProfile();return io((()=>{C&&(f||u)&&o.connect({applyUpdatesImmediately:!1})}),[C,u,f,o]),_o("div",{children:[_o("h2",{className:"sr-only",children:"Annotations"}),w&&_o(Rp,{}),_o(Vp,{onLogin:t,onSignUp:n}),y&&_o(Mp,{errorType:"annotation",onLoginRequest:t,showClearSelection:!0}),_&&_o(Mp,{
562
+ errorType:"group",onLoginRequest:t}),x&&_o(Yp,{isLoading:c}),_o(Np,{threads:i.children}),k&&_o(Dp,{onLogin:t})]})}),["frameSync","loadAnnotationsService","streamer"]);var Xp=ci((function({api:e,toastMessenger:t}){const n=hi(),r=n.routeParams().q,o=co((async t=>{const r={_separate_replies:!0,offset:0,limit:20,...Si(t)};try{n.annotationFetchStarted();const t=await e.search(r);n.addAnnotations([...t.rows,...t.replies])}finally{n.annotationFetchFinished()}}),[e,n]);return io((()=>{n.setSortKey("Newest"),n.clearAnnotations(),o(r).catch((e=>{t.error(`Unable to fetch annotations: ${e.message}`)}))}),[r,o,n,t]),_o(Np,{threads:na().children})}),["api","toastMessenger"]);class Zp{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.1007.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||a,
563
+ 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 Jp(e){const t=R(e);return!(null==t||!t.authority)&&t.authority!==e.authDomain}function Qp({commandName:e,iconName:t}){return _o("span",{className:"whitespace-nowrap",children:[_o(Do,{name:t,classes:Yr("mx-1 -mt-1","text-color-text-light inline")}),_o("em",{children:e})]})}var em=ci((function({settings:e}){const t=!Jp(e);return _o("ol",{className:"list-decimal pl-10 space-y-2",children:[_o("li",{children:["To create an annotation, select text and then select the"," ",_o(Qp,{iconName:"annotate",commandName:"Annotate"})," ","button."]}),_o("li",{
564
+ children:["To create a highlight (",_o(Bo,{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"," ",_o(Qp,{iconName:"highlight",commandName:"Highlight"})," ","button."]}),t&&_o("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"," ",_o(Bo,{classes:"underline hover:underline",href:"https://web.hypothes.is/help/how-to-join-a-private-group/",target:"_blank",children:"join link"}),")."]}),_o("li",{children:["To reply to an annotation, select the"," ",_o(Qp,{iconName:"reply",commandName:"Reply"})," button."]})]})}),["settings"]);var tm=ci((function({toastMessenger:e,versionData:t}){return _o("div",{className:"hyp-u-vertical-spacing",children:[_o("dl",{className:"VersionInfo",children:[_o("dt",{className:"VersionInfo__key",children:"Version"}),_o("dd",{
565
+ className:"VersionInfo__value",children:t.version}),_o("dt",{className:"VersionInfo__key",children:"User Agent"}),_o("dd",{className:"VersionInfo__value",children:t.userAgent}),_o("dt",{className:"VersionInfo__key",children:"URL"}),_o("dd",{className:"VersionInfo__value",children:t.urls}),_o("dt",{className:"VersionInfo__key",children:"Fingerprint"}),_o("dd",{className:"VersionInfo__value",children:t.fingerprint}),_o("dt",{className:"VersionInfo__key",children:"Account"}),_o("dd",{className:"VersionInfo__value",children:t.account}),_o("dt",{className:"VersionInfo__key",children:"Date"}),_o("dd",{className:"VersionInfo__value",children:t.timestamp})]}),_o("div",{className:"hyp-u-layout-row--justify-center",children:_o(Ao,{onClick:()=>{try{Ea(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 nm({children:e,onClick:t}){return _o(Eo,{
566
+ classes:"leading-none text-brand",onClick:t,children:[e,_o(Do,{classes:"ml-1",name:"arrow-right"})]})}function rm({linkText:e,url:t}){return _o("div",{className:"flex-1 border-r last-of-type:border-r-0",children:_o(Bo,{href:t,classes:"flex items-center justify-center space-x-2 text-color-text-light text-lg font-medium",target:"_blank",children:[_o("span",{children:e})," ",_o(Do,{name:"external",classes:"w-3 h-3"})]})})}var om=ci((function({auth:e,session:t}){const n=hi(),r=n.frames(),o=n.mainFrame(),i=!!n.profile().preferences.show_sidebar_tutorial,[a,s]=ro("tutorial"),l=lo((()=>{const t=e||{status:"logged-out"},n=[...r].sort(((e,t)=>e===o?-1:t===o?1:0));return new Zp(t,n)}),[e,r,o]),c=`https://web.hypothes.is/get-help/?sys_info=${l.asEncodedURLString()}`,u=(e,t)=>{e.preventDefault(),s(t)};return _o(Gp,{title:"Help",panelName:"help",onActiveChanged:co((e=>{!e&&i&&t.dismissSidebarTutorial()}),[t,i]),children:_o("div",{className:"space-y-4",children:[_o("div",{className:"flex items-center",children:[_o("h3",{
567
+ className:"grow text-lg font-medium","data-testid":"subpanel-title",children:{tutorial:"Getting started",versionInfo:"About this version"}[a]}),"versionInfo"===a&&_o(nm,{onClick:e=>u(e,"tutorial"),children:"Getting started"}),"tutorial"===a&&_o(nm,{onClick:e=>u(e,"versionInfo"),children:"About this version"})]}),_o("div",{className:"border-y py-4",children:["tutorial"===a&&_o(em,{}),"versionInfo"===a&&_o(tm,{versionData:l})]}),_o("div",{className:"flex items-center",children:[_o(rm,{linkText:"Help topics",url:"https://web.hypothes.is/help/"}),_o(rm,{linkText:"New support ticket",url:c})]})]})})}),["session"]),im={exports:{}};function am(){}am.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},
568
+ 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}},im.exports=am;var sm=im.exports.TinyEmitter=am;class lm extends Error{constructor(e){super(`Results size exceeds ${e}`)}}function cm(e){return 0===e?50:200}class um extends sm{constructor(e,{getPageSize:t=cm,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)),
569
+ this._maxResults&&t.total>this._maxResults)return this.emit("error",new lm(this._maxResults)),void this.emit("end");const i=t.rows.concat(t.replies||[]);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 hm({defaultOption:e,icon:t,onSelect:n,options:r,selectedOption:o,title:i}){const a=[e,...r],s=null!=o?o:e,l=_o("span",{className:"FilterSelect__menu-label",children:[t&&_o(Do,{name:t,classes:"text-xl hyp-u-margin--right--3"}),s.display]});return _o(Qd,{label:l,title:i,contentClass:"FilterSelect__menu",children:a.map((e=>_o(tp,{onClick:()=>n(e),isSelected:e.value===s.value,label:e.display},e.value)))})}function dm(){
570
+ const e=hi(),t=e.getFilter("user"),n=function(){const e=hi(),t=e.allAnnotations(),n=e.defaultAuthority(),r=e.isFeatureEnabled("client_display_names"),o=e.getFocusFilters(),i=oi(e.profile().userid);return lo((()=>{const e={};if(t.forEach((t=>{const o=oi(t.user);e[o]=op(t,ii(t.user,n),r)})),o.user){const t=oi(o.user.value)||o.user.value;e[t]=o.user.display}const a=Object.keys(e).map((t=>({display:t===i?`${e[t]} (Me)`:e[t],value:t})));return a.sort(((e,t)=>i===e.value?-1:i===t.value?1:e.display.localeCompare(t.display))),a}),[t,i,n,r,o.user])}();return _o(hm,{defaultOption:{value:"",display:"Everybody"},icon:"profile",onSelect:t=>e.setFilter("user",t),options:n,selectedOption:t,title:"Filter by user"})}function pm({forcedVisibleCount:e,isFiltered:t,isLoading:n,resultCount:r}){const o=na(),i=n?r:Xi(o),a=o.children.length>0,s=t&&e>0,l=i-e,c=o.children.length;return _o("div",{className:"hyp-u-layout-row NotebookResultCount",children:[n&&_o(Ko,{size:"small"}),!n&&_o("h2",{children:[!a&&_o("strong",{
571
+ children:"No results"}),a&&t&&_o("strong",{children:[l," ",1===l?"result":"results"]}),a&&!t&&_o("strong",{children:[c," ",1===c?"thread":"threads"]})]}),s&&_o("h3",{children:["(and ",e," more)"]}),!t&&a&&_o("h3",{children:["(",i," ",1===i?"annotation":"annotations",")"]})]})}function mm({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),null==n||n.blur()};return _o("div",{className:"PaginationNavigation",children:[_o("div",{className:"PaginationNavigation__relative PaginationNavigation__prev",children:o&&_o(Ao,{classes:"PaginationPageButton",icon:"arrow-left",title:"Go to previous page",onClick:t=>a(e-1,t.target),variant:"dark",children:"prev"})}),_o("ul",{className:"PaginationNavigation__pages",children:i.map(((t,n)=>_o("li",{
572
+ children:null===t?_o("div",{className:"PaginationNavigation__gap",children:"..."}):_o(Ao,{classes:"PaginationPageButton",title:`Go to page ${t}`,pressed:t===e,onClick:e=>a(t,e.target),variant:"dark",children:t.toString()},`page-${n}`)},n)))}),_o("div",{className:"PaginationNavigation__relative PaginationNavigation__next",children:r&&_o(Ao,{classes:"PaginationPageButton",icon:"arrow-right",iconPosition:"right",title:"Go to next page",onClick:t=>a(e+1,t.target),variant:"dark",children:"next"})})]})}function fm({currentPage:e,isLoading:t,onChangePage:n,threads:r,pageSize:o=25}){const{paginatedThreads:i,totalPages:a}=lo((()=>{const t=r.filter((e=>Xi(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 _o(m,{children:[_o(Np,{threads:i}),!t&&_o(mm,{currentPage:e,onChangePage:n,totalPages:a})]})}var gm=ci((function({loadAnnotationsService:e,streamer:t}){var n
573
+ ;const r=hi(),o=r.getFilterValues(),i=r.focusedGroup(),a=r.forcedVisibleThreads().length,s=r.hasAppliedFilter(),l=r.isLoading(),c=r.annotationResultCount(),u=r.pendingUpdateCount(),h=na(),d=null!==(n=null==i?void 0:i.name)&&void 0!==n?n:"",p=(null==i?void 0:i.id)||r.directLinkedGroupId(),m=so(1),[f,g]=ro(1),[v,y]=ro(!1),_=e=>{e instanceof lm&&y(!0)},b=r.hasFetchedProfile();io((()=>{b&&t.connect({applyUpdatesImmediately:!1})}),[b,t]),io((()=>{r.setSortKey("Newest"),p&&e.load({groupId:p,sortBy:"updated",sortOrder:"desc",maxResults:5e3,onError:_,streamFilterBy:"group"})}),[e,p,r]);const w=e=>{g(e)};io((()=>{w(1)}),[o,i]);const x=so(null);ao((()=>{f!==m.current&&(x.current&&$p(x.current),m.current=f)}),[f]);const k=`Show ${u} new or updated ${u>1?"annotations":"annotation"}`;return _o("div",{className:"NotebookView",children:[_o("header",{className:"NotebookView__heading",ref:x,children:_o("h1",{className:"NotebookView__group-name",children:d})}),_o("div",{className:"NotebookView__filters",children:_o(dm,{})
574
+ }),_o("div",{className:"NotebookView__results hyp-u-layout-row--align-center text-lg font-medium",children:[u>0&&!s&&_o(Co,{icon:"refresh",onClick:()=>t.applyPendingUpdates(),variant:"primary",title:k}),_o(pm,{forcedVisibleCount:a,isFiltered:s,isLoading:l,resultCount:c})]}),_o("div",{className:"NotebookView__items",children:[v&&_o("div",{className:"NotebookView__messages",children:_o(Wo,{title:"Too many results to show",children:["This preview of the Notebook can show"," ",_o("strong",{children:["up to ",5e3," results"]})," at a time (there are"," ",c," to show here)."," ",_o("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."]})}),_o(fm,{currentPage:f,isLoading:l,onChangePage:w,threads:h.children})]})]})}),["loadAnnotationsService","streamer"])
575
+ ;var vm=ci((function({toastMessenger:e}){const t=hi(),n=t.mainFrame(),r=t.focusedGroup(),o=`Share Annotations in ${r&&r.name||"..."}`,i=r&&n,a=i&&(s=n.uri,l=r.id,wa(s)?`https://hyp.is/go?url=${encodeURIComponent(s)}&group=${l}`:null);var s,l;return _o(Gp,{title:o,panelName:"shareGroupAnnotations",children:[!i&&_o("div",{className:"flex flex-row items-center justify-center",children:_o(Ko,{})}),i&&_o("div",{className:"text-color-text-light space-y-3",children:a?_o(m,{children:[_o("div",{className:"text-color-text font-medium","data-testid":"sharing-intro",children:"private"===r.type?_o("p",{children:"Use this link to share these annotations with other group members:"}):_o("p",{children:"Use this link to share these annotations with anyone:"})}),_o("div",{children:_o(Jo,{children:[_o(Zo,{"aria-label":"Use this URL to share these annotations",type:"text",value:a,readOnly:!0}),_o(Co,{icon:"copy",onClick:()=>{try{Ea(a),e.success("Copied share link to clipboard")}catch(t){e.error("Unable to copy link")}},
576
+ title:"Copy share link",variant:"dark"})]})}),_o("p",{"data-testid":"sharing-details",children:["private"===r.type?_o("span",{children:["Annotations in the private group"," ",_o("em",{children:r.name})," are only visible to group members."]}):_o("span",{children:["Anyone using this link may view the annotations in the group"," ",_o("em",{children:r.name}),"."]})," ",_o("span",{children:["Private (",_o(Do,{name:"lock",classes:"inline -mt-0.5"})," ",_o("em",{children:"Only Me"}),") annotations are only visible to you."]})]}),_o("div",{className:"text-[24px]",children:_o(Na,{shareURI:a})})]}):_o("p",{"data-testid":"no-sharing",children:"These annotations cannot be shared because this document is not available on the web."})})]})}),["toastMessenger"]);function ym({message:e,onDismiss:t}){const n=e.type.charAt(0).toUpperCase()+e.type.slice(1),r="notice"===e.type?"cancel":e.type;return _o("li",{className:Yr("toast-message-container",{"is-dismissed":e.isDismissed}),onClick:()=>t(e.id),children:_o("div",{
577
+ className:Yr("toast-message",`toast-message--${e.type}`),children:[_o("div",{className:"toast-message__type",children:_o(Do,{name:r,classes:"toast-message__icon"})}),_o("div",{className:"toast-message__message",children:[_o("strong",{children:[n,": "]}),e.message,e.moreInfoURL&&_o("div",{className:"toast-message__link",children:_o("a",{href:e.moreInfoURL,onClick:e=>e.stopPropagation(),target:"_new",children:"More info"})})]})]})})}var _m=ci((function({toastMessenger:e}){return _o("div",{children:_o("ul",{"aria-live":"polite","aria-relevant":"additions",className:"ToastMessages",children:hi().getToastMessages().map((t=>_o(ym,{message:t,onDismiss:t=>e.dismiss(t)},t.id)))})})}),["toastMessenger"]);function bm(e){return e.organization&&e.organization.name}function wm(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]=Object.assign({},e.organization),t[n].groups=[]),
578
+ 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 xm(e){const t=wm(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 km({heading:e,children:t}){return _o(m,{children:[e&&_o("h2",{className:"MenuSection__heading",children:e}),_o("ul",{className:"MenuSection__content",children:x(t).map((e=>_o("li",{children:e},e.key)))})]})}var Sm=ci((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=hi(),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 _o(tp,{icon:t.logo||"blank",iconAlt:bm(t),isDisabled:!s,isExpanded:!!a&&e,isSelected:u,isSubmenuVisible:a?e:void 0,label:t.name,onClick:s?()=>{
579
+ l.clearDirectLinkedGroupFetchFailed(),l.clearDirectLinkedIds(),n.focus(t.id)}:h,onToggleSubmenu:h,submenu:_o(m,{children:[_o("ul",{children:[i&&_o("li",{children:_o(tp,{href:i,icon:"external",isSubmenuItem:!0,label:"View group activity"})}),i&&_o("li",{children:_o(tp,{onClick:()=>(e=>{try{Ea(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&&_o("li",{children:_o(tp,{icon:"leave",isSubmenuItem:!0,label:"Leave group",onClick:async()=>{const e=`Are you sure you want to leave the group "${t.name}"?`;await ni({title:"Leave group?",message:e,confirmAction:"Leave"})&&n.leave(t.id)}})})]}),!s&&_o("p",{className:"GroupListItem__footer",children:"This group is restricted to specific URLs."})]})})}),["groups","toastMessenger"]);function Cm({expandedGroup:e,onExpandGroup:t,groups:n,heading:r}){return _o(km,{heading:r,children:n.map((n=>_o(Sm,{isExpanded:n===e,onExpand:e=>t(e?n:null),group:n},n.id)))})}
580
+ var Am=ci((function({settings:e}){const t=hi(),n=t.getCurrentlyViewingGroups(),r=t.getFeaturedGroups(),o=t.getMyGroups(),i=t.focusedGroup(),a=t.profile().userid,s=lo((()=>xm(o)),[o]),l=lo((()=>xm(r)),[r]),c=lo((()=>xm(n)),[n]),u=t.defaultAuthority(),h=a&&!ii(a,u),d=t.getLink("groups.new"),[p,m]=ro(null);let f;if(i){const t=i.organization.logo||function(e){const t=R(e);return t&&t.icon?t.icon:null}(e)||"",n=bm(i)?bm(i):"";f=_o("span",{className:"GroupList__menu-label",children:[t&&_o("img",{className:"GroupList__menu-icon",src:t,alt:n}),i.name]})}else f=_o("span",{children:"…"});return!!Jp(e)&&n.length+r.length+o.length<2?f:_o(Qd,{align:"left",contentClass:"GroupList__content",label:f,onOpenChanged:()=>m(null),title:i?`Select group (now viewing: ${i.name})`:"Select group",children:[c.length>0&&_o(Cm,{expandedGroup:p,onExpandGroup:m,heading:"Currently Viewing",groups:c}),l.length>0&&_o(Cm,{expandedGroup:p,onExpandGroup:m,heading:"Featured Groups",groups:l}),s.length>0&&_o(Cm,{expandedGroup:p,onExpandGroup:m,
581
+ heading:"My Groups",groups:s}),h&&_o(tp,{icon:"add",href:d,label:"New private group"})]})}),["settings"]);function Em({alwaysExpanded:e,query:t,onSearch:n}){const r=hi().isLoading(),o=so(),[i,a]=ro(t),[s,l]=ro(t);return t!==i&&(l(t),a(t)),_o("form",{action:"#",className:"SearchInput__form",name:"searchForm",onSubmit:e=>{e.preventDefault(),(o.current.value||i)&&n(o.current.value)},children:[_o("input",{"aria-label":"Search",className:Yr("SearchInput__input",{"is-expanded":e||t}),dir:"auto",type:"text",name:"query",placeholder:r?"Loading…":"Search…",disabled:r,ref:o,value:s||"",onInput:e=>l(e.target.value)}),!r&&_o("div",{className:"SearchInput__button-container",children:_o(Co,{icon:"search",onClick:()=>o.current.focus(),size:"small",title:"Search annotations"})}),r&&_o("div",{style:"margin:0.5em 0",children:_o(Ko,{size:"small"})})]})}function Tm(){const e=hi(),t=e.sortKey(),n=e.sortKeys().map((n=>_o(tp,{label:n,onClick:()=>e.setSortKey(n),isSelected:n===t},n))),r=_o("span",{className:"TopBar__menu-label",
582
+ children:_o(Do,{name:"sort",classes:"TopBar__menu-icon"})});return _o("div",{className:"SortMenu",children:_o(Qd,{label:r,title:`Sort by ${t}`,align:"right",menuIndicator:!1,children:n})})}var Nm=ci((function({router:e}){return _o(Em,{query:hi().routeParams().q,onSearch:t=>{e.navigate("stream",{q:t})},alwaysExpanded:!0})}),["router"]);var Mm=ci((function({auth:e,frameSync:t,onLogout:n,settings:r}){const o=hi(),i=o.defaultAuthority(),a=ii(e.userid,i),s=R(r),l=o.isFeatureEnabled("notebook_launch"),[c,u]=ro(!1),h=e=>s&&!!s[e],d=!a||h("onProfileRequestProvided"),p=!a||h("onLogoutRequestProvided"),m=()=>{t.notifyHost("openNotebook",o.focusedGroupId())},f=()=>a&&t.notifyHost("profileRequested"),g=(()=>{const t={};return d&&(a||(t.href=o.getLink("user",{user:e.username})),t.onClick=f),t})(),v=_o("span",{className:"TopBar__menu-label",children:_o(Do,{name:"profile",classes:"TopBar__menu-icon"})});return _o("div",{className:"UserMenu",onKeyDown:e=>{"n"===e.key&&(m(),u(!1))},children:_o(Qd,{label:v,title:e.displayName,
583
+ align:"right",open:c,onOpenChanged:u,children:[_o(km,{children:[_o(tp,{label:e.displayName,isDisabled:!d,...g}),!a&&_o(tp,{label:"Account settings",href:o.getLink("account.settings")}),l&&_o(tp,{label:"Open notebook",onClick:()=>m()})]}),p&&_o(km,{children:_o(tp,{label:"Log out",onClick:n})})]})})}),["frameSync","settings"]);var Lm=ci((function({auth:e,frameSync:t,isSidebar:n,onLogin:r,onLogout:o,onSignUp:i,settings:a,streamer:s}){const l=!Jp(a),c=si(["accentColor"],a),u=hi(),h=u.filterQuery(),d=u.pendingUpdateCount(),p=u.isSidebarPanelOpen("help"),f=u.isSidebarPanelOpen("shareGroupAnnotations"),g=()=>{const e=R(a);e&&e.onHelpRequestProvided?t.notifyHost("helpRequested"):u.toggleSidebarPanel("help")},v=_o(m,{children:["unknown"===e.status&&_o("span",{className:"TopBar__login-links",children:""}),"logged-out"===e.status&&_o("span",{className:"TopBar__login-links text-lg font-medium hyp-u-horizontal-spacing--2",children:[_o(Eo,{classes:"InlineLinkButton",onClick:i,style:c,variant:"primary",children:"Sign up"
584
+ }),_o("div",{children:"/"}),_o(Eo,{classes:"InlineLinkButton",onClick:r,style:c,variant:"primary",children:"Log in"})]}),"logged-in"===e.status&&_o(Mm,{auth:e,onLogout:o})]});return _o("div",{className:"TopBar",children:[!n&&_o("div",{className:"TopBar__inner content",children:[_o(Nm,{}),_o("div",{className:"hyp-u-stretch"}),_o(Co,{icon:"help",expanded:p,onClick:g,size:"small",title:"Help"}),v]}),n&&_o("div",{className:"TopBar__inner content",children:[_o(Am,{}),_o("div",{className:"hyp-u-stretch"}),d>0&&_o(Co,{icon:"refresh",onClick:()=>s.applyPendingUpdates(),size:"small",variant:"primary",title:`Show ${d} new/updated ${1===d?"annotation":"annotations"}`}),_o(Em,{query:h||null,onSearch:u.setFilterQuery}),_o(Tm,{}),l&&_o(Co,{icon:"share",expanded:f,onClick:()=>{u.toggleSidebarPanel("shareGroupAnnotations")},size:"small",title:"Share annotations on this page"}),_o(Co,{icon:"help",expanded:p,onClick:g,size:"small",title:"Help"}),v]})]})}),["frameSync","settings","streamer"])
585
+ ;var zm=ci((function({auth:e,frameSync:t,settings:n,session:r,toastMessenger:o}){const i=hi(),a=i.hasFetchedProfile(),s=i.profile(),l=i.route(),c=lo((()=>a?function(e){const t=ri(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",displayName:n,userid:e.userid,username:t.username}}return{status:"logged-out"}}(s):{status:"unknown"}),[a,s]),u=lo((()=>si(["appBackgroundColor"],n)),[n]),h="clean"===n.theme,d="sidebar"===l;io((()=>{(function(e,t,n){const r="object"==typeof t.preferences&&!!t.preferences.show_sidebar_tutorial,o=R(n)||{onHelpRequestProvided:!1};return e&&!o.onHelpRequestProvided&&r})(d,s,n)&&i.openSidebarPanel("help")}),[d,s,n,i]);const p=async()=>{if(R(n))t.notifyHost("loginRequested");else try{await e.login(),i.closeSidebarPanel("loginPrompt"),i.clearGroups(),r.reload()}catch(e){o.error(e.message)}},m=()=>{R(n)?t.notifyHost("signupRequested"):window.open(i.getLink("signup"))};return _o("div",{
586
+ className:Yr("HypothesisApp","js-thread-list-scroll-root",{"theme-clean":h,"HypothesisApp--notebook":"notebook"===l}),style:u,children:["notebook"!==l&&_o(Lm,{auth:c,onLogin:p,onSignUp:m,onLogout:async()=>{await(async()=>{const e=i.countDrafts();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?"),ni({title:"Discard drafts?",message:t,confirmAction:"Discard"})})()&&(i.clearGroups(),i.removeAnnotations(i.unsavedAnnotations()),i.discardAllDrafts(),R(n)?t.notifyHost("logoutRequested"):r.logout())},isSidebar:d}),_o("div",{className:"HypothesisApp__content",children:[_o(_m,{}),_o(om,{auth:"logged-in"===c.status?c:{}}),_o(vm,{}),l&&_o("main",{children:["annotation"===l&&_o(Lp,{onLogin:p}),"notebook"===l&&_o(gm,{}),"stream"===l&&_o(Xp,{}),"sidebar"===l&&_o(Kp,{onLogin:p,onSignUp:m})]})]})]})}),["auth","frameSync","session","settings","toastMessenger"])
587
+ ;function Om({error:e}){return _o("div",{className:"LaunchErrorPanel",children:_o(Wo,{title:"Unable to start Hypothesis",children:e.message})})}class Im{constructor(e,t){this._api=e,this._store=t}_applyDraftChanges(e){const t={},n=this._store.getDraft(e);return n&&(t.tags=n.tags,t.text=n.text,t.permissions=n.isPrivate?xa(e.user):ka(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,a=o.user_info,s="s:"+H(8),l=Object.assign({created:t.toISOString(),group:r,permissions:Sa(i,r,n),tags:[],text:"",updated:t.toISOString(),user:i,user_info:a,$tag:s,hidden:!1,links:{},document:{title:""}},e);return Ri(l)&&(l.permissions=xa(i)),l}create(e,t=new Date){const n=this._initialize(e,t);this._store.addAnnotations([n]),this._store.deleteNewAndEmptyDrafts(),Ri(n)||this._store.createDraft(n,{tags:n.tags,text:n.text,isPrivate:!zi(n)}),
588
+ Bi(n)?this._store.selectTab("note"):Fi(n)&&this._store.selectTab("annotation"),(n.references||[]).forEach((e=>{this._store.setExpanded(e,!0)}))}createPageNote(){const e=this._store.mainFrame();if(!this._store.isLoggedIn())return void this._store.openSidebarPanel("loginPrompt");if(!e)return;const t={target:[],uri:e.uri};this.create(t)}async delete(e){await this._api.annotation.delete({id:e.id}),this._store.removeAnnotations([e])}async flag(e){await this._api.annotation.flag({id:e.id}),this._store.updateFlagStatus(e.id,!0)}reply(e,t){const n={group:e.group,permissions:zi(e)?ka(t,e.group):xa(t),references:(e.references||[]).concat(e.id),target:[{source:e.target[0].source}],uri:e.uri};this.create(n)}async save(e){let t;const n=this._applyDraftChanges(e);let r;t=Mi(e)?this._api.annotation.update({id:e.id},n):this._api.annotation.create({},n),this._store.annotationSaveStarted(e);try{r=await t}finally{this._store.annotationSaveFinished(e)}return Object.keys(e).forEach((t=>{"$"===t[0]&&(r[t]=e[t])})),
589
+ this._store.removeDraft(e),this._store.addAnnotations([r]),r}}Im.$inject=["api","store"];class Pm 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 Rm(e,t){let n,r;try{n=await fetch(e,t)}catch(t){throw new Pm(e,null,t.message)}if(204===n.status)return null;try{r=await n.json()}catch(t){throw new Pm(e,n,"Failed to parse response")}var o;if(!n.ok)throw new Pm(e,n,null===(o=r)||void 0===o?void 0:o.reason);return r}function Dm(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}}function Bm(e){const t={};for(const n in e)e.hasOwnProperty(n)&&"$"!==n[0]&&(t[n]=e[n]);return t}class Fm{constructor(e,t,n){const r=e.routes();this._clientId=null;const o=()=>this._clientId,i=e=>function(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){
590
+ return async(a,s)=>{o();try{const[o,l]=await Promise.all([e,n()]),c=function(e,t){let n=e;return t.split(".").forEach((e=>{n=n[e]})),n}(o,t),u={"Content-Type":"application/json","Hypothesis-Client-Version":"1.1007.0"};l&&(u.Authorization="Bearer "+l);const h=r();h&&(u["X-Client-Id"]=h);const{url:d,unusedParams:p}=Dm(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 Rm(m.toString(),{body:s?JSON.stringify(Bm(s)):null,headers:u,method:c.method})}finally{i()}}}(r,e,{getAccessToken:t.getAccessToken,getClientId:o,onRequestStarted:n.apiRequestStarted,onRequestFinished:n.apiRequestFinished});this.search=i("search"),this.annotation={create:i("annotation.create"),delete:i("annotation.delete"),get:i("annotation.read"),update:i("annotation.update"),flag:i("annotation.flag"),hide:i("annotation.hide"),unhide:i("annotation.unhide")},this.group={member:{delete:i("group.member.delete")},read:i("group.read")},
591
+ 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}}Fm.$inject=["apiRoutes","auth","store"];var jm={};function Hm(e,t){"boolean"==typeof t&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var qm=Hm;Hm.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},Hm.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},Hm.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=(new Date).getTime()
592
+ ;if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var n=this._timeouts.shift();if(void 0===n){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1)}var r=this;return this._timer=setTimeout((function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout((function(){r._operationTimeoutCb(r._attempts)}),r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)}),n),this._options.unref&&this._timer.unref(),!0},Hm.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)},Hm.prototype.try=function(e){
593
+ console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},Hm.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},Hm.prototype.start=Hm.prototype.try,Hm.prototype.errors=function(){return this._errors},Hm.prototype.attempts=function(){return this._attempts},Hm.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var o=this._errors[r],i=o.message,a=(e[i]||0)+1;e[i]=a,a>=n&&(t=o,n=a)}return t},function(e){var t=qm;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))
594
+ ;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);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}}}(jm);var Um=jm;function $m(e,t){return new Promise(((n,r)=>{const o=Um.operation(t);o.attempt((async()=>{try{const t=await e();o.retry(),n(t)}catch(e){o.retry(e)||r(e)}}))}))}function Gm(e){return $m((()=>Rm(e)))}class Vm{constructor(e){this._apiUrl=e.apiUrl,this._routeCache=null,this._linkCache=null}routes(){
595
+ return this._routeCache||(this._routeCache=Gm(this._apiUrl).then((e=>e.links))),this._routeCache}links(){return this._linkCache||(this._linkCache=this.routes().then((e=>Gm(e.links.url)))),this._linkCache}}Vm.$inject=["settings"];class Wm extends Error{constructor(e,t){super(e),this.cause=t}}class Ym{constructor(e){this.clientId=e.clientId,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 Wm("Failed to revoke access token",e)}}authorize(e,t){const n=H(16),r=new Promise(((t,r)=>{e.addEventListener("message",(function o(i){
596
+ "object"==typeof i.data&&i.data.state===n&&("authorization_response"===i.data.type&&t(i.data),"authorization_canceled"===i.data.type&&r(new Error("Authorization window was closed")),e.removeEventListener("message",o))}))})),o=new URL(this.authorizationEndpoint);return o.searchParams.set("client_id",this.clientId),o.searchParams.set("origin",e.location.origin),o.searchParams.set("response_mode","web_message"),o.searchParams.set("response_type","code"),o.searchParams.set("state",n),t.location=o.toString(),r.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 Rm(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 Wm("Failed to fetch access token",e)}return{accessToken:t.access_token,expiresAt:Date.now()+1e3*(t.expires_in-10),refreshToken:t.refresh_token}}static openAuthPopupWindow(e){
597
+ const t=`left=${e.screen.width/2-237.5},top=${e.screen.height/2-215},width=475,height=430`,n=e.open("about:blank","Log in to Hypothesis",t);if(!n)throw new Error("Failed to open login window");return n}}class Km extends sm{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;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 Ym({clientId:r.oauthClientId,authorizationEndpoint:e["oauth.authorize"],revokeEndpoint:e["oauth.revoke"],tokenEndpoint:l}),s},m=()=>{var e;return null===(e=R(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)
598
+ ;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){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=Ym.openAuthPopupWindow(e),n=await p(),r=await n.authorize(e,t);i=r,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}}
599
+ Km.$inject=["$window","apiRoutes","localStorage","settings","toastMessenger"];class Xm{constructor(e,t){this._annotationsService=e,this._store=t,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),$m((()=>this._annotationsService.save(t))).catch((()=>{this._failed.add(n)})).finally((()=>{this._saving.delete(n)})))}))}))}isSaving(){return this._saving.size>0}}Xm.$inject=["annotationsService","store"];var Zm=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;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};function Jm(e,t,n){
600
+ const r=Array.isArray(t),o=()=>r?t.map((e=>e())):t();let i=o();return e((()=>{const e=o();if(r?Zm(e,i):e===i)return;const t=i;i=e,n(e,t)}))}class Qm{constructor(e,t){this._frameSync=e,this._store=t}init(){const e=()=>this._store.profile().features;Jm(this._store.subscribe,[e,()=>this._store.frames()],(()=>{this._frameSync.notifyHost("featureFlagsUpdated",e()||{})}))}}function ef(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())}Qm.$inject=["frameSync","store"];class tf{constructor({hostFrame:e,source:t}){this._hostFrame=e,this._source=t,this._listeners=new ya}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),
601
+ !t)throw new Error("Invalid request of channel/port");const n=H(6);return new Promise(((t,r)=>{const o=()=>{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;ef(o,{frame1:this._source,frame2:e,type:"offer",requestId:n})&&(clearInterval(i),clearTimeout(a),this._listeners.remove(s),t(l[0]))}));o()}))}}function nf(e,t,n=[],r=-1){e.postMessage({protocol:"frame-rpc",version:"1.0.0",arguments:n,method:t,sequence:r})}class rf{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 ya,this._listeners.add(t,"unload",(()=>{this._port&&(nf(this._port,"close"),t!==t.parent&&function(e){const t=e.match(/\bAppleWebKit\/([0-9]+)\b/)
602
+ ;return!!t&&!(parseInt(t[1])<=537)}(e)&&t.parent.postMessage({type:"hypothesisPortClosed"},"*",[this._port]))})),this._pendingCalls=[],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(),nf(e,"connect");for(let[e,t]of this._pendingCalls)this.call(e,...t);this._pendingCalls=[]}destroy(){this._port&&(nf(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)),nf(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){
603
+ if("close"===t.method){if(this._receivedCloseEvent)return;this._receivedCloseEvent=!0}const e=this._methods.get(t.method);if(!e)return;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 of({$tag:e,target:t,uri:n}){return{$tag:e,target:t,uri:n}}function af(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 sf{constructor(e,t,n){this._window=e,this._annotationsService=t,this._store=n,this._portFinder=new tf({hostFrame:this._window.parent,source:"sidebar"}),this._listeners=new ya,this._hostRPC=new rf,this._guestRPC=new Map,this._nextGuestId=0,this._inFrame=new Set,this._highlightsVisible=!1,this._setupSyncToGuests(),this._setupHostEvents()}_setupSyncToGuests(){let e=0
604
+ ;Jm(this._store.subscribe,[()=>this._store.allAnnotations(),()=>this._store.frames()],(([t,n],[r])=>{let o=0;const i=new Set,a=[];t.forEach((e=>{Ni(e)||(zi(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=af(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(of))}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))}))}_connectGuest(e){const t=new rf;++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({
605
+ id:e.frameIdentifier,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=va((()=>{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=>{
606
+ this._store.toggleSelectedAnnotations(this._store.findIDsForTags(e))})),t.on("openSidebar",(()=>{this._hostRPC.call("openSidebar")})),t.on("closeSidebar",(()=>{this._hostRPC.call("closeSidebar")})),t.connect(e),t.call("setHighlightsVisible",this._highlightsVisible)}_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)))}))}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;ef(t,{frame1:"guest",frame2:"sidebar",type:"offer"})&&this._connectGuest(n[0])}))}notifyHost(e,...t){this._hostRPC.call(e,...t)}focusAnnotations(e){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(),
607
+ this._listeners.removeAll()}}function lf(e){return Object.keys(e).reduce(((e,t)=>(e[t]=t,e)),{})}sf.$inject=["$window","annotationsService","store"];const cf={id:"__default__",name:"__DEFAULT__",logo:"data:image/svg+xml;utf8,"+encodeURIComponent(ei)};const uf=["organization","scopes"];class hf{constructor(e,t,n,r,o,i){this._store=e,this._api=t,this._auth=n,this._settings=o,this._toastMessenger=i,this._serviceConfig=R(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));return o?"__world__"===r||"__world__"===n?e:e.filter((e=>"__world__"!==e.id)):e}_setupAutoReload(){this._reloadSetUp||(this._reloadSetUp=!0,Jm(this._store.subscribe,(()=>this._mainURI()),(()=>{
608
+ this.load()})),Jm(this._store.subscribe,[()=>this._store.hasFetchedProfile(),()=>this._store.profile().userid],((e,[t])=>{t&&this.load()})))}_addGroupsToStore(e,t){!function(e){e.forEach((e=>{e.organization&&"object"==typeof e.organization||(e.organization=cf)}))}(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:uf})}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()),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
609
+ ;i&&(a=this._fetchGroup(i).then((e=>(this._store.clearDirectLinkedGroupFetchFailed(),e))).catch((()=>(this._store.setDirectLinkedGroupFetchFailed(),null))));const s={expand:uf},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:uf}),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}async _loadServiceSpecifiedGroups(e){const t=await this._api.profile.groups.read({expand:uf});let n;const r=async e=>{try{return await this._fetchGroup(e)}catch(e){return n=e,null}
610
+ },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;if(null!==(e=this._serviceConfig)&&void 0!==e&&e.groups){let e=[];try{e=await this._serviceConfig.groups}catch(e){this._toastMessenger.error(`Unable to fetch group configuration: ${e.message}`)}return this._loadServiceSpecifiedGroups(e)}return this._loadGroupsForUserAndDocument()}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=>!Ni(e))).map((e=>({...e,group:n})));e.length&&this._store.addAnnotations(e),this._store.setDefault("focusedGroup",n)}}leave(e){return this._api.group.member.delete({pubid:e,userid:"me"})}}hf.$inject=["store","api","auth","session","settings","toastMessenger"];class df{
611
+ 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 um(this._api.search,s),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)})),
612
+ 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}),Ni(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),!Ni(t)){const e=t.id;this._streamFilter.addClause("/references","one_of",e,!0).addClause("/id","equals",e,!0),this._streamer.setConfig("filter",{filter:this._streamFilter.getFilter()}),this._streamer.connect()}return r}}df.$inject=["api","store","streamer","streamFilter"];class pf{constructor(){this._store={}}getItem(e){return e in this._store?this._store[e]:null}
613
+ setItem(e,t){this._store[e]=t}removeItem(e){delete this._store[e]}}class mf{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 pf}}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)}}mf.$inject=["$window"];const ff={annotationPrivacy:"hypothesis.privacy",focusedGroup:"hypothesis.groups.focus"};class gf{constructor(e,t){this._storage=e,this._store=t}init(){Object.keys(ff).forEach((e=>{const t=this._storage.getItem(ff[e]);this._store.setDefault(e,t)})),Jm(this._store.subscribe,(()=>this._store.getDefaults()),((e,t)=>{for(let n in e)t[n]!==e[n]&&n in ff&&this._storage.setItem(ff[n],e[n])}))}}gf.$inject=["localStorage","store"];class vf{constructor(e,t){this._window=e,
612
614
  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,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){
613
- this._window.history.pushState({},"",this.routeUrl(e,t)),this.sync()}}mf.$inject=["$window","store"];class ff{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}`)}}}ff.$inject=["apiRoutes","store"];class gf{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=P(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(){return(!this._lastLoad||!this._lastLoadTime||Date.now()-this._lastLoadTime>3e5)&&(this._lastLoadTime=Date.now(),this._lastLoad=Hm((()=>{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(){
614
- 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?Nr({id:e.userid}):Nr(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()}}gf.$inject=["store","api","auth","settings","toastMessenger"];class vf{constructor(){this._filter={match_policy:"include_any",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 yf extends om{constructor(e){super();const t=[];let n
615
- ;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 _f{constructor(e,t,n,r,o){this._auth=n,this._groups=r,this._session=o,this._store=e,this._websocketURL=t.links().then((e=>e.websocket)),this.clientId=H(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})))
615
+ this._window.history.pushState({},"",this.routeUrl(e,t)),this.sync()}}vf.$inject=["$window","store"];class yf{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}`)}}}yf.$inject=["apiRoutes","store"];class _f{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=R(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(){return(!this._lastLoad||!this._lastLoadTime||Date.now()-this._lastLoadTime>3e5)&&(this._lastLoadTime=Date.now(),this._lastLoad=$m((()=>{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(){
616
+ 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?Lr({id:e.userid}):Lr(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()}}_f.$inject=["store","api","auth","settings","toastMessenger"];class bf{constructor(){this._filter={match_policy:"include_any",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 wf extends sm{constructor(e){super();const t=[];let n
617
+ ;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 xf{constructor(e,t,n,r,o){this._auth=n,this._groups=r,this._session=o,this._store=e,this._websocketURL=t.links().then((e=>e.websocket)),this.clientId=H(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})))
616
618
  ;t.length&&this._store.removeAnnotations(t),this._store.clearPendingUpdates()}_handleSocketError(e,t){V("Error connecting to H push notification service:",t);const n=new URL(e).hostname;-1!==["localhost","127.0.0.1"].indexOf(n)&&V("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})}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 V("Received unsupported notification",t.type)}_sendClientConfig(e){
617
- 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 yf(r);o.on("open",(()=>{this._reconnectionAttempts=0,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))),
618
- 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,Km(this._store.subscribe,(()=>this._store.profile().userid),(()=>{this._reconnect()}))),this._socket||await this._reconnect()}}_f.$inject=["store","apiRoutes","auth","groups","session"];class bf{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=>{if(null!==t&&r>=t)return!1;const o=n.split(/\W+/),i=new RegExp(`^${Y(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)
619
- ;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)}}bf.$inject=["localStorage"];class wf{constructor(e){this._store=e}forceVisible(e){e.children.forEach((e=>{this.forceVisible(e)})),e.visible||this._store.setForcedVisible(e.id,!0)}}wf.$inject=["store"];class xf{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))}_addMessage(e,t,{autoDismiss:n=!0,moreInfoURL:r=""}={}){if(this._store.hasToastMessage(e,t))return;const o=H(10),i={type:e,id:o,message:t,moreInfoURL:r};this._store.addToastMessage({isDismissed:!1,...i}),n&&setTimeout((()=>{this.dismiss(o)}),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)}}function kf(e,t,n){return t in e?Object.defineProperty(e,t,{
620
- value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sf(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 Cf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sf(Object(n),!0).forEach((function(t){kf(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Af(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. "}xf.$inject=["store"];var Ef="function"==typeof Symbol&&Symbol.observable||"@@observable",Tf=function(){return Math.random().toString(36).substring(7).split("").join(".")},Nf={INIT:"@@redux/INIT"+Tf(),
621
- REPLACE:"@@redux/REPLACE"+Tf(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Tf()}};function Lf(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 Mf(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Af(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Af(1));return n(Mf)(e,t)}if("function"!=typeof e)throw new Error(Af(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(Af(3));return i}function h(e){if("function"!=typeof e)throw new Error(Af(4));if(l)throw new Error(Af(5));var t=!0;return c(),s.push(e),function(){if(t){if(l)throw new Error(Af(6));t=!1,c();var n=s.indexOf(e);s.splice(n,1),a=null}}}function d(e){if(!Lf(e))throw new Error(Af(7));if(void 0===e.type)throw new Error(Af(8))
622
- ;if(l)throw new Error(Af(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(Af(10));o=e,d({type:Nf.REPLACE})}function m(){var e,t=h;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(Af(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[Ef]=function(){return this},e}return d({type:Nf.INIT}),(r={dispatch:d,subscribe:h,getState:u,replaceReducer:p})[Ef]=m,r}function zf(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:Nf.INIT}))throw new Error(Af(12));if(void 0===n(void 0,{type:Nf.PROBE_UNKNOWN_ACTION()}))throw new Error(Af(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,
623
- new Error(Af(14));o[l]=h,r=r||h!==u}return(r=r||a.length!==Object.keys(e).length)?o:e}}function Of(e,t){return function(){return t(e.apply(this,arguments))}}function If(){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 Rf(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}var Pf=Rf();Pf.withExtraArgument=Rf;var Df=Pf;function Bf(e,t=[],n=[]){const r={},o={},i={};e.forEach((e=>{e.namespace?(r[e.namespace]=e.initialState(...t),o[e.namespace]=function(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}}}(e.reducers),i[e.namespace]={selectors:e.selectors,rootSelectors:e.rootSelectors||{}}):console.warn("Store module does not specify a namespace",e)}));const a=function(){
624
- 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(Af(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=t.map((function(e){return e(o)}));return r=If.apply(void 0,i)(n.dispatch),Cf(Cf({},n),{},{dispatch:r})}}}(...[Df],...n);const s=Mf(zf(o),r,a),l=Object.assign({},...e.map((e=>e.actionCreators))),c=function(e,t){if("function"==typeof e)return Of(e,t);if("object"!=typeof e||null===e)throw new Error(Af(16));var n={};for(var r in e){var o=e[r];"function"==typeof o&&(n[r]=Of(o,t))}return n}(l,s.dispatch),u=function(e,t){const n={};return Object.keys(e).forEach((r=>{const{selectors:o,rootSelectors:i={}}=e[r];Object.keys(o).forEach((e=>{if(n[e])throw new Error(`Duplicate selector "${e}"`);n[e]=(...n)=>o[e](t()[r],...n)})),Object.keys(i).forEach((e=>{if(n[e])throw new Error(`Duplicate selector "${e}"`);n[e]=(...n)=>i[e](t(),...n)}))})),n}(i,s.getState)
625
- ;return Object.assign(s,c,u),s}function Ff(e,t){if(!(e instanceof Function)){const t=e;e=()=>t}return{initialState:e,...t}}function jf(e){let t=0;return function(n){return function(r){if(!window.debug)return void n(r);++t;const o=r.type+" ("+t.toString()+")";console.group(o),console.log("Prev State:",e.getState()),console.log("Action:",r),n(r),console.log("Next State:",e.getState()),console.groupEnd()}}}const Hf={API_REQUEST_STARTED:e=>({...e,activeApiRequests:e.activeApiRequests+1}),API_REQUEST_FINISHED(e){if(0===e.activeApiRequests)throw new Error("API_REQUEST_FINISHED action when no requests were active");return{...e,activeApiRequests:e.activeApiRequests-1}},ANNOTATION_SAVE_STARTED(e,t){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,
626
- 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})},qf=of(Hf);const Uf=Ff({activeAnnotationSaveRequests:[],activeApiRequests:0,activeAnnotationFetches:0,hasFetchedAnnotations:!1,annotationResultCount:null},{reducers:Hf,namespace:"activity",actionCreators:{annotationFetchStarted:function(){return{type:qf.ANNOTATION_FETCH_STARTED}},annotationFetchFinished:function(){return{type:qf.ANNOTATION_FETCH_FINISHED}},annotationSaveStarted:function(e){return{type:qf.ANNOTATION_SAVE_STARTED,annotation:e}},annotationSaveFinished:function(e){return{type:qf.ANNOTATION_SAVE_FINISHED,annotation:e}},apiRequestStarted:function(){return{
627
- type:qf.API_REQUEST_STARTED}},apiRequestFinished:function(){return{type:qf.API_REQUEST_FINISHED}},setAnnotationResultCount:function(e){return{type:qf.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 $f=function(e,t){return e===t};function Gf(e,t){var n,r,o="object"==typeof t?t:{equalityCheck:t},i=o.equalityCheck,a=void 0===i?$f: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"},
628
- 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)}h.put(arguments,t)}return t}return d.clearCache=function(){return h.clear()},d}function Vf(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(", ")
629
- ;throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function Wf(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=Vf(r),m=e.apply(void 0,[function(){return a++,l.apply(null,arguments)}].concat(d)),f=e((function(){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 Yf=Wf(Gf)
630
- ;function Kf(e,t){return e.reduce(((e,n)=>t(n)?e+1:e),0)}function Xf(e){const t={};return e.forEach((e=>t[e]=!0)),t}function Zf(e){return Object.keys(e).filter((t=>!0===e[t]))}const Jf={CHANGE_ROUTE:(e,{name:t,params:n})=>({name:t,params:n})},Qf=of(Jf);const eg=Ff({name:null,params:{}},{namespace:"route",reducers:Jf,actionCreators:{changeRoute:function(e,t={}){return{type:Qf.CHANGE_ROUTE,name:e,params:t}}},selectors:{route:function(e){return e.name},routeParams:function(e){return e.params}}});function tg(e,t){return e.find((e=>e.id===t))}function ng(e,t){return e.find((e=>e.$tag===t))}const rg={ADD_ANNOTATIONS(e,t){const n={},r={},o=[],i=[],a=[];let s=e.nextTag;return t.annotations.forEach((t=>{let i;t.id&&(i=tg(e.annotations,t.id)),!i&&t.$tag&&(i=ng(e.annotations,t.$tag)),i?(a.push(Object.assign({},i,t)),t.id&&(n[t.id]=!0),i.$tag&&(r[i.$tag]=!0)):(o.push(function(e,t){let n=e.$orphan;return e.id||(n=!1),Object.assign({},e,{$anchorTimeout:!1,$tag:e.$tag||t,$orphan:n})}(t,"t"+s)),++s)})),
631
- e.annotations.forEach((e=>{n[e.id]||r[e.$tag]||i.push(e)})),{annotations:o.concat(a).concat(i),nextTag:s}},CLEAR_ANNOTATIONS:()=>({annotations:[],focused:{},highlighted:{}}),FOCUS_ANNOTATIONS:(e,t)=>({focused:Xf(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;const n=Object.assign({},e,{flagged:t.isFlagged});if(n.moderation){
632
- const e=t.isFlagged?1:-1;n.moderation={...n.moderation,flagCount:n.moderation.flagCount+e}}return n}return e}))})},og=of(rg);function ig(e){return(t,n)=>{const r=function(e,t){const n={},r={};return t.forEach((e=>{e.id&&(n[e.id]=!0),e.$tag&&(r[e.$tag]=!0)})),e.filter((e=>!(e.id&&e.id in n||e.$tag&&e.$tag in r)))}(n().annotations.annotations,e);t({type:og.REMOVE_ANNOTATIONS,annotationsToRemove:e,remainingAnnotations:r})}}function ag(e){return{type:og.UPDATE_ANCHOR_STATUS,statusUpdates:e}}const sg=Ff({annotations:[],focused:{},highlighted:{},nextTag:1},{namespace:"annotations",reducers:rg,actionCreators:{addAnnotations:function(e){return function(t,n){const r=e.filter((e=>!e.id||!tg(n().annotations.annotations,e.id)));if(t({type:og.ADD_ANNOTATIONS,annotations:e,currentAnnotationCount:n().annotations.annotations.length}),"sidebar"!==eg.selectors.route(n().route))return;const o=r.filter(zi).map((e=>e.id));o.length>0&&setTimeout((()=>{
633
- const e=n().annotations.annotations,r=o.map((t=>t?tg(e,t):null)).filter((e=>e&&zi(e))).reduce(((e,t)=>(e[t.$tag]="timeout",e)),{});t(ag(r))}),500)}},clearAnnotations:function(){return{type:og.CLEAR_ANNOTATIONS}},focusAnnotations:function(e){return{type:og.FOCUS_ANNOTATIONS,focusedTags:e}},hideAnnotation:function(e){return{type:og.HIDE_ANNOTATION,id:e}},highlightAnnotations:function(e){return{type:og.HIGHLIGHT_ANNOTATIONS,highlighted:Xf(e)}},removeAnnotations:ig,unhideAnnotation:function(e){return{type:og.UNHIDE_ANNOTATION,id:e}},updateAnchorStatus:ag,updateFlagStatus:function(e,t){return{type:og.UPDATE_FLAG_STATUS,id:e,isFlagged:t}}},selectors:{allAnnotations:function(e){return e.annotations},annotationCount:Yf((e=>e.annotations),(e=>Kf(e,Di))),annotationExists:function(e,t){return e.annotations.some((e=>e.id===t))},findAnnotationByID:function(e,t){return tg(e.annotations,t)},findIDsForTags:function(e,t){const n=[];return t.forEach((t=>{const r=ng(e.annotations,t);r&&r.id&&n.push(r.id)})),n},
634
- focusedAnnotations:Yf((e=>e.focused),(e=>Zf(e))),highlightedAnnotations:Yf((e=>e.highlighted),(e=>Zf(e))),isAnnotationFocused:function(e,t){return!0===e.focused[t]},isWaitingToAnchorAnnotations:Yf((e=>e.annotations),(e=>e.some(zi))),newAnnotations:Yf((e=>e.annotations),(e=>e.filter((e=>Ni(e)&&!Ii(e))))),newHighlights:Yf((e=>e.annotations),(e=>e.filter((e=>Ni(e)&&Ii(e))))),noteCount:Yf((e=>e.annotations),(e=>Kf(e,Pi))),orphanCount:Yf((e=>e.annotations),(e=>Kf(e,Ri))),savedAnnotations:function(e){return e.annotations.filter((e=>Ti(e)))}}}),lg={SET_DEFAULT:function(e,t){return{[t.defaultKey]:t.value}}},cg=of(lg);const ug=Ff({annotationPrivacy:null,focusedGroup:null},{namespace:"defaults",reducers:lg,actionCreators:{setDefault:function(e,t){return{type:cg.SET_DEFAULT,defaultKey:e,value:t}}},selectors:{getDefault:function(e,t){return e[t]},getDefaults:function(e){return e}}});const hg={UPDATE_DIRECT_LINKED_GROUP_FETCH_FAILED:(e,t)=>({directLinkedGroupFetchFailed:t.directLinkedGroupFetchFailed}),
635
- 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:function(){return{directLinkedAnnotationId:null,directLinkedGroupId:null,directLinkedGroupFetchFailed:!1}}},dg=of(hg);const pg=Ff((function(e){return{directLinkedGroupId:e.group||null,directLinkedAnnotationId:e.annotations||null,directLinkedGroupFetchFailed:!1}}),{namespace:"directLinked",reducers:hg,actionCreators:{setDirectLinkedGroupFetchFailed:function(){return{type:dg.UPDATE_DIRECT_LINKED_GROUP_FETCH_FAILED,directLinkedGroupFetchFailed:!0}},setDirectLinkedGroupId:function(e){return{type:dg.UPDATE_DIRECT_LINKED_GROUP_ID,directLinkedGroupId:e}},setDirectLinkedAnnotationId:function(e){return{type:dg.UPDATE_DIRECT_LINKED_ANNOTATION_ID,directLinkedAnnotationId:e}},clearDirectLinkedGroupFetchFailed:function(){return{
636
- type:dg.UPDATE_DIRECT_LINKED_GROUP_FETCH_FAILED,directLinkedGroupFetchFailed:!1}},clearDirectLinkedIds:function(){return{type:dg.CLEAR_DIRECT_LINKED_IDS}}},selectors:{directLinkedAnnotationId:function(e){return e.directLinkedAnnotationId},directLinkedGroupFetchFailed:function(e){return e.directLinkedGroupFetchFailed},directLinkedGroupId:function(e){return e.directLinkedGroupId}}});class mg{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 fg={DISCARD_ALL_DRAFTS:function(){return[]},REMOVE_DRAFT:function(e,t){return e.filter((e=>!e.match(t.annotation)))},UPDATE_DRAFT:function(e,t){const n=e.filter((e=>!e.match(t.draft.annotation)));return n.push(t.draft),n}},gg=of(fg);function vg(e){return{type:gg.REMOVE_DRAFT,annotation:e}}function yg(e,t){const n=e
637
- ;for(let e=0;e<n.length;e++){const r=n[e];if(r.match(t))return r}return null}function _g(e,t){const n=yg(e,t);return n?n.isEmpty()?null:n:null}const bg=Yf((e=>e),(e=>e.filter((e=>!e.annotation.id)).map((e=>e.annotation)))),wg=Ff([],{namespace:"drafts",reducers:fg,actionCreators:{createDraft:function(e,t){return{type:gg.UPDATE_DRAFT,draft:new mg(e,t)}},deleteNewAndEmptyDrafts:function(){return(e,t)=>{const n=t().drafts.filter((e=>Ni(e.annotation)&&!_g(t().drafts,e.annotation))).map((t=>(e(vg(t.annotation)),t.annotation)));e(ig(n))}},discardAllDrafts:function(){return{type:gg.DISCARD_ALL_DRAFTS}},removeDraft:vg},selectors:{countDrafts:function(e){return e.length},getDraft:yg,getDraftIfNotEmpty:_g,unsavedAnnotations:bg}});function xg(e){var t,n;return!!(null!==(t=e.user)&&void 0!==t&&t.username||null!==(n=e.user)&&void 0!==n&&n.userid)}function kg(e){if(!xg(e))return{};const t=e.user.username||e.user.userid||"";return{user:{value:t,display:e.user.displayName||t}}}const Sg={CHANGE_FOCUS_MODE_USER:function(e,t){
638
- return{focusActive:xg({user:t.user}),focusFilters:kg({user:t.user})}},SET_FILTER:function(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:function(e,t){return{query:t.query}},SET_FOCUS_MODE:function(e,t){var n;return{focusActive:null!==(n=t.active)&&void 0!==n?n:!e.focusActive}},CLEAR_SELECTION:function(){return{filters:{},focusActive:!1,query:null}}},Cg=of(Sg);const Ag=Yf((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)||""}})),Eg=Yf((e=>e.filters),(e=>e.focusActive),(e=>e.focusFilters),((e,t,n)=>t?{...n,...e}:{...e}));const Tg=Yf((e=>Eg(e)),(e=>{const t={};return Object.keys(e).forEach((n=>t[n]=e[n].value)),t}));const Ng=Ff((function(e){const t=e.focus||{};return{filters:{},focusActive:xg(t),focusFilters:kg(t),query:e.query||null}}),{namespace:"filters",
639
- reducers:Sg,actionCreators:{changeFocusModeUser:function(e){return{type:Cg.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({type:Cg.SET_FOCUS_MODE,active:!1}),n({type:Cg.SET_FILTER,filterName:e,filterOption:t})}},setFilterQuery:function(e){return{type:Cg.SET_FILTER_QUERY,query:e}},toggleFocusMode:function(e){return{type:Cg.SET_FOCUS_MODE,active:e}}},selectors:{filterQuery:function(e){return e.query},focusState:Ag,getFilter:function(e,t){return Eg(e)[t]},getFilters:Eg,getFilterValues:Tg,getFocusFilters:function(e){return e.focusFilters},hasAppliedFilter:function(e){return!(!e.query&&!Object.keys(Eg(e)).length)}}}),Lg={CONNECT_FRAME:function(e,t){return[...e,t.frame]},DESTROY_FRAME:function(e,t){return e.filter((e=>e!==t.frame))},UPDATE_FRAME_ANNOTATION_FETCH_STATUS:function(e,t){return e.map((e=>e.uri&&e.uri===t.uri?Object.assign({},e,{isAnnotationFetchComplete:t.isAnnotationFetchComplete}):e))}},Mg=of(Lg)
640
- ;const zg=Yf((e=>e),(e=>e.find((e=>!e.id))||null));const Og=Wf(Gf,Ym)((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)),Ig=Ff([],{namespace:"frames",reducers:Lg,actionCreators:{connectFrame:function(e){return{type:Mg.CONNECT_FRAME,frame:e}},destroyFrame:function(e){return{type:Mg.DESTROY_FRAME,frame:e}},updateFrameAnnotationFetchStatus:function(e,t){return{type:Mg.UPDATE_FRAME_ANNOTATION_FETCH_STATUS,isAnnotationFetchComplete:t,uri:e}}},selectors:{frames:function(e){return e},mainFrame:zg,searchUris:Og}}),Rg={features:{},preferences:{},userid:null};const Pg={UPDATE_PROFILE:function(e,t){return{profile:{...t.profile}}}},Dg=of(Pg);const Bg=Ff((function(e){var t;return{defaultAuthority:null!==(t=null==e?void 0:e.authDomain)&&void 0!==t?t:"",profile:Rg}}),{namespace:"session",reducers:Pg,
641
- actionCreators:{updateProfile:function(e){return{type:Dg.UPDATE_PROFILE,profile:e}}},selectors:{defaultAuthority:function(e){return e.defaultAuthority},hasFetchedProfile:function(e){return e.profile!==Rg},isFeatureEnabled:function(e,t){return!!e.profile.features[t]},isLoggedIn:function(e){return null!==e.profile.userid},profile:function(e){return e.profile}}}),Fg={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,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
642
- ;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:[]})},jg=of(Fg);function Hg(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 qg(e,t){return e.groups.find((e=>e.id===t))}const Ug=Yf((e=>Hg(e)),(e=>e.filter((e=>!e.isMember&&e.isScopedToUri)))),$g=Yf((e=>Hg(e)),(e=>e.filter((e=>e.isScopedToUri)))),Gg=Yf((e=>Hg(e.groups)),(e=>Bg.selectors.isLoggedIn(e.session)),((e,t)=>t?e.filter((e=>e.isMember)):[])),Vg=Yf((e=>Hg(e.groups)),(e=>Gg(e)),(e=>Ug(e.groups)),((e,t,n)=>e.filter((e=>!t.includes(e)&&!n.includes(e))))),Wg=Ff({filteredGroupIds:null,groups:[],focusedGroupId:null},{namespace:"groups",reducers:Fg,actionCreators:{filterGroups:function(e){return{type:jg.FILTER_GROUPS,filteredGroupIds:e}},focusGroup:function(e){return{type:jg.FOCUS_GROUP,id:e}},
643
- loadGroups:function(e){return{type:jg.LOAD_GROUPS,groups:e}},clearGroups:function(){return{type:jg.CLEAR_GROUPS}}},selectors:{allGroups:function(e){return e.groups},filteredGroups:Hg,filteredGroupIds:function(e){return e.filteredGroupIds},focusedGroup:function(e){return e.focusedGroupId?qg(e,e.focusedGroupId):null},focusedGroupId:function(e){return e.focusedGroupId},getFeaturedGroups:Ug,getGroup:qg,getInScopeGroups:$g},rootSelectors:{getCurrentlyViewingGroups:Vg,getMyGroups:Gg}}),Yg={UPDATE_LINKS:(e,t)=>({...t.links})},Kg=of(Yg);const Xg=Ff(null,{namespace:"links",reducers:Yg,actionCreators:{updateLinks:function(e){return{type:Kg.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}=Im(r,n),a=Object.keys(i);if(a.length>0)throw new Error(`Unused parameters: ${a.join(", ")}`);return o}}}),Zg={RECEIVE_REAL_TIME_UPDATES:(e,t)=>({pendingUpdates:{...t.pendingUpdates},pendingDeletions:{...t.pendingDeletions}
644
- }),CLEAR_PENDING_UPDATES:()=>({pendingUpdates:{},pendingDeletions:{}}),ADD_ANNOTATIONS(e,{annotations:t}){const n={...e.pendingUpdates};return t.forEach((e=>delete n[e.id])),{pendingUpdates:n}},REMOVE_ANNOTATIONS(e,{annotationsToRemove:t}){const n={...e.pendingUpdates},r={...e.pendingDeletions};return t.forEach((e=>{delete n[e.id],delete r[e.id]})),{pendingUpdates:n,pendingDeletions:r}},FOCUS_GROUP:()=>({pendingUpdates:{},pendingDeletions:{}})},Jg=of(Zg);const Qg=Yf((e=>[e.pendingUpdates,e.pendingDeletions]),(([e,t])=>Object.keys(e).length+Object.keys(t).length));const ev=Ff({pendingUpdates:{},pendingDeletions:{}},{namespace:"realTimeUpdates",reducers:Zg,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!==Wg.selectors.focusedGroupId(t)&&"sidebar"===eg.selectors.route(n)||(o[e.id]=e)})),t.forEach((e=>{
645
- const t=e.id;delete o[t];const n=r().annotations;sg.selectors.annotationExists(n,t)&&(i[t]=!0)})),n({type:Jg.RECEIVE_REAL_TIME_UPDATES,pendingUpdates:o,pendingDeletions:i})}},clearPendingUpdates:function(){return{type:Jg.CLEAR_PENDING_UPDATES}}},selectors:{hasPendingDeletion:function(e,t){return e.pendingDeletions.hasOwnProperty(t)},pendingDeletions:function(e){return e.pendingDeletions},pendingUpdates:function(e){return e.pendingUpdates},pendingUpdateCount:Qg}}),tv={annotation:"Location",note:"Oldest",orphan:"Location"};function nv(e){const t={};return e.annotations&&!e.query&&(t[e.annotations]=!0),t}const rv=(e,t)=>t===e?{}:{selectedTab:e,sortKey:tv[e]},ov={CLEAR_SELECTION:function(){return{forcedVisible:{},selected:{}}},SELECT_ANNOTATIONS:function(e,t){return{selected:t.selection}},SELECT_TAB:function(e,t){return rv(t.tab,e.selectedTab)},SET_EXPANDED:function(e,t){const n={...e.expanded};return n[t.id]=t.expanded,{expanded:n}},SET_FORCED_VISIBLE:function(e,t){return{forcedVisible:{...e.forcedVisible,
646
- [t.id]:t.visible}}},SET_SORT_KEY:function(e,t){return{sortKey:t.key}},TOGGLE_SELECTED_ANNOTATIONS:function(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=>!Ei(e))),r=Kf(t.annotations,Pi)===n.length;return 0===t.currentAnnotationCount&&r?rv("note",e.selectedTab):{}},CHANGE_FOCUS_MODE_USER:function(){return{forcedVisible:{},selected:{}}},SET_FILTER:function(){return{forcedVisible:{},selected:{},expanded:{}}},SET_FILTER_QUERY:function(){return{forcedVisible:{},selected:{},expanded:{}}},SET_FOCUS_MODE:function(){return{forcedVisible:{},selected:{}}},REMOVE_ANNOTATIONS:function(e,t){let n=e.selectedTab;"orphan"===n&&0===Kf(t.remainingAnnotations,Ri)&&(n="annotation");const r=e=>(t.annotationsToRemove.forEach((t=>{t.id&&delete e[t.id],t.$tag&&delete e[t.$tag]})),e);return{...rv(n,e.selectedTab),expanded:r({...e.expanded}),forcedVisible:r({...e.forcedVisible}),selected:r({...e.selected})}}},iv=of(ov);function av(e){
647
- return e.expanded}const sv=Yf((e=>e.forcedVisible),(e=>Zf(e))),lv=Yf((e=>e.selected),(e=>Zf(e).length>0)),cv=Yf((e=>e.selected),(e=>Zf(e)));function uv(e){return e.selectedTab}const hv=Yf((e=>e),(e=>({expanded:av(e),forcedVisible:sv(e),selected:cv(e),sortKey:dv(e),selectedTab:uv(e)})));function dv(e){return e.sortKey}const pv=Yf((e=>e.selectedTab),(e=>{const t=["Newest","Oldest"];return"note"!==e&&t.push("Location"),t})),mv=Ff((function(e){return{selected:nv(e),expanded:nv(e)||{},forcedVisible:{},selectedTab:"annotation",sortKey:tv.annotation}}),{namespace:"selection",reducers:ov,actionCreators:{clearSelection:function(){return{type:iv.CLEAR_SELECTION}},selectAnnotations:function(e){return t=>{t({type:iv.CLEAR_SELECTION}),t({type:iv.SELECT_ANNOTATIONS,selection:Xf(e)})}},selectTab:function(e){return{type:iv.SELECT_TAB,tab:e}},setExpanded:function(e,t){return{type:iv.SET_EXPANDED,id:e,expanded:t}},setForcedVisible:function(e,t){return{type:iv.SET_FORCED_VISIBLE,id:e,visible:t}},setSortKey:function(e){return{
648
- type:iv.SET_SORT_KEY,key:e}},toggleSelectedAnnotations:function(e){return{type:iv.TOGGLE_SELECTED_ANNOTATIONS,toggleIds:e}}},selectors:{expandedMap:av,forcedVisibleThreads:sv,hasSelectedAnnotations:lv,selectedAnnotations:cv,selectedTab:uv,selectionState:hv,sortKey:dv,sortKeys:pv}}),fv={OPEN_SIDEBAR_PANEL:function(e,t){return{activePanelName:t.panelName}},CLOSE_SIDEBAR_PANEL:function(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}}},gv=of(fv);const vv=Ff({activePanelName:null},{namespace:"sidebarPanels",reducers:fv,actionCreators:{openSidebarPanel:function(e){return{type:gv.OPEN_SIDEBAR_PANEL,panelName:e}},closeSidebarPanel:function(e){return{type:gv.CLOSE_SIDEBAR_PANEL,panelName:e}},toggleSidebarPanel:function(e,t){return{type:gv.TOGGLE_SIDEBAR_PANEL,panelName:e,panelState:t}}},
649
- selectors:{isSidebarPanelOpen:function(e,t){return e.activePanelName===t}}}),yv={ADD_MESSAGE:function(e,t){return{messages:e.messages.concat({...t.message})}},REMOVE_MESSAGE:function(e,t){return{messages:e.messages.filter((e=>e.id!==t.id))}},UPDATE_MESSAGE:function(e,t){return{messages:e.messages.map((e=>e.id&&e.id===t.message.id?{...t.message}:e))}}},_v=of(yv);const bv=Ff({messages:[]},{namespace:"toastMessages",reducers:yv,actionCreators:{addToastMessage:function(e){return{type:_v.ADD_MESSAGE,message:e}},removeToastMessage:function(e){return{type:_v.REMOVE_MESSAGE,id:e}},updateToastMessage:function(e){return{type:_v.UPDATE_MESSAGE,message:e}}},selectors:{getToastMessage:function(e,t){return e.messages.find((e=>e.id===t))},getToastMessages:function(e){return e.messages},hasToastMessage:function(e,t,n){return e.messages.some((e=>e.type===t&&e.message===n))}}}),wv={SET_SIDEBAR_OPENED:(e,t)=>!0===t.opened?{sidebarHasOpened:!0}:{}},xv=of(wv);const kv=Ff({sidebarHasOpened:!1},{namespace:"viewer",reducers:wv,
650
- actionCreators:{setSidebarOpened:function(e){return{type:xv.SET_SIDEBAR_OPENED,opened:e}}},selectors:{hasSidebarOpened:function(e){return e.sidebarHasOpened}}});function Sv(e){return Bf([Uf,sg,ug,pg,wg,Ng,Ig,Xg,Wg,ev,eg,mv,Bg,vv,bv,kv],[e],[jf])}Sv.$inject=["settings"];class Cv{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){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)}
651
- 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 Av=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),Ev=function(e){const{version:t,origin:n}=R(e.location.href);return"1.1004.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.1004.0) than the host page (${t}). It may not work.`),
652
- !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 Tv(e,t){e.setClientId(t.clientId)}function Nv(e,t,n){e.load(),t.load(),n.sync()}function Lv(e,t,n,r){e.init(),t.init(),n.init(),r.init()}function Mv(e,t){"sidebar"===t.route()&&e.connect()}Av.sentry&&Ev&&function(e){const t=function(){let e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;Cr({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1004.0",beforeSend:(e,t)=>{if(Tr>=5)return V("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++Tr;try{const n=t&&t.originalException;n instanceof Event&&Object.assign(e.extra,{type:n.type,detail:n.detail,isTrusted:n.isTrusted})}catch(e){}return e}});try{
653
- Vt("host_config",R(window.location.href))}catch(e){}Vt("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),Er(((e,t)=>{Gt(e,{tags:{context:t}})}))}(Av.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)}}}(),Tv.$inject=["api","streamer"],Nv.$inject=["groups","session","router"],Lv.$inject=["autosaveService","features","persistedDefaults","serviceURL"],Mv.$inject=["frameSync","store"],function(e,{reset:t=!1}={}){t&&yo.clear();for(let[t,n]of Object.entries(e))yo.set(t,n)}(Qo);const zv=document.querySelector("hypothesis-app");!function(e=window){e.addEventListener("message",J)}(),async function(e,t=window){
654
- const n=function(e){const t=R(e.location.href),n=["annotations","group","query","appType","openSidebar","showHighlights","services","branding","enableExperimentalNewNoteButton","focus","requestConfigFromFrame","theme","usernameUrl"],r={openSidebar:D,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)}}};return Object.keys(t).reduce(((e,o)=>(-1!==n.indexOf(o)&&null!==t[o]&&(r[o]?e[o]=r[o](t[o]):e[o]=t[o]),e)),{})}(window),r=n.requestConfigFromFrame;if(!r)return U(e,n);if("number"==typeof r.ancestorLevel&&"string"==typeof r.origin){const o=function(e,t=window){let n=t;for(let t=0;t<e;t++){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}(r.ancestorLevel,t);return{...await $(e,o,r.origin),...n.group?{group:n.group}:{}}}
655
- throw new Error("Improper `requestConfigFromFrame` object. Both `ancestorLevel` and `origin` need to be specified")}(Av).then((e=>{!function(e,t){const n=new Cv;n.register("annotationsService",Mm).register("api",Pm).register("apiRoutes",Um).register("auth",Vm).register("autosaveService",Wm).register("features",Xm).register("frameSync",rf).register("groups",lf).register("loadAnnotationsService",cf).register("localStorage",hf).register("persistedDefaults",pf).register("router",mf).register("serviceURL",ff).register("session",gf).register("streamer",_f).register("streamFilter",vf).register("tags",bf).register("threadsService",wf).register("toastMessenger",xf).register("store",{factory:Sv}),n.register("$window",{value:window}).register("settings",{value:e}),n.run(Lv),n.run(Tv),n.run(Nv),n.run(Z),n.run(Mv),I(vo(ai.Provider,{value:n,children:vo(Nm,{})}),t)}(e,zv)})).catch((e=>function(e,t){console.error("Failed to start Hypothesis client: ",e),I(vo(Lm,{error:e}),t)}(e,zv)));
619
+ 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 wf(r);o.on("open",(()=>{this._reconnectionAttempts=0,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))),
620
+ 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,Jm(this._store.subscribe,(()=>this._store.profile().userid),(()=>{this._reconnect()}))),this._socket||await this._reconnect()}}xf.$inject=["store","apiRoutes","auth","groups","session"];class kf{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=>{if(null!==t&&r>=t)return!1;const o=n.split(/\W+/),i=new RegExp(`^${Y(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)
621
+ ;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)}}kf.$inject=["localStorage"];class Sf{constructor(e){this._store=e}forceVisible(e){e.children.forEach((e=>{this.forceVisible(e)})),e.visible||this._store.setForcedVisible(e.id,!0)}}Sf.$inject=["store"];class Cf{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))}_addMessage(e,t,{autoDismiss:n=!0,moreInfoURL:r=""}={}){if(this._store.hasToastMessage(e,t))return;const o=H(10),i={type:e,id:o,message:t,moreInfoURL:r};this._store.addToastMessage({isDismissed:!1,...i}),n&&setTimeout((()=>{this.dismiss(o)}),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)}}function Af(e,t,n){return t in e?Object.defineProperty(e,t,{
622
+ value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ef(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 Tf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ef(Object(n),!0).forEach((function(t){Af(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ef(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Nf(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. "}Cf.$inject=["store"];var Mf="function"==typeof Symbol&&Symbol.observable||"@@observable",Lf=function(){return Math.random().toString(36).substring(7).split("").join(".")},zf={INIT:"@@redux/INIT"+Lf(),
623
+ REPLACE:"@@redux/REPLACE"+Lf(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Lf()}};function Of(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 If(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Nf(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Nf(1));return n(If)(e,t)}if("function"!=typeof e)throw new Error(Nf(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(Nf(3));return i}function h(e){if("function"!=typeof e)throw new Error(Nf(4));if(l)throw new Error(Nf(5));var t=!0;return c(),s.push(e),function(){if(t){if(l)throw new Error(Nf(6));t=!1,c();var n=s.indexOf(e);s.splice(n,1),a=null}}}function d(e){if(!Of(e))throw new Error(Nf(7));if(void 0===e.type)throw new Error(Nf(8))
624
+ ;if(l)throw new Error(Nf(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(Nf(10));o=e,d({type:zf.REPLACE})}function m(){var e,t=h;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(Nf(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[Mf]=function(){return this},e}return d({type:zf.INIT}),(r={dispatch:d,subscribe:h,getState:u,replaceReducer:p})[Mf]=m,r}function Pf(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:zf.INIT}))throw new Error(Nf(12));if(void 0===n(void 0,{type:zf.PROBE_UNKNOWN_ACTION()}))throw new Error(Nf(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,
625
+ new Error(Nf(14));o[l]=h,r=r||h!==u}return(r=r||a.length!==Object.keys(e).length)?o:e}}function Rf(e,t){return function(){return t(e.apply(this,arguments))}}function Df(){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 Bf(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}var Ff=Bf();Ff.withExtraArgument=Bf;var jf=Ff;function Hf(e,t=[],n=[]){const r={},o={},i={};e.forEach((e=>{e.namespace?(r[e.namespace]=e.initialState(...t),o[e.namespace]=function(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}}}(e.reducers),i[e.namespace]={selectors:e.selectors,rootSelectors:e.rootSelectors||{}}):console.warn("Store module does not specify a namespace",e)}));const a=function(){
626
+ 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(Nf(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=t.map((function(e){return e(o)}));return r=Df.apply(void 0,i)(n.dispatch),Tf(Tf({},n),{},{dispatch:r})}}}(...[jf],...n);const s=If(Pf(o),r,a),l=Object.assign({},...e.map((e=>e.actionCreators))),c=function(e,t){if("function"==typeof e)return Rf(e,t);if("object"!=typeof e||null===e)throw new Error(Nf(16));var n={};for(var r in e){var o=e[r];"function"==typeof o&&(n[r]=Rf(o,t))}return n}(l,s.dispatch),u=function(e,t){const n={};return Object.keys(e).forEach((r=>{const{selectors:o,rootSelectors:i={}}=e[r];Object.keys(o).forEach((e=>{if(n[e])throw new Error(`Duplicate selector "${e}"`);n[e]=(...n)=>o[e](t()[r],...n)})),Object.keys(i).forEach((e=>{if(n[e])throw new Error(`Duplicate selector "${e}"`);n[e]=(...n)=>i[e](t(),...n)}))})),n}(i,s.getState)
627
+ ;return Object.assign(s,c,u),s}function qf(e,t){if(!(e instanceof Function)){const t=e;e=()=>t}return{initialState:e,...t}}function Uf(e){let t=0;return function(n){return function(r){if(!window.debug)return void n(r);++t;const o=r.type+" ("+t.toString()+")";console.group(o),console.log("Prev State:",e.getState()),console.log("Action:",r),n(r),console.log("Next State:",e.getState()),console.groupEnd()}}}const $f={API_REQUEST_STARTED:e=>({...e,activeApiRequests:e.activeApiRequests+1}),API_REQUEST_FINISHED(e){if(0===e.activeApiRequests)throw new Error("API_REQUEST_FINISHED action when no requests were active");return{...e,activeApiRequests:e.activeApiRequests-1}},ANNOTATION_SAVE_STARTED(e,t){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,
628
+ 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})},Gf=lf($f);const Vf=qf({activeAnnotationSaveRequests:[],activeApiRequests:0,activeAnnotationFetches:0,hasFetchedAnnotations:!1,annotationResultCount:null},{reducers:$f,namespace:"activity",actionCreators:{annotationFetchStarted:function(){return{type:Gf.ANNOTATION_FETCH_STARTED}},annotationFetchFinished:function(){return{type:Gf.ANNOTATION_FETCH_FINISHED}},annotationSaveStarted:function(e){return{type:Gf.ANNOTATION_SAVE_STARTED,annotation:e}},annotationSaveFinished:function(e){return{type:Gf.ANNOTATION_SAVE_FINISHED,annotation:e}},apiRequestStarted:function(){return{
629
+ type:Gf.API_REQUEST_STARTED}},apiRequestFinished:function(){return{type:Gf.API_REQUEST_FINISHED}},setAnnotationResultCount:function(e){return{type:Gf.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 Wf=function(e,t){return e===t};function Yf(e,t){var n,r,o="object"==typeof t?t:{equalityCheck:t},i=o.equalityCheck,a=void 0===i?Wf: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"},
630
+ 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)}h.put(arguments,t)}return t}return d.clearCache=function(){return h.clear()},d}function Kf(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(", ")
631
+ ;throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function Xf(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=Kf(r),m=e.apply(void 0,[function(){return a++,l.apply(null,arguments)}].concat(d)),f=e((function(){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 Zf=Xf(Yf)
632
+ ;function Jf(e,t){return e.reduce(((e,n)=>t(n)?e+1:e),0)}function Qf(e){const t={};return e.forEach((e=>t[e]=!0)),t}function eg(e){return Object.keys(e).filter((t=>!0===e[t]))}const tg={CHANGE_ROUTE:(e,{name:t,params:n})=>({name:t,params:n})},ng=lf(tg);const rg=qf({name:null,params:{}},{namespace:"route",reducers:tg,actionCreators:{changeRoute:function(e,t={}){return{type:ng.CHANGE_ROUTE,name:e,params:t}}},selectors:{route:function(e){return e.name},routeParams:function(e){return e.params}}});function og(e,t){return e.find((e=>e.id===t))}function ig(e,t){return e.find((e=>e.$tag===t))}const ag={ADD_ANNOTATIONS(e,t){const n={},r={},o=[],i=[],a=[];let s=e.nextTag;return t.annotations.forEach((t=>{let i;t.id&&(i=og(e.annotations,t.id)),!i&&t.$tag&&(i=ig(e.annotations,t.$tag)),i?(a.push(Object.assign({},i,t)),t.id&&(n[t.id]=!0),i.$tag&&(r[i.$tag]=!0)):(o.push(function(e,t){let n=e.$orphan;return e.id||(n=!1),Object.assign({},e,{$anchorTimeout:!1,$tag:e.$tag||t,$orphan:n})}(t,"t"+s)),++s)})),
633
+ e.annotations.forEach((e=>{n[e.id]||r[e.$tag]||i.push(e)})),{annotations:o.concat(a).concat(i),nextTag:s}},CLEAR_ANNOTATIONS:()=>({annotations:[],focused:{},highlighted:{}}),FOCUS_ANNOTATIONS:(e,t)=>({focused:Qf(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;const n=Object.assign({},e,{flagged:t.isFlagged});if(n.moderation){
634
+ const e=t.isFlagged?1:-1;n.moderation={...n.moderation,flagCount:n.moderation.flagCount+e}}return n}return e}))})},sg=lf(ag);function lg(e){return(t,n)=>{const r=function(e,t){const n={},r={};return t.forEach((e=>{e.id&&(n[e.id]=!0),e.$tag&&(r[e.$tag]=!0)})),e.filter((e=>!(e.id&&e.id in n||e.$tag&&e.$tag in r)))}(n().annotations.annotations,e);t({type:sg.REMOVE_ANNOTATIONS,annotationsToRemove:e,remainingAnnotations:r})}}function cg(e){return{type:sg.UPDATE_ANCHOR_STATUS,statusUpdates:e}}const ug=qf({annotations:[],focused:{},highlighted:{},nextTag:1},{namespace:"annotations",reducers:ag,actionCreators:{addAnnotations:function(e){return function(t,n){const r=e.filter((e=>!e.id||!og(n().annotations.annotations,e.id)));if(t({type:sg.ADD_ANNOTATIONS,annotations:e,currentAnnotationCount:n().annotations.annotations.length}),"sidebar"!==rg.selectors.route(n().route))return;const o=r.filter(Ii).map((e=>e.id));o.length>0&&setTimeout((()=>{
635
+ const e=n().annotations.annotations,r=o.map((t=>t?og(e,t):null)).filter((e=>e&&Ii(e))).reduce(((e,t)=>(e[t.$tag]="timeout",e)),{});t(cg(r))}),500)}},clearAnnotations:function(){return{type:sg.CLEAR_ANNOTATIONS}},focusAnnotations:function(e){return{type:sg.FOCUS_ANNOTATIONS,focusedTags:e}},hideAnnotation:function(e){return{type:sg.HIDE_ANNOTATION,id:e}},highlightAnnotations:function(e){return{type:sg.HIGHLIGHT_ANNOTATIONS,highlighted:Qf(e)}},removeAnnotations:lg,unhideAnnotation:function(e){return{type:sg.UNHIDE_ANNOTATION,id:e}},updateAnchorStatus:cg,updateFlagStatus:function(e,t){return{type:sg.UPDATE_FLAG_STATUS,id:e,isFlagged:t}}},selectors:{allAnnotations:function(e){return e.annotations},annotationCount:Zf((e=>e.annotations),(e=>Jf(e,Fi))),annotationExists:function(e,t){return e.annotations.some((e=>e.id===t))},findAnnotationByID:function(e,t){return og(e.annotations,t)},findIDsForTags:function(e,t){const n=[];return t.forEach((t=>{const r=ig(e.annotations,t);r&&r.id&&n.push(r.id)})),n},
636
+ focusedAnnotations:Zf((e=>e.focused),(e=>eg(e))),highlightedAnnotations:Zf((e=>e.highlighted),(e=>eg(e))),isAnnotationFocused:function(e,t){return!0===e.focused[t]},isWaitingToAnchorAnnotations:Zf((e=>e.annotations),(e=>e.some(Ii))),newAnnotations:Zf((e=>e.annotations),(e=>e.filter((e=>Li(e)&&!Ri(e))))),newHighlights:Zf((e=>e.annotations),(e=>e.filter((e=>Li(e)&&Ri(e))))),noteCount:Zf((e=>e.annotations),(e=>Jf(e,Bi))),orphanCount:Zf((e=>e.annotations),(e=>Jf(e,Di))),savedAnnotations:function(e){return e.annotations.filter((e=>Mi(e)))}}}),hg={SET_DEFAULT:function(e,t){return{[t.defaultKey]:t.value}}},dg=lf(hg);const pg=qf({annotationPrivacy:null,focusedGroup:null},{namespace:"defaults",reducers:hg,actionCreators:{setDefault:function(e,t){return{type:dg.SET_DEFAULT,defaultKey:e,value:t}}},selectors:{getDefault:function(e,t){return e[t]},getDefaults:function(e){return e}}});const mg={UPDATE_DIRECT_LINKED_GROUP_FETCH_FAILED:(e,t)=>({directLinkedGroupFetchFailed:t.directLinkedGroupFetchFailed}),
637
+ 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:function(){return{directLinkedAnnotationId:null,directLinkedGroupId:null,directLinkedGroupFetchFailed:!1}}},fg=lf(mg);const gg=qf((function(e){return{directLinkedGroupId:e.group||null,directLinkedAnnotationId:e.annotations||null,directLinkedGroupFetchFailed:!1}}),{namespace:"directLinked",reducers:mg,actionCreators:{setDirectLinkedGroupFetchFailed:function(){return{type:fg.UPDATE_DIRECT_LINKED_GROUP_FETCH_FAILED,directLinkedGroupFetchFailed:!0}},setDirectLinkedGroupId:function(e){return{type:fg.UPDATE_DIRECT_LINKED_GROUP_ID,directLinkedGroupId:e}},setDirectLinkedAnnotationId:function(e){return{type:fg.UPDATE_DIRECT_LINKED_ANNOTATION_ID,directLinkedAnnotationId:e}},clearDirectLinkedGroupFetchFailed:function(){return{
638
+ type:fg.UPDATE_DIRECT_LINKED_GROUP_FETCH_FAILED,directLinkedGroupFetchFailed:!1}},clearDirectLinkedIds:function(){return{type:fg.CLEAR_DIRECT_LINKED_IDS}}},selectors:{directLinkedAnnotationId:function(e){return e.directLinkedAnnotationId},directLinkedGroupFetchFailed:function(e){return e.directLinkedGroupFetchFailed},directLinkedGroupId:function(e){return e.directLinkedGroupId}}});class vg{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 yg={DISCARD_ALL_DRAFTS:function(){return[]},REMOVE_DRAFT:function(e,t){return e.filter((e=>!e.match(t.annotation)))},UPDATE_DRAFT:function(e,t){const n=e.filter((e=>!e.match(t.draft.annotation)));return n.push(t.draft),n}},_g=lf(yg);function bg(e){return{type:_g.REMOVE_DRAFT,annotation:e}}function wg(e,t){const n=e
639
+ ;for(let e=0;e<n.length;e++){const r=n[e];if(r.match(t))return r}return null}function xg(e,t){const n=wg(e,t);return n?n.isEmpty()?null:n:null}const kg=Zf((e=>e),(e=>e.filter((e=>!e.annotation.id)).map((e=>e.annotation)))),Sg=qf([],{namespace:"drafts",reducers:yg,actionCreators:{createDraft:function(e,t){return{type:_g.UPDATE_DRAFT,draft:new vg(e,t)}},deleteNewAndEmptyDrafts:function(){return(e,t)=>{const n=t().drafts.filter((e=>Li(e.annotation)&&!xg(t().drafts,e.annotation))).map((t=>(e(bg(t.annotation)),t.annotation)));e(lg(n))}},discardAllDrafts:function(){return{type:_g.DISCARD_ALL_DRAFTS}},removeDraft:bg},selectors:{countDrafts:function(e){return e.length},getDraft:wg,getDraftIfNotEmpty:xg,unsavedAnnotations:kg}});function Cg(e){var t,n;return!!(null!==(t=e.user)&&void 0!==t&&t.username||null!==(n=e.user)&&void 0!==n&&n.userid)}function Ag(e){if(!Cg(e))return{};const t=e.user.username||e.user.userid||"";return{user:{value:t,display:e.user.displayName||t}}}const Eg={CHANGE_FOCUS_MODE_USER:function(e,t){
640
+ return{focusActive:Cg({user:t.user}),focusFilters:Ag({user:t.user})}},SET_FILTER:function(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:function(e,t){return{query:t.query}},SET_FOCUS_MODE:function(e,t){var n;return{focusActive:null!==(n=t.active)&&void 0!==n?n:!e.focusActive}},CLEAR_SELECTION:function(){return{filters:{},focusActive:!1,query:null}}},Tg=lf(Eg);const Ng=Zf((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)||""}})),Mg=Zf((e=>e.filters),(e=>e.focusActive),(e=>e.focusFilters),((e,t,n)=>t?{...n,...e}:{...e}));const Lg=Zf((e=>Mg(e)),(e=>{const t={};return Object.keys(e).forEach((n=>t[n]=e[n].value)),t}));const zg=qf((function(e){const t=e.focus||{};return{filters:{},focusActive:Cg(t),focusFilters:Ag(t),query:e.query||null}}),{namespace:"filters",
641
+ reducers:Eg,actionCreators:{changeFocusModeUser:function(e){return{type:Tg.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({type:Tg.SET_FOCUS_MODE,active:!1}),n({type:Tg.SET_FILTER,filterName:e,filterOption:t})}},setFilterQuery:function(e){return{type:Tg.SET_FILTER_QUERY,query:e}},toggleFocusMode:function(e){return{type:Tg.SET_FOCUS_MODE,active:e}}},selectors:{filterQuery:function(e){return e.query},focusState:Ng,getFilter:function(e,t){return Mg(e)[t]},getFilters:Mg,getFilterValues:Lg,getFocusFilters:function(e){return e.focusFilters},hasAppliedFilter:function(e){return!(!e.query&&!Object.keys(Mg(e)).length)}}}),Og={CONNECT_FRAME:function(e,t){return[...e,t.frame]},DESTROY_FRAME:function(e,t){return e.filter((e=>e!==t.frame))},UPDATE_FRAME_ANNOTATION_FETCH_STATUS:function(e,t){return e.map((e=>e.uri&&e.uri===t.uri?Object.assign({},e,{isAnnotationFetchComplete:t.isAnnotationFetchComplete}):e))}},Ig=lf(Og)
642
+ ;const Pg=Zf((e=>e),(e=>e.find((e=>!e.id))||null));const Rg=Xf(Yf,Zm)((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)),Dg=qf([],{namespace:"frames",reducers:Og,actionCreators:{connectFrame:function(e){return{type:Ig.CONNECT_FRAME,frame:e}},destroyFrame:function(e){return{type:Ig.DESTROY_FRAME,frame:e}},updateFrameAnnotationFetchStatus:function(e,t){return{type:Ig.UPDATE_FRAME_ANNOTATION_FETCH_STATUS,isAnnotationFetchComplete:t,uri:e}}},selectors:{frames:function(e){return e},mainFrame:Pg,searchUris:Rg}}),Bg={features:{},preferences:{},userid:null};const Fg={UPDATE_PROFILE:function(e,t){return{profile:{...t.profile}}}},jg=lf(Fg);const Hg=qf((function(e){var t;return{defaultAuthority:null!==(t=null==e?void 0:e.authDomain)&&void 0!==t?t:"",profile:Bg}}),{namespace:"session",reducers:Fg,
643
+ actionCreators:{updateProfile:function(e){return{type:jg.UPDATE_PROFILE,profile:e}}},selectors:{defaultAuthority:function(e){return e.defaultAuthority},hasFetchedProfile:function(e){return e.profile!==Bg},isFeatureEnabled:function(e,t){return!!e.profile.features[t]},isLoggedIn:function(e){return null!==e.profile.userid},profile:function(e){return e.profile}}}),qg={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,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
644
+ ;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:[]})},Ug=lf(qg);function $g(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 Gg(e,t){return e.groups.find((e=>e.id===t))}const Vg=Zf((e=>$g(e)),(e=>e.filter((e=>!e.isMember&&e.isScopedToUri)))),Wg=Zf((e=>$g(e)),(e=>e.filter((e=>e.isScopedToUri)))),Yg=Zf((e=>$g(e.groups)),(e=>Hg.selectors.isLoggedIn(e.session)),((e,t)=>t?e.filter((e=>e.isMember)):[])),Kg=Zf((e=>$g(e.groups)),(e=>Yg(e)),(e=>Vg(e.groups)),((e,t,n)=>e.filter((e=>!t.includes(e)&&!n.includes(e))))),Xg=qf({filteredGroupIds:null,groups:[],focusedGroupId:null},{namespace:"groups",reducers:qg,actionCreators:{filterGroups:function(e){return{type:Ug.FILTER_GROUPS,filteredGroupIds:e}},focusGroup:function(e){return{type:Ug.FOCUS_GROUP,id:e}},
645
+ loadGroups:function(e){return{type:Ug.LOAD_GROUPS,groups:e}},clearGroups:function(){return{type:Ug.CLEAR_GROUPS}}},selectors:{allGroups:function(e){return e.groups},filteredGroups:$g,filteredGroupIds:function(e){return e.filteredGroupIds},focusedGroup:function(e){return e.focusedGroupId?Gg(e,e.focusedGroupId):null},focusedGroupId:function(e){return e.focusedGroupId},getFeaturedGroups:Vg,getGroup:Gg,getInScopeGroups:Wg},rootSelectors:{getCurrentlyViewingGroups:Kg,getMyGroups:Yg}}),Zg={UPDATE_LINKS:(e,t)=>({...t.links})},Jg=lf(Zg);const Qg=qf(null,{namespace:"links",reducers:Zg,actionCreators:{updateLinks:function(e){return{type:Jg.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}=Dm(r,n),a=Object.keys(i);if(a.length>0)throw new Error(`Unused parameters: ${a.join(", ")}`);return o}}}),ev={RECEIVE_REAL_TIME_UPDATES:(e,t)=>({pendingUpdates:{...t.pendingUpdates},pendingDeletions:{...t.pendingDeletions}
646
+ }),CLEAR_PENDING_UPDATES:()=>({pendingUpdates:{},pendingDeletions:{}}),ADD_ANNOTATIONS(e,{annotations:t}){const n={...e.pendingUpdates};return t.forEach((e=>delete n[e.id])),{pendingUpdates:n}},REMOVE_ANNOTATIONS(e,{annotationsToRemove:t}){const n={...e.pendingUpdates},r={...e.pendingDeletions};return t.forEach((e=>{delete n[e.id],delete r[e.id]})),{pendingUpdates:n,pendingDeletions:r}},FOCUS_GROUP:()=>({pendingUpdates:{},pendingDeletions:{}})},tv=lf(ev);const nv=Zf((e=>[e.pendingUpdates,e.pendingDeletions]),(([e,t])=>Object.keys(e).length+Object.keys(t).length));const rv=qf({pendingUpdates:{},pendingDeletions:{}},{namespace:"realTimeUpdates",reducers:ev,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!==Xg.selectors.focusedGroupId(t)&&"sidebar"===rg.selectors.route(n)||(o[e.id]=e)})),t.forEach((e=>{
647
+ const t=e.id;delete o[t];const n=r().annotations;ug.selectors.annotationExists(n,t)&&(i[t]=!0)})),n({type:tv.RECEIVE_REAL_TIME_UPDATES,pendingUpdates:o,pendingDeletions:i})}},clearPendingUpdates:function(){return{type:tv.CLEAR_PENDING_UPDATES}}},selectors:{hasPendingDeletion:function(e,t){return e.pendingDeletions.hasOwnProperty(t)},pendingDeletions:function(e){return e.pendingDeletions},pendingUpdates:function(e){return e.pendingUpdates},pendingUpdateCount:nv}}),ov={annotation:"Location",note:"Oldest",orphan:"Location"};function iv(e){const t={};return e.annotations&&!e.query&&(t[e.annotations]=!0),t}const av=(e,t)=>t===e?{}:{selectedTab:e,sortKey:ov[e]},sv={CLEAR_SELECTION:function(){return{forcedVisible:{},selected:{}}},SELECT_ANNOTATIONS:function(e,t){return{selected:t.selection}},SELECT_TAB:function(e,t){return av(t.tab,e.selectedTab)},SET_EXPANDED:function(e,t){const n={...e.expanded};return n[t.id]=t.expanded,{expanded:n}},SET_FORCED_VISIBLE:function(e,t){return{forcedVisible:{...e.forcedVisible,
648
+ [t.id]:t.visible}}},SET_SORT_KEY:function(e,t){return{sortKey:t.key}},TOGGLE_SELECTED_ANNOTATIONS:function(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=>!Ni(e))),r=Jf(t.annotations,Bi)===n.length;return 0===t.currentAnnotationCount&&r?av("note",e.selectedTab):{}},CHANGE_FOCUS_MODE_USER:function(){return{forcedVisible:{},selected:{}}},SET_FILTER:function(){return{forcedVisible:{},selected:{},expanded:{}}},SET_FILTER_QUERY:function(){return{forcedVisible:{},selected:{},expanded:{}}},SET_FOCUS_MODE:function(){return{forcedVisible:{},selected:{}}},REMOVE_ANNOTATIONS:function(e,t){let n=e.selectedTab;"orphan"===n&&0===Jf(t.remainingAnnotations,Di)&&(n="annotation");const r=e=>(t.annotationsToRemove.forEach((t=>{t.id&&delete e[t.id],t.$tag&&delete e[t.$tag]})),e);return{...av(n,e.selectedTab),expanded:r({...e.expanded}),forcedVisible:r({...e.forcedVisible}),selected:r({...e.selected})}}},lv=lf(sv);function cv(e){
649
+ return e.expanded}const uv=Zf((e=>e.forcedVisible),(e=>eg(e))),hv=Zf((e=>e.selected),(e=>eg(e).length>0)),dv=Zf((e=>e.selected),(e=>eg(e)));function pv(e){return e.selectedTab}const mv=Zf((e=>e),(e=>({expanded:cv(e),forcedVisible:uv(e),selected:dv(e),sortKey:fv(e),selectedTab:pv(e)})));function fv(e){return e.sortKey}const gv=Zf((e=>e.selectedTab),(e=>{const t=["Newest","Oldest"];return"note"!==e&&t.push("Location"),t})),vv=qf((function(e){return{selected:iv(e),expanded:iv(e)||{},forcedVisible:{},selectedTab:"annotation",sortKey:ov.annotation}}),{namespace:"selection",reducers:sv,actionCreators:{clearSelection:function(){return{type:lv.CLEAR_SELECTION}},selectAnnotations:function(e){return t=>{t({type:lv.CLEAR_SELECTION}),t({type:lv.SELECT_ANNOTATIONS,selection:Qf(e)})}},selectTab:function(e){return{type:lv.SELECT_TAB,tab:e}},setExpanded:function(e,t){return{type:lv.SET_EXPANDED,id:e,expanded:t}},setForcedVisible:function(e,t){return{type:lv.SET_FORCED_VISIBLE,id:e,visible:t}},setSortKey:function(e){return{
650
+ type:lv.SET_SORT_KEY,key:e}},toggleSelectedAnnotations:function(e){return{type:lv.TOGGLE_SELECTED_ANNOTATIONS,toggleIds:e}}},selectors:{expandedMap:cv,forcedVisibleThreads:uv,hasSelectedAnnotations:hv,selectedAnnotations:dv,selectedTab:pv,selectionState:mv,sortKey:fv,sortKeys:gv}}),yv={OPEN_SIDEBAR_PANEL:function(e,t){return{activePanelName:t.panelName}},CLOSE_SIDEBAR_PANEL:function(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}}},_v=lf(yv);const bv=qf({activePanelName:null},{namespace:"sidebarPanels",reducers:yv,actionCreators:{openSidebarPanel:function(e){return{type:_v.OPEN_SIDEBAR_PANEL,panelName:e}},closeSidebarPanel:function(e){return{type:_v.CLOSE_SIDEBAR_PANEL,panelName:e}},toggleSidebarPanel:function(e,t){return{type:_v.TOGGLE_SIDEBAR_PANEL,panelName:e,panelState:t}}},
651
+ selectors:{isSidebarPanelOpen:function(e,t){return e.activePanelName===t}}}),wv={ADD_MESSAGE:function(e,t){return{messages:e.messages.concat({...t.message})}},REMOVE_MESSAGE:function(e,t){return{messages:e.messages.filter((e=>e.id!==t.id))}},UPDATE_MESSAGE:function(e,t){return{messages:e.messages.map((e=>e.id&&e.id===t.message.id?{...t.message}:e))}}},xv=lf(wv);const kv=qf({messages:[]},{namespace:"toastMessages",reducers:wv,actionCreators:{addToastMessage:function(e){return{type:xv.ADD_MESSAGE,message:e}},removeToastMessage:function(e){return{type:xv.REMOVE_MESSAGE,id:e}},updateToastMessage:function(e){return{type:xv.UPDATE_MESSAGE,message:e}}},selectors:{getToastMessage:function(e,t){return e.messages.find((e=>e.id===t))},getToastMessages:function(e){return e.messages},hasToastMessage:function(e,t,n){return e.messages.some((e=>e.type===t&&e.message===n))}}}),Sv={SET_SIDEBAR_OPENED:(e,t)=>!0===t.opened?{sidebarHasOpened:!0}:{}},Cv=lf(Sv);const Av=qf({sidebarHasOpened:!1},{namespace:"viewer",reducers:Sv,
652
+ actionCreators:{setSidebarOpened:function(e){return{type:Cv.SET_SIDEBAR_OPENED,opened:e}}},selectors:{hasSidebarOpened:function(e){return e.sidebarHasOpened}}});function Ev(e){return Hf([Vf,ug,pg,gg,Sg,zg,Dg,Qg,Xg,rv,rg,vv,Hg,bv,kv,Av],[e],[Uf])}Ev.$inject=["settings"];class Tv{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){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)}
653
+ 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 Nv=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),Mv=function(e){const{version:t,origin:n}=P(e.location.href);return"1.1007.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.1007.0) than the host page (${t}). It may not work.`),
654
+ !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 Lv(e,t){e.setClientId(t.clientId)}function zv(e,t,n){e.load(),t.load(),n.sync()}function Ov(e,t,n,r){e.init(),t.init(),n.init(),r.init()}function Iv(e,t){"sidebar"===t.route()&&e.connect()}Nv.sentry&&Mv&&function(e){const t=function(){let e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;Er({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1007.0",beforeSend:(e,t)=>{if(Mr>=5)return V("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++Mr;try{const n=t&&t.originalException;n instanceof Event&&Object.assign(e.extra,{type:n.type,detail:n.detail,isTrusted:n.isTrusted})}catch(e){}return e}});try{
655
+ Yt("host_config",P(window.location.href))}catch(e){}Yt("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),Nr(((e,t)=>{Wt(e,{tags:{context:t}})}))}(Nv.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)}}}(),Lv.$inject=["api","streamer"],zv.$inject=["groups","session","router"],Ov.$inject=["autosaveService","features","persistedDefaults","serviceURL"],Iv.$inject=["frameSync","store"],function(e,{reset:t=!1}={}){t&&bo.clear();for(let[t,n]of Object.entries(e))bo.set(t,n)}(ti);const Pv=document.querySelector("hypothesis-app");!function(e=window){e.addEventListener("message",J)}(),async function(e,t=window){
656
+ const n=function(e){const t=P(e.location.href),n=["annotations","group","query","appType","openSidebar","showHighlights","services","branding","enableExperimentalNewNoteButton","focus","requestConfigFromFrame","theme","usernameUrl"],r={openSidebar:D,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)}}};return Object.keys(t).reduce(((e,o)=>(-1!==n.indexOf(o)&&null!==t[o]&&(r[o]?e[o]=r[o](t[o]):e[o]=t[o]),e)),{})}(window),r=n.requestConfigFromFrame;if(!r)return U(e,n);if("number"==typeof r.ancestorLevel&&"string"==typeof r.origin){const o=function(e,t=window){let n=t;for(let t=0;t<e;t++){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}(r.ancestorLevel,t);return{...await $(e,o,r.origin),...n.group?{group:n.group}:{}}}
657
+ throw new Error("Improper `requestConfigFromFrame` object. Both `ancestorLevel` and `origin` need to be specified")}(Nv).then((e=>{!function(e,t){const n=new Tv;n.register("annotationsService",Im).register("api",Fm).register("apiRoutes",Vm).register("auth",Km).register("autosaveService",Xm).register("features",Qm).register("frameSync",sf).register("groups",hf).register("loadAnnotationsService",df).register("localStorage",mf).register("persistedDefaults",gf).register("router",vf).register("serviceURL",yf).register("session",_f).register("streamer",xf).register("streamFilter",bf).register("tags",kf).register("threadsService",Sf).register("toastMessenger",Cf).register("store",{factory:Ev}),n.register("$window",{value:window}).register("settings",{value:e}),n.run(Ov),n.run(Lv),n.run(zv),n.run(Z),n.run(Iv),I(_o(li.Provider,{value:n,children:_o(zm,{})}),t)}(e,Pv)})).catch((e=>function(e,t){console.error("Failed to start Hypothesis client: ",e),I(_o(Om,{error:e}),t)}(e,Pv)));
656
658
  //# sourceMappingURL=sidebar.bundle.js.map